/* Signed-out landing page (main/templates/main/landing.html). The composition comes from the
   taste-skill run (D16): a first screen in type only, the interval example, AeroSync's own
   screens as the pictures. The colours, type and shapes are the app's (app.css, D13): navy shell,
   slate on #f8fafc, indigo for actions, the system font, 6/8/12px corners. */

:root {
  --navy: #0f172a;              /* app: --c-shell / --c-text */
  --navy-2: #1e293b;            /* app: --c-shell-hover */
  --bg: #f8fafc;                /* app: --c-bg */
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --muted: #64748b;             /* app: --c-text-muted */
  --accent: #5b5ef0;            /* app: indigo scheme (the default) */
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-on-dark: #a5b4fc;    /* app: link colour on the dark theme */

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;             /* buttons, inputs */
  --radius: 8px;                /* cards */
  --radius-lg: 12px;            /* tiles, screens */

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);   /* 13–14px  captions, legal */
  --step-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);         /* 16–18px  text */
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);       /* 20–26px  statements */
  --step-head: clamp(2rem, 1.3rem + 3vw, 4rem);                /* 32–64px  section headings */
  --step-xl: clamp(2.5rem, 1rem + 5vw, 6rem);                  /* 40–96px  the close */

  --m: 28px;                    /* page margin */
  --gap: 24px;
  --section: clamp(88px, 11vw, 180px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms; --t-hover: 180ms; --t-reveal: 800ms;
}
@media (max-width: 700px) { :root { --m: 20px; --gap: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--navy); color: var(--navy); font-family: var(--font); font-size: var(--step-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
p, h1, h2, h3, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.field-dark :focus-visible { outline-color: var(--accent-on-dark); }

.page { position: relative; z-index: 1; }
.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: var(--m); }   /* one left edge for every section */
.field-dark { background: var(--navy); color: #e2e8f0; --soft: #94a3b8; }
.field-page { background: var(--bg); color: var(--navy); --soft: var(--muted); }
.field-light { background: var(--surface); color: var(--navy); --soft: var(--muted); }
.field-accent { background: var(--accent-soft); color: var(--navy); --soft: #475569; }

/* Buttons and links, as in the app: indigo fill, white text, 6px corners. */
.button { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; min-height: 46px; padding: 0 20px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; border-radius: var(--radius-sm);
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease; }
.button:active { transform: scale(0.97); }
.button-lg { min-height: 54px; padding: 0 26px; }
.text-link, .footer a, .top-links a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease; }
.text-link { text-decoration-color: currentColor; font-weight: 500; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--accent-hover); }
  .footer a:hover, .top-links a:hover { text-decoration-color: currentColor; }
  .field-dark .text-link:hover { color: var(--accent-on-dark); }
}
/* The language flags (D15), as in the app's top bar; also in the footer, on the light ground. */
.lang-flags { display: inline-flex; align-items: center; gap: 2px; margin: 0; }
.lang-flags .lang-flag { background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 3px; line-height: 0; opacity: 0.55; cursor: pointer; transition: opacity var(--t-hover) ease, background-color var(--t-hover) ease; }
.lang-flags .lang-flag img { display: block; width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); }
.lang-flags .lang-flag.is-current { opacity: 1; border-color: rgba(255, 255, 255, 0.5); }
@media (hover: hover) and (pointer: fine) { .lang-flags .lang-flag:hover { opacity: 1; background: var(--navy-2); } }
.footer .lang-flags .lang-flag img { box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15); }
.footer .lang-flags .lang-flag.is-current { border-color: var(--border-strong); }
@media (hover: hover) and (pointer: fine) { .footer .lang-flags .lang-flag:hover { background: var(--surface-2); } }

