/* TheLabs.fyi: colors come from the logo (cream lettering, deep navy-teal, teal flask) */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin.woff2") format("woff2"); font-weight: 300 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-ext.woff2") format("woff2"); font-weight: 300 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Alfa Slab One"; src: url("fonts/alfa-slab-one-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --navy: #0e2733; --navy-2: #133542; --navy-3: #1b4352; --cream: #f0e1a9; --cream-2: #d9c78c;
  --bg: #f6f2e4; --surface: #fffdf6; --surface-2: #efe9d4; --ink: #10262f; --ink-2: #3c5560; --ink-3: #576b73;
  --line: #ddd5bb; --accent: #12707a; --accent-ink: #ffffff; --accent-hover: #0c5960; --link: #0f6670;
  --ok: #1d7a45; --shadow: 0 1px 2px rgb(16 38 47 / .06), 0 6px 20px rgb(16 38 47 / .07);
  --radius: 14px; --wrap: 1120px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --slab: "Alfa Slab One", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
/* Appearance: Auto (follows the computer) unless the visitor picks Light or Dark with the header button (theme.js) */
:root[data-theme="dark"] {
    --bg: #0b1f28; --surface: #11303c; --surface-2: #163a48; --ink: #f2e9c9; --ink-2: #cdc4a4; --ink-3: #aca489;
    --line: #22495a; --accent: #39b8bf; --accent-ink: #082229; --accent-hover: #5fcbd1; --link: #6fd0d6;
    --ok: #63c98d; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0b1f28; --surface: #11303c; --surface-2: #163a48; --ink: #f2e9c9; --ink-2: #cdc4a4; --ink-3: #aca489;
    --line: #22495a; --accent: #39b8bf; --accent-ink: #082229; --accent-hover: #5fcbd1; --link: #6fd0d6;
    --ok: #63c98d; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 var(--sans); }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font: 400 clamp(2rem, 1.4rem + 2.6vw, 3.1rem)/1.1 var(--slab); letter-spacing: .005em; }
h2 { font-size: 1.45rem; font-weight: 750; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; overflow-wrap: anywhere; }
.muted { color: var(--ink-3); }
.small { font-size: .9rem; }
.center { text-align: center; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
.i-sm { width: 1.05em; height: 1.05em; vertical-align: -.17em; }
.i-lg { width: 34px; height: 34px; }
.flip { transform: scaleX(-1); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .55em 1.15em;
  border-radius: 999px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: 650 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn-big { min-height: 52px; padding: .7em 1.4em; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.btn-wide { width: 100%; }
.btn-donate { background: #ffdd00; border-color: #ffdd00; color: #1b1b1b; }
.btn-donate:hover { background: #f2cf00; border-color: #f2cf00; }

/* ---------- header / footer (always the logo's dark navy) ---------- */
.site-head { background: var(--navy); color: var(--cream); border-bottom: 1px solid #1d4655; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 76px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.logo { display: block; line-height: 0; }
.logo img { width: 230px; }
.menu { display: flex; flex-wrap: wrap; gap: 2px; }
.menu a { color: var(--cream); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 1rem; }
.menu a:hover { background: var(--navy-3); }
.menu a[aria-current] { background: var(--navy-3); box-shadow: inset 0 -2px 0 #3cbcc2; }
@media (max-width: 640px) {
  .head-row { justify-content: center; gap: 8px; padding-top: 14px; padding-bottom: 8px; }
  .logo img { width: 200px; }
  .menu { justify-content: center; width: 100%; }
  .menu a { padding: 8px 11px; font-size: .95rem; }
}
.banner { background: #3cbcc2; color: #082229; font-weight: 600; text-align: center; padding: 8px 0; }
.banner a { color: inherit; }
.preview-bar { position: sticky; top: 0; z-index: 30; background: #ffdd00; color: #1b1b1b; text-align: center; font-weight: 700; padding: 6px 12px; font-size: .9rem; }

.site-foot { background: var(--navy); color: var(--cream-2); margin-top: 72px; }
.site-foot a { color: var(--cream); }
.foot-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 40px; padding-bottom: 24px; }
.foot-row nav { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: flex-start; }
.foot-row .muted { color: var(--cream-2); opacity: .85; margin: 8px 0 0; }
.foot-logo { width: 190px; }
.foot-base { padding-bottom: 28px; font-size: .9rem; opacity: .85; }
.foot-line { margin: 0; padding-top: 16px; border-top: 1px solid #1d4655; }
.site-foot nav a { text-decoration: none; }
.site-foot nav a:hover { text-decoration: underline; }

/* ---------- home ---------- */
.hero { background: radial-gradient(1200px 400px at 85% -10%, #1f5a66 0%, transparent 60%), var(--navy); color: var(--cream); padding: 56px 0 72px; }
.hero h1 { max-width: 16ch; color: var(--cream); font-size: clamp(2.3rem, 1.5rem + 3.6vw, 4rem); margin-bottom: .35em; }
.hero-inner { position: relative; }
.hero-art { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 300px; height: 260px; }
.hero-art img { position: absolute; width: 128px; height: 128px; border-radius: 30px; background: var(--navy-2); border: 1px solid #2a5464; padding: 16px; box-shadow: 0 18px 40px rgb(0 0 0 / .35); }
.hero-art .art-0 { left: 20px; top: 10px; transform: rotate(-8deg); }
.hero-art .art-1 { left: 150px; top: 90px; transform: rotate(7deg); }
.hero-art .art-2 { left: 10px; top: 150px; transform: rotate(4deg) scale(.8); }
.hero-art .art-3 { left: 170px; top: -30px; transform: rotate(-4deg) scale(.7); }
@media (max-width: 1000px) { .hero-art { display: none; } }
.hero-text { max-width: 60ch; font-size: 1.2rem; color: #e6dab0; }
.hero-text p:last-child { margin-bottom: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.hero-actions.center { justify-content: center; }
.hero .btn { background: #3cbcc2; border-color: #3cbcc2; color: #082229; }
.hero .btn:hover { background: #63ced3; border-color: #63ced3; }
.hero .btn-ghost { background: transparent; color: var(--cream); border-color: #5b7d86; }
.hero .btn-ghost:hover { background: var(--navy-3); color: var(--cream); }

.section { padding: 56px 0 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
@media (max-width: 640px) { .panel { padding: 24px 20px; } }
.section-title { font-size: 1.7rem; margin-bottom: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 20px; }
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tool-card-link { display: flex; flex-direction: column; gap: 14px; height: 100%; padding: 22px; color: inherit; text-decoration: none; }
.tool-card-head { display: flex; gap: 14px; align-items: center; }
.tool-icon { width: 64px; height: 64px; border-radius: 16px; background: var(--navy); padding: 8px; flex: none; }
.tool-name { display: block; font: 400 1.5rem/1.15 var(--slab); }
.tool-meta { display: block; color: var(--ink-3); font-size: .9rem; margin-top: 4px; }
.tool-meta .i { margin-right: 4px; }
.tool-tagline { color: var(--ink-2); flex: 1; }
.tool-more { color: var(--link); font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.tool-card:hover .tool-more .i { transform: translateX(3px); }
.tool-more .i { transition: transform .15s; }
.promises { list-style: none; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 28px; }
.promises .i-lg { color: var(--accent); margin-bottom: 8px; }
.promises h3 { margin-bottom: .3em; }
.promises p { margin: 0; color: var(--ink-2); }
.support { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.support > div { max-width: 60ch; }
.support p:last-child { margin-bottom: 0; }
.support-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* ---------- project page ---------- */
.project-hero { background: radial-gradient(900px 340px at 90% -20%, #1f5a66 0%, transparent 60%), var(--navy); color: var(--cream); padding: 44px 0 40px; }
.project-hero-inner { display: flex; gap: 28px; align-items: flex-start; }
.project-icon { width: 112px; height: 112px; border-radius: 26px; background: var(--navy-2); border: 1px solid #2a5464; padding: 14px; flex: none; }
.project-intro { min-width: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: #7fd3d7; margin: 0 0 .5em; }
.eyebrow .i { margin-right: 6px; }
.project-hero h1 { color: var(--cream); margin-bottom: .2em; }
.project-tagline { font-size: 1.25rem; color: #e6dab0; margin: 0; max-width: 55ch; }
.project-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.project-hero .btn { background: #3cbcc2; border-color: #3cbcc2; color: #082229; }
.project-hero .btn:hover { background: #63ced3; border-color: #63ced3; }
.project-hero .btn-ghost { background: transparent; color: var(--cream); border-color: #5b7d86; }
.project-hero .btn-ghost:hover { background: var(--navy-3); }
.project-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; font-size: .95rem; color: var(--cream-2); }
.project-facts span + span::before { content: "·"; margin-right: 18px; opacity: .6; }
@media (max-width: 640px) { .project-facts { flex-direction: column; gap: 2px; } .project-facts span + span::before { content: none; } }
.project-facts a { color: #7fd3d7; }
@media (max-width: 640px) {
  .project-hero-inner { flex-direction: column; gap: 16px; }
  .project-icon { width: 84px; height: 84px; border-radius: 20px; padding: 10px; }
  .project-actions .btn { flex: 1 1 100%; }
}
.project-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; padding-top: 40px; align-items: start; }
@media (max-width: 900px) { .project-body { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.project-side { position: sticky; top: 20px; display: grid; gap: 20px; }
@media (max-width: 900px) { .project-side { position: static; margin-top: 40px; } }
.block { margin-bottom: 44px; }
.block > h2 { padding-bottom: .35em; border-bottom: 2px solid var(--line); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks .i { color: var(--ok); margin-top: .2em; stroke-width: 2.6; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.shot { margin: 0; }
.shot a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); cursor: zoom-in; line-height: 0; }
.shot img { width: 100%; height: 190px; object-fit: cover; object-position: top left; transition: transform .25s; }
.shot a:hover img { transform: scale(1.03); }
.shot figcaption { font-size: .9rem; color: var(--ink-2); margin-top: 8px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding: 4px 0 4px 52px; min-height: 36px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 750; }
.note { margin-top: 18px; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; color: var(--ink-2); font-size: .95rem; }
.faq { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 10px; }
.faq summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 650; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { transition: transform .2s; color: var(--ink-3); }
.faq[open] summary .i { transform: rotate(90deg); }
.faq > div { padding: 0 18px 4px; color: var(--ink-2); }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.side-card h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.side-card > p:last-child { margin-bottom: 0; }
.big-version { font: 400 2rem/1 var(--slab); margin: 0 0 .25em; }
.side-card .btn-wide { margin: 8px 0 14px; }
.older summary { cursor: pointer; color: var(--ink-2); }
.older ul { margin: 8px 0 0; padding-left: 1.1em; }
.perms { margin: 0; }
.perms dt { margin-top: 12px; }
.perms dd { margin: 4px 0 0; color: var(--ink-2); font-size: .95rem; }
.crumbs { margin: 0 0 12px; font-weight: 600; }
.crumbs a { text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }

/* ---------- text pages ---------- */
.prose { overflow-wrap: break-word; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .25em 0; }
.prose blockquote { margin: 1em 0; padding: .4em 1em; border-left: 4px solid var(--accent); color: var(--ink-2); background: var(--surface); border-radius: 0 10px 10px 0; }
.prose pre { background: var(--surface-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose img { border-radius: 10px; }
.prose hr { border: 0; border-top: 2px solid var(--line); margin: 2em 0; }
.prose .anchor { margin-left: .35em; color: var(--ink-3); text-decoration: none; opacity: 0; font-weight: 400; }
.prose :is(h2, h3, h4):hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose > h1 { margin-bottom: .6em; }
.changelog h2 { font-size: 1.25rem; padding-top: .9em; border-top: 1px solid var(--line); }
.changelog h3 { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }

/* ---------- screenshot viewer ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgb(5 15 20 / .85); }
.lightbox img { display: block; max-width: min(96vw, 1400px); max-height: 84vh; width: auto; height: auto; border-radius: 10px; background: #fff; }
.lightbox-cap { color: #f0e1a9; text-align: center; margin: 10px 0 0; }
.lightbox-close { position: absolute; top: -14px; right: -14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #f0e1a9; color: #0e2733; cursor: pointer; display: grid; place-items: center; }
@media (max-width: 640px) { .lightbox-close { top: 6px; right: 6px; } }

/* ---------- appearance button ---------- */
.head-tools { display: flex; align-items: center; gap: 8px; }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid #3d6573; background: transparent; color: var(--cream); font: 600 .9rem/1 var(--sans); cursor: pointer; }
.theme-btn:hover { background: var(--navy-3); border-color: #5b7d86; }
.theme-btn .i { width: 1.1em; height: 1.1em; }
@media (max-width: 640px) { .head-tools { width: 100%; justify-content: center; gap: 2px; } .menu { width: auto; } .theme-btn { min-height: 36px; min-width: 36px; padding: 4px 8px; } .theme-btn span { display: none; } }
.prose table { margin: 1.2em 0; font-size: .95rem; }
.prose th { background: var(--surface-2); }
@media (max-width: 640px) { .prose table { font-size: .8rem; } .prose th, .prose td { padding: 6px 7px; } }

/* ---------- lab telemetry (footer) ---------- */
.telemetry { margin: 4px 0 0; font: 400 .74rem/1.5 var(--mono); color: var(--cream-2); opacity: .75; }
.telemetry b { font-weight: 700; color: var(--cream); opacity: 1; }
.foot-base { padding-bottom: 22px; }

/* ---------- contact form ---------- */
.contact-intro { margin: -.2em 0 18px; }
.contact-form { display: grid; gap: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field label { display: block; font-weight: 650; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.field textarea { resize: vertical; min-height: 9em; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field [aria-invalid] { border-color: #c0392b; }
.field-err { color: #c0392b; font-size: .92rem; margin: 4px 0 0; }
.contact-form .btn { justify-self: start; }
.note-err { border-left-color: #c0392b; margin: 0 0 16px; }
.contact-alt { font-size: .95rem; margin-top: 12px; }
.contact-done h2 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.contact-done h2 .i { color: var(--ok); }
.contact-done p:last-child { margin-bottom: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field-err { color: #ff8a7a; } }
:root[data-theme="dark"] .field-err { color: #ff8a7a; }

/* Text only screen readers hear */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
