/* The web page. It uses the app's own tokens and fonts, copied into assets/ by npm run site:sync. */
@import './assets/tokens.css';

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('./assets/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Figtree';
  src: url('./assets/fonts/figtree-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  /* Squared paper, the same as every page of the extension. */
  background:
    linear-gradient(var(--grid) 1.5px, transparent 1.5px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1.5px, transparent 1.5px) 0 0 / 28px 28px,
    var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  line-height: 1.02;
  text-wrap: balance;
}

h2 {
  font-size: clamp(36px, 5vw, 60px);
  letter-spacing: var(--tracking-display-tight);
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.wrap {
  width: 100%;
  max-width: 1176px;
  margin: 0 auto;
  padding: 0 24px;
}

.lead {
  max-width: 34em;
  margin-top: 18px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.4;
}

/* Header: the same mark and name as the top of the popup */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: 30px;
  letter-spacing: var(--tracking-display);
  line-height: 1;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
}

.top nav {
  display: flex;
  gap: 26px;
  font-size: 17px;
  font-weight: var(--weight-bold);
}

.top nav a {
  text-decoration: none;
}

.top nav a:hover,
.top nav a[aria-current] {
  text-decoration: underline;
}

/* Buttons, as in the extension */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 10px 30px;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-size: 19px;
  font-weight: var(--weight-bold);
  text-align: center;
  text-decoration: none;
  transition:
    transform 0.08s ease-out,
    box-shadow 0.08s ease-out;
}

.btn-primary {
  background: var(--tangerine);
  box-shadow: var(--shadow-hard);
}

.btn-primary:hover {
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-primary:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

/*
 * The way into the store. Tangerine like every primary action here, with the Chrome mark in its
 * own colours: a brand mark keeps them. It lifts toward the pointer, the mark turns once, the arrow
 * leans the way it goes, and a press sinks it into its shadow like every button in Perk.
 */
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 22px 8px 9px;
  border: var(--border-heavy);
  border-radius: var(--radius-pill);
  background: var(--tangerine);
  box-shadow: var(--shadow-hard);
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    background-color 0.15s ease-out;
}

.btn-store__logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: var(--border);
  border-radius: 50%;
  background: var(--white);
}

.btn-store__logo svg {
  width: 32px;
  height: 32px;
  transition: rotate 0.6s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.btn-store__text {
  display: grid;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: 22px;
  letter-spacing: var(--tracking-display);
  line-height: 1;
}

.btn-store__text small {
  margin-bottom: 3px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.btn-store__arrow {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate 0.15s ease-out;
}

.btn-store:hover,
.btn-store:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.btn-store:hover .btn-store__logo svg,
.btn-store:focus-visible .btn-store__logo svg {
  rotate: 360deg;
}

.btn-store:hover .btn-store__arrow,
.btn-store:focus-visible .btn-store__arrow {
  translate: 4px 0;
}

.btn-store:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* On the tangerine closing panel the button turns lime, so it still stands out. */
.btn-store--light {
  background: var(--lime);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 34px;
}

.cta__note {
  color: var(--muted);
  font-size: 16px;
  font-weight: var(--weight-semibold);
}

/* A picture of the popup, framed the way it sits under the toolbar */
.popup {
  width: 300px;
  overflow: hidden;
  border: var(--border-heavy);
  border-radius: 18px;
  background: var(--cream);
  box-shadow: var(--shadow-hard);
}

/* A picture of one of Perk's full pages, in a plain window */
.window {
  overflow: hidden;
  border: var(--border-heavy);
  border-radius: 22px;
  background: var(--cream);
}

.window__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-bottom: var(--border-heavy);
  background: var(--white);
  font-size: 14px;
  font-weight: var(--weight-semibold);
}

.window__bar i {
  width: 11px;
  height: 11px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.window__bar span {
  margin-left: 10px;
  color: var(--muted);
}

.window img {
  width: 100%;
}

/* A loop recorded from the real break screen. It shows its still until the script plays it. */
.loop {
  display: block;
  width: 100%;
  height: auto;
}

/* Hero: the break screen running, with the popup hanging off its corner */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: center;
  padding: 72px 0 40px;
}

.hero h1 {
  font-size: clamp(44px, 5.4vw, 70px);
  line-height: 0.96;
  letter-spacing: -3px;
}

/* Lime is "done" in Perk, so it marks the part of the promise that is about finishing. */
.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 58%, var(--lime) 58% 92%, transparent 92%);
}

