/* Complete Company showcase kit — one design system for the five showcase sites
   (hub, Itqan, Mizan, HR-System, Space Planner). Master copy: complete-company/showcase/kit.
   Each site copies this folder unchanged into site/assets/kit/. Design record: showcase/DESIGN.md. */

/* ---------- Fonts (SIL OFL 1.1, see fonts/) ---------- */
@font-face { font-family: "CC Display"; src: url("fonts/Alexandria-arabic.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "CC Display"; src: url("fonts/Alexandria-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "CC Text"; src: url("fonts/PlexArabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "CC Text"; src: url("fonts/PlexArabic-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "CC Text"; src: url("fonts/Inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }

/* ---------- Tokens ---------- */
:root {
  --paper: #F3F1EC;          /* warm ground */
  --paper-2: #E9E6DF;        /* quiet band */
  --surface: #FFFFFF;
  --ink: #101114;            /* text, display */
  --ink-2: #4B4E57;          /* secondary text, 7.6:1 on paper */
  --ink-3: #6E717A;          /* captions, 4.6:1 on paper */
  --line: #D6D2C8;           /* hairlines */
  --night: #0C0D11;          /* dark chapters */
  --night-2: #16181E;
  --on-night: #F3F1EC;
  --on-night-2: #A9ADB8;     /* 7.9:1 on night */
  --night-line: #2A2D36;

  /* app accents: each site sets --accent on <body> */
  --mizan: #2D5BFF; --itqan: #F26B1D; --hr: #0E9F7E; --space: #6D4AFF;
  --mizan-text: #2347D6; --itqan-text: #B44A0B; --hr-text: #0A7A60; --space-text: #5634E0;
  --accent: var(--ink); --accent-text: var(--ink); --on-accent: #FFFFFF;

  --font-display: "CC Display", "Segoe UI", system-ui, sans-serif;
  --font-text: "CC Text", "Segoe UI", system-ui, sans-serif;

  --t-sm: 14px; --t-body: 18px; --t-lg: clamp(20px, 1.6vw, 24px);
  --t-h3: clamp(26px, 2.6vw, 38px); --t-h2: clamp(38px, 5.6vw, 88px); --t-display: clamp(50px, 9.4vw, 156px);

  --wrap: 1320px; --gutter: clamp(16px, 4vw, 56px); --section: clamp(96px, 13vw, 200px);
  --r: 18px; --r-sm: 10px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow-float: 0 40px 80px -30px rgba(12, 13, 17, .35), 0 12px 24px -12px rgba(12, 13, 17, .18);
}
body.app-mizan { --accent: var(--mizan); --accent-text: var(--mizan-text); }
body.app-itqan { --accent: var(--itqan); --accent-text: var(--itqan-text); }
body.app-hr    { --accent: var(--hr);    --accent-text: var(--hr-text); }
body.app-space { --accent: var(--space); --accent-text: var(--space-text); }
body.app-hub   { --accent: var(--ink);   --accent-text: var(--ink); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--t-body)/1.65 var(--font-text); overflow-x: clip; -webkit-font-smoothing: antialiased; }
html[lang="ar"] body { line-height: 1.85; }
img, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 16px; }

/* bilingual: one element per language, the page language shows its own */
html[lang="ar"] [data-l="en"], html[lang="en"] [data-l="ar"] { display: none !important; }

/* ---------- Type ---------- */
.display, .h2, .h3, .stat b, .brand-word { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; }
html[lang="ar"] .display, html[lang="ar"] .h2, html[lang="ar"] .h3, html[lang="ar"] .stat b { letter-spacing: 0; }
.display { font-size: var(--t-display); line-height: .98; margin: 0; }
html[lang="ar"] .display { line-height: 1.22; font-weight: 800; }
.h2 { font-size: var(--t-h2); line-height: 1.02; margin: 0 0 .4em; max-width: 16ch; }
html[lang="ar"] .h2 { line-height: 1.3; }
.h3 { font-size: var(--t-h3); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
.lead { font-size: var(--t-lg); line-height: 1.55; color: var(--ink-2); max-width: 38ch; margin: 0; }
.muted { color: var(--ink-2); }
.cap { font-size: var(--t-sm); color: var(--ink-3); line-height: 1.6; }
.accent { color: var(--accent-text); }
.night .accent { color: var(--accent); }
p { max-width: 62ch; }

/* ---------- Top bar ---------- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .4s var(--ease), border-color .4s var(--ease), transform .5s var(--ease); border-bottom: 1px solid transparent; }
.top.is-solid { background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom-color: var(--line); }
.top.is-hidden { transform: translateY(-100%); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; font: 800 15px/1 var(--font-display); }
.brand-word { font-size: 20px; letter-spacing: -0.02em; }
.brand small { display: block; font: 500 12px/1.2 var(--font-text); color: var(--ink-3); letter-spacing: 0; }
.nav { display: flex; gap: 6px; margin-inline-start: auto; }
.nav a { text-decoration: none; padding: 10px 14px; border-radius: 999px; font-size: 15px; color: var(--ink-2); transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 15px/1 var(--font-text); text-decoration: none; cursor: pointer; transition: transform .35s var(--ease), background .2s, color .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-ghost-night { background: transparent; color: var(--on-night); border-color: var(--night-line); }
.btn .arr { transition: transform .35s var(--ease); }
html[dir="rtl"] .btn .arr { transform: scaleX(-1); }
.btn:hover .arr { transform: translateX(4px); }
html[dir="rtl"] .btn:hover .arr { transform: scaleX(-1) translateX(4px); }
.lang-btn { min-width: 46px; padding: 0 14px; }
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 60; }
html[dir="rtl"] .progress { transform-origin: 100% 50%; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(120px, 16vh, 180px); }
.hero-head { text-align: center; }
.hero .display .slot { display: inline-block; vertical-align: middle; width: 2.6em; height: .74em; margin-inline: .08em; border-radius: .16em; background: var(--accent); overflow: hidden; position: relative; transform: translateY(-.06em); }
.hero .display .slot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-sub { display: flex; justify-content: center; gap: clamp(16px, 6vw, 120px); margin: clamp(24px, 4vw, 48px) auto 0; flex-wrap: wrap; font-size: var(--t-lg); color: var(--ink-2); }
.hero-sub span { max-width: 26ch; }
.hero-cta { display: flex; justify-content: center; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.stage { position: relative; margin-top: clamp(40px, 6vw, 80px); height: min(78vh, 760px); }
.stage-clip { position: absolute; inset: 0; overflow: hidden; background: var(--night); clip-path: inset(0 var(--gutter) 0 var(--gutter) round var(--r)); }
.stage canvas.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.read { position: absolute; z-index: 3; color: var(--on-night); font-size: 13px; line-height: 1.4; }
.read b { display: block; font: 700 clamp(22px, 2.6vw, 40px)/1 var(--font-display); letter-spacing: -0.02em; margin-bottom: 6px; }
.read > span { color: var(--on-night-2); }
.read.r1 { inset-inline-start: calc(var(--gutter) + 28px); bottom: 28px; }
.read.r2 { inset-inline-start: calc(var(--gutter) + 300px); bottom: 28px; }
.read.r3 { inset-inline-end: calc(var(--gutter) + 28px); bottom: 28px; text-align: end; }
.read.r4 { inset-inline-end: calc(var(--gutter) + 28px); top: 28px; text-align: end; max-width: 280px; }
.read.r4 b { font-size: 15px; font-family: var(--font-text); color: var(--accent); letter-spacing: 0; }
.stage-cap { position: absolute; top: calc(100% + 16px); inset-inline: 0; }
.stage + * { margin-top: 56px; }

/* ---------- Sections ---------- */
.block { padding-block: var(--section); position: relative; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.night { background: var(--night); color: var(--on-night); }
.night .lead, .night .muted { color: var(--on-night-2); }
.night .cap { color: var(--on-night-2); }
.band { background: var(--paper-2); }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.rule-list li { border-top: 2px solid var(--ink); padding: 22px 0 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; }
.night .rule-list li { border-top-color: var(--on-night); }
.rule-list b { font: 700 var(--t-lg)/1.3 var(--font-display); letter-spacing: -0.01em; }
.rule-list span { color: var(--ink-2); }
.night .rule-list span { color: var(--on-night-2); }

/* the statement: a sentence that colours word by word as you read */
.statement p { font: 700 clamp(30px, 4.6vw, 72px)/1.18 var(--font-display); letter-spacing: -0.03em; max-width: 22ch; margin: 0; }
html[lang="ar"] .statement p { letter-spacing: 0; line-height: 1.45; }
.statement .w { color: color-mix(in srgb, var(--ink) 18%, var(--paper)); transition: color .3s; }
.statement .w.on { color: var(--ink); }
.statement .w.hl.on { color: var(--accent-text); }

/* ---------- Screen frame ---------- */
.screen { position: relative; border-radius: var(--r); background: var(--night-2); padding: 10px; box-shadow: var(--shadow-float); }
.screen::before { content: ""; position: absolute; top: 4px; inset-inline-start: 18px; width: 40px; height: 2px; border-radius: 2px; background: var(--night-line); }
.screen .view { position: relative; overflow: hidden; border-radius: calc(var(--r) - 8px); aspect-ratio: 16 / 10; background: #fff; }
.screen .view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; transform-origin: 50% 0; }
.screen .tag-live { position: absolute; z-index: 2; top: 18px; inset-inline-end: 18px; background: var(--ink); color: var(--paper); font-size: 12px; padding: 6px 10px; border-radius: 6px; }

/* ---------- Theater: pinned screen, steps change the picture ---------- */
.theater { position: relative; }
.theater-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr); gap: clamp(28px, 5vw, 72px); align-items: center; min-height: 100vh; }
.theater-steps { position: relative; min-height: 340px; }
.t-step { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); pointer-events: none; }
.t-step.on { opacity: 1; transform: none; pointer-events: auto; }
.t-step .n { font: 700 14px/1 var(--font-display); color: var(--accent); letter-spacing: .02em; display: block; margin-bottom: 18px; }
.theater-count { display: flex; gap: 8px; margin-top: 28px; }
.theater-count i { display: block; height: 3px; flex: 1; max-width: 48px; background: var(--night-line); border-radius: 2px; overflow: hidden; position: relative; }
.theater-count i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease); }
html[dir="rtl"] .theater-count i::after { transform-origin: 100% 50%; }
.theater-count i.on::after { transform: scaleX(1); }
.theater .screen { perspective: 1600px; }
.theater .view img { opacity: 0; transition: opacity .7s var(--ease); }
.theater .view img.on { opacity: 1; }
.focus-ring { position: absolute; z-index: 3; border: 2px solid var(--accent); border-radius: 10px; pointer-events: none; opacity: 0; transition: all .8s var(--ease); box-shadow: 0 0 0 9999px rgba(12, 13, 17, .35); }
.focus-ring.on { opacity: 1; }

