/* i3AI design layer — restrained editorial, in the register serious research
 * institutes present themselves: light paper, a refined serif, generous
 * whitespace, one muted accent used only where it earns attention. Loaded
 * after tailwind.css. A quiet dark variant is available via the toggle. */

:root {
  /* light (primary) */
  --paper:   #ffffff;
  --paper-2: #f4f4f5;
  --ink:     #1e293b;
  --ink-2:   #475569;
  --ink-3:   #64748b;
  --accent:  #a8452a;   /* muted terracotta, a serious reading of the brand orange */
  --accent-2:#863a22;
  --line:    rgba(15,23,42,0.12);
  --line-2:  rgba(15,23,42,0.20);
  --focus:   #a8452a;

  /* Source Sans Pro / Source Code Pro — the site's tuned typography */
  --font-serif: "Source Sans Pro", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-sans:  "Source Sans Pro", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:  "Source Code Pro", ui-monospace, "SFMono-Regular", monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 160ms;
  --maxw: 60rem;      /* generous outer bound */
  --measure: 37rem;   /* reading measure */
}

/* ---------- base ---------- */
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body.body-font, body {
  background: var(--paper); color: var(--ink); font-family: var(--font-serif);
}
::selection { background: color-mix(in oklab, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
img { border-radius: 0; }  /* neutralize the legacy global img rounding */

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--line); }
.masthead__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; position: relative;
}
.masthead__brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.masthead__logo { height: 26px; width: auto; display: block; }
.masthead__word { font-family: var(--font-sans); font-weight: 600; letter-spacing: .01em; font-size: 1.02rem; }
.masthead__nav { display: flex; align-items: center; gap: .2rem; flex-wrap: wrap; }
.nav-link {
  font-family: var(--font-sans); font-size: .84rem; font-weight: 450; letter-spacing: .005em;
  color: var(--ink-2); text-decoration: none; padding: .4rem .6rem; border-radius: 6px; white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--accent); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-left: .3rem; padding: 0; background: transparent;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.theme-toggle svg { width: 17px; height: 17px; display: block; }
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

@media (max-width: 700px) {
  .masthead__inner { flex-wrap: wrap; gap: .6rem; }
  .masthead__nav { width: 100%; gap: 0 .1rem; }
  .nav-link { padding: .4rem .5rem .4rem 0; }
  .theme-toggle { position: absolute; top: 1.25rem; right: 1.5rem; margin: 0; }
}

/* ---------- shell ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }
.breadcrumb { font-family: var(--font-sans); font-size: .82rem; }
.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- long-form document ---------- */
.doc { font-size: 1.2rem; line-height: 1.6; }
.doc-title {
  font-family: var(--font-serif); font-weight: 300; font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  line-height: 1.12; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance;
  margin: .1rem 0 .4rem; overflow-wrap: anywhere;
}
.doc > p:first-of-type { color: var(--ink-2); }
.doc p { color: var(--ink); max-width: var(--measure); margin: 1.15em 0; text-wrap: pretty; }
.doc h2 {
  font-family: var(--font-serif); font-weight: 300; font-size: clamp(1.5rem, 1.15rem + 1.1vw, 1.9rem);
  line-height: 1.25; letter-spacing: -0.006em; color: var(--ink); margin: 2.6rem 0 .8rem; text-wrap: balance;
  overflow-wrap: anywhere;
}
.doc h3 { font-family: var(--font-serif); font-weight: 400; font-size: 1.3rem; color: var(--ink); margin: 2rem 0 .5rem; }
.doc h4 { font-family: var(--font-sans); font-weight: 600; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin: 1.7rem 0 .5rem; }
.doc strong { font-weight: 600; }
.doc em { font-style: italic; }
.doc a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 35%, transparent); text-underline-offset: 2.5px; text-decoration-thickness: 1px; transition: text-decoration-color var(--dur) var(--ease); }
.doc a:hover { text-decoration-color: var(--accent); }
.doc ul, .doc ol { max-width: var(--measure); margin: 1.1em 0; padding-left: 1.3em; }
.doc ul { list-style: none; } .doc ol { list-style: decimal; }
.doc ul > li { position: relative; }
.doc ul > li::before { content: ""; position: absolute; left: -1.05em; top: .72em; width: .3em; height: .3em; border-radius: 50%; background: var(--ink-3); }
.doc li { margin: .45em 0; }
.doc ol li::marker { color: var(--ink-3); }
.doc blockquote { margin: 1.8rem 0; padding: .2rem 0 .2rem 1.4rem; max-width: var(--measure); border-left: 2px solid var(--line-2); font-style: italic; color: var(--ink-2); }
.doc blockquote p { margin: .4em 0; max-width: none; }
.doc hr { border: 0; height: 1px; background: var(--line); margin: 3rem 0; }
.doc code { font-family: var(--font-mono); font-size: .86em; background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }
/* home visual: the traveling-waves gif inside the Pattern Machine cell, never upscaled (asset is 432px wide) */
.doc .stack__fig { margin: .9rem 0 0; }
.doc .wave-gif { display: block; width: 100%; max-width: 288px; height: auto; border-radius: 4px; outline: 1px solid var(--line); outline-offset: -1px; }
.doc .wave-cap { display: block; font-family: var(--font-sans); font-size: .8rem; line-height: 1.4; color: var(--ink-3); margin-top: .5rem; max-width: 288px; }
.doc img { border-radius: 6px; outline: 1px solid var(--line); outline-offset: -1px; max-width: 100%; height: auto; }
/* the wordmark: left aligned on the same edge as the masthead and the text below it;
   a light backing in dark mode since the asset is dark-on-transparent */
