/* FlowState site stylesheet. Hand-written, no build step. */

:root {
  --blue: #5b8def;
  --teal: #38bd94;
  --grad: linear-gradient(120deg, #5b8def 0%, #38bd94 100%);
  --bg: #ffffff;
  --bg-soft: #f5f8fc;
  --bg-card: #ffffff;
  --border: #e3e9f2;
  --text: #17202e;
  --text-soft: #4a5568;
  --text-faint: #6b7686;
  --link: #3a6fd8;
  --shadow: 0 1px 2px rgba(23, 32, 46, .05), 0 8px 24px rgba(23, 32, 46, .06);
  --shadow-lg: 0 2px 6px rgba(23, 32, 46, .06), 0 24px 60px rgba(23, 32, 46, .12);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131b;
    --bg-soft: #131a24;
    --bg-card: #161e2a;
    --border: #253041;
    --text: #e8edf4;
    --text-soft: #b3bfcf;
    --text-faint: #8794a6;
    --link: #8db0f7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-soft); border: 1px solid var(--border); padding: .08em .35em; border-radius: 5px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--bg-card); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--text-soft); font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: #fff; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; width: 40px; height: 38px; font-size: 1.2rem; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .98rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  font-family: inherit; line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(91, 141, 239, .35); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(56, 189, 148, .35); }
.btn-ghost { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--blue); }
.btn-sm { padding: 8px 16px; font-size: .9rem; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 760px; z-index: -1;
  background:
    radial-gradient(closest-side, rgba(91, 141, 239, .20), transparent 70%) 20% 40% / 60% 70% no-repeat,
    radial-gradient(closest-side, rgba(56, 189, 148, .18), transparent 70%) 80% 50% / 55% 70% no-repeat;
}
.hero-icon { width: 96px; height: 96px; margin: 0 auto 18px; filter: drop-shadow(0 10px 24px rgba(91, 141, 239, .35)); }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); font-weight: 800; letter-spacing: -.035em; margin-bottom: .15em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--text-soft); font-weight: 600; letter-spacing: .01em; margin-bottom: 18px; }
.lede { max-width: 720px; margin: 0 auto 30px; font-size: 1.12rem; color: var(--text-soft); }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: .9rem; color: var(--text-faint); }
.hero-shot {
  margin: 52px auto 0; max-width: 1080px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); background: var(--bg-card);
  cursor: zoom-in; padding: 0; display: block; width: 100%;
}
.hero-shot img { width: 100%; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 44px auto 0; max-width: 900px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.8rem; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: .88rem; color: var(--text-faint); }

/* ---------- sections ---------- */
section { padding: 84px 0; scroll-margin-top: 64px; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head p { color: var(--text-soft); font-size: 1.06rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--blue); margin-bottom: 10px; }