/* ── Hero: the app's navy top bar, one sentence, the name across the bottom ── */
.hero { position: relative; min-height: 100svh; overflow: hidden; display: flex; flex-direction: column; }
.top { display: flex; justify-content: space-between; align-items: center; gap: var(--gap); padding-block: 14px; font-size: 15px; }
.wordmark { font-weight: 700; font-size: 17px; text-decoration: none; color: #fff; }
.top-right { display: flex; align-items: center; gap: 22px; }
.powered { display: flex; align-items: center; gap: 8px; color: var(--soft); font-size: 13px; }
.powered img { height: 26px; width: auto; }
.top-links { display: flex; gap: 20px; align-items: center; }
.hero-text { padding-top: 88px; position: relative; z-index: 1; }
.statement { font-size: var(--step-lead); line-height: 1.35; text-wrap: balance; max-width: 36ch; color: #fff; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 32px; }
/* Sized by landing.js to fill the column exactly, whatever the system font; 15vw without script. */
.hero-name { margin-top: auto; padding-top: 48px; padding-bottom: var(--m); }
.hero-word { margin: 0; font-weight: 800; font-size: 15vw; line-height: 0.9; letter-spacing: -0.02em; white-space: nowrap; color: var(--accent); transform-origin: 0 100%; }
.hero-word span { display: inline-block; }

/* ── Showcase: pick an interval, see when the demo aircraft is due ── */
.showcase { padding: var(--section) 0 calc(var(--section) * 0.8); }
.section-title { font-weight: 800; font-size: var(--step-head); line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
/* Choices (intervals, logbooks) like the app's Airframe/Engine/Propeller switch: white, 6px corners,
   the chosen one in indigo. */
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.choices button { min-height: 40px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--navy); font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.choices button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: hover) and (pointer: fine) { .choices button[aria-pressed="false"]:hover { background: var(--surface-2); } }
.showcase-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: calc(var(--gap) * 3); margin-top: 28px; align-items: start; }
.answer { max-width: 560px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 15px; font-variant-numeric: tabular-nums; }
.answer-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; font-size: 18px; }
.answer-head span { color: var(--muted); font-size: 15px; }
.answer dl div { display: grid; grid-template-columns: 11rem 1fr; gap: 12px; padding: 5px 0; }
.answer dt { color: var(--muted); }
.answer .answer-due { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 18px; font-weight: 600; }
.answer .answer-due dt { color: var(--navy); }
.answer-note { margin-top: 6px; color: var(--accent-hover); font-weight: 600; }
.shot img { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); }

/* ── The logbooks: the same choice, swapping the screen ── */
.band { padding: calc(var(--section) * 0.6) 0; }
.band-frame { margin: 28px 0 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--bg); }
.band-frame img { width: 100%; }

