/* Get Better Software — home page (prototype).
 * Colour, type, radius, shadow and easing all come from colors_and_type.css tokens;
 * translucent lines are the Paper and Sprout tokens mixed with transparent.
 * No JavaScript. Motion sits behind prefers-reduced-motion: no-preference, and nothing needs it to be visible. */

*, *::before, *::after { box-sizing: border-box; }
:root {
  --line: color-mix(in srgb, var(--paper) 13%, transparent);
  --line-strong: color-mix(in srgb, var(--paper) 38%, transparent);
  --glow: color-mix(in srgb, var(--sprout) 20%, transparent);
  --pad: clamp(20px, 4.4vw, 64px);
  --sweep-tint: color-mix(in srgb, var(--sprout) 30%, transparent);
}
html { background: var(--ink); color: var(--paper); font-family: var(--font-sans); -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; }
a { color: inherit; }
::selection { background: var(--sprout); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: var(--s-1); border-radius: var(--r-sm); }
.product :focus-visible { outline-color: var(--ink); }
.hero:has(.top :focus-visible) { z-index: 2; }
.wrap { width: 100%; max-width: 1480px; margin-inline: auto; padding-inline: var(--pad); }
.pip { fill: var(--sprout); }
.eyebrow { margin: 0; font-family: var(--font-mono); font-size: var(--t-12); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone-3); }

/* ── hero: the company, seen through a viewfinder ─────────────────────── */
.hero { position: relative; isolation: isolate; overflow: clip; display: flex; flex-direction: column; min-height: 100svh; background: var(--ink); }
@media (min-height: 620px) { .hero { position: sticky; top: 0; height: 100svh; } }

.finder { position: absolute; inset: clamp(10px, 1.5vw, 22px); z-index: 2; pointer-events: none; }
.finder i { position: absolute; width: 28px; height: 28px; border: 1.5px solid var(--line-strong); }
.finder i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.finder i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.finder i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.finder i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.top { position: relative; z-index: 3; padding-top: clamp(28px, 5vh, 48px); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); white-space: nowrap; text-decoration: none; font-size: var(--t-16); font-weight: 600; letter-spacing: -0.02em; }
.brand svg { width: 34px; height: 34px; }
.top-end { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); }
.motion-toggle { display: none; }
.nav { display: flex; gap: clamp(16px, 2.4vw, 32px); font-size: var(--t-14); font-weight: 500; }
.nav a { padding-block: var(--s-2); color: var(--stone-3); text-decoration: none; }

.hero-inner { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: clamp(28px, 5.5vh, 64px); padding-block: var(--s-8) clamp(36px, 6.5vh, 72px); transform-origin: 0 100%; }
.hero h1 { margin: 0; font-size: clamp(42px, min(9.5vw, 22svh), 156px); font-weight: 300; line-height: 0.92; letter-spacing: -0.055em; }
.ln { display: block; overflow: clip; padding-block: 0.1em; margin-block: -0.1em; }
.ln > span { display: block; }
.accent { color: var(--sprout); }
.slate { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: var(--s-3) var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line);
         font-family: var(--font-mono); font-size: var(--t-12); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone-3); }
.slate p { margin: 0; }

