/* DIGS AI - site styles. Vanilla CSS, no build step.
   Visual system: warm stone neutrals, one clay accent, serif headings (Newsreader),
   grotesque text (Instrument Sans), system mono for annotations and numbers. */

:root {
  --bg: #f6f4ef;
  --bg-elev: #fcfbf8;
  --fg: #1b1a17;
  --fg-muted: #5b574f;
  --line: #dad5cb;
  --line-strong: #b3ac9f;
  --accent: #9c4f14;
  --accent-fg: #ffffff;
  --soft: #edeae3;

  /* The dark "inside the perimeter" band. */
  --band-bg: #1b1a17;
  --band-elev: #24221e;
  --band-fg: #ece8e0;
  --band-muted: #aaa398;
  --band-line: #34312c;
  --band-line-strong: #57524a;
  --band-accent: #e4a65e;
  --band-accent-fg: #1b1a17;

  --max: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --radius: 6px;
  --font: "Instrument Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131210;
    --bg-elev: #1b1a17;
    --fg: #ebe7df;
    --fg-muted: #a8a196;
    --line: #2b2925;
    --line-strong: #4d483f;
    --accent: #e3a45c;
    --accent-fg: #131210;
    --soft: #1e1d1a;

    --band-bg: #1c1b18;
    --band-elev: #262420;
    --band-fg: #ebe7df;
    --band-muted: #a8a196;
    --band-line: #383530;
    --band-line-strong: #5a554d;
    --band-accent: #e3a45c;
    --band-accent-fg: #131210;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
@media (max-width: 600px) {
  body { font-size: 16px; }
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.6rem, 1.4rem + 4.8vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 12.5em;
}
h2 {
  font-size: clamp(1.85rem, 1.2rem + 2.2vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 17em;
}
h3 {
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); flex: none; display: block; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  padding-top: 2px;
}
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--fg-muted); font-size: 0.92rem; letter-spacing: 0.01em; }
.site-nav a:hover { color: var(--fg); text-decoration: none; }
@media (max-width: 720px) {
  .site-nav { display: none; }
}

/* Sections */
section { padding: clamp(64px, 9vw, 120px) 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
section[id] { scroll-margin-top: 72px; }

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-muted);
  margin-bottom: 22px;
}
.kicker::before { content: ""; width: 22px; height: 1px; background: var(--accent); flex: none; }

.lead {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 34em;
}

/* Hero: headline top-left, deck bottom-right */
.hero { padding-top: clamp(80px, 12vw, 160px); padding-bottom: clamp(72px, 10vw, 140px); }
.hero h1 { margin-bottom: 0; }
.hero-deck {
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--line);
}
.hero .lead { max-width: 36em; }
@media (min-width: 960px) {
  .hero-deck { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
  .hero-deck .lead { grid-column: 6 / 13; }
}

/* Steps: numbered columns on hairlines, no boxes */
.steps {
  list-style: none;
  padding: 0;
  margin: clamp(40px, 6vw, 72px) 0 0;
  display: grid;
  gap: 36px 32px;
  grid-template-columns: 1fr;
}
.step-item {
  border-top: 1px solid var(--line-strong);
  padding-top: 20px;
  display: grid;
  grid-template-columns: 76px 1fr;
  column-gap: 12px;
}
.step-item .step {
  grid-row: 1 / 3;
  font-family: var(--mono);
  font-size: 2.25rem;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin-top: 0.04em;
}
.step-item h3 { margin-bottom: 0.4em; }
.step-item p { color: var(--fg-muted); font-size: 0.97rem; grid-column: 2; }
@media (min-width: 620px) {
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 32px; }
  .step-item { display: block; }
  .step-item .step { display: block; font-size: 3rem; margin: 0 0 clamp(40px, 5vw, 64px); }
}

