/* ============================================================
   AI ADVANCED INC — THEME
   Identity Rev B. Paper, ink, one spot. Built on tokens.css.
   The page is a plate: rules, not boxes; type, not chrome.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-serif);
  font-size: var(--fs-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
::selection { background: var(--c-cyan); color: var(--c-paper); }

:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 3px; }

/* ============================================================
   TYPOGRAPHY — one family, doing everything
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--f-serif);
  font-weight: var(--w-semi);
  letter-spacing: var(--ls-heading);
  line-height: var(--lh-tight);
  color: var(--c-ink);
  margin: 0 0 var(--s-5);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-snug); }
h3 { font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -0.01em; }

p { margin: 0 0 var(--s-5); color: var(--c-ink-70); max-width: var(--w-text); }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--c-ink);
  max-width: 52ch;
}

strong { color: var(--c-ink); font-weight: var(--w-semi); }
em, i { font-style: italic; color: inherit; }          /* the italic is the voice */
a { color: var(--c-cyan); text-decoration: none; }
a:hover { color: var(--c-cyan-deep); text-decoration: underline; text-underline-offset: 3px; }

/* Spec label — the small tracked caps that annotate every plate */
.spec {
  display: block;
  font-size: var(--fs-spec);
  font-weight: var(--w-semi);
  letter-spacing: var(--ls-spec);
  text-transform: uppercase;
  color: var(--c-cyan);
  margin: 0 0 var(--s-3);
}
.spec--ink { color: var(--c-ink); }
.spec--quiet { color: var(--c-ink-45); font-weight: var(--w-medium); }
.spec--magenta { color: var(--c-magenta); }

.caption { font-size: var(--fs-xs); color: var(--c-ink-45); margin: var(--s-3) 0 0; max-width: 60ch; }

.pull {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: var(--w-regular);
  font-size: clamp(1.375rem, 2.6vw, 2.125rem);
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--c-ink);
  max-width: 26ch;
  margin: 0;
}
.pull--roman { font-style: normal; font-weight: var(--w-semi); }

/* Display pull — a closing statement that carries a plate on its own,
   with no spec label above it to share the weight. Quote marks hang
   into the margin where supported, so the text edge stays flush. */
.pull--display {
  font-size: clamp(2rem, 4.8vw, 3.75rem);
  font-weight: var(--w-medium);
  line-height: 1.14;
  letter-spacing: -0.028em;
  max-width: 21ch;
  hanging-punctuation: first last;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.wrap {
  width: 100%; max-width: var(--w-page);
  margin-inline: auto; padding-inline: var(--gutter);
  position: relative; z-index: var(--z-content);
}
.wrap--narrow { max-width: var(--w-narrow); }

.band { padding-block: clamp(56px, 8.5vw, 128px); }
.band--tight { padding-block: clamp(40px, 5.5vw, 80px); }
.band--rule { border-top: var(--bw) solid var(--c-rule); }
.band--sunk { background: var(--c-paper-sunk); }
/* Reversed band. Pair with data-surface="ink" on the same element:
   the token file flips ink and paper, so everything below inherits
   correctly and nothing needs a hard-coded colour. */
.band--ink { background: var(--c-paper); color: var(--c-ink); }

.split { display: grid; grid-template-columns: minmax(0,4fr) minmax(0,7fr); gap: clamp(28px,5vw,80px); align-items: start; }
.split--even { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 820px) { .split, .split--even { grid-template-columns: 1fr; } }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(28px,4vw,56px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(28px,4vw,56px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: clamp(24px,3vw,44px); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stack > * + * { margin-top: var(--s-5); }
.section-head { max-width: 60ch; margin-bottom: clamp(36px, 5vw, 64px); }

/* Section opener — a numbered chip and a heading, as in the plates */
.opener { display: flex; align-items: baseline; gap: var(--s-4); margin-bottom: var(--s-5); }
.opener__n {
  flex: none;
  display: inline-block;
  background: var(--c-cyan);
  color: var(--c-paper);
  font-size: 0.625rem;
  font-weight: var(--w-semi);
  letter-spacing: 0.1em;
  padding: 4px 7px 3px;
  transform: translateY(-2px);
}
.opener__n--ink { background: var(--c-ink); }
.opener h2 { margin: 0; }

/* ============================================================
   MASTHEAD / NAV — a rule, a row, a rule
   ============================================================ */

.masthead { background: var(--c-paper); position: sticky; top: 0; z-index: var(--z-nav); }
.masthead__rule { height: 3px; background: var(--c-ink); }
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-6);
  padding-block: 14px;
  border-bottom: var(--bw) solid var(--c-ink);
}
.lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--c-ink); }
.lockup__mark { width: 21px; height: auto; flex: none; fill: currentColor; }
.lockup__name {
  font-size: 0.9375rem;
  font-weight: var(--w-semi);
  letter-spacing: var(--ls-wordmark);
  text-transform: uppercase;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); }