.reticle { position: absolute; z-index: 0; top: 27%; left: 77%; width: min(124vh, 100vw); aspect-ratio: 1; translate: -50% -50%; pointer-events: none; }
.reticle::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent 74%); }
.reticle svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.sweep { position: absolute; inset: 0; border-radius: 50%;
         background: conic-gradient(from 0deg, transparent 0 76%, var(--sweep-tint) 100%);
         -webkit-mask: radial-gradient(closest-side, transparent 19.5%, #000 20%, #000 80%, transparent 80.5%);
                 mask: radial-gradient(closest-side, transparent 19.5%, #000 20%, #000 80%, transparent 80.5%); }
.rt { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rt.r4, .rt.core { stroke: var(--line-strong); }
.rt.dash { stroke: var(--line-strong); stroke-dasharray: 2 14; }
.rt.ticks { stroke: var(--line-strong); stroke-width: 10; stroke-dasharray: 1 22.69; vector-effect: none; }
.rt, .orbit { transform-box: view-box; transform-origin: 50% 50%; }

/* ── sheets that slide over the hero ──────────────────────────────────── */
.sheet { position: relative; z-index: 1; border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* product: Paper */
.product { overflow: clip; background: var(--paper); color: var(--ink); padding-block: clamp(56px, 10vh, 120px) calc(clamp(56px, 9vh, 112px) + var(--r-lg)); }
.product-head { display: flex; align-items: center; gap: 0.16em; font-size: clamp(54px, 14.6vw, 232px); }
.icon-tile { flex: none; width: 0.78em; height: 0.78em; border-radius: 22%; overflow: hidden; background: var(--ink); box-shadow: var(--shadow-2); }
.icon-tile img { width: 100%; height: 100%; }
.product h2 { margin: 0; font-size: 1em; font-weight: 300; line-height: 0.9; letter-spacing: -0.065em; white-space: nowrap; }
.product-grid { display: grid; gap: var(--s-9); margin-top: clamp(32px, 6vh, 72px); }
.product-copy { display: flex; flex-direction: column; gap: var(--s-8); }
.desc { margin: 0; max-width: 13em; font-size: clamp(28px, 4vw, 60px); font-weight: 300; line-height: 1.04; letter-spacing: -0.04em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-5); }
.cta { display: inline-flex; align-items: center; gap: var(--s-3); padding: var(--s-5) var(--s-7); border-radius: var(--r-pill); background: var(--ink); color: var(--paper);
       font-size: var(--t-18); font-weight: 600; line-height: 1; letter-spacing: -0.01em; text-decoration: none; }
.cta::after { content: ""; flex: none; width: 8px; height: 8px; border-top: 2px solid var(--sprout); border-right: 2px solid var(--sprout); rotate: 45deg; }
.platform { margin: 0; padding: var(--s-2) var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-pill); font-size: var(--t-14); font-weight: 500; color: var(--fg-2); }

.fan { position: relative; width: 100%; max-width: 660px; aspect-ratio: 1 / 1.08; margin-inline: auto; }
.ph.before, .ph.after { aspect-ratio: 787 / 1400; }
.ph.card { aspect-ratio: 686 / 1400; }
.ph, .strip img { background: var(--ink-soft); color: var(--paper); font-size: var(--t-14); }
.ph { position: absolute; top: 50%; left: 50%; height: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.ph.before { width: 36%; translate: -140% -50%; rotate: -9deg; }
.ph.after  { width: 36%; translate: 40% -54%; rotate: 8deg; }
.ph.card   { width: 42%; translate: -50% -50%; rotate: -2deg; }

.strip { margin-top: clamp(48px, 9vh, 112px); overflow: clip; }
.strip-track { display: flex; gap: var(--s-4); width: max-content; padding-right: var(--s-4); }
.strip img { width: clamp(150px, 18vw, 280px); height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-md); }

/* contact: Ink */
.contact { margin-top: calc(-1 * var(--r-lg)); background: var(--ink); color: var(--paper); padding-block: clamp(72px, 15vh, 176px) clamp(56px, 10vh, 120px); }
.mail { display: inline-block; margin-top: var(--s-5); padding-bottom: 0.1em; font-size: clamp(21px, 6.8vw, 112px); font-weight: 300; line-height: 1; letter-spacing: -0.05em; text-decoration: none; white-space: nowrap;
        background: linear-gradient(var(--sprout), var(--sprout)) no-repeat 0 100% / 0 2px; }

/* footer: Ink */
.site-footer { position: relative; z-index: 1; background: var(--ink); border-top: 1px solid var(--line); padding-block: var(--s-7); font-size: var(--t-14); color: var(--stone-3); }
.site-footer .wrap { display: flex; flex-direction: column; gap: var(--s-3); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--paper); text-decoration-color: var(--line-strong); text-underline-offset: var(--s-1); }

/* ── wider screens ────────────────────────────────────────────────────── */
@media (max-width: 559px) { .nav { display: none; } }
@media (max-width: 759px) {
  .slate { grid-template-columns: repeat(2, auto); justify-content: start; }
  .reticle { top: 24%; left: 78%; width: 138vw; }
  .ph.card { width: 46%; } .ph.before { width: 38%; translate: -128% -50%; } .ph.after { width: 38%; translate: 28% -54%; }
  .cta { flex: 1 1 100%; justify-content: center; }
}
@media (min-width: 760px) {
  .site-footer .wrap { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3) var(--s-7); }
}
@media (min-width: 1000px) {
  .product-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; column-gap: var(--s-9); }
  .fan { margin-top: calc(-1 * clamp(40px, 9vh, 120px)); }
}

