/* ============================================================
   Rozeen Hussain — "the engine" (yang to Tanya's "voice")
   Shared DNA: cobalt, spacing, minimal rigor.
   Inverted: cool paper, grotesque+mono, schematic grid, query-graph.
   ============================================================ */

:root {
  --paper:   #F5F6F8;
  --paper-2: #EDEFF3;
  --ink:     #14151A;
  --ink-soft:#2B2D36;
  --graphite:#63666F;
  --graphite-2:#8a8d96;
  --line:    rgba(20,21,26,.14);
  --line-2:  rgba(20,21,26,.07);
  --accent:  #2B2BEE;
  --accent-ink:#1A1AC4;
  --cyan:    #0E93A8;
  --amber:   #B4791B;
  --surface: #FFFFFF;
  --code-bg: #15161C;
  --code-fg: #E7E8EE;
  --code-dim:#8b8e9a;

  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1180px;
  --gut: clamp(20px, 5vw, 76px);
  --radius: 9px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); background: var(--paper); color: var(--ink);
  font-size: clamp(15.5px, 1.02vw, 17.5px); line-height: 1.6; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 600; } em { font-style: italic; }
[hidden] { display: none !important; }
code, kbd, pre { font-family: var(--mono); }

.skip-link { position: fixed; top: -60px; left: 12px; z-index: 200; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; transition: top .2s; }
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

/* schematic grid background */
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 55%, transparent 100%);
}

/* ---------- type helpers ---------- */
.section-kicker { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); margin-bottom: 24px; }
.section-kicker span { color: var(--accent); }
.section-title { font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 4.8vw, 3.2rem); line-height: 1.05; letter-spacing: -.025em; max-width: 18ch; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5em; font: 500 .92rem/1 var(--sans); padding: 12px 18px; border-radius: var(--radius); border: 1px solid transparent; background: var(--ink); color: var(--paper); cursor: pointer; transition: transform .16s var(--ease), background .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.linklike { background: none; border: none; font: inherit; color: var(--accent); cursor: pointer; border-bottom: 1px solid currentColor; padding: 0; }

/* ============================================================
   NAV
   ============================================================ */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 90; display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gut); background: color-mix(in srgb, var(--paper) 84%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s, padding .3s; }
.nav.is-scrolled { border-color: var(--line-2); padding-top: 10px; padding-bottom: 10px; }
.nav__mark { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em; }
.nav__glyph { width: 30px; height: 20px; color: var(--accent); }
.nav__links { display: none; gap: 26px; font-family: var(--mono); font-size: .82rem; color: var(--graphite); }
.nav__links a { position: relative; transition: color .2s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--ink); }
.nav__links a::after { content:""; position: absolute; left: 0; bottom: -5px; height: 1.5px; width: 0; background: var(--accent); transition: width .25s var(--ease); }
.nav__links a:hover::after, .nav__links a.is-active::after { width: 100%; }
.kbd-hint { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-family: var(--mono); font-size: .72rem; color: var(--graphite); transition: border-color .2s, color .2s; }
.kbd-hint:hover { border-color: var(--accent); color: var(--accent); }
.kbd-hint kbd { background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: .74em; color: var(--ink); }
.kbd-hint span { margin-left: 2px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 116px var(--gut) 80px; overflow: hidden; }
.hero__graph { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .85; }
.hero__inner { position: relative; z-index: 2; width: 100%; max-width: 860px; }
.hero__eyebrow { font-family: var(--mono); font-size: .8rem; letter-spacing: .04em; color: var(--graphite); margin-bottom: 20px; }
.hero__title { font-family: var(--display); font-weight: 600; letter-spacing: -.035em; line-height: .98; font-size: clamp(2.6rem, 8.5vw, 6.4rem); }
.hero__title .hl { color: var(--accent); position: relative; }
.hero__lead { margin-top: 26px; max-width: 54ch; font-size: clamp(1rem, 1.9vw, 1.2rem); color: var(--ink-soft); }

