/* Base reset (the publishing sandbox supplied this before) */
:root { color-scheme: light; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

/* Layout: left-aligned 12-column workshop grid. Bench-notebook rules, mono labels, one cobalt accent. */
:root {
  --bg: #EDF0F4;
  --surface: #F8F9FB;
  --fg: #11151C;
  --muted: #566070;
  --line: #CAD1DB;
  --accent: #2540E8;
  --accent-fg: #FFFFFF;
  --ok: #0C7A54;
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1015; --surface: #151922; --fg: #E8EBF0; --muted: #8D97A7; --line: #272D38;
    --accent: #8FA2FF; --accent-fg: #0D1015; --ok: #4CD6A0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1015; --surface: #151922; --fg: #E8EBF0; --muted: #8D97A7; --line: #272D38;
  --accent: #8FA2FF; --accent-fg: #0D1015; --ok: #4CD6A0; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  background: var(--bg); color: var(--fg);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  background: var(--bg); z-index: 30;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap {
  width: 100%; max-width: 1240px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.mono { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.03em; }
.brand svg { width: 26px; height: 26px; flex: none; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a.link { text-decoration: none; font-size: 0.95rem; color: var(--muted); transition: color .15s; }
.nav a.link:hover { color: var(--fg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 0.95rem var(--font-body); text-decoration: none; cursor: pointer;
  padding: 12px 20px; border-radius: 6px; border: 1px solid var(--fg);
  background: transparent; color: var(--fg); transition: transform .15s, background .15s, color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.btn.small { padding: 9px 14px; font-size: 0.875rem; }

/* Hero */
.hero { padding-block: clamp(48px, 8vw, 104px) clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: end; }
.hero h1 {
  font-size: clamp(2.7rem, 7.2vw, 5.9rem); line-height: 0.98; font-weight: 650;
  font-stretch: 88%; letter-spacing: -0.035em; margin-top: 20px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { margin-top: 28px; max-width: 34em; font-size: 1.2rem; color: var(--muted); }
.hero .actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

.log { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; }
.log-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.log-body { padding: 16px; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.5; }
.log-cmd { color: var(--muted); margin-bottom: 14px; overflow-wrap: anywhere; }
.log-cmd b { color: var(--fg); font-weight: 500; }
.log-row { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--line); align-items: baseline; }
.log-row .wk { color: var(--muted); }
.pill { font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.pill.ok { color: var(--ok); }
.pill.live { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }
.cursor { display: inline-block; width: 0.55em; height: 1em; background: var(--accent); vertical-align: -0.15em; animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.stack { margin-top: clamp(40px, 6vw, 64px); padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; }
.stack span.t { font-family: var(--font-mono); font-size: 0.875rem; }

/* Sections */
section.block { padding-block: clamp(56px, 9vw, 112px); border-top: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px 48px; margin-bottom: clamp(32px, 5vw, 56px); align-items: start; }
.sec-head h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.02; font-stretch: 90%; }
.sec-head p { color: var(--muted); max-width: 36em; font-size: 1.125rem; }
.sec-head .mono { grid-column: 1 / -1; }

/* Capabilities */
.caps { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.cap-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cap-btn {
  width: 100%; display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; gap: 12px; align-items: baseline; text-align: left;
  font: 500 1.2rem var(--font-display); letter-spacing: -0.01em;
  background: none; color: var(--muted); border: 0; border-bottom: 1px solid var(--line); padding: 16px 4px; cursor: pointer; transition: color .15s, padding .2s;
}
.cap-btn .n { font: 400 0.75rem var(--font-mono); letter-spacing: 0.06em; }
.cap-btn .arr { opacity: 0; transform: translateX(-6px); transition: opacity .15s, transform .15s; color: var(--accent); }
.cap-btn:hover { color: var(--fg); }
.cap-btn[aria-selected="true"] { color: var(--fg); padding-left: 12px; }
.cap-btn[aria-selected="true"] .arr { opacity: 1; transform: none; }
.cap-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: clamp(22px, 3vw, 36px); min-width: 0; position: sticky; top: 96px; }
.cap-panel h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; margin-top: 14px; }
.cap-panel p { margin-top: 16px; color: var(--muted); }
.tags { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font: 400 0.8125rem var(--font-mono); padding: 5px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }

/* Approach */
.quote { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 3rem); line-height: 1.12; letter-spacing: -0.025em; font-weight: 550; max-width: 22em; }
.quote em { font-style: normal; color: var(--accent); }
.steps { list-style: none; margin: clamp(40px, 6vw, 72px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--fg); }
.steps li { padding: 20px 20px 8px 0; min-width: 0; }
.steps li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.steps .when { color: var(--accent); }
.steps h3 { font-size: 1.35rem; margin-top: 12px; }
.steps p { color: var(--muted); margin-top: 10px; font-size: 0.975rem; }
.facts { margin: clamp(40px, 6vw, 64px) 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.facts div { border-top: 1px solid var(--line); padding-top: 14px; min-width: 0; }
.facts dt { margin-bottom: 6px; }
.facts dd { margin: 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 550; }

/* Work */
.work-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fg); }
.work-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr) minmax(0, 3fr); gap: 16px 40px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: start; }
.work-row h3 { font-size: 1.55rem; line-height: 1.12; }
.work-row p { color: var(--muted); }
.work-row .meta { display: flex; flex-direction: column; gap: 6px; }
.work-row .meta .res { font: 500 0.95rem var(--font-body); color: var(--fg); }
.note { margin-top: 18px; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.contact h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; font-stretch: 88%; }
.contact .intro { margin-top: 20px; color: var(--muted); max-width: 28em; }
.details { margin: 32px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.details div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
form.brief { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: clamp(20px, 3vw, 32px); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font: 400 0.75rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  font: 400 1rem var(--font-body); color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; width: 100%; min-width: 0;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field .err { color: #C0392B; font-size: 0.8125rem; min-height: 1em; }
:root[data-theme="dark"] .field .err { color: #FF8A7A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field .err { color: #FF8A7A; } }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.result { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 18px; display: grid; gap: 12px; }
.result textarea { min-height: 170px; font-family: var(--font-mono); font-size: 0.8125rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.status { font-size: 0.9rem; color: var(--ok); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px calc(40px + 8px); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-start; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.foot nav a:hover { color: var(--fg); }
.legal { margin-top: 32px; }

@media (max-width: 960px) {
  .hero-grid, .caps, .contact, .sec-head { grid-template-columns: minmax(0, 1fr); }
  .cap-panel { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .steps li:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 24px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 640px) {
  .nav a.link { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 24px; }
  .steps li:nth-child(n+3) { margin-top: 12px; }
  form.brief { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .btn, .cap-btn, .cap-btn .arr { transition: none; }
}