/* features */
.feature-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.fgroup { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 26px 18px; box-shadow: var(--shadow); }
.fgroup-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fgroup-head h3 { margin: 0; font-size: 1.22rem; }
.ficon { flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #fff; }
.ficon svg { width: 22px; height: 22px; }
.fgroup ul { list-style: none; padding: 0; margin: 0; }
.fgroup li { position: relative; padding: 0 0 10px 22px; color: var(--text-soft); font-size: .97rem; }
.fgroup li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
.fgroup li strong { color: var(--text); font-weight: 600; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.shot { margin: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.shot:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.shot button { all: unset; display: block; cursor: zoom-in; width: 100%; }
.shot button:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.shot img { aspect-ratio: 960 / 606; object-fit: cover; object-position: top left; width: 100%; border-bottom: 1px solid var(--border); }
.shot figcaption { padding: 12px 16px 14px; font-size: .92rem; color: var(--text-soft); }
.shot figcaption b { display: block; color: var(--text); font-size: .98rem; margin-bottom: 2px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(8, 12, 18, .88); display: none; align-items: center; justify-content: center; padding: 56px 64px; }
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: 1400px; width: 100%; text-align: center; }
.lightbox img { max-height: calc(100vh - 150px); width: auto; max-width: 100%; margin: 0 auto; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff; }
.lightbox figcaption { color: #e8edf4; margin-top: 14px; font-size: .98rem; }
.lb-btn { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .2); width: 46px; height: 46px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; display: grid; place-items: center; line-height: 1; }
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* library */
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lib-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.lib-card h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lib-count { font-size: .8rem; font-weight: 700; color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.lib-card p { color: var(--text-soft); font-size: .95rem; margin-bottom: 12px; }
.lib-card .chips { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .78rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-soft); background: var(--bg-soft); }
.lib-card.lib-cta { background: var(--grad); color: #fff; border: 0; justify-content: center; }
.lib-card.lib-cta h3, .lib-card.lib-cta p { color: #fff; }
.lib-card.lib-cta a { color: #fff; font-weight: 600; text-decoration: underline; }
.lib-note { text-align: center; color: var(--text-faint); font-size: .92rem; margin-top: 26px; }

/* platforms */
.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.platform { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.platform-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.platform-head svg { width: 30px; height: 30px; color: var(--text); flex: none; }
.tux-belly { fill: var(--bg-card); }
.tux-beak { fill: #f2b21b; }
.platform-head h3 { margin: 0; font-size: 1.2rem; }
.badge { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: #0f7a5a; background: rgba(56, 189, 148, .14); border: 1px solid rgba(56, 189, 148, .35); padding: 2px 9px; border-radius: 999px; margin-bottom: 12px; }
@media (prefers-color-scheme: dark) { .badge { color: #6fe0bb; } }
.platform ul { margin: 0; padding-left: 18px; color: var(--text-soft); font-size: .95rem; }
.platform li { margin-bottom: 6px; }
.platform-foot { text-align: center; margin-top: 28px; color: var(--text-soft); }

/* form */
.access { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: start; }
.access-copy h2 { text-align: left; }
.access-copy p { color: var(--text-soft); }
.access-copy ol { color: var(--text-soft); padding-left: 20px; }
.access-copy li { margin-bottom: 8px; }
.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: var(--shadow-lg); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .88rem; font-weight: 600; color: var(--text); }
.field label .opt { font-weight: 400; color: var(--text-faint); }
.field input, .field select, .field textarea {
  font: inherit; font-size: .97rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
.field .err { color: #d14343; font-size: .82rem; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #d14343; }
.field.invalid .err { display: block; }
.form-actions { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.privacy-line { margin-top: 16px; font-size: .86rem; color: var(--text-faint); display: flex; gap: 8px; align-items: flex-start; }
.privacy-line svg { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--teal); }
.form-status { font-size: .9rem; color: var(--text-soft); }
.form-status.ok { color: #0f7a5a; }
@media (prefers-color-scheme: dark) { .form-status.ok { color: #6fe0bb; } }

/* about */
.about { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; max-width: 900px; margin: 0 auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 36px; box-shadow: var(--shadow); }
.avatar { width: 148px; height: 148px; border-radius: 50%; border: 4px solid transparent; background: var(--grad) border-box; object-fit: cover; }
.about h2 { font-size: 1.7rem; margin-bottom: .2em; text-align: left; }
.about .role { font-weight: 600; color: var(--text-soft); margin-bottom: 4px; }
.about .bio { font-style: italic; color: var(--text-faint); }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.about-links a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: .9rem; color: var(--text); background: var(--bg); }
.about-links a:hover { border-color: var(--blue); text-decoration: none; }
.about-links svg { width: 16px; height: 16px; }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0 44px; color: var(--text-faint); font-size: .92rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text-soft); }
.footer-brand img { width: 24px; height: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--text-soft); }

/* legal pages */
.legal { max-width: 780px; margin: 0 auto; padding: 56px 24px 72px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin-bottom: .3em; }
.legal .meta { color: var(--text-faint); margin-bottom: 32px; }
.legal h2 { font-size: 1.25rem; margin-top: 1.8em; }
.legal ul, .legal ol { padding-left: 22px; color: var(--text-soft); }
.legal li { margin-bottom: 10px; }
.legal p { color: var(--text-soft); }
.legal strong { color: var(--text); }
.legal .callout { background: var(--bg-soft); border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: var(--radius-sm); padding: 16px 20px; margin: 22px 0; color: var(--text); font-weight: 600; }
.licence-list { counter-reset: none; list-style: none; padding: 0 !important; }
.licence-list > li { margin-bottom: 18px; }
.licence-list ol { list-style: lower-alpha; margin-top: 8px; }
.back { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 24px; font-size: .94rem; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .gallery, .lib-grid, .platforms { grid-template-columns: repeat(2, 1fr); }
  .access { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 4px; border-bottom: 1px solid var(--border); }
  .nav-links .btn { margin-top: 12px; border-bottom: 0; }
  .hero { padding: 48px 0 24px; }
  .hero-icon { width: 76px; height: 76px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  section { padding: 60px 0; }
  .feature-groups, .gallery, .lib-grid, .platforms, .form-grid { grid-template-columns: 1fr; }
  .fgroup { padding: 22px 18px 12px; }
  .form-card { padding: 20px 16px; }
  .about { grid-template-columns: 1fr; text-align: center; padding: 28px 18px; gap: 18px; }
  .about .avatar { margin: 0 auto; width: 120px; height: 120px; }
  .about h2 { text-align: center; }
  .about-links { justify-content: center; }
  .lightbox { padding: 56px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .footer-row { flex-direction: column; align-items: flex-start; }
}
.nowrap { white-space: nowrap; }
