/* Layout: product-studio site. Hero with the app suite as a home-screen of icons, then a bento of product cards, each with a live mini UI preview of what the app does. */
:root {
  --bg: #F8FAF9;
  --surface: #FFFFFF;
  --panel: #F1F5F3;
  --ink: #0D1916;
  --muted: #5A6A65;
  --faint: #8C9A95;
  --line: #E1E8E5;
  --green: #0E7A5E;   /* alexandrite by day */
  --wine: #A1254E;    /* alexandrite by lamplight */
  --green-soft: #E3F2EC;
  --shadow: 0 1px 2px rgba(13,25,22,.05), 0 8px 24px -8px rgba(13,25,22,.12);
  --a-ll: #0E7A5E; --a-sl: #A1254E; --a-ov: #6A4DE0; --a-ko: #DD5530; --a-kp: #1F74DB; --a-gm: #B98008; --a-ml: #0C8585;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --max: 1180px;
  --r: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0F0D; --surface: #111917; --panel: #16201D; --ink: #EAF1EE; --muted: #9AABA5; --faint: #6D7D78; --line: #22302B;
    --green: #3CC99C; --wine: #F0709A; --green-soft: #12302A;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -10px rgba(0,0,0,.6);
    --a-ll: #2FB98F; --a-sl: #E85A88; --a-ov: #8F78FF; --a-ko: #FF7A52; --a-kp: #4B9BFF; --a-gm: #E3AB2E; --a-ml: #26B5B5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0F0D; --surface: #111917; --panel: #16201D; --ink: #EAF1EE; --muted: #9AABA5; --faint: #6D7D78; --line: #22302B;
  --green: #3CC99C; --wine: #F0709A; --green-soft: #12302A;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -10px rgba(0,0,0,.6);
  --a-ll: #2FB98F; --a-sl: #E85A88; --a-ov: #8F78FF; --a-ko: #FF7A52; --a-kp: #4B9BFF; --a-gm: #E3AB2E; --a-ml: #26B5B5;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -.025em; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 8px; }
.eyebrow { font: 500 .78rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--green); }

