/* Pale landing, in Glass and Birch. Tokens mirror android/design Birch.kt (day dim is #666864, which
   passes AA). Rules from the design review: flat for reading, physical for touching; no cards, pills,
   bevels or gradients on content; hairlines only where they separate; main action inverted, the
   alternative a paper key, the way out grey. Day and night follow the system, or the switch. */

@font-face {
  font-family: "Familjen Grotesk";
  src: url("/shared/fonts/FamiljenGrotesk-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/shared/fonts/GeistMono-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #e7e8e3;
  --fg: #18191b;
  --ink: #2b2d30;
  --dim: #666864;
  --rule: #c9cbc5;
  --frame: #18191b;
  --panel: #dedfda;
  --paper: #f3f4f0;
  --paper-b: #e9eae5;
  --key-a: #34363a;
  --key-b: #17181b;
  --key-fg: #f3f4f0;
  --sh: rgba(24, 25, 27, 0.22);
  --sh2: rgba(24, 25, 27, 0.1);
  --hi: rgba(255, 255, 255, 0.85);
  --scrim: rgba(24, 25, 27, 0.32);
  --f-d: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-m: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
  --pad: clamp(20px, 5vw, 64px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517;
    --fg: #e9eae6;
    --ink: #d3d6d0;
    --dim: #8e918d;
    --rule: #2c2e31;
    --frame: #34363a;
    --panel: #1b1c1f;
    --paper: #1f2124;
    --paper-b: #18191c;
    --key-a: #eef0eb;
    --key-b: #cfd1cb;
    --key-fg: #141517;
    --sh: rgba(0, 0, 0, 0.55);
    --sh2: rgba(0, 0, 0, 0.35);
    --hi: rgba(255, 255, 255, 0.07);
    --scrim: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141517;
  --fg: #e9eae6;
  --ink: #d3d6d0;
  --dim: #8e918d;
  --rule: #2c2e31;
  --frame: #34363a;
  --panel: #1b1c1f;
  --paper: #1f2124;
  --paper-b: #18191c;
  --key-a: #eef0eb;
  --key-b: #cfd1cb;
  --key-fg: #141517;
  --sh: rgba(0, 0, 0, 0.55);
  --sh2: rgba(0, 0, 0, 0.35);
  --hi: rgba(255, 255, 255, 0.07);
  --scrim: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: var(--f-d);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition:
    background-color 0.3s,
    color 0.3s;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

canvas,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* the field behind everything */

canvas.mist {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

/* ---- type ---- */

.label {
  font: 500 12px / 1.5 var(--f-m);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
}

.label a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dim {
  color: var(--dim);
}

.t-xl {
  font-weight: 600;
  font-size: clamp(56px, min(9.2vw, 15vh), 148px);
  line-height: 0.92;
  letter-spacing: -0.058em;
}

.t-l {
  font-weight: 600;
  font-size: clamp(38px, 5.8vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.048em;
}

.t-m {
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.lede {
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.008em;
  max-width: 31em;
}

/* ---- keys: the things you touch ---- */

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 14px 22px;
  border: 0;
  border-radius: 12px;
  font-family: var(--f-d);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  color: var(--key-fg);
  background: linear-gradient(var(--key-a), var(--key-b));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 1px var(--sh),
    0 6px 12px -6px var(--sh);
  transition:
    transform 0.12s var(--ease),
    box-shadow 0.12s;
}

.key.paper {
  color: var(--fg);
  background: linear-gradient(var(--paper), var(--paper-b));
  box-shadow:
    inset 0 1px 0 var(--hi),
    0 0 0 1px var(--sh2),
    0 5px 10px -6px var(--sh);
}

.key.sm {
  padding: 8px 14px;
  font-size: 15px;
  border-radius: 10px;
}

.key:active {
  transform: translateY(1px) scale(0.97);
  box-shadow:
    inset 0 1px 0 var(--hi),
    0 0 0 1px var(--sh2),
    0 1px 2px var(--sh2);
}

.word {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--dim);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.word:hover {
  color: var(--fg);
}

/* day / night switch */

.seg {
  display: inline-flex;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
  border: 1px solid var(--fg);
  font: 500 12px var(--f-m);
}

.seg button {
  font: inherit;
  background: transparent;
  color: var(--fg);
  border: 0;
  border-right: 1px solid var(--rule);
  padding: 5px 10px;
  cursor: pointer;
}

.seg button:last-child {
  border-right: 0;
}

.seg button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}

/* ---- reveal ---- */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- reserve: a paper sheet, handed to you ---- */

dialog.reserve {
  border: 0;
  padding: 0;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  margin: auto;
  color: var(--fg);
  border-radius: 24px;
  background: linear-gradient(var(--paper), var(--paper-b));
  box-shadow:
    inset 0 1px 0 var(--hi),
    0 1px 2px var(--sh2),
    0 40px 90px -20px var(--sh);
}

dialog.reserve::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

dialog.reserve[open] {
  animation: sheet-in 0.5s var(--ease);
}

dialog.reserve[open]::backdrop {
  animation: sheet-fade 0.5s var(--ease);
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes sheet-fade {
  from {
    opacity: 0;
  }
}

@media (max-width: 560px) {
  dialog.reserve {
    margin: auto 12px 12px;
    width: calc(100vw - 24px);
  }
}

.rv-body {
  padding: 30px 26px 26px;
  position: relative;
}

.rv-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.rv-close button {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.rv-mark {
  display: none;
}

.rv-body h2 {
  font-weight: 600;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.045em;
  margin: 4px 0 12px;
}

.rv-sub {
  color: var(--dim);
  font-size: 16px;
  line-height: 1.35;
  margin-bottom: 22px;
}

.rv-sub strong {
  color: var(--fg);
  font-weight: 600;
}

.rv-form label {
  display: block;
  font: 500 11.5px / 1.4 var(--f-m);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 14px;
}

.rv-form .opt {
  margin-left: 6px;
  opacity: 0.8;
}

.rv-form input,
.rv-form textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--paper-b);
  box-shadow: inset 0 1px 3px var(--sh2);
  font-family: var(--f-d);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--fg);
  resize: none;
}

.rv-form input::placeholder,
.rv-form textarea::placeholder {
  color: var(--dim);
  opacity: 0.8;
}

.rv-form input:focus,
.rv-form textarea:focus {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.rv-form .btn {
  display: flex;
  width: 100%;
  margin-top: 6px;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  color: var(--key-fg);
  background: linear-gradient(var(--key-a), var(--key-b));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 1px var(--sh),
    0 6px 12px -6px var(--sh);
}

.rv-form .btn:disabled {
  opacity: 0.6;
}

.rv-err {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

.rv-fine {
  margin-top: 14px;
  font: 500 11px / 1.5 var(--f-m);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
}

.rv-feel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 6px;
}

.rv-feel button {
  flex: 1 1 auto;
  padding: 12px 14px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-family: var(--f-d);
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
  background: linear-gradient(var(--paper), var(--paper-b));
  box-shadow:
    inset 0 1px 0 var(--hi),
    0 0 0 1px var(--sh2),
    0 5px 10px -6px var(--sh);
}

.rv-feel button[aria-pressed="true"] {
  color: var(--key-fg);
  background: linear-gradient(var(--key-a), var(--key-b));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 1px var(--sh);
}

/* inline email, used at the foot of the page */

.rv-inline {
  display: flex;
  gap: 10px;
  width: min(480px, 100%);
}

.rv-inline input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--paper-b);
  box-shadow: inset 0 1px 3px var(--sh2);
  font-family: var(--f-d);
  font-size: 17px;
  font-weight: 500;
  color: var(--fg);
}

.rv-inline input::placeholder {
  color: var(--dim);
  opacity: 0.8;
}

.rv-inline input:focus {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .rv-inline {
    flex-direction: column;
  }
  .rv-body {
    padding: 28px 20px 22px;
  }
}

/* the headline can be sized down for longer options */
.t-xl.m {
  font-size: clamp(48px, min(7.4vw, 12.5vh), 120px);
}

.t-xl.l {
  font-size: clamp(40px, min(5.6vw, 10vh), 92px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}