.hero__sub {
  max-width: 27em;
  margin-top: 24px;
  color: var(--muted);
  font-size: clamp(18px, 1.7vw, 21px);
  font-weight: var(--weight-medium);
  line-height: 1.4;
}

.hero__art {
  position: relative;
  padding: 0 0 84px 44px;
}

.hero__art .window {
  box-shadow: var(--shadow-stage);
}

.hero__art .popup {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 190px;
  rotate: -4deg;
}

.hero__star {
  position: absolute;
  top: -36px;
  right: -22px;
  width: 88px;
  rotate: 12deg;
}

/* One block, told as a clock running down the left edge */
.block {
  padding-top: 110px;
}

.moments {
  margin-top: 64px;
}

/* Every moment is the same three columns: the clock, the words, the picture. */
.moment {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) minmax(0, 500px);
  column-gap: 44px;
  align-items: center;
  padding-bottom: 72px;
}

/* The rail the clock sits on */
.moment::before {
  content: '';
  position: absolute;
  top: 70px;
  bottom: 6px;
  left: 62px;
  border-left: var(--border-empty);
}

.moment:last-child {
  padding-bottom: 0;
}

.moment:last-child::before {
  display: none;
}

.moment__time {
  align-self: start;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: 40px;
  letter-spacing: var(--tracking-display);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.moment__time small {
  display: block;
  margin-top: 6px;
  color: var(--muted-soft);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
}

.moment h3 {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: var(--tracking-display);
}

.moment p {
  margin-top: 14px;
  color: var(--muted);
}

.moment p + p {
  margin-top: 10px;
}

/*
 * The picture for a moment: always the same size, so the column stays even. Sizes inside are in
 * container units and shrink with it.
 */
.panel {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: var(--border-heavy);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.panel--done img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* A little closer, so the page's corner stickers are not left half in the picture. */
  scale: 1.05;
  transform-origin: 100% 45%;
}

/*
 * The popup where it really appears: hanging from Perk's icon at the end of the browser's toolbar.
 * The space beside it holds one thing, said once.
 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 3cqi;
  height: 12cqi;
  padding: 0 7cqi 0 4cqi;
  border-bottom: var(--border-heavy);
  background: var(--cream);
}

.toolbar__address {
  flex: 1;
  height: 5.6cqi;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
}

.toolbar__icon {
  position: relative;
  width: 6.4cqi;
}

.toolbar__icon b {
  position: absolute;
  right: -2.6cqi;
  bottom: -1.4cqi;
  min-width: 4.4cqi;
  padding: 0 1cqi;
  border-radius: 1.1cqi;
  background: var(--ink);
  color: var(--white);
  font-size: 2.6cqi;
  line-height: 1.45;
  text-align: center;
}

/* The heads-up badge is the one place Perk uses yellow on the toolbar. */
.toolbar__icon b.is-alert {
  background: var(--sun);
  color: var(--ink);
}

.panel .popup {
  position: absolute;
  top: 14.4cqi;
  right: 5cqi;
  width: 36cqi;
  border-width: var(--border-width);
  border-radius: 2.6cqi;
  box-shadow: var(--shadow-hard);
}

.panel__side {
  position: absolute;
  top: 12cqi;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4cqi;
  width: 56cqi;
  padding: 0 4cqi 0 6cqi;
}

.panel__note {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: 5.4cqi;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.panel__note small {
  display: block;
  margin-top: 2.4cqi;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: max(12px, 3.1cqi);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  line-height: 1.35;
}

/* The heads-up as a notification */
.toast {
  padding: 3.6cqi;
  border: var(--border);
  border-radius: 3.2cqi;
  background: var(--cream);
  font-size: 3cqi;
  line-height: 1.3;
}

.toast__title {
  display: flex;
  align-items: center;
  gap: 2cqi;
  font-size: 3.2cqi;
  font-weight: var(--weight-bold);
  white-space: nowrap;
}

.toast__title img {
  width: 5.6cqi;
}

.toast p {
  margin: 1.4cqi 0 0;
  color: var(--muted);
}

/* One under the other: side by side there is no room for the words to breathe. */
.toast__buttons {
  display: grid;
  gap: 1.8cqi;
  margin-top: 3.2cqi;
}

.toast__buttons span {
  padding: 1.6cqi 3cqi;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-size: 2.7cqi;
  font-weight: var(--weight-bold);
  text-align: center;
  white-space: nowrap;
}

/* The break is the point of the whole thing, so it gets the full width. */
.moment--break {
  align-items: start;
  row-gap: 30px;
}

.moment--break p {
  margin-top: 4px;
}

.moment--break .window {
  grid-column: 2 / -1;
  box-shadow: var(--shadow-stage);
}

/* When Perk keeps quiet */
.quiet {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 72px;
  align-items: center;
  padding-top: 130px;
}

.quiet .popup {
  rotate: -2deg;
}

.rules {
  margin-top: 30px;
  border-top: var(--border);
}

.rules div {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  padding: 16px 0;
  border-bottom: var(--border-empty);
}

.rules div:last-child {
  border-bottom: var(--border);
}

.rules dt {
  font-weight: var(--weight-bold);
}

.rules dd {
  color: var(--muted);
}

/* The stretch library, with the other figure doing a stretch on its corner */
.library {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 56px;
  align-items: center;
  padding-top: 130px;
}

.library__art {
  position: relative;
  padding: 0 0 56px 56px;
}

.library .window img {
  /* Just the library card: the settings menu to its left is cropped away. */
  aspect-ratio: 1.2;
  object-fit: cover;
  object-position: 89% 0;
}

.library__woman {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 220px;
  overflow: hidden;
  border: var(--border-heavy);
  border-radius: 30px;
  box-shadow: var(--shadow-hard);
  rotate: -3deg;
}

/* The recording still has the stage's own rounded corners in it; this frame's corners cover them. */
.library__woman .loop {
  scale: 1.08;
}

.library p + p {
  margin-top: 12px;
}

/* The week */
.week {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 56px;
  align-items: center;
  padding-top: 130px;
}

.week .window img {
  aspect-ratio: 1.6;
  object-fit: cover;
  object-position: 50% 0;
}

/* Privacy: the promise on the left, and on the right what Chrome says Perk can do and why */
.private {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 64px;
  align-items: start;
  padding-top: 130px;
}

.private__say {
  position: sticky;
  top: 32px;
}

.private h2 em {
  font-style: normal;
  background: linear-gradient(transparent 58%, var(--lime) 58% 92%, transparent 92%);
}

.zeros {
  display: flex;
  margin-top: 34px;
  border-top: var(--border);
  border-bottom: var(--border);
}

.zeros li {
  flex: 1;
  padding: 16px 16px 18px 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: var(--weight-semibold);
  line-height: 1.25;
}

.zeros li + li {
  padding-left: 18px;
  border-left: var(--border-empty);
}

.zeros b {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: 64px;
  line-height: 0.9;
}

.private__more {
  margin-top: 26px;
  font-weight: var(--weight-bold);
}

.sheet {
  overflow: hidden;
  border: var(--border-heavy);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-stage);
}

.sheet__head {
  padding: 26px 32px;
  border-bottom: var(--border-heavy);
  background: var(--cream);
  font-size: 19px;
  font-weight: var(--weight-semibold);
  line-height: 1.35;
}

.sheet__rows div {
  position: relative;
  padding: 22px 32px 22px 80px;
  border-bottom: var(--border-empty);
}

.sheet__rows div:last-child {
  border-bottom: 0;
}

/* Lime is "done" in Perk: each permission is accounted for. */
.sheet__rows div::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 32px;
  width: 30px;
  height: 30px;
  border: var(--border);
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317120e' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E")
      center / 16px no-repeat,
    var(--lime);
}