.doc .banner-wrap { max-width: 260px; margin: 0 0 2.75rem; }
@media (max-width: 600px) { .doc .banner-wrap { max-width: 210px; margin-bottom: 2rem; } }
.doc .banner-wrap .banner-logo { display: block; width: 100%; height: auto; outline: none; border-radius: 0; }
:root[data-theme="dark"] .doc .banner-wrap { background: #f7f5f0; padding: 1rem 1.25rem; border-radius: 10px; box-sizing: border-box; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .doc .banner-wrap { background: #f7f5f0; padding: 1rem 1.25rem; border-radius: 10px; box-sizing: border-box; } }
.doc .text-sm.text-center { font-family: var(--font-sans); font-size: .8rem; color: var(--ink-3); }
.doc table { width: 100%; border-collapse: collapse; margin: 1.8rem 0; font-size: .98rem; }
.doc thead th { font-family: var(--font-sans); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.doc tbody td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc tbody tr:last-child td { border-bottom: 0; }

/* ---------- home: quiet, substance-forward ---------- */
.doc .lede { max-width: 34rem; }
.doc .lede__q {
  font-family: var(--font-serif); font-weight: 300; font-size: clamp(2.1rem, 1.4rem + 2.9vw, 3.4rem);
  line-height: 1.1; letter-spacing: -0.015em; color: var(--ink); text-wrap: balance; margin: 0 0 1.6rem; max-width: 16ch;
  overflow-wrap: anywhere;
}
.doc .lede__body { font-size: 1.2rem; line-height: 1.66; color: var(--ink-2); max-width: var(--measure); margin: 0 0 1.15em; }
.doc .lede__body strong { color: var(--ink); font-weight: 600; }

/* conscious vs sentient: the two terms the position rests on */
.doc .terms { max-width: var(--measure); margin: 1.4rem 0 1.6rem; padding: .15rem 0 .15rem 1.2rem; border-left: 2px solid var(--accent); }
.doc .terms__row { display: grid; grid-template-columns: 10.5rem 1fr; gap: .15rem 1rem; padding: .4rem 0; }
.doc .terms dt { font-weight: 600; font-size: 1.12rem; color: var(--ink); }
.doc .terms dd { margin: 0; font-size: 1.12rem; line-height: 1.55; color: var(--ink-2); }

.doc .home-section { margin-top: 4.5rem; }
.doc .home-h { font-weight: 300; font-size: clamp(1.5rem, 1.15rem + 1.1vw, 1.9rem); line-height: 1.25; margin: 0 0 .5rem; }
.doc .home-intro { color: var(--ink-2); margin: 0 0 1.6rem; }

/* progression of agency: a real sequence, so an ordered row of steps on one rule;
   the last, hypothesized step is drawn dashed */
.doc .ladder { list-style: none; padding: 0; margin: 1.8rem 0 2rem; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 1.25rem; max-width: none; }
.doc .ladder__step { position: relative; display: flex; flex-direction: column; gap: .3rem; padding-top: 1.35rem; border-top: 2px solid var(--line-2); margin: 0; }
.doc .ladder__step::before { content: ""; position: absolute; top: -.4rem; left: 0; width: .7rem; height: .7rem; border-radius: 50%; background: var(--ink-3); }
.doc .ladder__step--hyp { border-top-style: dashed; border-top-color: var(--accent); }
.doc .ladder__step--hyp::before { background: var(--paper); box-shadow: inset 0 0 0 2px var(--accent); }
.doc .ladder__name { font-family: var(--font-sans); font-weight: 600; font-size: 1rem; line-height: 1.3; color: var(--ink); }
.doc .ladder__step--hyp .ladder__name { color: var(--accent); }
.doc .ladder__desc { font-size: .95rem; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 860px) {
  .doc .ladder { grid-template-columns: 1fr; gap: 0; }
  .doc .ladder__step { border-top: 0; border-left: 2px solid var(--line-2); padding: 0 0 1.2rem 1.4rem; }
  .doc .ladder__step::before { top: .35rem; left: -.45rem; }
  .doc .ladder__step--hyp { border-left-style: dashed; border-left-color: var(--accent); padding-bottom: .2rem; }
}

/* the research program as one figure: theory, then architecture, then two substrates side by side */
.doc .stack { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.doc .stack__layer { display: grid; }
.doc .stack__layer + .stack__layer { border-top: 1px solid var(--line-2); }
.doc .stack__cells { display: grid; }
.doc .stack__cells--pair { grid-template-columns: 1fr 1fr; }
.doc .stack__cells--pair > .stack__cell + .stack__cell { border-left: 1px solid var(--line); }
.doc a.stack__cell { display: flex; flex-direction: column; gap: .35rem; padding: 1.5rem 1.6rem; font-weight: 400; color: inherit; text-decoration: none; transition: background-color var(--dur) var(--ease); }
.doc a.stack__cell:hover { text-decoration: none; background: color-mix(in oklab, var(--paper-2) 70%, transparent); }
.doc a.stack__cell:hover .stack__name { color: var(--accent); }
.doc a.stack__cell:focus-visible { outline-offset: -3px; }
.doc .stack__kind { font-family: var(--font-sans); font-size: .84rem; color: var(--ink-3); }
.doc .stack__name { font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.008em; color: var(--ink); transition: color var(--dur) var(--ease); }
.doc .stack__desc { font-size: 1.02rem; line-height: 1.55; color: var(--ink-2); max-width: var(--measure); }
.doc .stack__status { display: inline-flex; align-items: baseline; gap: .5rem; margin-top: .35rem; font-family: var(--font-sans); font-size: .86rem; color: var(--ink-2); }
.doc .stack__status::before { content: ""; flex: none; width: .45rem; height: .45rem; border-radius: 50%; background: var(--ink-3); transform: translateY(-.05rem); }
.doc .stack__cell--focus .stack__status::before { background: var(--accent); }

@media (max-width: 640px) {
  .doc .terms__row { grid-template-columns: 1fr; }
  .doc .stack__cells--pair { grid-template-columns: 1fr; }
  .doc .stack__cells--pair > .stack__cell + .stack__cell { border-left: 0; border-top: 1px solid var(--line); }
  .doc a.stack__cell { padding: 1.25rem 1.2rem; }
}

/* writing / publications */
.doc .pubs { display: flex; flex-direction: column; }
.doc .pub { display: grid; grid-template-columns: 4.5rem 1fr; gap: .2rem 1.4rem; padding: 1.15rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.doc .pub:first-child { padding-top: 0; }
.doc .pub__year { font-family: var(--font-sans); font-size: .84rem; color: var(--ink-3); }
.doc .pub__title { font-size: 1.08rem; line-height: 1.4; color: var(--ink); margin: 0; }
.doc .pub__title a { color: var(--ink); text-decoration-color: var(--line-2); }
.doc .pub__title a:hover { color: var(--accent); }
.doc .pub__meta { grid-column: 2; font-family: var(--font-sans); font-size: .84rem; color: var(--ink-3); margin: .25rem 0 0; }

/* ---------- footer ---------- */
.closing { border-top: 1px solid var(--line); margin-top: 5rem; }
.closing__inner { max-width: var(--maxw); margin: 0 auto; padding: 2.2rem 1.5rem 3rem; display: flex; flex-wrap: wrap; gap: .6rem 2rem; align-items: baseline; justify-content: space-between; font-family: var(--font-sans); font-size: .84rem; color: var(--ink-3); }
.closing__inner a { color: var(--ink-2); text-decoration: none; }
.closing__inner a:hover { color: var(--accent); }
.closing__meta { color: var(--ink-3); }

/* ---------- motion: only hover/focus feedback; content never starts hidden ---------- */
@media (prefers-reduced-motion: reduce) { .nav-link, .doc a, .doc .stack__name, .theme-toggle { transition: none; } }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .page { padding: 2.5rem 1.25rem 3.5rem; }
  .doc .pub { grid-template-columns: 1fr; gap: .1rem; }
  .doc .pub__meta { grid-column: 1; }
}

/* =========================================================
   Dark variant — a quiet, warm dark editorial (not neon).
   Default = light. Auto-dark when the OS prefers it and the
   visitor hasn't chosen; the toggle's data-theme wins.
   ========================================================= */
:root[data-theme="dark"] {
  --paper:   #1a1815;
  --paper-2: #232019;
  --ink:     #ece7dd;
  --ink-2:   #a7a196;
  --ink-3:   #726c61;
  --accent:  #d0774e;
  --accent-2:#e08a63;
  --line:    rgba(255,255,255,0.11);
  --line-2:  rgba(255,255,255,0.20);
  --focus:   #d0774e;
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #1a1815; --paper-2: #232019;
    --ink: #ece7dd; --ink-2: #a7a196; --ink-3: #726c61;
    --accent: #d0774e; --accent-2: #e08a63;
    --line: rgba(255,255,255,0.11); --line-2: rgba(255,255,255,0.20); --focus: #d0774e;
  }
  :root:not([data-theme]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: block; }
}