.nav a {
  font-size: var(--fs-sm);
  color: var(--c-ink-70);
  padding-block: 2px;
  border-bottom: var(--bw-heavy) solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.nav a:hover { color: var(--c-ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--c-ink); border-bottom-color: var(--c-cyan); }
.nav a.is-contact { color: var(--c-cyan); }
/* Narrow: the masthead becomes two rules and two rows. */
@media (max-width: 680px) {
  .masthead__inner {
    display: block;
    padding-block: 10px 0;
    border-bottom: none;
  }
  .nav {
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-block: 7px;
    border-top: var(--bw) solid var(--c-rule);
    border-bottom: var(--bw) solid var(--c-ink);
  }
  .nav a { font-size: var(--fs-xs); }
}
/* Narrowest phones: five items wrap onto a second line rather than overflow. */
@media (max-width: 430px) {
  .nav { flex-wrap: wrap; justify-content: flex-start; gap: 4px var(--s-4); }
}

/* Running head — the three-part strip used inside pages */
.runhead {
  display: flex; justify-content: space-between; gap: var(--s-5);
  font-size: var(--fs-spec); font-weight: var(--w-medium);
  letter-spacing: var(--ls-spec); text-transform: uppercase;
  color: var(--c-ink-45);
  padding-block: 10px;
  border-bottom: var(--bw) solid var(--c-rule);
}
.runhead b { color: var(--c-cyan); font-weight: var(--w-semi); }
@media (max-width: 700px) { .runhead span:nth-child(2) { display: none; } }

/* ============================================================
   HERO
   ============================================================ */

.hero { padding-block: clamp(56px, 9vw, 132px) clamp(48px, 7vw, 104px); }
.hero__title {
  font-size: var(--fs-display);
  line-height: 0.98;
  max-width: 14ch;
  margin-bottom: var(--s-6);
}
.hero__title em { font-style: italic; }
.hero__grid { display: grid; grid-template-columns: minmax(0,7fr) minmax(0,5fr); gap: clamp(28px,5vw,72px); align-items: end; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; align-items: start; } }
.hero__figure { display: flex; justify-content: flex-end; }
.hero__figure svg { width: min(230px, 42vw); height: auto; fill: var(--c-ink); }
@media (max-width: 900px) { .hero__figure { justify-content: flex-start; } .hero__figure svg { width: 130px; } }

.pagehead { padding-block: clamp(48px, 7vw, 104px) clamp(32px, 4vw, 56px); border-bottom: var(--bw) solid var(--c-ink); }
.pagehead h1 { max-width: 17ch; }

/* ============================================================
   PLATE ITEMS — figure, spec label, description
   ============================================================ */

.item { border-top: var(--bw-heavy) solid var(--c-ink); padding-top: var(--s-4); }
.item--hair { border-top-width: var(--bw); border-top-color: var(--c-rule); }
.item h3 { margin-bottom: var(--s-2); }
.item p { font-size: var(--fs-sm); margin: 0; }
/* Plate figure. Each SVG carries its own fill and stroke — do not
   set them here, or the presentation attributes get overridden. */
.item__fig { height: 72px; display: flex; align-items: flex-end; margin-bottom: var(--s-5); }
.item__fig svg { height: 56px; width: auto; }

/* Band figure — a full-width diagram set between two passages of text.
   A class rather than an inline style: the CSP forbids inline styles. */
.fig { margin: clamp(40px, 6vw, 72px) 0 clamp(36px, 5vw, 64px); }
.fig svg { display: block; }

/* Rows — enumerated arguments, as in the study */
.rows { border-top: var(--bw) solid var(--c-ink); }
.row {
  display: grid; grid-template-columns: 60px minmax(0,20ch) minmax(0,1fr);
  gap: var(--s-5);
  padding-block: var(--s-5);
  border-bottom: var(--bw) solid var(--c-rule);
  align-items: baseline;
}
.row__n { font-size: var(--fs-spec); font-weight: var(--w-semi); letter-spacing: var(--ls-spec); color: var(--c-cyan); text-transform: uppercase; }
.row__t { font-weight: var(--w-semi); letter-spacing: -0.01em; font-size: 1.0625rem; }
.row__d { font-size: var(--fs-sm); color: var(--c-ink-70); margin: 0; }
@media (max-width: 760px) {
  .row { grid-template-columns: 48px 1fr; gap: var(--s-2) var(--s-4); }
  .row__d { grid-column: 2; margin-top: var(--s-2); }
}

