/* IdealFace landing page. Extends site.css; the page colour matches the app screenshots so images blend in with no seams. */

body.home { background: var(--paper); }
.home .masthead { padding-bottom: 0; }

.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(40px, 9vw, 88px) var(--gutter) 0;
  text-align: center;
}
.app-icon { display: block; width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 22%; box-shadow: var(--shadow-card); }
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(46px, 9.4vw, 112px);
  line-height: 1.04;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 14px auto 0;
  max-width: 20ch;
  text-wrap: balance;
}
.hero .lede {
  max-width: 50ch;
  margin: 24px auto 0;
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.65;
  color: var(--text);
}

.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 188px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  text-align: left;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.store svg { width: 26px; height: 26px; flex: none; }
.store span { display: flex; flex-direction: column; }
.store b, .store small { color: inherit; }
.store small { font-size: 11px; letter-spacing: 0.04em; opacity: .72; }
.store b { font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.2; letter-spacing: 0.01em; }
.store:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-hover); color: var(--paper); }
.store:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.fineprint { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

.feature {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(56px, 12vw, 112px) var(--gutter) 0;
  display: grid;
  gap: 32px;
  align-items: center;
}
.feature .copy h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 5.6vw, 44px);
  line-height: 1.1;
  color: var(--ink);
  margin: 10px 0 0;
}
.feature .copy p {
  margin: 14px 0 0;
  max-width: 40ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}
@media (min-width: 760px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 96px; }
  .feature.flip .copy { order: 2; }
}

.closing {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(40px, 9vw, 88px) var(--gutter) 0;
  text-align: center;
}
.closing h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 5.6vw, 44px);
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
}
.closing p { margin: 12px auto 0; max-width: 44ch; font-size: 15px; line-height: 1.7; color: var(--muted); }

.home .site-footer { margin-top: clamp(56px, 12vw, 96px); padding-left: var(--gutter); padding-right: var(--gutter); }
.home .site-footer .note { margin: 14px auto 0; max-width: 56ch; font-size: 12px; line-height: 1.7; }

/* Scroll reveal: only active once the script has run, so the page is fully visible without JavaScript. */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
}

/* Scrollable screenshots: inside a slim device bezel, content fading into the frame at both ends. */
.frame {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 9px;
  border-radius: 42px;
  background: #17140f;
  box-shadow: 0 18px 40px rgba(30, 26, 22, .10);
}
html[data-theme="dark"] .frame { background: #2d2820; box-shadow: 0 18px 44px rgba(0, 0, 0, .45); }
.scroll {
  max-height: clamp(480px, 70vh, 600px);
  overflow-y: auto;
  border-radius: 33px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20px, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 20px, #000 calc(100% - 48px), transparent);
}
.scroll::-webkit-scrollbar { display: none; }
.scroll:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.scroll img { display: block; width: 100%; height: auto; }
.hero .frame { width: min(480px, 100%); margin: clamp(36px, 8vw, 64px) auto 0; }
@media (min-width: 760px) {
  .feature .frame { margin: 0; }
  .feature.flip .frame { margin-left: auto; }
}
.hint { text-align: center; margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }

/* Brand: the app's face mark; the name slides out on hover or keyboard focus (always shown on touch screens). */
.home .masthead { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1240px; margin: 0 auto; text-align: left; padding-left: var(--gutter); padding-right: var(--gutter); }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; padding: 6px 4px; border-radius: 12px; }
.brand:hover { color: var(--ink); }
.brand:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand-name {
  display: block;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  transition: max-width .5s var(--ease), opacity .3s ease-out;
}
.brand-name > span {
  display: block;
  padding: 0 4px 0 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: 0.015em;
  transform: translateX(-8px);
  transition: transform .5s var(--ease);
}
.brand-name b { font-weight: inherit; }
.brand:hover .brand-name, .brand:focus-visible .brand-name { max-width: 9em; opacity: 1; }
.brand:hover .brand-name > span, .brand:focus-visible .brand-name > span { transform: none; }
@media (hover: none) {
  .brand-name { max-width: 9em; opacity: 1; }
  .brand-name > span { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-name, .brand-name > span { transition: none; }
}

/* Top navigation. The Legal panel grows from a small pill; its contents sit in place and are uncovered, not faded in. */
.topnav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px; border: 0; border-radius: 12px;
  background: none; cursor: pointer;
  font: inherit; font-size: 14.5px; color: var(--muted); text-decoration: none;
  transition: color .2s ease-out, background-color .2s ease-out;
}
.nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--ink); }
.nav-link[aria-expanded="true"] { background: var(--surface-tint); }
.nav-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.nav-link .chev { opacity: .7; transition: transform .3s var(--ease); }
.nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }

