/* ==========================================================================
   Vision2027 — Living design system (SOP §20)
   Nature-derived palette, slow continuous motion, reduced-motion honoured.
   ========================================================================== */

@property --v27-hue {
  syntax: '<angle>';
  inherits: true;
  initial-value: 0deg;
}

:root {
  --v27-deep: #041E3A;
  --v27-deep-2: #0A2E52;
  --v27-ocean: #0A6E8A;
  --v27-ocean-2: #12A5B8;
  --v27-aqua: #2FD6C4;
  --v27-aqua-2: #7BEFD8;
  --v27-sky: #6FA8DC;
  --v27-sky-2: #A8D8FF;
  --v27-leaf: #3FA66B;
  --v27-leaf-2: #7BD69A;
  --v27-light: #FFF8E7;
  --v27-white: #FFFFFF;
  --v27-gold: #E8C36B;

  --ink: #0B2239;
  --ink-soft: #3E5870;
  --muted: #5B7288;
  --line: rgba(10, 46, 82, .12);
  --surface: rgba(255, 255, 255, .82);
  --ground: #F3F9FC;
  --danger: #C2410C;
  --danger-bg: #FFF1EA;
  --success-bg: #EAF8F0;
  --warn: #9A6700;
  --warn-bg: #FFF7E0;

  --font-display: 'Sora', 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --font-accent: 'Cinzel', 'Trajan Pro', Georgia, serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(4, 30, 58, .06), 0 8px 24px rgba(4, 30, 58, .08);
  --shadow-lift: 0 2px 4px rgba(4, 30, 58, .08), 0 16px 40px rgba(4, 30, 58, .14);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --container: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; position: relative; z-index: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--v27-ocean); text-underline-offset: 3px; }
a:hover { color: var(--v27-deep-2); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5em; color: var(--v27-deep); }
p { margin: 0 0 1em; }
code { font-size: .88em; background: rgba(10, 110, 138, .08); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--v27-aqua); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--v27-deep); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: #fff; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.text-left { text-align: left; }
.lead { font-size: 1.125rem; color: var(--ink-soft); }
.eyebrow { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; font-weight: 700; color: var(--v27-ocean); margin-bottom: .5rem; }
.tagline-serif { font-family: var(--font-serif); font-style: italic; font-size: 1.15rem; }
.section { padding: 72px 0; position: relative; }
.section--center { text-align: center; }
.section--tint { background: linear-gradient(180deg, rgba(168, 216, 255, .18), rgba(123, 239, 216, .12)); }
.section-title { font-family: var(--font-serif); font-size: clamp(2.05rem, 1.4rem + 2.4vw, 3.1rem); font-weight: 600; letter-spacing: -.005em; line-height: 1.1; }
.h3 { font-size: 1.15rem; margin-bottom: .25rem; }
.stack > * + * { margin-top: 1rem; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.list { padding-left: 1.2rem; margin: 0; }
.list li + li { margin-top: .35rem; }

/* ---- Living sky background (§20.2, §20.5) -------------------------------- */
.v27-sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(168, 216, 255, .55), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(123, 239, 216, .35), transparent 60%),
    linear-gradient(180deg, #F7FBFE 0%, #EEF7FB 100%);
  animation: v27-hue-drift 80s ease-in-out infinite alternate;
}
@keyframes v27-hue-drift {
  from { filter: hue-rotate(-12deg); }
  to   { filter: hue-rotate(22deg); }
}
.v27-cloud {
  position: absolute; width: 60vw; height: 30vw; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .9), transparent);
  opacity: .05; will-change: transform;
}
.v27-cloud--a { top: 10%; left: -20%; animation: v27-drift 140s linear infinite; }
.v27-cloud--b { top: 55%; left: -30%; animation: v27-drift 190s linear infinite; animation-delay: -60s; opacity: .04; }
@keyframes v27-drift { from { transform: translateX(0); } to { transform: translateX(150vw); } }