/* ---------- Layer stack: screens fan out in depth ---------- */
.stack-wrap { position: relative; height: 300vh; }
.stack-pin { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; overflow: hidden; perspective: 2200px; }
.stack { position: relative; width: min(1100px, 86vw); aspect-ratio: 16 / 10; transform-style: preserve-3d; }
.stack .layer { position: absolute; inset: 0; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-float); background: #fff; border: 1px solid rgba(255, 255, 255, .08); }
.stack .layer img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.stack-pin { align-content: end; padding-bottom: 6vh; }
.stack { width: min(980px, 80vw); }
.stack-label { position: absolute; z-index: 4; inset-inline-start: var(--gutter); top: clamp(88px, 13vh, 132px); max-width: 560px; }
.stack-label .lead { margin-top: 10px; }
.stack-label .h3 { margin: 0; }

/* ---------- Horizontal gallery ---------- */
.hgal { position: relative; overflow: hidden; }
.js.motion .hgal-block { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-block: 96px 56px; overflow: hidden; }
.hgal-track { display: flex; gap: clamp(16px, 2.4vw, 32px); padding-inline: var(--gutter); width: max-content; will-change: transform; }
.hcard { width: clamp(300px, 46vw, 720px); flex: none; }
.hcard .screen { padding: 8px; }
.hcard h3 { font: 700 var(--t-lg)/1.3 var(--font-display); margin: 22px 0 6px; letter-spacing: -0.01em; }
.hcard p { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 46ch; }
.night .hcard p { color: var(--on-night-2); }
.hgal-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(32px, 5vw, 64px); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.night .stats { border-top-color: var(--night-line); }
.stat { padding: 28px 24px 8px 0; border-inline-end: 1px solid var(--line); }
html[dir="rtl"] .stat { padding: 28px 0 8px 24px; }
.night .stat { border-inline-end-color: var(--night-line); }
.stat:last-child { border-inline-end: 0; }
.stat b { display: block; font-size: clamp(40px, 5.2vw, 80px); line-height: 1; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.stat > span { color: var(--ink-2); font-size: 16px; display: block; max-width: 24ch; }
.night .stat > span { color: var(--on-night-2); }
.src { margin-top: 20px; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding-block: 22px; white-space: nowrap; }
.night .marquee { border-color: var(--night-line); }
.marquee-track { display: inline-flex; gap: 48px; animation: mq 48s linear infinite; font: 600 clamp(22px, 2.6vw, 36px)/1 var(--font-display); letter-spacing: -0.02em; }
html[dir="rtl"] .marquee-track { animation-direction: reverse; }
.marquee-track span { display: inline-flex; align-items: center; gap: 48px; }
.marquee-track span::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
@keyframes mq { to { transform: translateX(-50%); } }

/* ---------- Connected: this app among the four ---------- */
.eco { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 48px; }
.eco a { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 240px; padding: 22px; border-radius: var(--r); text-decoration: none; color: var(--on-night); background: var(--night-2); border: 1px solid var(--night-line); overflow: hidden; transition: transform .5s var(--ease), border-color .3s; }
.eco a::before { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--c); transform: scaleX(.18); transform-origin: 0 50%; transition: transform .6s var(--ease); }
html[dir="rtl"] .eco a::before { transform-origin: 100% 50%; }
.eco a:hover { transform: translateY(-6px); border-color: var(--c); }
.eco a:hover::before { transform: scaleX(1); }
.eco a.here { border-color: var(--c); }
.eco b { font: 700 28px/1.1 var(--font-display); letter-spacing: -0.02em; }
.eco span { color: var(--on-night-2); font-size: 15px; }
.eco .k { font-size: 12px; color: var(--c); font-weight: 600; letter-spacing: .04em; }

