/* Home page. The legal pages keep the plainer style.css. Colours are the app's v3 palette: cream, warm black,
   Compact Orange. The page is a dark room (hero, statement, four scenes, closer) with one sheet of cream paper in the
   middle (bonus tracks, pricing, questions). The jewel cases in assets/cases are cut out of the app's own 3D renders.
   One typeface throughout: Archivo (SIL Open Font License), a single self-hosted variable file. Headings use its
   expanded width, as the wordmark does. */
@font-face { font-family: "Archivo"; src: url("/assets/archivo-var.woff2") format("woff2");
  font-weight: 400 800; font-stretch: 100% 125%; font-style: normal; font-display: swap; }

:root {
  --orange: #FF5A1F;
  --night: #0E0D0C; --tile: #191715; --night-ink: #F6F1E7; --night-muted: #ABA397; --night-rule: #2A2724;
  /* The paper sheet follows the reader's appearance setting. */
  --bg: #F6F1E7; --surface: #FFFDF8; --ink: #1D1B18; --muted: #6B655C; --rule: #DDD3C1;
  --accent: #C93A08; /* orange text on cream, darker for contrast */
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 12px 24px -12px rgba(0, 0, 0, .5);
  --paper-shadow: 0 24px 48px -20px rgba(60, 30, 10, .4);
  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #181614; --surface: #211E1B; --ink: #F1ECE3; --muted: #A69E92; --rule: #34302B; --accent: #FF7A45;
    --paper-shadow: 0 24px 48px -20px rgba(0, 0, 0, .7); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--night); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--night); color: var(--night-ink); font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }

h1, h2, h3 { font-weight: 800; font-stretch: 125%; letter-spacing: -0.035em; line-height: 1.02; margin: 0; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); text-wrap: balance; }
h1 em, h2 em { font-style: normal; }
h3 { font-size: 1.18rem; letter-spacing: -0.02em; line-height: 1.2; }
.nb { white-space: nowrap; }

/* The App Store badge: a solid Compact Orange pill, the one warm light in the dark room. */
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 36px; }
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 30px 0 24px; border-radius: 999px;
  color: #fff; text-decoration: none; background: var(--orange);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 16px 36px -16px rgba(255, 90, 31, .75);
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.store:hover { transform: translateY(-2px); background: #FF6B33; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 20px 40px -16px rgba(255, 90, 31, .9); }
.store:focus-visible { border-radius: 999px; outline: 3px solid var(--night-ink); outline-offset: 3px; }
.store-logo { width: 28px; height: 34px; flex: none; margin-top: -4px; }
.store-text { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.store-text small { font-size: .8rem; font-weight: 500; letter-spacing: .01em; }
.store-text b { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }

/* Hero */
.hero, .ritual, .closer { position: relative; overflow-x: clip; }
.nav { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; }
.logo img { height: 22px; width: auto; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--night-muted); transition: color .15s; }
.nav-links a:hover { color: var(--night-ink); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 32px; align-items: center;
  padding-top: 28px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.5rem); letter-spacing: -0.05em; line-height: .96; }
.hero h1 em { color: var(--orange); }
.lede { font-size: 1.25rem; line-height: 1.45; max-width: 27em; margin: 30px 0 0; color: var(--night-muted); }
.fine { margin: 20px 0 0; font-size: .95rem; color: var(--night-muted); }

/* The phone, with jewel cases at three distances: far ones small and soft, one in focus, one so near the lens it
   blurs and runs off the edge. */
.hero-stage { position: relative; justify-self: center; }
.hero-stage::before { content: ""; position: absolute; inset: -18% -60%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 90, 31, .11), transparent); }
.case { position: absolute; height: auto; z-index: 2; pointer-events: none; user-select: none;
  filter: drop-shadow(0 22px 24px rgba(0, 0, 0, .55)); transform: translate3d(0, calc(var(--sy, 0) * var(--d, 0) * 1px), 0);
  animation: float 7s ease-in-out infinite alternate; }
.case.far { z-index: 0; filter: blur(2.5px) brightness(.62); animation-duration: 11s; --d: .1; }
.case.near { z-index: 3; filter: blur(6px) drop-shadow(0 30px 30px rgba(0, 0, 0, .5)); animation-duration: 5s; --d: -.22; }
.case-a { width: 146px; left: -96px; top: 40px; rotate: -9deg; z-index: 0; --d: .04; }
.case-b { width: 96px; right: -118px; top: 96px; rotate: 10deg; animation-delay: -3s; }
.case-c { width: 212px; left: -178px; top: 330px; rotate: 7deg; animation-delay: -5s; --d: -.08; }
.case-d { width: 270px; right: -214px; top: 452px; rotate: -8deg; animation-delay: -1.5s; }
.case-g { width: 62px; left: -292px; top: -4px; rotate: 14deg; animation-delay: -6s; filter: blur(3.5px) brightness(.5); }
@keyframes float { from { translate: 0 -6px; } to { translate: 0 8px; } }
@media (prefers-reduced-motion: reduce) { .case { animation: none; } .store, .nav-links a, summary::after { transition: none; } }