/* Dark band: same components, swapped tokens */
.band {
  --bg: var(--band-bg);
  --bg-elev: var(--band-elev);
  --fg: var(--band-fg);
  --fg-muted: var(--band-muted);
  --line: var(--band-line);
  --line-strong: var(--band-line-strong);
  --accent: var(--band-accent);
  --accent-fg: var(--band-accent-fg);
  --soft: var(--band-elev);
  background: var(--bg);
  color: var(--fg);
  border-bottom: 0;
}

/* Two-column text block */
.cols {
  display: grid;
  gap: 48px;
  grid-template-columns: 1fr;
  margin-top: clamp(32px, 5vw, 56px);
  align-items: start;
}
.cols-text p { max-width: 32em; }
@media (min-width: 900px) {
  .cols { grid-template-columns: 1fr 1fr; gap: clamp(48px, 7vw, 96px); }
}

/* Bullet list */
.facts { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 12px; }
.facts li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 14px;
  align-items: start;
}
.facts li::before {
  content: "";
  width: 16px;
  height: 1px;
  margin-top: 0.8em;
  background: var(--accent);
}

/* Perimeter schematic (inline SVG) */
.perimeter { margin: 0; }
.perimeter svg { display: block; width: 100%; height: auto; }
.perimeter .fence { fill: none; stroke: var(--line-strong); stroke-width: 1.25; stroke-dasharray: 5 4; }
.perimeter .hatch-line { stroke: var(--line); stroke-width: 1; }
.perimeter .label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  fill: var(--fg-muted);
}
.perimeter .label.accent { fill: var(--accent); }
.perimeter .node rect { fill: var(--bg-elev); stroke: var(--line-strong); stroke-width: 1; }
.perimeter .node text, .perimeter .model-title { font-family: var(--font); font-size: 14px; fill: var(--fg); }
.perimeter .model rect { fill: var(--bg-elev); stroke: var(--accent); stroke-width: 1.5; }
.perimeter .model-title { font-weight: 600; }
.perimeter .link path { fill: none; stroke: var(--fg-muted); stroke-width: 1.25; }
.perimeter .link circle { fill: var(--fg-muted); }
.perimeter .block path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }

.note {
  margin-top: 28px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Expertise metrics: a ruled row of large numbers */
.metrics {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: clamp(36px, 5vw, 56px);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}
.metric { padding: 24px 0; border-top: 1px solid var(--line); }
.metric:first-child { border-top: 0; }
.metric b {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(2.4rem, 2rem + 2vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  word-spacing: -0.3em;
  margin-bottom: 10px;
}
.metric span { display: block; color: var(--fg-muted); font-size: 0.95rem; max-width: 18em; }
@media (min-width: 700px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metric { border-top: 0; padding: 32px 28px; border-left: 1px solid var(--line); }
  .metric:first-child { padding-left: 0; border-left: 0; }
}
#expertise .note { margin-top: 24px; }

/* Task cards */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  margin-top: clamp(36px, 5vw, 56px);
}
@media (min-width: 620px) and (max-width: 879px) {
  .card { display: grid; grid-template-columns: 1fr 1.5fr; column-gap: 32px; align-items: start; }
  .card .index { grid-column: 1 / -1; margin-bottom: 20px; }
  .card h3 { margin: 0; }
}
@media (min-width: 880px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px 30px;
}
.card:hover { border-color: var(--line-strong); }
.card .index {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: var(--fg-muted);
  margin-bottom: 40px;
}
.card h3 { margin-bottom: 0.5em; }
.card p { color: var(--fg-muted); font-size: 0.97rem; }

/* Contact (reserved, no markup on the page yet) */
.contact .email {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--fg);
  max-width: 100%;
  word-break: break-all;
}
.contact .email:hover { border-color: var(--accent); text-decoration: none; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.footer-brand .brand-mark { color: var(--fg-muted); }
.lang-switch { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0; }
.lang-switch a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
}
.lang-switch a:hover { color: var(--fg); text-decoration: none; }
.lang-switch a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-fg);
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  a, .card { transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