.sheet__rows dt {
  font-weight: var(--weight-bold);
  line-height: 1.3;
}

.sheet__rows dd {
  margin-top: 4px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

/* The end of the page */
.end {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 130px;
  padding: 44px 48px;
  border: var(--border-heavy);
  border-radius: var(--radius-stage);
  background: var(--tangerine);
  box-shadow: var(--shadow-stage);
}

.end h2 {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.95;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: 72px;
  padding: 22px 0 44px;
  border-top: var(--border-empty);
  color: var(--muted);
  font-size: 15px;
}

.foot p {
  max-width: 34em;
}

.foot__by {
  flex-basis: 100%;
}

.foot nav {
  display: flex;
  gap: 24px;
  font-weight: var(--weight-semibold);
}

/* Privacy policy and support: one sheet of paper */
.doc {
  max-width: 780px;
  margin: 56px 0 0;
  padding: 52px 56px;
  border: var(--border-heavy);
  border-radius: var(--radius-lg);
  background: var(--white);
  font-size: 18px;
}

.doc h1 {
  font-size: clamp(38px, 5.6vw, 58px);
  letter-spacing: var(--tracking-display-tight);
}

.doc__date {
  margin-top: 12px;
  color: var(--muted);
  font-weight: var(--weight-semibold);
}

.doc h2 {
  margin-top: 44px;
  font-size: 28px;
  letter-spacing: var(--tracking-display);
}

.doc h3 {
  margin-top: 28px;
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1.3;
}

.doc p,
.doc ul {
  margin-top: 12px;
}

.doc ul {
  padding-left: 22px;
  list-style: disc;
}

.doc li + li {
  margin-top: 8px;
}

.doc a {
  font-weight: var(--weight-semibold);
}

.lost {
  padding: 96px 0 40px;
}

.lost h1 {
  font-size: clamp(46px, 7vw, 92px);
  letter-spacing: -3px;
}

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 48px;
  }

  .hero__art {
    max-width: 640px;
  }

  .moment {
    grid-template-columns: 100px minmax(0, 1fr) minmax(0, 0.9fr);
    column-gap: 24px;
  }

  .moment::before {
    left: 46px;
  }

  .moment__time {
    font-size: 30px;
  }

  .quiet,
  .library,
  .week,
  .private {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .private__say {
    position: static;
  }

  .week .window {
    order: 2;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 17px;
  }

  .wrap {
    padding: 0 16px;
  }

  .lead {
    font-size: 19px;
  }

  .top nav {
    gap: 18px;
    font-size: 16px;
  }

  .hero__art {
    padding: 0 0 104px 16px;
  }

  .hero__art .window {
    box-shadow: var(--shadow-hard);
  }

  /* Small and low, so it does not cover the figure. */
  .hero__art .popup {
    width: 108px;
    border-radius: 10px;
  }

  .hero__star {
    top: -26px;
    right: -6px;
    width: 60px;
  }

  .block,
  .quiet,
  .library,
  .week,
  .private {
    padding-top: 84px;
  }

  /* The clock moves above each moment and the rail goes. */
  .moment,
  .moment--break {
    display: block;
    padding-bottom: 60px;
  }

  .moment::before {
    display: none;
  }

  .moment__time {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: var(--border-empty);
  }

  .moment .panel,
  .moment .window {
    margin-top: 24px;
  }

  .moment--break p {
    margin-top: 14px;
  }

  .moment--break .window {
    box-shadow: var(--shadow-hard);
  }

  .library__art {
    padding: 0 0 44px 24px;
  }

  .library__woman {
    width: 150px;
    border-radius: 22px;
  }

  .rules div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .private__say {
    position: static;
  }

  .zeros b {
    font-size: 48px;
  }

  .sheet {
    box-shadow: var(--shadow-hard);
  }

  .sheet__head {
    padding: 20px;
    font-size: 17px;
  }

  .sheet__rows div {
    padding: 18px 20px 18px 62px;
  }

  .sheet__rows div::before {
    top: 18px;
    left: 20px;
    width: 28px;
    height: 28px;
  }

  .end {
    margin-top: 84px;
    padding: 30px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hard);
  }

  .doc {
    margin-top: 32px;
    padding: 28px 22px;
    font-size: 17px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 17px;
  }

  .btn-store {
    width: 100%;
    justify-content: flex-start;
  }

  .btn-store__arrow {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn-store,
  .btn-store__logo svg,
  .btn-store__arrow {
    transition: none;
  }
}