/* ── How it works: an itinerary, as an app card, on the soft accent field ── */
.how { padding: var(--section) 0; }
.how-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.how-text { grid-column: 1 / span 6; }
.how-text p { margin-top: 24px; max-width: 32ch; font-size: var(--step-lead); line-height: 1.4; color: #334155; }
.slip { grid-column: 7 / span 5; max-width: 480px; width: 100%; justify-self: start; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 16px; font-variant-numeric: tabular-nums; }
.slip-body { padding: 24px 24px 20px; }
.slip h3 { margin: 24px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.slip h3:first-child { margin-top: 0; }
.slip .row { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; }
.slip .row span { flex: 0 1 auto; }
.slip .row i { flex: 1 1 24px; min-width: 24px; height: 0; border-bottom: 2px dotted var(--border-strong); }   /* the leader dots */
.slip .row b { flex: none; font-weight: 600; text-align: right; }
.slip .row.total { margin: 0; padding: 0 24px; min-height: 48px; align-items: center; justify-content: space-between; background: var(--navy); color: #fff; }

/* ── What it keeps: two-ended rows in a narrow column, screens beside ── */
.keeps { padding: var(--section) 0; }
.keeps-grid { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: calc(var(--gap) * 3); align-items: start; }
.keeps-list h2 { font-size: var(--step-lead); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 28px; }
.keeps-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-height: 36px; padding: 6px 0; }
.keeps-list li span { font-size: 16px; }
.keeps-list li b { flex: none; font-weight: 400; font-size: var(--step-small); color: var(--soft); font-variant-numeric: tabular-nums; text-align: right; }
.keeps-shots { position: sticky; top: 10vh; display: grid; gap: 44px; }

/* ── Close: back to the navy ── */
.close { position: relative; min-height: 70svh; display: flex; padding: var(--section) 0 40px; }
.close-inner { display: grid; grid-template-rows: 1fr auto; gap: 48px; }
.close-title { font-weight: 800; font-size: var(--step-xl); line-height: 1; letter-spacing: -0.045em; color: #fff; }
.close-title .line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.close-title [data-line] { display: block; }
.close-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--gap); }
.close-bottom p { max-width: 38ch; font-size: var(--step-lead); line-height: 1.35; }

/* ── Footer: uncovered as the page slides away ── */
.footer { position: sticky; bottom: 0; z-index: 0; min-height: 100svh; display: flex; padding: 40px 0 20px; background: var(--bg); color: var(--navy); --soft: var(--muted); font-size: 15px; overflow: hidden; }
.footer-inner { display: grid; grid-template-rows: auto 1fr auto; gap: 32px; }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.footer-cols p, .footer-cols li { color: var(--soft); line-height: 1.7; }
.footer-cols .first { color: var(--navy); font-weight: 600; }
.footer .support-line { margin-top: 12px; color: var(--soft); }
.footer-note { align-self: end; max-width: 70ch; color: var(--soft); font-size: var(--step-small); }
.footer-note p { margin: 0; }
/* Sized by landing.js to run from margin to margin; 15vw without script. */
.footer-word { margin: 0; font-weight: 800; font-size: 15vw; line-height: 0.86; letter-spacing: -0.02em; white-space: nowrap; color: var(--navy); transform-origin: 50% 100%; }
.footer-word span { display: inline-block; }

/* ── Tablet: one column below the wide grids ── */
@media (max-width: 1000px) {
  .showcase-grid { grid-template-columns: 1fr; gap: 56px; }
  .how-text, .slip { grid-column: 1 / -1; }
  .how-text p { max-width: 40ch; }
  .keeps-grid { grid-template-columns: 1fr; gap: 64px; }
  .keeps-list { max-width: 620px; }
  .keeps-shots { position: static; }
}

/* ── Phone: its own composition ── */
@media (max-width: 760px) {
  .powered span { display: none; }
  .top { flex-wrap: wrap; row-gap: 12px; }
  .top-right { display: contents; }
  .top-links { order: 3; width: 100%; gap: 22px; }
  .hero-text { padding-top: 36px; padding-right: calc(30vw + var(--m)); }
  .statement { font-size: 18px; }
  .actions { flex-direction: column; align-items: flex-start; gap: 18px; }
  /* Down the right side inside the margins, below the top bar; landing.js caps its thickness at 30% of the width. */
  .hero-name { position: absolute; top: 112px; bottom: var(--m); right: var(--m); width: auto; max-width: none; margin: 0; padding: 0; }
  .hero-word { writing-mode: vertical-rl; font-size: 28vw; line-height: 0.85; transform-origin: 100% 0; }
  .showcase-grid { margin-top: 24px; }
  .answer dl div { grid-template-columns: 7.5rem 1fr; }
  .choices button { min-height: 44px; }
  .band-frame { height: 56vh; }
  .band-frame img { width: auto; height: 100%; max-width: none; }
  .slip { max-width: none; }
  .slip-body { padding-inline: 18px; }
  .slip .row { flex-wrap: wrap; gap: 2px 8px; }
  .slip .row span { flex: 1 1 100%; }                      /* the description, then dots and value beneath it */
  .slip .row.total { padding: 10px 18px; flex-wrap: wrap; }
  .slip .row.total span { flex: 1 1 auto; }
  .keeps-list li { min-height: 44px; flex-wrap: wrap; gap: 2px 12px; }
  .close { min-height: 64svh; }
  .close-title { font-size: 13vw; }
  .close-bottom { flex-direction: column; align-items: stretch; gap: 28px; }
  .close-bottom .button { width: 100%; }
  .close-bottom p { font-size: 17px; }
  .footer-cols { grid-template-columns: 1fr 1fr; row-gap: 32px; }
}

/* ── Motion: entrances, the scaling name, a drifting screen. Content stays visible without script. ── */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(18px); animation: rise var(--t-reveal) var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 200ms); }
  .js .hero-word span { transform: translateY(40%); animation: word-up 1100ms var(--ease-out) 80ms forwards; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--d, 0) * 1ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  /* The clip sits on the picture, not the figure: an observer never sees a fully clipped element. */
  .js .shutter { opacity: 1; transform: none; }
  .js .shutter img { clip-path: inset(0 0 100% 0 round var(--radius-lg)); transform: scale(1.04); transition: clip-path 1100ms var(--ease-in-out), transform 1500ms var(--ease-soft); }
  .js .shutter figcaption { opacity: 0; transition: opacity 600ms ease 500ms; }
  .js .shutter.is-in img { clip-path: inset(0 round var(--radius-lg)); transform: none; }
  .js .shutter.is-in figcaption { opacity: 1; }
  .js .close-title [data-line] { transform: translateY(105%); transition: transform 900ms var(--ease-out); transition-delay: calc(var(--i) * 110ms); }
  .js .close-title.is-in [data-line] { transform: none; }
  .answer [data-out] { transition: opacity 220ms ease; }
  .answer.is-updating [data-out] { opacity: 0.35; }
  .choices button:active { transform: scale(0.97); }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes word-up { to { transform: none; } }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-word { animation: name-shrink linear both; animation-timeline: scroll(root); animation-range: 0 100svh; }
    .drift { animation: drift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    .footer-word { animation: name-grow linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
  }
}
@keyframes name-shrink { to { scale: 0.93; } }
@keyframes drift { from { scale: 1.025; translate: 0 -1.5%; } to { scale: 1.025; translate: 0 1.5%; } }
@keyframes name-grow { from { scale: 0.94; } to { scale: 1; } }
