/* ==========================================================================
   landing.css — styles for welcome.php only.
   Kept entirely separate from styles.css so the marketing page can evolve
   without any risk to the application's own chrome.

   CSP: style-src 'self' 'unsafe-inline'. Everything here is a same-origin
   stylesheet; no @import, no web fonts (default-src 'self' would block them),
   no external images. System font stack only.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --ground: #f4f7fa;
  --ground-2: #ffffff;
  --surface: #ffffff;
  --ink: #1a2b3c;
  --ink-soft: #4a5b6c;      /* 5.7:1 on --ground */
  --line: #dde5ec;
  --line-soft: #e8eef4;
  --accent: #0e7490;
  --accent-deep: #0b5f73;   /* 7.3:1 on white — used for text */
  --accent-soft: #e0f2f7;
  --shadow-sm: 0 1px 2px rgba(16, 40, 58, .06), 0 2px 8px rgba(16, 40, 58, .05);
  --shadow-lg: 0 10px 24px rgba(16, 40, 58, .10), 0 32px 64px rgba(16, 40, 58, .09);
  --radius: 14px;

  /* schedule bar colours — same six the app uses */
  --c0: #0e7490;
  --c1: #15803d;
  --c2: #6d28d9;
  --c3: #b45309;
  --c4: #be185d;
  --c5: #1d4ed8;
  --pend-bg: #fef3c7;
  --pend-fg: #fde68a;
  --pend-ink: #92400e;
  --ok-soft: #dcfce7;
}

/* the deep band is the same in both themes */
:root {
  --deep: #10283a;
  --deep-2: #16344a;
  --deep-ink: #eaf2f7;
  --deep-soft: #a9c2d2;     /* 7.6:1 on --deep */
  --deep-line: #29465c;
  --deep-accent: #5ecfe6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d1720;
    --ground-2: #111e29;
    --surface: #16212c;
    --ink: #e9eff5;
    --ink-soft: #a3b5c4;    /* 8.0:1 on --ground */
    --line: #26343f;
    --line-soft: #1e2b35;
    --accent: #2aa5c2;
    --accent-deep: #6fd3e8; /* light text on dark */
    --accent-soft: #10323c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, .45), 0 32px 64px rgba(0, 0, 0, .4);

    --c0: #2aa5c2;
    --c1: #2f9e5a;
    --c2: #9d76e8;          /* lifted from #8f5cf0: dark bar ink needs 4.5:1 */
    --c3: #d1791f;
    --c4: #e0518c;
    --c5: #4f82ec;
    --pend-bg: #3d3212;
    --pend-fg: #5a4a19;
    --pend-ink: #f4c667;
    --ok-soft: #14301f;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* tells the UA to render scrollbars and the canvas to match the scheme we
     actually paint, so a dark viewer does not get a white overscroll gutter */
  color-scheme: light dark;
}

body.landing {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--ground);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; }

a { color: var(--accent-deep); }

/* Plain :focus first, so engines without :focus-visible still show a ring;
   then withdraw it for mouse focus where :focus-visible IS understood. */