/* Two-column comparison — machine and human */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: var(--bw-heavy) solid var(--c-ink); }
.compare__col { padding: var(--s-5) var(--s-6) var(--s-6) 0; }
.compare__col + .compare__col { padding-left: var(--s-6); border-left: var(--bw) solid var(--c-rule); }
.compare h3 { margin-bottom: var(--s-4); }
.compare ul { list-style: none; margin: 0; padding: 0; }
.compare li { font-size: var(--fs-sm); color: var(--c-ink-70); padding-block: var(--s-3); border-top: var(--bw) solid var(--c-rule-soft); }
.compare li:first-child { border-top: none; }
@media (max-width: 760px) {
  .compare { grid-template-columns: 1fr; }
  .compare__col + .compare__col { padding-left: 0; border-left: none; border-top: var(--bw) solid var(--c-rule); padding-top: var(--s-5); }
  .compare__col { padding-right: 0; }
}

/* Definition — set in the cyan tint, once per page */
.definition { background: var(--c-cyan-tint); padding: clamp(24px,3.5vw,44px); }
.definition__term { font-size: clamp(1.5rem,2.6vw,2.125rem); font-weight: var(--w-semi); letter-spacing: var(--ls-heading); margin-bottom: var(--s-3); }
.definition__term i { font-style: italic; font-weight: var(--w-regular); color: var(--c-ink-45); font-size: 0.6em; margin-left: var(--s-3); }
.definition p { color: var(--c-ink); font-size: var(--fs-lead); line-height: 1.5; max-width: 58ch; }
.definition .formula { display: inline-block; margin-top: var(--s-5); font-weight: var(--w-semi); letter-spacing: 0.01em; color: var(--c-cyan-deep); border-top: var(--bw) solid var(--c-cyan); border-bottom: var(--bw) solid var(--c-cyan); padding: var(--s-2) 0; }

/* Sector plate */
.sector { border-top: var(--bw-heavy) solid var(--c-ink); padding-top: var(--s-4); }
.sector h3 { margin-bottom: var(--s-2); }
.sector p { font-size: var(--fs-sm); margin: 0; }
.sector__meta { display: block; margin-top: var(--s-4); font-size: var(--fs-spec); letter-spacing: var(--ls-spec); text-transform: uppercase; color: var(--c-ink-45); font-weight: var(--w-medium); }

/* Note with a rule down its left side */
.note { border-left: var(--bw-heavy) solid var(--c-ink); padding-left: var(--s-5); }
.note--cyan { border-left-color: var(--c-cyan); }
.note--magenta { border-left-color: var(--c-magenta); }
.note h3 { font-size: 1.0625rem; margin-bottom: var(--s-2); }
.note p { font-size: var(--fs-sm); margin: 0; }

/* Data table set as a plate */
.plate { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.plate th {
  text-align: left; font-weight: var(--w-semi); font-size: var(--fs-spec);
  letter-spacing: var(--ls-spec); text-transform: uppercase; color: var(--c-ink-45);
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  border-bottom: var(--bw-heavy) solid var(--c-ink);
}
.plate td { padding: var(--s-4) var(--s-4) var(--s-4) 0; border-bottom: var(--bw) solid var(--c-rule); color: var(--c-ink-70); vertical-align: top; }
.plate td:first-child { color: var(--c-ink); font-weight: var(--w-semi); width: 26%; }

/* Document plate — a published essay, set as an object you can pick up */
.doc { margin: 0; }
.doc__cover {
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--c-paper-raised);
  border: var(--bw-heavy) solid var(--c-ink);
  padding: clamp(20px, 3vw, 32px);
  aspect-ratio: 17 / 22;
}
.doc__mark { width: 30px; height: auto; fill: var(--c-ink); margin-bottom: auto; }
.doc__kicker, .doc__by {
  font-size: var(--fs-spec); letter-spacing: var(--ls-spec);
  text-transform: uppercase; color: var(--c-ink-45); font-weight: var(--w-medium);
}
.doc__title {
  font-size: clamp(1.625rem, 3vw, 2.25rem); font-weight: var(--w-semi);
  letter-spacing: var(--ls-heading); line-height: var(--lh-snug); margin-top: var(--s-3);
}
.doc__title i { display: block; font-style: italic; font-weight: var(--w-regular); color: var(--c-cyan); }
.doc__sub { font-size: var(--fs-sm); color: var(--c-ink-70); margin-top: var(--s-3); }
.doc__by { width: 100%; margin-top: var(--s-5); padding-top: var(--s-3); border-top: var(--bw) solid var(--c-rule); }