/* ---------- Closing ---------- */
.close { text-align: center; }
.close .display { font-size: clamp(44px, 8vw, 128px); }
.close .hero-cta { margin-top: 44px; }

footer { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 14px; color: var(--ink-3); }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer a { color: var(--ink-2); }

/* ---------- Reveal (only when motion is allowed and JS runs) ---------- */
.js.motion [data-reveal] { opacity: 0; transform: translateY(36px); }
.js.motion [data-split] .wd { display: inline-block; opacity: 0; transform: translateY(.5em); }
.wd-wrap { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
  .eco { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-inline-end: 0; }
}
@media (max-width: 820px) {
  .split, .theater-grid { grid-template-columns: 1fr; }
  .theater-grid { min-height: 0; padding-block: 72px; }
  .theater-steps { min-height: 280px; }
  .rule-list li { grid-template-columns: 1fr; gap: 8px; }
  .read.r2 { display: none; }
  .stage { height: 62vh; }
  .hide-sm { display: none !important; }
  .hgal-head { flex-direction: column; align-items: start; }
}
@media (max-width: 560px) {
  :root { --t-body: 17px; }
  .eco, .stats { grid-template-columns: 1fr; }
  .stat { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .night .stat { border-bottom-color: var(--night-line); }
  .read.r4 { display: none; }
  .read b { font-size: 24px; }
  .top .wrap { height: 64px; gap: 10px; }
  .brand small { display: none; }
  .btn { padding: 0 16px; }
  .hero .display .slot { width: 1.9em; }
}

/* ---------- Without motion (reduced motion, or no script): the finished page, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
html:not(.motion) .t-step { position: relative; opacity: 1; transform: none; margin-bottom: 40px; pointer-events: auto; }
html:not(.motion) .theater-steps { min-height: 0; }
html:not(.motion) .theater-count { display: none; }
html:not(.motion) .theater .view img { opacity: 0; } html:not(.motion) .theater .view img:first-child { opacity: 1; }
html:not(.motion) .stack-wrap { height: auto; padding: 96px 0; }
html:not(.motion) .stack-pin { position: relative; height: auto; display: block; padding: 0; overflow: visible; }
html:not(.motion) .stack { margin: 32px auto 0; }
html:not(.motion) .stack .layer:not(:first-child) { display: none; }
html:not(.motion) .stack-label { position: relative; top: auto; inset-inline-start: auto; width: min(100% - 2 * var(--gutter), var(--wrap)); max-width: none; margin: 0 auto 24px; }
html:not(.motion) .hgal { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
html:not(.motion) .hcard { scroll-snap-align: start; }
html:not(.motion) .theater-grid { align-items: start; }
html:not(.motion) .theater .screen { position: sticky; top: 96px; }
html:not(.motion) .stack-label:first-of-type { margin-top: 40px; }
@media (max-width: 820px) { html:not(.motion) .theater .screen { position: relative; top: auto; } }

/* ---------- Concept screens inside frames ---------- */
.view .ui-frame.shot, .layer .ui-frame { position: absolute; inset: 0; }
.theater .view .shot { opacity: 0; transition: opacity .7s var(--ease); }
.theater .view .shot.on { opacity: 1; }
html:not(.motion) .theater .view .shot { opacity: 0; } html:not(.motion) .theater .view .shot:first-child { opacity: 1; }
.layer { aspect-ratio: 16 / 10; }

/* ---------- Workflows ---------- */
.flow-sec { position: relative; }
.flow-wrap { display: grid; grid-template-columns: 1fr; gap: 12px; align-content: center; min-height: 100vh; padding-block: 88px 24px; }
.flow-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: clamp(20px, 4vw, 56px); align-items: end; }
.flow-head .h2 { margin: 0; max-width: 14ch; font-size: clamp(34px, 4.4vw, 64px); }
.flow-head .lead { font-size: 17px; }
.flow { position: relative; width: min(100%, calc((100vh - 250px) * 16 / 9)); aspect-ratio: 16 / 9; margin-inline: auto; }
.fl-svg { width: 100%; height: 100%; overflow: visible; }
.fl-edge { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease); opacity: .85; }
.fl-node { opacity: .14; transition: opacity .5s var(--ease), transform .6s var(--ease); }
.fl-node rect:first-child { filter: url(#flsh); }
.fl-node.on { opacity: 1; }
.fl-node.now rect:first-child { stroke-width: 3.5; }
.fl-t { font: 700 22px var(--font-display); fill: var(--ink); }
.fl-s { font: 500 15px var(--font-text); fill: var(--ink-2); }
.fl-app { font: 700 13px var(--font-text); }
.fl-n { font: 700 13px var(--font-text); fill: var(--ink-3); }
.fl-packet { transition: opacity .3s; }
.flow-steps { display: grid; gap: 14px; }
.flow-count { text-align: start; font: 700 clamp(44px, 6vw, 96px)/1 var(--font-display); color: var(--accent-text); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
html:not(.motion) .flow-wrap { min-height: 0; }
@media (max-width: 820px) { .flow-wrap { min-height: 0; } .flow-head { grid-template-columns: 1fr; } .flow { width: 100%; aspect-ratio: 16 / 11; } }

/* ---------- Family switcher and present button ---------- */
.family { position: relative; }
.family summary { list-style: none; cursor: pointer; }
.family summary::-webkit-details-marker { display: none; }
.family[open] .fam-menu { opacity: 1; transform: none; pointer-events: auto; }
.fam-menu { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px; box-shadow: var(--shadow-float); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .25s var(--ease), transform .3s var(--ease); z-index: 70; }
.fam-menu a { display: grid; grid-template-columns: 12px 1fr; gap: 4px 12px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.fam-menu a:hover, .fam-menu a[aria-current] { background: var(--paper-2); }
.fam-menu i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); grid-row: span 2; }
.fam-menu b { font: 700 15px/1.2 var(--font-display); } .fam-menu span { font-size: 13px; color: var(--ink-3); grid-column: 2; }
.next-site { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; margin-top: 48px; padding: 28px 32px; border-radius: var(--r); background: var(--c); color: #fff; text-decoration: none; transition: transform .5s var(--ease); }
.next-site:hover { transform: translateY(-4px); }
.next-site b { display: block; font: 700 clamp(26px, 3vw, 44px)/1.1 var(--font-display); }
.next-site span { opacity: .85; }