/* Nav */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.05rem var(--font-display); letter-spacing: -.02em; }
.logo svg { width: 30px; height: 30px; flex: none; }
/* 4A Code Gem mark: the center gem flips so green and wine swap, like alexandrite changing color */
.m-g { fill: var(--green); }
.m-w { fill: var(--wine); }
.m-hi { fill: #fff; opacity: .25; }
.mark .gem { transform-box: fill-box; transform-origin: center; }
.mark.flip .gem { animation: gemflip 2.4s cubic-bezier(.65,0,.35,1); }
@keyframes gemflip { 0% { transform: scaleX(1); } 35%, 65% { transform: scaleX(-1); } 100% { transform: scaleX(1); } }
.logo span { color: var(--faint); font-weight: 500; }
.links { display: flex; align-items: center; gap: 28px; font-size: .94rem; }
.links a { text-decoration: none; color: var(--muted); font-weight: 500; }
.links a:hover { color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer; font: 600 .94rem var(--font-body); padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; transition: transform .15s, background .2s, border-color .2s; }
.btn-dark { background: var(--ink); color: var(--bg) !important; }
.btn-dark:hover { transform: translateY(-1px); }
.btn-line { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-line:hover { border-color: var(--faint); }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
@media (max-width: 720px) { .links a:not(.btn) { display: none; } .logo span { display: none; } }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 72px); align-items: center; padding-block: clamp(56px, 9vw, 112px) clamp(48px, 7vw, 88px); }
.hero > * { min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .85rem; color: var(--muted); }
.pill b { font: 600 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; background: var(--green-soft); color: var(--green); padding: 3px 8px; border-radius: 999px; }
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 4.7rem); font-weight: 800; line-height: 1.02; margin-top: 22px; }
.hero h1 em { font-style: normal; background: linear-gradient(95deg, var(--green) 30%, var(--wine) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin-top: 22px; font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--muted); max-width: 32em; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Home screen of app icons */
.homescreen { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); }
.homescreen::before { content: ""; position: absolute; inset: -40px -30px auto auto; width: 70%; height: 80%; z-index: -1; filter: blur(60px); opacity: .35; background: radial-gradient(circle at 30% 30%, var(--green), transparent 60%), radial-gradient(circle at 80% 70%, var(--wine), transparent 60%); }
.hs-bar { display: flex; justify-content: space-between; align-items: center; font: 500 .75rem var(--font-mono); color: var(--faint); margin-bottom: 18px; }
.icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2.4vw, 22px) clamp(10px, 2vw, 18px); }
.ic { display: grid; justify-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.ic-tile { width: 100%; max-width: 76px; aspect-ratio: 1; border-radius: 22%; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 78%, #fff), var(--c) 55%); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 14px -6px var(--c); transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.ic:hover .ic-tile { transform: translateY(-3px) scale(1.05); }
.ic-tile svg { width: 46%; height: 46%; }
.ic-name { font-size: .74rem; font-weight: 500; color: var(--muted); text-align: center; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic.add .ic-tile { background: transparent; border: 1.5px dashed var(--line); box-shadow: none; color: var(--faint); }
.hs-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.hs-foot b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

/* Audience strip */
.strip { border-block: 1px solid var(--line); }
.strip-in { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; padding-block: 22px; color: var(--muted); font-size: .95rem; }
.strip-in .lbl { font: 500 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.aud { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500; color: var(--ink); padding: 6px 12px 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, transform .15s; }
.aud i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.aud small { font-size: .82rem; color: var(--faint); font-weight: 400; }
.aud::after { content: "→"; color: var(--faint); transition: transform .15s, color .15s; }
.aud:hover { border-color: var(--c); transform: translateY(-1px); }
.aud:hover::after { transform: translateX(3px); color: var(--c); }
.strip-in { gap: 10px; }
.strip-in .lbl { margin-right: 8px; }

/* Products */
section { padding-block: clamp(64px, 9vw, 112px); }
.head { max-width: 640px; margin-bottom: 40px; }
.head h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 800; line-height: 1.05; margin-top: 12px; }
.head p { margin-top: 14px; color: var(--muted); font-size: 1.08rem; }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.card { grid-column: span var(--span, 2); display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; scroll-margin-top: 90px; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.card:target { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.stage { position: relative; height: 210px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, var(--panel)), var(--panel)); border-bottom: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; padding: 18px; }
.card-body { padding: 20px 22px 22px; display: grid; gap: 10px; flex: 1; align-content: start; }
.card-title { display: flex; align-items: center; gap: 12px; }
.mini-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; background: var(--c); }
.mini-ic svg { width: 18px; height: 18px; }
.card h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.card .cat { font-size: .82rem; color: var(--faint); }
.card p { color: var(--muted); font-size: .96rem; }
.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.tag { font: 500 .72rem var(--font-mono); padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.tag.dev::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #D99A1E; }
.tag.suite { color: var(--c); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.card.next { --c: var(--faint); background: transparent; border-style: dashed; grid-column: span 6; }
.card.next .card-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px; }
@media (max-width: 960px) { .bento { grid-template-columns: repeat(2, 1fr); } .card { grid-column: span 1 !important; } .card.next { grid-column: span 2 !important; } }
@media (max-width: 620px) { .bento { grid-template-columns: 1fr; } .card.next { grid-column: span 1 !important; } }

/* ---- Mini UI previews (shared) ---- */
.ui { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font-size: .74rem; color: var(--ink); overflow: hidden; }
.ui-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--faint); font-family: var(--font-mono); font-size: .66rem; }
.ui-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.ui-bar b { margin-left: 6px; font-weight: 500; color: var(--muted); }
.ui-body { padding: 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: .68rem; font-weight: 600; background: color-mix(in srgb, var(--k) 14%, var(--surface)); color: var(--k); }
.row { display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Ledger Lore graph */
.graph { position: relative; height: 150px; }
.graph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.node { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; box-shadow: var(--shadow); white-space: nowrap; }
.node small { display: block; font: 500 .58rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--k); }
/* Sentinel manuscript */
.ms-line { height: 6px; border-radius: 3px; background: var(--line); margin-bottom: 7px; }
.flag { margin-top: 10px; border: 1px solid color-mix(in srgb, var(--a-sl) 40%, var(--line)); background: color-mix(in srgb, var(--a-sl) 7%, var(--surface)); border-radius: 8px; padding: 8px 10px; display: grid; gap: 3px; }
.flag b { color: var(--a-sl); font-size: .7rem; }
.hl { background: color-mix(in srgb, var(--a-sl) 22%, transparent); border-radius: 3px; padding: 0 2px; }
/* Ovlo */
.dump { padding: 9px 10px; border-radius: 10px; background: var(--panel); color: var(--muted); font-style: italic; line-height: 1.45; }
.sorted { display: grid; gap: 6px; margin-top: 10px; }
.sorted .row { justify-content: space-between; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
/* Kodoma */
.ko { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 70px; }
.bars span { background: color-mix(in srgb, var(--a-ko) 30%, var(--panel)); border-radius: 4px 4px 2px 2px; }
.bars span.on { background: var(--a-ko); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; font: .6rem var(--font-mono); color: var(--faint); margin-top: 4px; }
/* Charts */
.chart svg { width: 100%; height: auto; display: block; }
/* MarketLens */
.wl .row { justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.wl .row:last-child { border-bottom: 0; }
.tk { font: 600 .74rem var(--font-mono); width: 44px; }

/* Studio */
.studio { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.studio > * { min-width: 0; }
.studio .copy { display: grid; gap: 16px; color: var(--muted); font-size: 1.06rem; max-width: 34em; }
.vals { display: grid; gap: 0; border-top: 1px solid var(--line); }
.val { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.val-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.val-ic svg { width: 20px; height: 20px; }
.val h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -.015em; }
.val p { color: var(--muted); font-size: .96rem; margin-top: 4px; }
@media (max-width: 860px) { .studio { grid-template-columns: 1fr; } }

/* CTA */
.cta-box { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(32px, 6vw, 72px); background: var(--ink); color: var(--bg); display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
.cta-box > * { min-width: 0; position: relative; }
.cta-box::before { content: ""; position: absolute; right: -10%; top: -40%; width: 60%; height: 180%; background: radial-gradient(circle at 40% 40%, color-mix(in srgb, var(--green) 55%, transparent), transparent 60%), radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--wine) 50%, transparent), transparent 55%); filter: blur(30px); opacity: .7; }
.cta-box h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; line-height: 1.05; }
.cta-box p { margin-top: 14px; opacity: .75; max-width: 30em; }
.mailbox { background: color-mix(in srgb, var(--bg) 8%, transparent); border: 1px solid color-mix(in srgb, var(--bg) 18%, transparent); border-radius: 16px; padding: 18px; display: grid; gap: 12px; }
.mailbox small { font: 500 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; opacity: .65; }
.mailbox code { font: 500 1rem var(--font-mono); user-select: all; overflow-wrap: anywhere; }
.copy-btn { justify-self: start; cursor: pointer; font: 600 .9rem var(--font-body); padding: 10px 18px; border-radius: 999px; border: 0; background: var(--bg); color: var(--ink); }
@media (max-width: 760px) { .cta-box { grid-template-columns: 1fr; } }

/* Footer */
footer { padding-block: 48px 56px; border-top: 1px solid var(--line); margin-top: clamp(64px, 9vw, 112px); }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot > * { min-width: 0; }
.foot h4 { margin: 0 0 12px; font: 500 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .94rem; }
.foot a { text-decoration: none; color: var(--muted); }
.foot a:hover { color: var(--ink); }
.foot .fine { margin-top: 14px; color: var(--faint); font-size: .88rem; max-width: 26em; }
@media (max-width: 680px) { .foot { grid-template-columns: 1fr 1fr; } .foot > :first-child { grid-column: 1 / -1; } }

@keyframes draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
.drawn { stroke-dasharray: 400; animation: draw 1.6s ease-out both; }
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; animation: none !important; } .drawn { stroke-dasharray: none; } }

/* Production fix: the blurred glow behind the home screen (.homescreen::before) reaches 30px past the panel, which caused a 5px sideways scroll at 375px. `clip` trims it without creating a scroll container. */
.hero { overflow-x: clip; }