/* ---------- query bar ---------- */
.qbar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 16px; transition: border-color .2s, box-shadow .2s; box-shadow: 0 1px 0 rgba(20,21,26,.03); }
.qbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,43,238,.14); }
.qbar--hero { margin-top: 34px; max-width: 640px; }
.qbar__prompt { font-family: var(--mono); font-weight: 700; color: var(--accent); font-size: 1rem; }
.qbar__input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: 400 1rem var(--mono); color: var(--ink); }
.qbar__input::placeholder { color: var(--graphite-2); }
.qbar__run { display: inline-flex; align-items: center; gap: 5px; border: none; cursor: pointer; background: var(--ink); color: var(--paper); font: 500 .82rem var(--mono); padding: 10px 14px; border-radius: 8px; transition: background .2s; }
.qbar__run:hover { background: var(--accent); }
.qbar__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip-btn { font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn::before { content: "› "; color: var(--accent); }

/* ============================================================
   CONSOLE / REPL
   ============================================================ */
.console { padding: clamp(70px,10vh,120px) 0; position: relative; z-index: 1; }
.console__intro { margin-top: 22px; max-width: 64ch; color: var(--ink-soft); font-size: clamp(1rem,1.6vw,1.12rem); }
.repl { margin-top: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.repl__empty { padding: clamp(26px,4vw,44px); text-align: center; color: var(--graphite); }
.repl__empty > p { margin-bottom: 16px; }
.repl__empty .qbar__chips { justify-content: center; }
.repl__hint { margin-top: 22px; font-family: var(--mono); font-size: .78rem; color: var(--graphite-2); }
.repl__hint code { color: var(--accent); }

.repl__out { padding: clamp(20px,3vw,32px); display: grid; gap: 22px; }
.repl__q { font-family: var(--mono); font-size: .95rem; }
.repl__qlabel { display: inline-block; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite); margin-right: 10px; }
.repl__q span:last-child { color: var(--ink); }

.repl__sql { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.repl__sqlhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.repl__sqllabel { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite); }
.safety { display: flex; gap: 6px; flex-wrap: wrap; }
.safety__pill { font-family: var(--mono); font-size: .66rem; font-style: normal; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--graphite); background: var(--surface); }
.safety__pill[data-ok] { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 40%, var(--line)); }
.repl__code { background: var(--code-bg); color: var(--code-fg); padding: 14px 16px; overflow-x: auto; font-size: .86rem; line-height: 1.6; }
.repl__code .kw { color: #8f8fff; } .repl__code .fn { color: #67d0e0; } .repl__code .num { color: #e0b15a; } .repl__code .str { color: #7fd191; }

.repl__result { display: grid; grid-template-columns: 1fr; gap: 24px; }
.repl__chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.ct-chip { font-family: var(--mono); font-size: .72rem; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: all .18s; position: relative; }
.ct-chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ct-chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ct-chip:disabled { color: var(--graphite-2); background: var(--paper-2); cursor: not-allowed; opacity: .7; text-decoration: line-through; text-decoration-thickness: 1px; }
.ct-chip[data-reason]:hover::after { content: attr(data-reason); position: absolute; left: 0; bottom: calc(100% + 6px); white-space: nowrap; background: var(--ink); color: var(--paper); font-size: .68rem; padding: 5px 8px; border-radius: 6px; pointer-events: none; z-index: 5; text-decoration: none; max-width: 60vw; }
.repl__chart { width: 100%; min-height: 260px; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px; }
.repl__chart canvas, .repl__chart svg { max-width: 100%; }
.repl__chartcol { min-width: 0; }

.repl__tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.repl__table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: .8rem; }
.repl__table th, .repl__table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.repl__table th { background: var(--paper-2); color: var(--graphite); font-weight: 500; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; position: sticky; top: 0; }
.repl__table tr:last-child td { border-bottom: none; }
.repl__meta { margin-top: 8px; font-family: var(--mono); font-size: .72rem; color: var(--graphite-2); }