.doc__meta {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--s-5);
  margin: 0; padding-top: var(--s-4); border-top: var(--bw-heavy) solid var(--c-ink);
}
.doc__meta dt { font-size: var(--fs-spec); letter-spacing: var(--ls-spec); text-transform: uppercase; color: var(--c-ink-45); font-weight: var(--w-medium); }
.doc__meta dd { margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--c-ink); }
@media (max-width: 420px) { .doc__meta { grid-template-columns: 1fr; } }

/* Contents — roman numeral against the section name */
.toc { list-style: none; margin: var(--s-4) 0 0; padding: 0; border-top: var(--bw) solid var(--c-ink); }
.toc li {
  display: grid; grid-template-columns: 3rem minmax(0,1fr); gap: var(--s-4);
  align-items: baseline; padding-block: var(--s-3);
  border-bottom: var(--bw) solid var(--c-rule-soft);
  font-size: var(--fs-sm); color: var(--c-ink-70);
}
.toc__n { font-size: var(--fs-spec); letter-spacing: var(--ls-spec); font-weight: var(--w-semi); color: var(--c-cyan); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-serif);
  font-size: var(--fs-sm); font-weight: var(--w-semi);
  letter-spacing: 0.02em;
  padding: 11px 20px;
  border: var(--bw) solid var(--c-ink);
  background: transparent; color: var(--c-ink);
  cursor: pointer;
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.btn:hover { background: var(--c-ink); color: var(--c-paper); text-decoration: none; }
.btn--primary { background: var(--c-ink); color: var(--c-paper); }
.btn--primary:hover { background: var(--c-cyan); border-color: var(--c-cyan); color: var(--c-paper); }
.btn__arrow { transition: transform var(--t-base) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ============================================================
   FORM
   ============================================================ */

.field { display: block; margin-bottom: var(--s-6); }
.field__label { display: block; font-size: var(--fs-spec); font-weight: var(--w-semi); letter-spacing: var(--ls-spec); text-transform: uppercase; color: var(--c-ink); margin-bottom: var(--s-2); }
.field__hint { display: block; font-size: var(--fs-xs); color: var(--c-ink-45); margin-top: var(--s-2); font-style: italic; }
.input, .textarea, .select {
  width: 100%;
  font-family: var(--f-serif); font-size: var(--fs-body); color: var(--c-ink);
  background: var(--c-paper-raised);
  border: var(--bw) solid var(--c-rule);
  border-bottom: var(--bw-heavy) solid var(--c-ink);
  padding: 11px 13px;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--c-cyan); background: #fff; }
.input::placeholder, .textarea::placeholder { color: var(--c-ink-25); font-style: italic; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--c-ink) 50%), linear-gradient(135deg, var(--c-ink) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.form-note { font-size: var(--fs-xs); color: var(--c-ink-45); font-style: italic; }

/* Guidance column alongside a long form stays with the reader. */
.aside-sticky { position: sticky; top: 92px; }
@media (max-width: 820px) { .aside-sticky { position: static; } }

/* ============================================================
   FOOTER
   ============================================================ */

.footer { border-top: 3px solid var(--c-ink); padding-block: var(--s-8) var(--s-6); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-6); }
@media (max-width: 820px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s-7) var(--s-5); } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }
.footer h4 { font-size: var(--fs-spec); font-weight: var(--w-semi); letter-spacing: var(--ls-spec); text-transform: uppercase; color: var(--c-ink-45); margin: 0 0 var(--s-4); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: var(--s-2); }
.footer li a, .footer li span { font-size: var(--fs-sm); color: var(--c-ink-70); }
.footer li a:hover { color: var(--c-cyan); }
.footer__line { font-style: italic; color: var(--c-ink-70); max-width: 30ch; margin: var(--s-4) 0 0; font-size: var(--fs-sm); }
.footer__base {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-4);
  margin-top: var(--s-8); padding-top: var(--s-4);
  border-top: var(--bw) solid var(--c-rule);
  font-size: var(--fs-spec); letter-spacing: var(--ls-spec); text-transform: uppercase; color: var(--c-ink-45);
}

/* ============================================================
   REVEAL — a plate does not animate; this is the one exception
   ============================================================ */

.reveal { opacity: 0; transform: translateY(10px); transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* Utilities */
.u-cyan { color: var(--c-cyan); }
.u-magenta { color: var(--c-magenta); }
.u-center { text-align: center; }
.u-mt-6 { margin-top: var(--s-6); }
.u-mt-7 { margin-top: var(--s-7); }
.u-mt-8 { margin-top: var(--s-8); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
