@font-face {
  font-family: "W95FA";
  src: url("./fonts/w95fa.woff2") format("woff2");
  font-display: swap;
}

/* Mutter landing — tokens ported from the app's design language v0.2 */
:root {
  --ground:    #141210;
  --hairline:  #2B2723;
  --ink:       #EDE6DB;
  --ink-dim:   #A79E92;
  --signal:    #E8623D;
  --paper:     #EFEAE1;
  --ink-paper: #1A1714;
  --font: "W95FA", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  /* Anchor jumps and any programmatic scrolling ease rather than snap. */
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  /* .viewport owns the layout now; body only carries the timeline's height. */
}

/* ---- corner chrome ---- */
.chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
/* Two states share one slot, so the footer never changes height as they swap:
   the scroll invitation while the sequence runs, the closing copy once it ends. */
.chrome-foot {
  position: relative;
  display: grid;
  /* One full-width track, or .chrome's inherited space-between pins the
     content-sized column to the left instead of centring it. */
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  place-items: center;
  min-height: 92px;
  padding: 14px 24px 18px;
  text-align: center;
}
.cue, .outro {
  grid-area: 1 / 1;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
.cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cue-word { color: var(--ink-dim); }
.cue-arrow { width: 26px; height: auto; }
@media (prefers-reduced-motion: no-preference) {
  /* A slow nudge downward — the one piece of idle motion on the page, and it
     exists to say "there is more below". */
  .cue-arrow { animation: nudge 2.4s ease-in-out infinite; }
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}

.outro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
}
/* Once the last panel is behind us, the invitation gives way to the payoff. */
body.is-outro .cue    { opacity: 0; visibility: hidden; }
body.is-outro .outro  { opacity: 1; visibility: visible; transition-delay: 0s, 0s; }

.terms-link, .home-link { color: var(--ink-dim); text-decoration: none; }
.terms-link:hover, .terms-link:focus-visible,
.home-link:hover, .home-link:focus-visible { color: var(--ink); }

.dl { color: var(--signal); cursor: default; }
.dl .dl-hot { display: none; color: var(--ink); }
.dl:hover .dl-idle, .dl:focus-visible .dl-idle { display: none; }
.dl:hover .dl-hot,  .dl:focus-visible .dl-hot  { display: inline; }

a:focus-visible, .dl:focus-visible, .phone:focus-visible {
  outline: 1px solid var(--ink-dim);
  outline-offset: 3px;
}
body.paper a:focus-visible {
  outline-color: currentColor;
}

/* ---- lockup ---- */
.lockup { text-align: center; padding: 4px 20px 10px; }
.lockup-row {
  margin: 0;
  display: flex;
  justify-content: center;
  font-weight: normal;
}
/* The lockup is a single piece of artwork — the wording, the mic and the
   wordmark are drawn together with their own kerning. Nothing to compose here. */
.logotype {
  height: clamp(64px, 9.5vw, 107px);
  width: auto;
  max-width: 100%;
  display: block;
}
/* Sits under the artwork inside the pinned header, so it stays small: every
   pixel here is taken from the stage the phone occupies. */
.lockup-sub {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}

.subline {
  margin: 0;
  /* Lives inside .chrome, which shouts in tracked-out caps — this is sentence
     copy, so it opts back out of every one of those inherited settings. */
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  /* One line wherever it fits. No max-width: the 60ch measure that keeps long
     copy readable would force this single sentence to break in two. */
  text-wrap: balance;
}

/* ---- the pinned page ----
   Nothing the visitor can see ever moves. The whole composition is fixed to the
   viewport; scrolling advances the invisible timeline below and the panels are
   the only thing that changes. */
.viewport {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.stage {
  position: relative;
  flex: 1;
}

/* The timeline: a lead-in so nothing is showing at rest, one screen per panel,
   and a tail so the last one can finish before the page runs out. */
.driver { height: 430dvh; }
.lead   { height: 55dvh; }
.step   { height: 100dvh; }
/* Long enough that the closing copy has room to sit once it arrives — a short
   tail leaves it triggering only in the final few pixels of the page. */
.tail   { height: 75dvh; }

.frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 260px;
}

.panel {
  position: absolute;
  top: 50%;
  width: min(30ch, 34vw);
  opacity: 0;
  visibility: hidden;
  /* Panels start displaced toward their own side and settle inward. */
  transition:
    opacity 0.5s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.5s;
}
.panel.side-right { left: calc(50% + min(21vw, 300px)); transform: translate(0, -50%) translateX(28px); }
.panel.side-left  { right: calc(50% + min(21vw, 300px)); transform: translate(0, -50%) translateX(-28px); text-align: right; }
.panel.side-left .panel-icon { margin-left: auto; }

.panel.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%) translateX(0);
  transition-delay: 0s, 0s, 0s;
}

.panel-icon { display: block; width: 44px; height: auto; margin-bottom: 16px; }
.panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: normal;
  line-height: 1.2;
  color: var(--ink);
}
.panel p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-dim);
}