/* ── hover (pointer devices): end states apply at once; transitions are in the motion block ── */
@media (hover: hover) {
  .nav a:hover { color: var(--paper); }
  .site-footer a:hover { text-decoration-color: var(--paper); }
  .cta:hover { background: var(--ink-soft); }
  .cta:hover::after { translate: 5px 0; }
  .mail:hover { background-size: 100% 2px; color: var(--sprout); }
  .fan:hover .ph.before { rotate: -13deg; } .fan:hover .ph.after { rotate: 12deg; } .fan:hover .ph.card { rotate: 0deg; scale: 1.03; }
  .strip:hover .strip-track { animation-play-state: paused; }
}

/* ── motion ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @media (hover: hover) {
    .nav a, .site-footer a { transition: color var(--d-1) var(--ease-standard), text-decoration-color var(--d-1) var(--ease-standard); }
    .cta { transition: background-color var(--d-1) var(--ease-standard); }
    .cta::after { transition: translate var(--d-2) var(--ease-standard); }
    .mail { transition: background-size var(--d-3) var(--ease-standard), color var(--d-2) var(--ease-standard); }
    .ph { transition: rotate var(--d-3) var(--ease-standard), scale var(--d-3) var(--ease-standard); }
  }
  /* WCAG 2.2.2: a pause for the endless motion, no script, nothing stored */
  .motion-toggle { display: inline-flex; align-items: center; gap: var(--s-2); padding-block: var(--s-2); font-size: var(--t-14); font-weight: 500; color: var(--stone-3); cursor: pointer; }
  .motion-toggle input { width: var(--s-4); height: var(--s-4); margin: 0; accent-color: var(--paper); }
  html:has(#motion-off:checked) :is(.sweep, .orbit, .rt.spin-a, .rt.spin-b, .strip-track) { animation-play-state: paused; }
  @keyframes line-up { from { translate: 0 112%; } }
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes ring-in { from { opacity: 0; scale: 0.9; } }
  @keyframes spin { to { rotate: 360deg; } }
  @keyframes marquee { to { translate: -50% 0; } }

  /* entrance: system duration and easing, staggered */
  .ln > span { animation: line-up var(--d-3) var(--ease-standard) both; }
  .ln:nth-child(2) > span { animation-delay: 90ms; } .ln:nth-child(3) > span { animation-delay: 180ms; }
  .slate, .top { animation: fade-in var(--d-3) var(--ease-standard) 300ms both; }
  .rt.r1, .rt.r2, .rt.r3, .rt.r4, .rt.r5, .rt.cross, .rt.core { animation: ring-in var(--d-3) var(--ease-standard) both; }
  .rt.r2 { animation-delay: 70ms; } .rt.r3 { animation-delay: 140ms; } .rt.r4 { animation-delay: 210ms; } .rt.r5 { animation-delay: 280ms; } .rt.cross { animation-delay: 350ms; }

  /* ambient: the viewfinder is live */
  .sweep { animation: spin 9s linear infinite; }
  .orbit { animation: spin 36s linear infinite; }
  .rt.spin-a { animation: spin 120s linear infinite; }
  .rt.spin-b { animation: spin 180s linear infinite reverse; }
  .strip-track { animation: marquee 60s linear infinite; }

  /* scroll-linked: the hero recedes as the product sheet covers it; the photos fan out */
  @supports (animation-timeline: scroll()) {
    @keyframes hero-out { to { opacity: 0.12; scale: 0.94; } }
    @keyframes reticle-out { to { scale: 1.3; opacity: 0.45; } }
    @keyframes fan-out { from { translate: -50% -46%; rotate: 0deg; } }
    .hero-inner { animation: hero-out linear both; animation-timeline: scroll(root block); animation-range: 0 90vh; }
    .reticle { animation: reticle-out linear both; animation-timeline: scroll(root block); animation-range: 0 100vh; }
    .ph { animation: fan-out linear both; animation-timeline: view(); animation-range: entry 10% cover 48%; }
  }
}

/* reduced motion: the strip becomes a static wrapped set of the five photos, so none is clipped off-screen */
@media (prefers-reduced-motion: reduce) {
  .strip-track { width: auto; flex-wrap: wrap; padding-inline: var(--pad); }
  .strip-track [aria-hidden="true"] { display: none; }
}
