/*
  Lacuna Labs landing — stylesheet.

  Canon:
    research/lacuna-labs-did-v1.md      § Machine Data (palette, typography, geometry)
    research/lacuna-did-v1.md           § parent canon
    research/lacuna-did-v1.2-web-surface-rule.md   structural greys / interactive hue split
    research/lacuna-did-v1.4-geometry-naming-version.md   hard 90 corners brand-adjacent
    research/lacuna-canon-v0.4.0-visual-canon-rename.md   visual scope rule

  Per DID v1.2: Lacuna/Labs is the parent surface — no claimed hue.
  Structural elements use the canonical greys; interactive feedback falls back
  to the mid-grey since the parent claims no color. No --accent brass; no
  Sakura pink; no Fraunces. Geist Mono (SIL OFL) for the wordmark, Inter for
  body copy.
*/

/* Geist Mono — SIL OFL, served via Google Fonts. */
@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Canonical greys — DID-LACUNA-LABS-v1.0 § Color, light mode */
  --ink-light: #d4d4d4;        /* bar.square_1 / L*84 */
  --ink-mid:   #888888;        /* bar.square_2 / L*57 — invariant across modes */
  --ink-dark:  #1a1a1a;        /* bar.square_3 / L*10 / wordmark_fg */
  --slash:     #555555;        /* L*36 — constant across modes */
  --page-bg:   #fffaf3;        /* L*98 a*+1 b*+4 — soft warm white */

  /* Reading-surface neutrals derived from the bar tones (chrome only, no claim) */
  --tone-1:    #f1ece4;        /* card surface — between page-bg and ink-light */
  --tone-2:    #e6ddd0;        /* card hover / border axis */
  --rule:      #d4d4d4;        /* hairline rule == ink-light */

  /* Lacuna/Labs has no claimed hue. Interactive feedback uses the mid-grey
     per DID v1.2 ("bare-Lacuna and Lacuna/Labs ... fall back to the mid-grey
     for hover; this is intentional restraint, not a gap"). */
  --interactive: var(--ink-mid);

  /* Typography stacks — DID v1.0 § Typography */
  --mono: 'Geist Mono', ui-monospace, 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* SVG var bridge so the canonical assets read the page palette */
  --bar-1: var(--ink-light);
  --bar-2: var(--ink-mid);
  --bar-3: var(--ink-dark);
  --wordmark-fg: var(--ink-dark);

  /* Geometry — DID v1.4 lock: brand-adjacent chrome is hard 90 corners. */
  --radius-brand: 0;
  --radius-distant: 2px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode tones — DID-LACUNA-LABS-v1.0 § Color, dark mode */
    --ink-light: #2a2a2a;      /* bar.square_1 / L*16 */
    --ink-mid:   #888888;      /* bar.square_2 / L*57 — invariant */
    --ink-dark:  #fafafa;      /* bar.square_3 / L*98 / wordmark_fg */
    --slash:     #555555;
    --page-bg:   #0a0a0a;      /* lifted from #000 per Harrison 2002 halation */

    --tone-1:    #141414;
    --tone-2:    #1c1c1c;
    --rule:      #2a2a2a;

    --bar-1: var(--ink-light);
    --bar-2: var(--ink-mid);
    --bar-3: var(--ink-dark);
    --wordmark-fg: var(--ink-dark);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink-dark);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
}

/* ---------- Layout ---------- */

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}

.page--wide { max-width: 1080px; }

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 56px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav__home {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  text-decoration: none;
  color: var(--ink-dark);
}

.nav__home img {
  height: 24px;          /* DID v1.0 min_size: 24px tall on screen */
  width: auto;
  display: block;
}

.nav a {
  text-decoration: none;
  color: var(--ink-mid);
  padding: 4px 0;
  border-radius: var(--radius-brand);
  transition: color 120ms ease;
}

.nav a:hover,
.nav a.is-current {
  color: var(--ink-dark);
}

/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ink-dark);
  margin: 0;
  letter-spacing: -0.005em;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 16px;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
  margin: 56px 0 16px;
  font-weight: 500;
  text-transform: none;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 500;
  margin: 0 0 8px;
}

p {
  margin: 0 0 16px;
  color: var(--ink-dark);
  max-width: 66ch;
}

.lede {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-mid);
  margin: 0 0 40px;
  max-width: 66ch;
}

a {
  color: var(--ink-dark);
  text-decoration: underline;
  text-decoration-color: var(--ink-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 120ms ease;
}

a:hover { text-decoration-color: var(--ink-dark); }

a:focus-visible {
  outline: 2px solid var(--interactive);
  outline-offset: 2px;
  border-radius: var(--radius-brand);
}

code, kbd, samp, pre {
  font-family: var(--mono);
  font-size: 0.94em;
}

/* ---------- Hero ---------- */

.hero { padding: 8px 0 24px; }

.hero__lockup {
  display: block;
  width: 100%;
  max-width: 620px;          /* respects 660 viewBox */
  height: auto;
  margin: 0 0 40px;
}

.hero__positioning {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-dark);
  margin: 0 0 24px;
  max-width: 66ch;
}

.hero__caption {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-mid);
  margin: 0 0 32px;
  max-width: 66ch;
}

/* ---------- Section divider ---------- */

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 48px 0 32px;
}

/* ---------- Data table (apps, docs, team) ---------- */

.dtable {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 14px;
  font-family: var(--sans);
}

.dtable th,
.dtable td {
  text-align: left;
  padding: 12px 16px 12px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.dtable th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mid);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink-mid);
}

.dtable td.col-key {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-dark);
  white-space: nowrap;
  width: 1%;
  padding-right: 24px;
}

.dtable td.col-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mid);
  white-space: nowrap;
  width: 1%;
}

.dtable td.col-desc {
  color: var(--ink-dark);
  line-height: 1.5;
}

.dtable td.col-desc .authority {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mid);
}

.dtable a {
  color: var(--ink-dark);
  text-decoration: underline;
  text-decoration-color: var(--ink-mid);
}

.dtable a:hover { text-decoration-color: var(--ink-dark); }

/* Doc rows — path beneath the description */
.dtable .docpath {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mid);
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mid);
  line-height: 1.6;
}

.footer p { margin: 0 0 4px; color: var(--ink-mid); }

.footer a {
  color: var(--ink-mid);
  text-decoration-color: var(--ink-mid);
}

.footer a:hover { color: var(--ink-dark); text-decoration-color: var(--ink-dark); }

/* ---------- Append-only marker (canon ornament) ---------- */

.colophon {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mid);
  letter-spacing: 0.02em;
}

.colophon::before { content: "# "; color: var(--ink-mid); }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .page { padding: 32px 20px 64px; }
  h1 { font-size: 22px; }
  h2 { font-size: 16px; margin-top: 40px; }
  .lede { font-size: 13px; }
  .dtable { font-size: 13px; }
  .dtable td.col-key { white-space: normal; }
  .nav { flex-wrap: wrap; gap: 16px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