.menu {
  --mw: min(520px, calc(100vw - 2 * var(--gutter))); --mh: 248px; --spring: cubic-bezier(0.3, 1.36, 0.5, 1);
  position: absolute; right: var(--gutter); top: calc(100% - 4px); z-index: 20;
  pointer-events: none; visibility: hidden;
  transition: visibility 0s linear .24s;
}
.menu.is-open { visibility: visible; transition-delay: 0s; }
.menu.is-open::before { content: ""; position: absolute; right: 0; top: -14px; width: 100%; height: 14px; pointer-events: auto; }
.menu__panel {
  position: relative; width: 120px; height: 44px; overflow: hidden; margin-left: auto;
  border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-card-hover);
  opacity: 0;
  transition: width .2s cubic-bezier(0.4, 0, 1, 1), height .2s cubic-bezier(0.4, 0, 1, 1), opacity .14s ease-out .08s;
}
.menu.is-open .menu__panel { width: var(--mw); height: var(--mh); opacity: 1; pointer-events: auto; transition: width .5s var(--spring), height .56s var(--spring), opacity .1s ease-out; }
.menu__grid { position: absolute; right: 0; top: 0; width: var(--mw); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 12px; }
.menu__row { display: block; padding: 14px 16px; border-radius: 16px; text-decoration: none; color: var(--ink); transition: background-color .2s ease-out; }
.menu__row:hover, .menu__row:focus-visible { background: var(--surface-tint); color: var(--ink); }
.menu__row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.menu__row b { display: block; font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.25; }
.menu__row small { display: block; margin-top: 3px; font-size: 13px; line-height: 1.4; color: var(--muted); }
@media (max-width: 600px) {
  .menu { --mh: 396px; }
  .menu__grid { grid-template-columns: 1fr; }
}
@media (max-width: 479px) { .nav-support { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .menu, .menu__panel, .menu.is-open .menu__panel, .nav-link, .nav-link .chev { transition: none; }
}

/* 3D stage: a large phone you spin yourself. Falls back to the flat layout when WebGL, motion or hardware does not allow it. */
.stage { display: none; }
.three-ok .stage { display: block; margin-top: clamp(16px, 4vw, 40px); }
.three-ok .flat { display: none; }
.stage__pin {
  max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(16px, 3vw, 48px); align-items: center;
}
.stage__copy { padding-left: clamp(0px, 3vw, 40px); }
.steps { position: relative; display: grid; }
.step { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: flex-start; opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .5s var(--ease), transform .6s var(--ease); }
.step.on { opacity: 1; transform: none; pointer-events: auto; }
.step h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5.2vw, 64px); line-height: 1.05; color: var(--ink); margin: 12px 0 0; }
.step p:not(.eyebrow) { margin: 18px 0 0; max-width: 42ch; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.7; color: var(--text); }
.tabs { display: flex; gap: 4px; margin-top: 28px; }
.tab { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; transition: color .2s ease-out, background-color .2s ease-out; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); background: var(--surface-tint); }
.tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.stage__view { position: relative; height: clamp(620px, 92svh, 940px); }
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s ease-out; touch-action: pan-y; }
.stage.ready .stage__canvas { opacity: 1; }
.grab { position: absolute; inset: 0 16%; touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent; border-radius: 24px; }
.grab.is-grabbing { cursor: grabbing; }
.grab:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.poster {
  position: absolute; left: 50%; top: 50%; height: 80%; aspect-ratio: 0.47; transform: translate(-50%, -50%);
  border: 8px solid var(--ink); border-radius: 36px; box-shadow: var(--shadow-card);
  background: var(--paper) url("img/home-long.webp") top center / 100% auto no-repeat;
  transition: opacity .5s ease-out;
}
.stage.ready .poster { opacity: 0; }