.repl__history { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.repl__history .hlabel { font-family: var(--mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--graphite); margin-right: 6px; }
.hnode { font-family: var(--mono); font-size: .72rem; color: var(--graphite); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; cursor: pointer; transition: all .18s; }
.hnode:hover { border-color: var(--accent); color: var(--accent); }
.hnode.is-current { color: var(--accent); border-color: var(--accent); }
.hnode + .hnode::before { content: "→"; color: var(--graphite-2); margin-right: 8px; margin-left: 2px; }
.repl__status { font-family: var(--mono); font-size: .76rem; color: var(--accent); text-align: center; padding: 0 20px 18px; min-height: 1em; }

/* ============================================================
   SYSTEMS
   ============================================================ */
.systems { padding: clamp(60px,9vh,110px) 0; position: relative; z-index: 1; }
.sys { list-style: none; margin-top: 48px; display: flex; flex-direction: column; gap: 1px; background: var(--line-2); border-block: 1px solid var(--line-2); }
.sys__item { position: relative; background: var(--paper); padding: clamp(28px,5vw,60px) var(--gut); display: grid; gap: 16px; transition: background .3s; }
.sys__item:hover { background: var(--surface); }
.sys__no { position: absolute; top: clamp(22px,4vw,44px); right: var(--gut); font-family: var(--mono); font-size: .78rem; color: var(--graphite-2); }
.sys__title { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem,3.6vw,2.4rem); letter-spacing: -.025em; line-height: 1.03; }
.sys__org { font-family: var(--mono); font-size: .76rem; color: var(--graphite); margin-top: 8px; }
.sys__desc { font-size: clamp(1.02rem,1.8vw,1.24rem); max-width: 60ch; color: var(--ink-soft); }
.sys__points { list-style: none; display: grid; gap: 11px; max-width: 70ch; }
.sys__points li { position: relative; padding-left: 20px; color: var(--ink-soft); font-size: .97rem; }
.sys__points li::before { content: "»"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.chips li { font-family: var(--mono); font-size: .72rem; color: var(--graphite); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; }
.sys__aside { font-size: .9rem; color: var(--graphite); }
.sys__aside a { color: var(--accent); border-bottom: 1px solid currentColor; }
.sys__link { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); transition: border-color .2s, color .2s; white-space: nowrap; }
.sys__link:hover { color: var(--accent-ink); border-bottom-color: currentColor; }