/* Phone frame */
.phone { position: relative; z-index: 1; width: 300px; aspect-ratio: 600 / 1304; border-radius: 46px; padding: 9px;
  background: #0A0908; box-shadow: var(--shadow), inset 0 0 0 1.5px #3a3632; flex: none; }
.phone picture { display: contents; }
.phone img, .phone video { width: 100%; height: 100%; object-fit: cover; border-radius: 37px; background: #000; }
.phone-lg { width: 320px; }
.phone-sm { width: 216px; border-radius: 34px; padding: 7px; }
.phone-sm img { border-radius: 27px; }

/* The statement. With scripting on, its words light up one by one as the paragraph is read down the screen (site.js
   sets --p from 0 to 1) and stay lit. Without scripting, or under Reduce Motion, it is simply lit. */
.ritual { padding: 136px 0 168px; }
.ritual p { font-size: clamp(1.55rem, 3.7vw, 2.9rem); line-height: 1.16; letter-spacing: -0.03em; font-weight: 700;
  font-stretch: 112%; max-width: 20em; margin: 0; text-wrap: pretty; }
.ritual strong { font-weight: 700; color: var(--orange); }
.lit .w { opacity: clamp(.2, calc((var(--p, 1) * (var(--n) + 5) - var(--i)) / 5), 1); }
.case-h { width: 330px; right: max(-150px, calc(50% - 760px)); top: 38%; rotate: 13deg; filter: blur(8px) brightness(.8); --d: 0; }

/* Features: four scenes, each one object on a dark tile, on a 12-column grid. */
.features { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.scene { position: relative; overflow: hidden; background: var(--tile); border-radius: 36px; }
.scene-copy { position: relative; z-index: 2; max-width: 27em; }
.scene-copy p { font-size: 1.06rem; color: var(--night-muted); margin: 20px 0 0; }

.scene-wide { grid-column: span 12; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr); gap: 40px; align-items: end;
  height: 580px; padding: 0 64px; }
.scene-wide .scene-copy { padding-bottom: 60px; }
.scene-wide > .phone, .duo { justify-self: center; align-self: start; margin-top: 72px; }
.scene-flip .scene-copy { order: 2; }
/* Two phones on the shelf scene: the one behind shows the dark appearance. */
.duo { position: relative; width: 410px; max-width: 100%; }
.duo .phone-back { position: absolute; right: 0; top: 56px; width: 264px; z-index: 0; }

.scene-tall { grid-column: span 5; display: flex; flex-direction: column; height: 680px; padding: 52px 44px 0; }
.scene-split { grid-column: span 7; display: flex; flex-direction: column; height: 680px; padding: 52px 52px 0; }
.scene-split .scene-copy { max-width: 29em; }

/* "Hold it up to the light": a lamp above the tile, and a jewel case that turns under it. site.js moves --t from -1
   to 1 as the tile scrolls by, or with the pointer where there is one; the band of light is masked to the case. */
.scene-light { background-image: radial-gradient(ellipse 85% 60% at 62% 0%, rgba(255, 236, 214, .13), transparent 70%); }
.held { position: relative; width: min(100%, 336px); margin: auto auto 48px; rotate: -5deg;
  transform: perspective(900px) rotateY(calc(var(--t, -.3) * 13deg)) rotateX(calc(var(--u, 0) * -9deg));
  filter: drop-shadow(0 34px 34px rgba(0, 0, 0, .6)); transition: transform .25s ease-out; }
.held img { width: 100%; height: auto; }
.held::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  -webkit-mask: url("/assets/cases/homework-large.webp") center / 100% 100% no-repeat;
  mask: url("/assets/cases/homework-large.webp") center / 100% 100% no-repeat;
  background: linear-gradient(108deg, transparent 36%, rgba(255, 255, 255, .34) 47%, rgba(255, 255, 255, .08) 54%, transparent 63%)
    calc(50% - var(--t, -.3) * 46%) 0 / 300% 100% no-repeat; }
@media (prefers-reduced-motion: reduce) { .held { transition: none; } }

/* "Booklet left, disc right": the tile takes the album's own ground, as the app does, and the open case lies on it. */
.scene-album { background: linear-gradient(#852739 45%, #6F202E 90%); color: #fff; } /* Homogenic's own colour in the app */
.scene-album .scene-copy p { color: rgba(255, 255, 255, .86); }
.spread { width: calc(100% + 64px); max-width: none; height: auto; margin: auto -32px;
  -webkit-mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent);
  mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent); }

/* Scroll-driven settling for the phones, where the browser has it and the reader has not asked for less. */
@keyframes settle { from { translate: 0 44px; } }
@keyframes settle-far { from { translate: 0 96px; } }
@keyframes arrive { from { scale: .92; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .scene .phone, .peek .phone { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
    .duo .phone-back { animation-name: settle-far; }
    .spread { animation: arrive linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
  }
}

/* The paper sheet. */
.paper { background: var(--bg); color: var(--ink); border-radius: 48px; margin: 160px 12px 0; padding: 120px 0 128px; }
.paper a:focus-visible, .paper summary:focus-visible { outline-color: var(--accent); }

/* Bonus tracks, set like the tracklist on a back inlay: a ruled row each, numbered 5 to 7 because four came before.
   Each row's screen stands behind its rule. */
.tracks { margin-top: 56px; counter-reset: track 4; border-bottom: 1px solid var(--rule); }
.track { display: grid; grid-template-columns: 2.4rem minmax(0, 4fr) minmax(0, 5fr) 216px; column-gap: 28px; align-items: start;
  border-top: 1px solid var(--rule); counter-increment: track; }
.track::before { content: counter(track); content: counter(track) / ""; margin-top: 38px;
  font-weight: 800; font-stretch: 125%; font-size: 1.18rem; line-height: 1.2; color: var(--accent); font-variant-numeric: tabular-nums; }
.track h3 { margin-top: 38px; text-wrap: balance; }
.track p { margin: 37px 0 36px; color: var(--muted); max-width: 30em; }
.peek { align-self: end; height: 196px; margin-top: 24px; overflow: hidden; }
.peek .phone { box-shadow: inset 0 0 0 1.5px #3a3632; }

/* Pricing and FAQ: the heading holds the left column, the content the right. */
.pricing, .faq { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 48px; align-items: start; padding-top: 144px; }
.promises { list-style: none; padding: 0; margin: 36px 0 0; color: var(--muted); font-weight: 500; font-size: .98rem; max-width: 22em; }
.promises li { padding: 11px 0; border-top: 1px solid var(--rule); }
.promises li:last-child { border-bottom: 1px solid var(--rule); }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.plan { background: var(--surface); border-radius: 28px; padding: 30px 28px 20px; }
.plan h3 { font-stretch: 100%; font-weight: 600; font-size: 1rem; letter-spacing: 0; color: var(--muted); }
.price { font-weight: 800; font-stretch: 125%; font-size: 1.5rem; line-height: 1.1; letter-spacing: -0.03em;
  margin: 8px 0 22px; min-height: 2.2em; text-wrap: balance; }
.plan-pro { background: #141210; color: #F6F1E7; box-shadow: var(--paper-shadow); }
.plan-pro h3 { color: #B9B1A5; }
.plan-pro .price { color: #FF7A45; }
.plan ul { list-style: none; padding: 0; margin: 0; }
.plan li { padding: 10px 0 10px 28px; border-top: 1px solid var(--rule); position: relative; }
.plan-pro li { border-color: rgba(255, 255, 255, .14); }
/* Each bullet is a small disc. */
.plan li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle, transparent 0 2.5px, var(--orange) 3px); }
@media (prefers-color-scheme: dark) {
  .plan-pro { background: #F6F1E7; color: #1D1B18; }
  .plan-pro h3 { color: #6B655C; }
  .plan-pro .price { color: #C93A08; }
  .plan-pro li { border-color: rgba(0, 0, 0, .12); }
}

details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; list-style: none; padding: 22px 40px 22px 0; font-weight: 600; font-size: 1.12rem; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; font-weight: 400; color: var(--accent); transition: transform .2s; }
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details p { margin: -4px 0 24px; color: var(--muted); max-width: 40em; }

/* Closer: the line the whole page is for, as large as the screen allows. */
.closer { text-align: center; padding: 184px 0 176px; overflow: hidden; }
.closer .wrap { position: relative; z-index: 4; }
.closer h2 { font-size: clamp(2.3rem, 8.4vw, 6.5rem); letter-spacing: -0.055em; line-height: .94; }
.closer-sub { margin: 30px 0 0; font-size: 1.2rem; color: var(--night-muted); }
.closer .cta { justify-content: center; }
.case-e { width: 190px; left: max(-40px, calc(50% - 640px)); top: 92px; rotate: -10deg; }
.case-f { width: 180px; right: max(-36px, calc(50% - 630px)); bottom: 96px; rotate: 9deg; animation-delay: -4s; }
.case-i { width: 84px; right: max(40px, calc(50% - 420px)); top: 56px; rotate: 12deg; animation-delay: -2s; }
.case-j { width: 300px; left: max(-140px, calc(50% - 760px)); bottom: -70px; rotate: 11deg; animation-delay: -6s; filter: blur(8px) brightness(.85); }

/* Footer */
.foot { padding-top: 36px; padding-bottom: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 36px;
  color: var(--night-muted); font-size: .9rem; position: relative; }
.foot::before { content: ""; position: absolute; top: 0; left: 20px; right: 20px; border-top: 1px solid var(--night-rule); }
.foot img { height: 18px; width: auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-left: auto; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { color: var(--night-ink); }
.foot p { margin: 0; flex-basis: 100%; font-size: .82rem; }

/* Narrow desktop and tablet. */
@media (max-width: 1040px) {
  .scene-wide { padding: 0 44px; }
  .scene-tall, .scene-split { grid-column: span 6; padding: 44px 36px 0; }
  .spread { width: calc(100% + 48px); margin: auto -24px; }
  .duo { width: 360px; }
  .duo .phone-back { width: 230px; }
  .duo > .phone:not(.phone-back) { width: 260px; }
  .track { grid-template-columns: 2.6rem minmax(0, 4fr) minmax(0, 5fr) 180px; column-gap: 22px; }
  .peek .phone { width: 180px; }
  .case-e { width: 160px; left: -44px; top: 60px; }
  .case-f { width: 150px; right: -40px; bottom: 56px; }
}
/* Phone and small tablet: one column, still left-aligned. */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 16px; gap: 56px; padding-bottom: 40px; }
  .ritual { padding: 88px 0 112px; }
  .case-h { display: none; }
  .features { grid-template-columns: 1fr; gap: 16px; }
  .scene, .scene-wide, .scene-tall, .scene-split { grid-column: auto; display: flex; flex-direction: column; height: auto; padding: 44px 32px 0; gap: 0; }
  .scene-wide .scene-copy { padding-bottom: 0; }
  .scene-flip .scene-copy { order: 0; }
  .scene .phone, .scene .duo { align-self: center; margin-top: 44px; }
  .scene > .phone { width: 280px; margin-bottom: -250px; }
  .duo { margin-bottom: -250px; }
  .duo .phone { margin-top: 0; }
  .held { margin: 48px auto 56px; width: min(100%, 340px); }
  .spread { margin: 28px -24px 36px; }
  .paper { margin-top: 96px; border-radius: 36px; padding: 88px 0 96px; margin-left: 8px; margin-right: 8px; }
  .tracks { margin-top: 40px; }
  .track { grid-template-columns: 2.2rem minmax(0, 1fr); column-gap: 0; }
  .track::before, .track h3 { margin-top: 30px; }
  .track p { grid-column: 2; margin: 10px 0 0; }
  .peek { grid-column: 2; justify-self: start; margin-top: 26px; height: 210px; }
  .peek .phone { width: 216px; }
  .pricing, .faq { grid-template-columns: 1fr; padding-top: 104px; }
  .pricing .side { display: contents; }
  .promises { order: 3; margin-top: 0; max-width: none; }
  .closer { padding: 190px 0 200px; }
  .case-e { width: 130px; left: -30px; top: 36px; }
  .case-f { width: 126px; right: -28px; bottom: 44px; }
  .case-i { width: 60px; right: 18%; top: 70px; }
  .case-j { width: 200px; left: -90px; bottom: -50px; }
  .foot nav { margin-left: 0; }
}
@media (max-width: 620px) {
  .plans { grid-template-columns: 1fr; }
  .price { min-height: 0; }
}
@media (max-width: 560px) {
  .nav-links { display: none; }
  h2 .nb { white-space: normal; }
  .hero h1 { font-size: clamp(1.9rem, 9.8vw, 2.9rem); }
  .lede { font-size: 1.1rem; margin-top: 22px; }
  .phone-lg { width: 264px; }
  .case-a { width: 104px; left: -62px; top: 30px; }
  .case-b { width: 70px; right: -58px; top: 84px; }
  .case-c { width: 136px; left: -84px; top: 270px; }
  .case-d { width: 150px; right: -112px; top: 380px; }
  .case-g { display: none; }
  .scene, .scene-wide, .scene-tall, .scene-split { padding: 36px 24px 0; border-radius: 28px; }
  .scene-copy p { font-size: 1.02rem; }
  .scene > .phone { width: 250px; margin-bottom: -220px; }
  .duo { width: 100%; max-width: 330px; margin-bottom: -220px; }
  .duo > .phone:not(.phone-back) { width: 72%; }
  .duo .phone-back { width: 64%; top: 48px; }
  .spread { width: calc(100% + 40px); margin: 24px -20px 32px; }
  .paper { border-radius: 28px; }
  .closer h2 { letter-spacing: -0.045em; }
}
