/* 40Second — basalt inscription */

:root {
  --basalt: #0B0C0E;
  --surface: #14161A;
  --hairline: #2A2E35;
  --bone: #ECEAE3;
  --slate: #8B9099;
  --accent: #FFC300;
  --accent-ink: #FFC300;
  --splotch: #B23A48;

  --bg: var(--basalt);
  --fg: var(--bone);
  --muted: var(--slate);

  --font-display: "Cinzel", "Times New Roman", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --display: var(--font-display);

  --spine-w: 176px;
  --rail-gutter: 60px;
  --space-section: clamp(76px, 11vh, 118px);
  --row-pad: 22px;
  --measure: 60ch;
}

/* Accent variants (graphics accent + text-safe accent-ink per mode) */
html[data-accent="saffron"]   { --accent: #FFC300; --accent-ink: #FFC300; }
html[data-accent="verdigris"] { --accent: #3FB68B; --accent-ink: #3FB68B; }
html[data-accent="porphyry"]  { --accent: #B23A48; --accent-ink: #C9505E; }
html[data-accent="lapis"]     { --accent: #3D6EFF; --accent-ink: #6E92FF; }
html[data-accent="murex"]     { --accent: #7C3AED; --accent-ink: #A78BFA; }
html[data-accent="oleander"]  { --accent: #D6498A; --accent-ink: #E06A9F; }
html[data-accent="bone"]      { --accent: #ECEAE3; --accent-ink: #ECEAE3; }

/* Marble (light) mode */
html[data-mode="marble"] {
  --bg: #ECEAE3;
  --surface: #E3E0D6;
  --hairline: #CFCABC;
  --fg: #16171B;
  --muted: #5C6068;
  --splotch: #9A2F3D;
}
html[data-mode="marble"][data-accent="saffron"]   { --accent: #A87B00; --accent-ink: #7D5C00; }
html[data-mode="marble"][data-accent="verdigris"] { --accent: #1E7A5C; --accent-ink: #176349; }
html[data-mode="marble"][data-accent="porphyry"]  { --accent: #9A2F3D; --accent-ink: #8B2A37; }
html[data-mode="marble"][data-accent="lapis"]     { --accent: #2B53D6; --accent-ink: #2546B5; }
html[data-mode="marble"][data-accent="murex"]     { --accent: #6D28D9; --accent-ink: #5B21B6; }
html[data-mode="marble"][data-accent="oleander"]  { --accent: #B03060; --accent-ink: #9C2A55; }
html[data-mode="marble"][data-accent="bone"]      { --accent: #16171B; --accent-ink: #16171B; }

/* Display face toggle */
html[data-display="grotesque"] { --display: var(--font-mono); }

/* Density */
html[data-density="compact"] {
  --space-section: clamp(52px, 8vh, 76px);
  --row-pad: 13px;
}

/* ---------- base ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--fg); text-decoration-color: var(--hairline); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--fg);
  font-family: var(--font-mono); font-size: 13px;
  padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: var(--spine-w); }

/* ---------- spine ---------- */

.spine {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--spine-w);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 28px 0;
  z-index: 10;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.spine::-webkit-scrollbar { display: none; }
.spine__toggle { display: none; }
.spine-backdrop { display: none; }

.spine__mark {
  display: block;
  width: 48px;
  height: 48px;
  flex: none;
  margin-left: calc((var(--rail-gutter) - 48px) / 2);
}
.spine__mark svg { display: block; width: 100%; height: 100%; }

.spine__line {
  flex: 1;
  width: 1px;
  background: var(--hairline);
  margin: 24px 0;
  margin-left: calc(var(--rail-gutter) / 2);
}
.spine__line--short {
  flex: none;
  height: 26px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.spine__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  list-style: none;
}

.spine__num {
  position: relative;
  display: flex;
  align-items: center;
  width: calc(100% - 16px);
  margin: 1px 8px;
  min-height: 40px;
  padding: 0 12px 0 0;
  border-radius: 9px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.spine__num-glyph {
  width: calc(var(--rail-gutter) - 16px);
  flex: none;
  display: flex;
  justify-content: center;
  transition: transform 0.22s ease;
}
.spine__num-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Section sub-menu: a subtle highlight on hover, and the CURRENT section ("where
   you are") gets a clean GREY OUTLINE that stays put as you scroll or click into
   a section — no blue fill, distinct from the blue page links above. */
.spine__num:hover { background: rgba(140, 146, 158, 0.12); color: var(--fg); }
.spine__num[aria-current="true"] {
  border-color: rgba(150, 156, 168, 0.55);
  color: var(--fg);
}

/* ---------- stele (main column) ---------- */

.stele {
  margin-left: var(--spine-w);
  padding: 0 clamp(24px, 5vw, 72px) 0 clamp(40px, 9vw, 150px);
}

.stele__inner { max-width: 880px; }

section { padding: var(--space-section) 0 0; }

/* meander rule */
.meander-rule {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: calc(var(--space-section) * 0.6);
}
.meander-rule::before,
.meander-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
.meander-rule svg { display: block; width: 30px; height: 15px; flex: none; }
.meander-rule svg path { stroke: var(--accent); }
html[data-ornament="off"] .meander-rule svg { display: none; }
html[data-ornament="off"] .meander-rule { gap: 0; }

/* section headers */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: clamp(30px, 5vh, 52px);
}
.sec-head__num {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--accent-ink);
}
.sec-head__num::before {
  content: "";
  position: absolute;
  inset: -12px -16px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--splotch), transparent 72%);
  opacity: 0.25;
  filter: blur(5px);
}
.sec-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* headers are always visible: no scroll-reveal */

/* ---------- portico ---------- */

.portico {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 0;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(44px, 9.5vw, 124px);
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.wordmark .dial {
  display: inline-block;
  width: 0.82em;
  height: 0.82em;
  margin: 0 0.045em;
  flex: none;
}
.wordmark .dial svg { display: block; width: 100%; height: 100%; }

.thesis {
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.5vw, 15px);
  color: var(--muted);
  margin-top: 34px;
  letter-spacing: 0.02em;
}

/* terminal strip */
.term {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 46px;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 13px 16px;
  font-family: var(--font-mono);
  font-size: 13.5px;
}
.term__prompt { color: var(--muted); flex: none; user-select: none; }
.term__cmd { flex: 1; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.term__cmd::-webkit-scrollbar { display: none; }
.term__copy {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--hairline);
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  min-height: 28px;
}
.term__copy:hover { color: var(--accent-ink); border-color: var(--accent); }
.term__copy.is-copied { color: var(--accent-ink); border-color: var(--accent); }

/* ---------- index ---------- */

.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1.2em; }
.prose .quiet { color: var(--muted); }

/* ---------- research (codex list) ---------- */

.codex { list-style: none; border-bottom: 1px solid var(--hairline); }

.codex__row {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 28px;
  padding: var(--row-pad) 0 var(--row-pad) 18px;
  border-top: 1px solid var(--hairline);
}
.codex__row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
}
@media (prefers-reduced-motion: no-preference) {
  .codex__row::before { transition: transform 0.3s ease; }
}
.codex__row:hover::before,
.codex__row:focus-within::before { transform: scaleY(1); }

.codex__date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 4px;
}
.codex__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(16px, 1.9vw, 20px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
}
.codex__title a { text-decoration: none; }
.codex__title a:hover { color: var(--accent-ink); }
.codex__desc {
  grid-column: 2;
  color: var(--muted);
  font-size: 14.5px;
  max-width: var(--measure);
}

/* ---------- releases ---------- */

.releases { display: grid; gap: clamp(26px, 4vh, 40px); }

.release { border-top: 1px solid var(--hairline); padding-top: var(--row-pad); }

.release__head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.release__name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.04em;
}
.release__license {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.release__desc {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 8px;
  max-width: var(--measure);
}
.release .term { margin-top: 16px; }

/* ---------- lab log ---------- */

.log { list-style: none; font-family: var(--font-mono); font-size: 13.5px; }
.log li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  padding: calc(var(--row-pad) * 0.72) 0;
  border-top: 1px solid var(--hairline);
}
.log li:last-child { border-bottom: 1px solid var(--hairline); }
.log .d { color: var(--muted); }
.log .e { color: var(--fg); line-height: 1.65; }

/* ---------- studio ---------- */

.studio-panel {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent);
  padding: clamp(28px, 4vw, 44px);
}
.studio-panel__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 18px;
}
.studio-panel h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(19px, 2.4vw, 25px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.studio-panel p { color: var(--muted); font-size: 14.5px; max-width: var(--measure); }

.studio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}
.studio-slot {
  border: 1px dashed var(--hairline);
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Condensed "projects coming soon" placeholder — a quiet centred row of dots
   that stands in for the project grid until real client work is added. */
.studio-soon {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 40px 0 4px;
}
.studio-soon span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hairline);
}
.studio-panel .placeholder-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 22px;
  text-align: center;
}

/* ---------- colophon ---------- */

.colophon { padding-bottom: 90px; }
.colophon__grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.colophon__lines { font-family: var(--font-mono); font-size: 13px; color: var(--muted); line-height: 2.1; }
.colophon__lines a { color: var(--fg); }
.colophon__mark { width: 52px; }
.colophon__mark svg, .colophon__mark img { display: block; width: 100%; height: auto; }
.colophon .meander-rule { margin-top: 56px; }
.colophon__year {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-align: center;
  margin-top: 26px;
}

/* ---------- dial mark ---------- */

.dial-ring { stroke: var(--fg); }
.dial-sweep { stroke: var(--accent); }
.dial-hand { stroke: var(--accent); }
.dial-tick { stroke: var(--muted); }

/* ---------- mobile ---------- */

@media (max-width: 720px) {
  :root { --spine-w: 46px; --rail-gutter: 46px; }

  .spine { padding: 16px 0; }
  .spine__mark { width: 30px; height: 30px; margin-left: calc((var(--rail-gutter) - 30px) / 2); }
  .spine__num-label,
  .spine__page-label { display: none; }

  /* mobile nav: the thin glyph rail taps OPEN to a labeled drawer so you can see
     where you are; smooth width transition, overlays the content. (jay 2026-06-19) */
  .spine { transition: width .28s cubic-bezier(.4,0,.2,1), box-shadow .28s ease; }
  .spine--open { width: min(78vw, 232px); box-shadow: 16px 0 46px rgba(0,0,0,.5); }
  .spine--open .spine__page-label,
  .spine--open .spine__num-label { display: inline-block; }
  .spine__toggle {
    display: flex; align-items: center; justify-content: center;
    width: calc(var(--spine-w) - 12px); height: 32px; margin: 2px 6px 6px; flex: none;
    border: 1px solid var(--hairline); border-radius: 8px; background: none;
    color: var(--muted); cursor: pointer;
  }
  .spine__toggle:hover { color: var(--fg); border-color: var(--accent); }
  .spine__toggle svg { width: 13px; height: 13px; transition: transform .28s ease; }
  .spine--open .spine__toggle svg { transform: rotate(180deg); }
  .spine-backdrop {
    display: block; position: fixed; inset: 0; z-index: 9; background: rgba(0,0,0,.5);
    opacity: 0; pointer-events: none; transition: opacity .28s ease;
  }
  .spine-backdrop.is-on { opacity: 1; pointer-events: auto; }
  .spine__line { margin: 14px 0; }
  .spine__num { font-size: 11px; }

  .stele { padding: 0 18px 0 22px; }

  .wordmark { font-size: clamp(34px, 11.5vw, 60px); }

  .codex__row { grid-template-columns: 1fr; gap: 4px; padding-left: 14px; }
  .codex__desc { grid-column: 1; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .studio-grid { grid-template-columns: 1fr; }
  .term { gap: 10px; }
}