/* ---- Header -------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); background: rgba(247, 251, 254, .72); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.05; }
.brand__mark { font-family: var(--font-display); font-weight: 700; letter-spacing: .14em; font-size: 1.15rem; color: var(--v27-deep); }
.brand__mark b { font-weight: 700; background: linear-gradient(90deg, var(--v27-ocean), var(--v27-aqua)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand__sub { font-family: var(--font-accent); font-weight: 600; font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.site-nav { display: none; align-items: center; gap: 22px; }
.site-nav a:not(.btn) { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .95rem; padding: 10px 0; }
.site-nav a:not(.btn):hover { color: var(--v27-ocean); }
.nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; padding: 10px; }
.nav-toggle span:not(.sr-only) { display: block; height: 2px; background: var(--v27-deep); border-radius: 2px; transition: transform .3s var(--ease-out), opacity .3s; }
.nav-open .site-nav { display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 20px 20px; background: rgba(247, 251, 254, .97); border-bottom: 1px solid var(--line); }
.nav-open .site-nav .btn { margin-top: 6px; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav, .nav-open .site-nav { display: flex; position: static; flex-direction: row; align-items: center; padding: 0; background: none; border: 0; }
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  --btn-bg: var(--v27-ocean); --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px; border: 1px solid transparent;
  font: 600 .94rem/1 var(--font-display); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background-color .25s;
  position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); color: var(--btn-fg); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--primary { background: linear-gradient(135deg, var(--v27-ocean), var(--v27-ocean-2) 55%, var(--v27-aqua)); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--v27-deep); border-color: var(--line); }
.btn--light { --btn-bg: #fff; --btn-fg: var(--v27-deep); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: #fff; border-color: rgba(255, 255, 255, .5); }
.btn--sm { min-height: 40px; padding: 8px 18px; font-size: .9rem; }
.btn--block { width: 100%; }

/* ---- Cards, ripple hover (§20.5) ---------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card + .card { margin-top: 20px; }
.ripple { position: relative; overflow: hidden; transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out); }
.ripple::after {
  content: ''; position: absolute; left: var(--rx, 50%); top: var(--ry, 50%); width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 214, 196, .35), transparent 70%);
  transform: translate(-50%, -50%) scale(0); opacity: 0; pointer-events: none;
}
.ripple:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.ripple:hover::after { animation: v27-ripple .9s var(--ease-out); }
@keyframes v27-ripple { from { transform: translate(-50%, -50%) scale(0); opacity: 1; } to { transform: translate(-50%, -50%) scale(40); opacity: 0; } }

.badge { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; }
.badge--leaf { background: rgba(63, 166, 107, .14); color: #25774A; }

/* ---- Forms --------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 500; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: 400 1rem/1.4 var(--font-body); color: var(--ink); min-height: 46px; padding: 10px 14px;
  border: 1px solid rgba(10, 46, 82, .2); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--v27-ocean-2); box-shadow: 0 0 0 4px rgba(18, 165, 184, .18); }

.alert { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 20px; font-size: .95rem; text-align: left; }
.alert ul { margin: 6px 0 0; padding-left: 1.2rem; }
.alert--error { background: var(--danger-bg); color: #8A2E07; border: 1px solid rgba(194, 65, 12, .25); }
.alert--success { background: var(--success-bg); color: #1D5E3A; border: 1px solid rgba(63, 166, 107, .3); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist__item { display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.checklist__item:last-child { border-bottom: 0; }
.checklist__icon { grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.checklist__detail { color: var(--muted); font-size: .85rem; word-break: break-word; }
@media (min-width: 640px) {
  .checklist__item { grid-template-columns: 28px 1fr auto; align-items: center; }
  .checklist__icon { grid-row: auto; }
  .checklist__detail { text-align: right; }
}
.is-ok .checklist__icon { background: rgba(63, 166, 107, .16); color: #25774A; }
.is-warn .checklist__icon { background: var(--warn-bg); color: var(--warn); }
.is-fail .checklist__icon { background: var(--danger-bg); color: var(--danger); }

.debug-trace { text-align: left; white-space: pre-wrap; word-break: break-word; background: #0B2239; color: #CFE8F5; padding: 16px; border-radius: var(--radius-sm); font-size: .8rem; max-height: 360px; overflow: auto; }

/* ---- Hero from space (preview of the Module 10 entry ritual) ------------ */
.hero-space {
  position: relative; min-height: min(88vh, 760px); display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 120%, var(--v27-deep-2) 0%, #020D1C 55%, #01060F 100%);
  color: #fff; text-align: center; isolation: isolate;
}
.hero-space::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; background: linear-gradient(transparent, var(--ground)); z-index: 1; }
.starfield { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-space__inner { position: relative; z-index: 2; padding: 80px 20px 120px; }
.wordmark { font-family: var(--font-display); font-weight: 300; color: #fff; font-size: clamp(2.6rem, 1rem + 8vw, 6.5rem); letter-spacing: .12em; margin: 0; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; line-height: 1; }
.wm-l { display: inline-block; opacity: 0; transform: translateY(12px) scale(.96); filter: blur(6px); animation: v27-letter 1s var(--ease-out) forwards; animation-delay: calc(var(--i) * 140ms + 200ms); }
.wm-year { display: inline-flex; font-weight: 600; background: linear-gradient(90deg, var(--v27-sky-2), var(--v27-aqua), var(--v27-gold)); -webkit-background-clip: text; background-clip: text; }
.wm-year .wm-l { color: transparent; background: inherit; -webkit-background-clip: text; background-clip: text; }
.wm-zero { position: relative; }
.wm-zero::before { content: ''; position: absolute; left: 50%; top: 50%; width: .3em; height: .3em; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, #fff, rgba(232, 195, 107, .6) 40%, transparent 70%); animation: v27-glow 4s ease-in-out infinite 2s; }
@keyframes v27-letter { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes v27-glow { 0%, 100% { opacity: .35; transform: translate(-50%, -50%) scale(.8); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); } }

.wm-globe { width: .78em; height: .78em; margin: 0 .06em; }
.globe { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; position: relative;
  background: radial-gradient(circle at 35% 30%, #7BEFD8 0%, #12A5B8 35%, #0A2E52 80%);
  box-shadow: 0 0 .25em rgba(123, 239, 216, .55), inset -.12em -.08em .2em rgba(0, 0, 0, .45); }
.globe__land { position: absolute; top: 0; left: 0; width: 200%; height: 100%;
  background:
    radial-gradient(ellipse 14% 22% at 12% 38%, rgba(123, 214, 154, .9) 60%, transparent 62%),
    radial-gradient(ellipse 9% 16% at 30% 66%, rgba(123, 214, 154, .85) 60%, transparent 62%),
    radial-gradient(ellipse 12% 10% at 40% 28%, rgba(123, 214, 154, .8) 60%, transparent 62%),
    radial-gradient(ellipse 14% 22% at 62% 38%, rgba(123, 214, 154, .9) 60%, transparent 62%),
    radial-gradient(ellipse 9% 16% at 80% 66%, rgba(123, 214, 154, .85) 60%, transparent 62%),
    radial-gradient(ellipse 12% 10% at 90% 28%, rgba(123, 214, 154, .8) 60%, transparent 62%);
  animation: v27-spin 24s linear infinite; }
@keyframes v27-spin { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.hero-space__sub { font-family: var(--font-accent); margin: 18px 0 0; letter-spacing: .32em; text-transform: uppercase; font-size: clamp(.7rem, .6rem + .4vw, .95rem); color: var(--v27-sky-2); opacity: 0; animation: v27-fade 1.2s ease forwards 1.7s; }
.hero-space__sub strong { color: #fff; font-weight: 600; }
.hero-space__lead { font-family: var(--font-serif); font-style: italic; font-weight: 500; margin: 28px auto 0; max-width: 30ch; font-size: clamp(1.35rem, 1rem + 1.1vw, 1.9rem); line-height: 1.35; color: rgba(255, 255, 255, .86); opacity: 0; animation: v27-fade 1.2s ease forwards 2.3s; }
.hero-space__cta { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; opacity: 0; animation: v27-fade 1.2s ease forwards 2.8s; }
@keyframes v27-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Steps & roadmap ------------------------------------------------------ */
.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps .card { margin: 0; }
.steps__no { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-family: var(--font-display); font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--v27-ocean), var(--v27-aqua)); margin-bottom: 12px; }
.steps h3 { font-size: 1.2rem; }
.steps p { color: var(--ink-soft); margin: 0; font-size: .95rem; }

.roadmap { margin-top: 32px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.roadmap .card { margin: 0; }
.roadmap__phase h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--v27-ocean); }
.roadmap__phase ul { list-style: none; margin: 0; padding: 0; }
.roadmap__phase li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: .92rem; color: var(--ink-soft); }
.roadmap__phase li .badge { margin-left: auto; }
.roadmap__dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(10, 110, 138, .35); flex: none; }
.roadmap__phase li.is-done { color: var(--ink); font-weight: 500; }
.roadmap__phase li.is-done .roadmap__dot { background: var(--v27-leaf); border-color: var(--v27-leaf); box-shadow: 0 0 0 4px rgba(63, 166, 107, .18); }

/* ---- Empty state sprout, success bloom, error code ---------------------- */
.sprout { color: var(--v27-deep-2); margin: 0 auto 12px; width: 120px; }
.sprout__leaf { transform-origin: 60px 62px; animation: v27-sway 5s ease-in-out infinite; }
.sprout__leaf--r { animation-delay: -2.5s; }
@keyframes v27-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.bloom { width: 140px; height: 140px; margin: 0 auto 12px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, rgba(232, 195, 107, .55) 35%, rgba(123, 239, 216, .25) 60%, transparent 72%); animation: v27-bloom 3.5s ease-in-out infinite; }
@keyframes v27-bloom { 0%, 100% { transform: scale(.9); opacity: .8; } 50% { transform: scale(1.08); opacity: 1; } }
.error-code { font-family: var(--font-display); font-weight: 700; font-size: clamp(4rem, 2rem + 10vw, 8rem); line-height: 1; margin: 0; background: linear-gradient(135deg, var(--v27-ocean), var(--v27-aqua), var(--v27-sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section--center .card { text-align: left; }

/* ---- Footer & wave divider (§20.5) -------------------------------------- */
.site-footer { position: relative; z-index: 1; background: var(--v27-deep); color: rgba(255, 255, 255, .8); padding: 56px 0 32px; margin-top: 40px; }
.site-footer .brand__mark { color: #fff; }
.site-footer .muted { color: rgba(168, 216, 255, .75); }
.site-footer__inner { display: grid; gap: 24px; }
@media (min-width: 760px) { .site-footer__inner { grid-template-columns: 1fr auto; align-items: center; } .site-footer__inner > .small { grid-column: 1 / -1; } }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { color: #fff; text-decoration: none; padding: 10px 0; }
.footer-nav a:hover { color: var(--v27-aqua-2); }
.wave-divider { position: absolute; left: 0; right: 0; top: -38px; height: 40px; overflow: hidden; }
.wave-divider::before {
  content: ''; position: absolute; left: 0; top: 0; width: 200%; height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20 C150 0 300 40 450 20 S750 0 900 20 S1050 40 1200 20 V40 H0Z' fill='%23041E3A'/%3E%3C/svg%3E") repeat-x;
  background-size: 50% 100%;
  animation: v27-wave 18s linear infinite;
}
@keyframes v27-wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- Reduced motion: hard requirement (§20.2) --------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
  .wm-l, .hero-space__sub, .hero-space__lead, .hero-space__cta { opacity: 1; transform: none; filter: none; }
  .v27-sky, .v27-cloud, .globe__land, .wave-divider::before { animation: none !important; }
}