/* Spin hint: two arrows wrapping the phone. Gone for good after the first touch. */
.tutor { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; color: var(--ink); opacity: 0; transition: opacity .5s ease-out; }
.stage.ready .tutor { opacity: .8; }
.stage.touched .tutor { opacity: 0; transition-duration: .3s; }
.tutor svg { height: 88%; width: auto; overflow: visible; }
.tutor .arc { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tutor path:nth-child(odd) { stroke-dasharray: 8 12; animation: tutor-flow 1.6s linear infinite; }
.tutor text { fill: #1e1a16; font-family: var(--sans); font-size: 30px; font-weight: 500; letter-spacing: 0.02em; }
.tutor__label { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
@keyframes tutor-flow { to { stroke-dashoffset: -40; } }
@media (prefers-reduced-motion: reduce) { .tutor path:nth-child(odd) { animation: none; } }

@media (max-width: 859px) {
  .stage__pin { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .stage__view { order: -1; height: clamp(440px, 64svh, 620px); }
  .grab { inset: 0 18%; }
  .stage__copy { padding: 0 var(--gutter) 8px; text-align: center; }
  .step { align-items: center; }
  .step h2 { font-size: clamp(32px, 9vw, 44px); }
  .tabs { justify-content: center; }
}

/* ---------- Journey spine: the app's five-step line, with one gold point that follows the scroll ---------- */
.spine { position: fixed; left: 0; right: 0; top: 0; z-index: 5; height: 3px; pointer-events: none; opacity: 0; transition: opacity .5s ease-out; }
.spine.on { opacity: 1; }
.spine__line { position: absolute; inset: 0; background: var(--rule-soft); }
.spine__fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--gold); }
.spine__dot, .spine ol { display: none; }
@media (min-width: 1360px) {
  .spine { left: clamp(10px, 1.6vw, 28px); right: auto; top: 50%; height: min(46svh, 360px); transform: translateY(-50%); width: 14px; }
  .spine__line, .spine__fill { left: 6px; right: auto; width: 2px; border-radius: 1px; }
  .spine__line { top: 0; bottom: auto; height: 100%; background: var(--rule); }
  .spine__fill { width: 2px; height: var(--p, 0%); bottom: auto; background: var(--ink); }
  .spine__dot { display: block; position: absolute; left: 1px; top: var(--p, 0%); width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-wash); }
  .spine ol { display: block; list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
  .spine li { position: absolute; left: 3px; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--paper); border: 2px solid var(--rule-strong); font-size: 0; transition: border-color .3s ease-out, background-color .3s ease-out; }
  .spine li:nth-child(1) { top: 0; } .spine li:nth-child(2) { top: 25%; } .spine li:nth-child(3) { top: 50%; } .spine li:nth-child(4) { top: 75%; } .spine li:nth-child(5) { top: 100%; }
  .spine li.passed { border-color: var(--ink); background: var(--ink); }
}
@media (min-width: 1760px) {
  .spine li::after { content: attr(data-l); position: absolute; left: 20px; top: 50%; transform: translateY(-50%); font-size: 11.5px; line-height: 1; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; transition: color .3s ease-out; }
  .spine li.passed::after { color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) { .spine, .spine li, .spine li::after { transition: none; } }