/* ---- the phone ---- */
/* The device is drawn, not photographed — no mockup image, no dependency.
   Three layers, outside in: the titanium rail (a gradient that catches light
   at the edges the way a machined band does), the black bezel, then the screen. */
.phone {
  --rail: 3px;                          /* the metal band's own thickness */
  --bezel: 5px;                         /* black surround inside the rail */
  /* ~14% of the device's width, which is the real proportion. Derived from
     height because the width comes from the aspect ratio: width = h × 0.4616,
     so 14% of width ≈ 6.5% of height ≈ 4dvh at this scale. */
  --r: clamp(19px, 4dvh, 34px);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Fill the frame, but never grow so tall that the width derived from the
     aspect ratio runs past a narrow screen — hence the third term. */
  height: min(100%, 62dvh, calc((100vw - 44px) * 2556 / 1180));
  aspect-ratio: 1180 / 2556;
  border-radius: var(--r);
  padding: calc(var(--rail) + var(--bezel));
  cursor: pointer;
  /* Light rakes across the rail: bright at the top-left and bottom-right
     chamfers, dark through the middle where the band turns away. */
  background:
    linear-gradient(148deg,
      #8A8179 0%, #4A443E 9%, #2C2823 30%,
      #241F1B 55%, #3E3832 78%, #7C736A 93%, #4A443E 100%);
  box-shadow:
    0 0 0 1px #17130F,                                  /* the rail's outer edge */
    inset 0 0 0 var(--rail) #0A0806,                    /* bezel behind the glass */
    0 14px 30px -14px rgba(0, 0, 0, 0.9),               /* the device's own weight */
    0 5px 12px -6px rgba(0, 0, 0, 0.7);
}

/* Side hardware. Decorative, never in the way of the click target. */
.btn {
  position: absolute;
  width: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, #6B635B, #2A2621);
}
.btn.action    { left: calc(var(--rail) * -1); top: 17.5%; height: 3.4%; border-radius: 2px 0 0 2px; }
.btn.vol-up    { left: calc(var(--rail) * -1); top: 24.5%; height: 5.6%; border-radius: 2px 0 0 2px; }
.btn.vol-down  { left: calc(var(--rail) * -1); top: 31.5%; height: 5.6%; border-radius: 2px 0 0 2px; }
.btn.power     { right: calc(var(--rail) * -1); top: 27%;  height: 8.2%; border-radius: 0 2px 2px 0;
                 background: linear-gradient(270deg, #6B635B, #2A2621); }
#demo {
  position: relative;                   /* sits above the rail's inset shadow */
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The screen's corner follows the shell's, minus everything outside it —
     concentric radii are most of what makes a drawn device read as real. */
  border-radius: calc(var(--r) - var(--rail) - var(--bezel));
  display: block;
  background: #000;
}

/* Narrow screens have no room beside the device, and Reduce Motion must not
   move anything — both get the same honest fallback: the pin and the scroll
   timeline are dropped, and the panels simply stack under the phone. */
@media (max-width: 820px), (prefers-reduced-motion: reduce) {
  /* Unpin: the page becomes an ordinary scrolling document. */
  .viewport {
    position: static;
    display: block;
  }
  .driver { display: none; }
  .stage { position: static; }
  .frame { height: 62dvh; }
  /* No timeline here, so there is no sequence to invite anyone through: the
     closing copy just stands, stated rather than inferred from empty rects. */
  .cue { display: none; }
  .outro { opacity: 1; visibility: visible; transition: none; }
  .chrome-foot { min-height: 0; }
  .panel {
    position: static;
    width: min(52ch, 100%);
    margin: 30px auto 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    text-align: left;
  }
  /* Must match .panel.side-* specificity, or the side offsets — including the
     -50% vertical shift — survive into the stacked layout. */
  .panel.side-left, .panel.side-right {
    left: auto;
    right: auto;
    transform: none;
  }
  .panel.side-left { text-align: left; }
  .panel.side-left .panel-icon { margin-left: 0; }
}

/* ---- small viewports ---- */
@media (max-width: 640px) {
  .lockup-row { gap: 10px; }
}
@media (max-width: 480px) {
  .chrome { padding: 14px 16px; letter-spacing: 0.05em; }
}

/* ---- paper (terms) ---- */
body.paper {
  background: var(--paper);
  color: var(--ink-paper);
  display: block;
}
.sheet {
  max-width: 62ch;
  margin: 0 auto;
  padding: 56px 24px 72px;
  font-size: 15px;
  line-height: 1.65;
}
.sheet h1 { font-size: 24px; margin: 0 0 32px; font-weight: normal; }
.sheet h2 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 36px 0 8px;
  font-weight: normal;
}
.sheet h3 {
  font-size: 15px;
  margin: 24px 0 4px;
  font-weight: normal;
}
.sheet .meta {
  margin-top: 40px;
  font-size: 12px;
  color: var(--ink-paper);
  opacity: 0.65;
}
.sheet a { color: var(--ink-paper); text-decoration: underline; }
.sheet .back { margin-top: 48px; }