:focus {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
/* landing.js parks focus on the section an in-page link points at. Those are
   programmatic focus targets, not controls — do not ring a whole section. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 12px 18px;
  font-weight: 700; text-decoration: none; z-index: 50;
}
/* fixed, not absolute: an absolutely-positioned skip link parks itself at the
   top of the *document*, so it is invisible if the page is already scrolled */
.skip:focus { position: fixed; left: 8px; top: 8px; }
@media (prefers-color-scheme: dark) {
  .skip { background: #3ab6d2; color: #04222b; }
}

.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(14, 116, 144, .3), 0 6px 16px rgba(14, 116, 144, .24);
}
.btn-primary:hover { background: #0c657e; transform: translateY(-1px); }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #04222b; background: #3ab6d2; }
  .btn-primary:hover { background: #57c7e0; }
}
.btn-ghost {
  background: var(--surface);
  color: var(--accent-deep);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ground);                                  /* fallback */
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .site-head { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
/* landing.js toggles .stuck once the page has scrolled past the top */
.site-head.stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.head-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 66px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); font-weight: 700;
  letter-spacing: -0.02em; font-size: 18px;
}
.brand-mark { display: block; width: 30px; height: 30px; flex: none; }
.brand-mark.small { width: 20px; height: 20px; }
.brand-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.brand-mark svg rect, .brand-mark svg path {
  fill: none; stroke: var(--accent); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.brand-mark svg .m1 { fill: var(--accent); stroke: none; }
.brand-mark svg .m2 { fill: var(--accent); stroke: none; opacity: .45; }

.head-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.head-nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 14.5px;
  padding: 8px 12px; border-radius: 8px;
}
.head-nav a:hover { color: var(--accent-deep); background: var(--accent-soft); }
.head-nav a.btn { margin-left: 8px; }
.head-nav a.btn:hover { background: var(--surface); }
@media (max-width: 640px) {
  .head-nav a:not(.btn) { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(40px, 7vw, 86px) 0 clamp(44px, 7vw, 92px);
  overflow: hidden;
}
/* a soft, static wash — no parallax, nothing that moves */
.hero::before {
  content: "";
  position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(52% 44% at 78% 18%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(48% 40% at 12% 8%, color-mix(in srgb, var(--c2) 11%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; display: grid; gap: clamp(32px, 5vw, 56px); align-items: center; }
@media (min-width: 960px) {
  .hero-inner { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
}

.eyebrow {
  font-size: 12.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: 14px;
}
.eyebrow.light { color: var(--deep-accent); }

.hero h1 {
  font-size: clamp(31px, 5.4vw, 53px);
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  text-wrap: balance;
}
.lede {
  font-size: clamp(16.5px, 1.9vw, 19px);
  color: var(--ink-soft);
  max-width: 34em;
  margin-bottom: 30px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.cta-note { font-size: 13.5px; color: var(--ink-soft); max-width: 36em; }

/* entrance for the hero copy — CSS only, so it works with JS off */
.hero-copy > * { animation: rise .7s cubic-bezier(.22,.8,.26,1) both; }
.hero-copy > :nth-child(1) { animation-delay: .04s; }
.hero-copy > :nth-child(2) { animation-delay: .10s; }
.hero-copy > :nth-child(3) { animation-delay: .17s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; }
.hero-copy > :nth-child(5) { animation-delay: .31s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   Hero artwork — the stylised month schedule
   ========================================================================== */
.hero-art { animation: rise .8s cubic-bezier(.22,.8,.26,1) both .18s; }
.sched-art {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 18px 38px rgba(16, 40, 58, .14));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  .sched-art { filter: drop-shadow(0 18px 38px rgba(0, 0, 0, .55)); }
}

.a-card { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.a-month { fill: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.a-rule { stroke: var(--line); stroke-width: 1; fill: none; }

.a-pill-ok rect  { fill: var(--ok-soft); fill: color-mix(in srgb, var(--c1) 16%, var(--surface)); }
.a-pill-ok text  { fill: var(--c1); }
.a-pill-wait rect { fill: var(--pend-bg); }
.a-pill-wait text { fill: var(--pend-ink); }
.a-pill-ok text, .a-pill-wait text {
  font-size: 10px; font-weight: 700; text-anchor: middle;
}

.a-weekend rect { fill: var(--line-soft); }
.a-today { fill: var(--accent-soft); fill: color-mix(in srgb, var(--accent) 13%, transparent); }

.a-day text { fill: var(--ink-soft); font-size: 9px; font-weight: 700; text-anchor: middle; }
.a-day text.on { fill: var(--accent-deep); }

.a-grid path { stroke: var(--line-soft); stroke-width: 1; fill: none; }
.a-grid path.strong { stroke: var(--line); }

.a-row .av.c0 { fill: var(--c0); } .a-row .av.c1 { fill: var(--c1); }
.a-row .av.c2 { fill: var(--c2); } .a-row .av.c3 { fill: var(--c3); }
.a-row .av.c4 { fill: var(--c4); } .a-row .av.c5 { fill: var(--c5); }
.a-row .avt { fill: #fff; font-size: 8.5px; font-weight: 700; text-anchor: middle; }
.a-row .nm  { fill: var(--ink); font-size: 11px; font-weight: 600; }
.a-row .sb  { fill: var(--ink-soft); font-size: 8.5px; }

.bar.c0 { fill: var(--c0); } .bar.c1 { fill: var(--c1); }
.bar.c2 { fill: var(--c2); } .bar.c3 { fill: var(--c3); }
.bar.c4 { fill: var(--c4); } .bar.c5 { fill: var(--c5); }
.bar.pend { stroke: var(--pend-ink); stroke-width: 1; stroke-dasharray: 3 2.5; }
.pend-bg { fill: var(--pend-bg); }
.pend-fg { fill: var(--pend-fg); }

.blb { fill: #fff; font-size: 9.5px; font-weight: 600; }
.blb.pendlb { fill: var(--pend-ink); font-weight: 700; }
@media (prefers-color-scheme: dark) {
  /* the bar/avatar colours lighten in dark mode, so the text on top of them
     has to flip with them — white initials on a light disc were 2.9:1 */
  .blb { fill: #07161d; }
  .a-row .avt { fill: #07161d; }
}

.a-legend rect.c0 { fill: var(--c0); } .a-legend rect.c1 { fill: var(--c1); }
.a-legend rect.c2 { fill: var(--c2); }
.a-legend rect.lg-pend { stroke: var(--pend-ink); stroke-width: .8; }
.a-legend text { fill: var(--ink-soft); font-size: 9px; font-weight: 600; }

/* --- the bars draw themselves in, left to right --- */
.bar {
  transform-box: fill-box;
  transform-origin: left center;
  animation: bar-grow .75s cubic-bezier(.22,.9,.28,1) both;
}
.blb { animation: fade-in .45s ease both; }

.bar.d1 { animation-delay: .35s; } .blb.d1 { animation-delay: .70s; }
.bar.d2 { animation-delay: .47s; } .blb.d2 { animation-delay: .82s; }
.bar.d3 { animation-delay: .59s; } .blb.d3 { animation-delay: .94s; }
.bar.d4 { animation-delay: .71s; } .blb.d4 { animation-delay: 1.06s; }
.bar.d5 { animation-delay: .83s; } .blb.d5 { animation-delay: 1.18s; }
.bar.d6 { animation-delay: .95s; } .blb.d6 { animation-delay: 1.30s; }

@keyframes bar-grow {
  from { transform: scaleX(0); opacity: .35; }
  to   { transform: scaleX(1); opacity: 1; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- generic band ---------- */
.band { padding: clamp(52px, 8vw, 96px) 0; }
/* the header is sticky, so an anchor jump must stop short of sliding the
   heading underneath it */
section[id], main[id] { scroll-margin-top: 84px; }
.band-head { max-width: 40rem; margin: 0 auto clamp(32px, 5vw, 54px); text-align: center; }
.band-head h2 { font-size: clamp(25px, 3.6vw, 36px); margin-bottom: 14px; text-wrap: balance; }
.band-head .sub { color: var(--ink-soft); font-size: clamp(15.5px, 1.7vw, 17.5px); text-wrap: pretty; }

/* ---------- features ---------- */
.feat-grid {
  list-style: none;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.feat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.feat h3 { font-size: 17.5px; margin: 16px 0 9px; }
.feat p { color: var(--ink-soft); font-size: 15px; }

.ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.ico svg { width: 25px; height: 25px; display: block; }
.ico svg :is(path, rect, circle, line) {
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico svg .dash { stroke-dasharray: 3 2.5; }

/* ---------- security band ---------- */
.band.deep {
  background: var(--deep);                                    /* fallback */
  background:
    radial-gradient(60% 50% at 84% 0%, color-mix(in srgb, var(--deep-accent) 12%, transparent), transparent 72%),
    var(--deep);
  color: var(--deep-ink);
}
.band.deep .band-head h2 { color: var(--deep-ink); }
.band.deep .band-head .sub { color: var(--deep-soft); }

.sec-grid {
  list-style: none;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.sec {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--deep-2);                                  /* fallback */
  background: color-mix(in srgb, var(--deep-2) 72%, transparent);
  border: 1px solid var(--deep-line);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
}
.sec h3 { font-size: 16.5px; color: var(--deep-ink); margin-bottom: 7px; }
.sec p { color: var(--deep-soft); font-size: 14.8px; }
.sec .ico {
  flex: none; width: 42px; height: 42px;
  background: var(--deep-line);                               /* fallback */
  background: color-mix(in srgb, var(--deep-accent) 15%, transparent);
  color: var(--deep-accent);
}
.sec .ico svg { width: 23px; height: 23px; }

/* ---------- how it works ---------- */
.steps {
  list-style: none;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
}
.step {
  position: relative;
  padding: 26px 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.step .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 15.5px;
  margin-bottom: 14px;
}
@media (prefers-color-scheme: dark) { .step .num { color: #04222b; background: #3ab6d2; } }
.step h3 { font-size: 16.5px; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: 14.8px; }

/* ---------- closing ---------- */
.closing { padding-top: 0; }
.closer {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(36px, 6vw, 58px) 24px;
  box-shadow: var(--shadow-sm);
}
.closer h2 { font-size: clamp(24px, 3.4vw, 33px); margin-bottom: 12px; }
.closer .sub { color: var(--ink-soft); margin-bottom: 26px; }
.closer .cta-row { justify-content: center; margin-bottom: 0; }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  background: var(--ground-2);
  padding: 40px 0 48px;
}
.foot-inner { text-align: center; }
.foot-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px;
}
.foot-nav { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin-bottom: 18px; }
.foot-nav a { color: var(--accent-deep); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.foot-nav a:hover { text-decoration: underline; }
.foot-note { color: var(--ink-soft); font-size: 13px; max-width: 46em; margin: 0 auto 6px; }
/* no opacity here: dimming --ink-soft to 75% lands at 3.8:1 on the footer
   ground, under the 4.5:1 bar. Smaller type carries the hierarchy instead. */
.foot-note.dim { font-size: 12.5px; }

/* ==========================================================================
   Scroll reveal.

   The no-JS default is "visible": these rules only bite once landing.js has
   added .reveal-on to <html>. If JavaScript never runs, nothing is ever
   hidden, so nothing can get stuck waiting for a reveal that will not fire.
   ========================================================================== */
.reveal-on .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.22,.8,.26,1), transform .6s cubic-bezier(.22,.8,.26,1);
  will-change: opacity, transform;
}
/* drop the compositor hint once the element has arrived — leaving will-change
   on every card for the life of the page keeps layers alive for nothing */
.reveal-on .reveal.in { opacity: 1; transform: none; will-change: auto; }

/* stagger children inside a grid, cheaply */
.reveal-on .feat-grid .reveal:nth-child(2),
.reveal-on .sec-grid .reveal:nth-child(2),
.reveal-on .steps .reveal:nth-child(2) { transition-delay: .07s; }
.reveal-on .feat-grid .reveal:nth-child(3),
.reveal-on .sec-grid .reveal:nth-child(3),
.reveal-on .steps .reveal:nth-child(3) { transition-delay: .14s; }
.reveal-on .feat-grid .reveal:nth-child(4),
.reveal-on .sec-grid .reveal:nth-child(4),
.reveal-on .steps .reveal:nth-child(4) { transition-delay: .21s; }
.reveal-on .feat-grid .reveal:nth-child(5),
.reveal-on .sec-grid .reveal:nth-child(5) { transition-delay: .28s; }
.reveal-on .feat-grid .reveal:nth-child(6),
.reveal-on .sec-grid .reveal:nth-child(6) { transition-delay: .35s; }

/* ==========================================================================
   Reduced motion — no transforms, no long animations, nothing hidden.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
    animation-delay: 0ms !important;
  }

  .hero-copy > *, .hero-art { animation: none; opacity: 1; transform: none; }
  .bar, .blb { animation: none; opacity: 1; transform: none; }

  .reveal-on .reveal { opacity: 1; transform: none; }

  .btn:hover, .feat:hover { transform: none; }
}

/* ---------- print ---------- */
@media print {
  .site-head, .hero-art, .btn { display: none; }
  body.landing { background: #fff; color: #000; }
}