/* ---- also shipped (secondary projects) ---- */
.more__label { margin-top: clamp(40px,6vw,64px); font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; color: var(--graphite); }
.more { list-style: none; margin-top: 22px; display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.more__card { display: flex; flex-direction: column; gap: 7px; height: 100%; background: var(--paper); padding: clamp(20px,2.6vw,30px); text-decoration: none; color: inherit; transition: background .25s var(--ease); }
.more__card:hover { background: var(--surface); }
.more__yr { font-family: var(--mono); font-size: .72rem; color: var(--graphite-2); }
.more__name { font-family: var(--display); font-weight: 600; font-size: clamp(1.15rem,2.2vw,1.5rem); letter-spacing: -.02em; display: flex; align-items: baseline; gap: .35em; }
.more__ext { font-size: .72em; color: var(--graphite-2); transition: color .2s, transform .2s var(--ease); }
.more__card:hover .more__ext { color: var(--accent); transform: translate(2px,-2px); }
.more__dom { font-family: var(--mono); font-size: .74rem; color: var(--accent); }
.more__desc { color: var(--ink-soft); font-size: .93rem; line-height: 1.6; max-width: 46ch; }
.more__stack { margin-top: auto; font-family: var(--mono); font-size: .7rem; color: var(--graphite); padding-top: 4px; }

/* ============================================================
   TOOLKIT
   ============================================================ */
.toolkit { padding: clamp(66px,10vh,120px) 0; position: relative; z-index: 1; }
.tk-grid { display: grid; grid-template-columns: 1fr; gap: 1px; margin-top: 44px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.tk { background: var(--paper); padding: 28px clamp(20px,3vw,36px); }
.tk h3 { font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.tk p { color: var(--ink-soft); font-size: 1rem; line-height: 1.7; }

/* ============================================================
   EXPERIENCE
   ============================================================ */
.exp { padding: clamp(66px,10vh,120px) 0; position: relative; z-index: 1; }
.timeline { list-style: none; margin-top: 44px; }
.tl { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 24px 0; border-top: 1px solid var(--line); }
.tl:last-child { border-bottom: 1px solid var(--line); }
.tl__when { font-family: var(--mono); font-size: .78rem; color: var(--graphite); }
.tl__body h3 { font-family: var(--display); font-weight: 500; font-size: clamp(1.15rem,2.4vw,1.5rem); letter-spacing: -.01em; }
.tl__body h3 span { color: var(--graphite); font-family: var(--sans); font-weight: 400; font-size: .82em; }
.tl__body p { margin-top: 7px; max-width: 66ch; color: var(--ink-soft); font-size: .96rem; }

/* ============================================================
   CONTACT + FOOTER
   ============================================================ */
.contact { padding: clamp(66px,10vh,120px) 0 clamp(50px,7vh,90px); position: relative; z-index: 1; }
.contact__lead { margin-top: 18px; max-width: 48ch; color: var(--ink-soft); font-size: clamp(1rem,1.7vw,1.14rem); }
.links { display: grid; gap: 11px; margin-top: 40px; max-width: 620px; }
.link-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; transition: border-color .2s, transform .2s, background .2s; }
.link-row:hover { border-color: var(--ink); transform: translateX(4px); background: var(--surface); }
.link-row span { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); }
.link-row b { font-weight: 500; font-family: var(--mono); font-size: .92rem; }

.foot { padding: clamp(40px,7vh,72px) 0 40px; border-top: 1px solid var(--line); position: relative; z-index: 1; }
.foot__inner { display: flex; flex-direction: column; gap: 14px; }
.foot__yy { font-size: 1rem; color: var(--ink-soft); max-width: 60ch; }
.foot__yy a { color: var(--accent); border-bottom: 1px solid currentColor; }
.foot__seed { display: block; font-family: var(--mono); font-size: .78rem; color: var(--graphite-2); margin-top: 6px; }
.foot__made { font-family: var(--mono); font-size: .78rem; color: var(--graphite); }
.foot__made a { color: var(--ink); border-bottom: 1px solid var(--line); }

/* ============================================================
   DOCK (sticky console spine)
   ============================================================ */
.dock { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(120%); z-index: 95; display: flex; align-items: center; gap: 8px; width: min(92vw, 560px); background: var(--ink); color: var(--paper); border-radius: 12px; padding: 7px 7px 7px 14px; box-shadow: 0 16px 44px rgba(20,21,26,.3); transition: transform .4s var(--ease); }
.dock.is-show { transform: translateX(-50%) translateY(0); }
.dock__prompt { font-family: var(--mono); font-weight: 700; color: #8f8fff; }
.dock__input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--paper); font: 400 .92rem var(--mono); }
.dock__input::placeholder { color: #8b8e9a; }
.dock__run { border: none; cursor: pointer; background: var(--accent); color: #fff; font: 500 .9rem var(--mono); width: 34px; height: 34px; border-radius: 8px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(10px); z-index: 130; background: var(--ink); color: var(--paper); padding: 11px 17px; border-radius: 10px; font-family: var(--mono); font-size: .84rem; max-width: 88vw; opacity: 0; transition: opacity .3s, transform .3s; }
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   MOTION
   ============================================================ */
.reveal, [data-reveal] { opacity: 0; transform: translateY(20px); }
.reveal.is-in, [data-reveal].is-in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 720px) {
  .repl__result { grid-template-columns: 1.15fr .85fr; align-items: start; }
}
@media (min-width: 720px) {
  .more { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 820px) {
  .nav__links { display: flex; }
  .tk-grid { grid-template-columns: 1fr 1fr; }
  .tl { grid-template-columns: 210px 1fr; gap: 30px; align-items: baseline; }
}
@media (min-width: 1024px) {
  .sys__item { grid-template-columns: 1.05fr 1fr; grid-template-areas: "head desc" "points points" "chips aside"; column-gap: 40px; }
  .sys__head { grid-area: head; } .sys__desc { grid-area: desc; align-self: end; }
  .sys__points { grid-area: points; margin-top: 6px; } .chips { grid-area: chips; } .sys__aside { grid-area: aside; text-align: right; align-self: center; }
}
@media (max-width: 540px) {
  .kbd-hint span { display: none; }
  .dock { bottom: 12px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal, [data-reveal] { opacity: 1 !important; transform: none !important; }
  .dock { transition: none; }
  * { scroll-behavior: auto !important; }
}
