/* ============================================================
   SHRDLU (1968-70) · Critical Code Studies
   Aesthetic: the blocks world. A dark lab workbench seen on the
   DEC-340 display; primary-coloured cubes and pyramids in
   axonometric line-drawing; a teletype dialogue in upper case.
   Person types lowercase; SHRDLU answers in CAPITALS.
   ============================================================ */

:root {
  --bg:        #11131a;          /* workbench charcoal */
  --bg-2:      #171a23;
  --panel:     rgba(231, 228, 218, 0.035);
  --line:      rgba(231, 228, 218, 0.18);
  --line-soft: rgba(231, 228, 218, 0.10);
  --ink:       #e7e4da;          /* body text, warm white */
  --ink-dim:   #989b93;
  --bright:    #faf8f2;          /* headings */
  /* the blocks-world palette: saturated primaries on dark */
  --blk-red:   #e25141;
  --blk-green: #57b86b;
  --blk-blue:  #4d92e0;
  --pyr-amber: #f2ab3c;          /* pyramids */
  --beam:      #57c08a;  /* default link / accent */
  --shrdlu:    #6fdc8c;          /* the machine's voice (phosphor green) */
  --you:       #f2ab3c;          /* the person's voice (amber) */
  --glow:      0 0 6px rgba(87, 192, 138, 0.5), 0 0 14px rgba(87, 192, 138, 0.22);
  --glow-soft: 0 0 5px rgba(250, 248, 242, 0.25);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --wrap: 920px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* keyboard-only skip link, off-screen until focused */
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 9999;
  background: var(--bg-2); color: var(--bright); border: 1px solid var(--beam);
  font-family: var(--mono); font-size: 0.8rem; padding: 0.6rem 1rem; border-radius: 3px;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

body {
  margin: 0;
  background:
    linear-gradient(rgba(231,228,218,0.022) 1px, transparent 1px) 0 0 / 100% 2.4rem,
    radial-gradient(ellipse 120% 80% at 50% -10%, var(--bg-2) 0%, var(--bg) 62%) fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* a faint vignette only, no heavy scanlines (this is a vector display, not a TV) */
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  background: radial-gradient(ellipse 92% 78% at 50% 42%, transparent 58%, rgba(0,0,0,0.5) 100%);
}

.wrap { width: min(var(--wrap), 92vw); margin: 0 auto; }
section[id], [id]:target { scroll-margin-top: 92px; }

/* ---------- links ---------- */
a { color: var(--beam); text-decoration: none; }
a:hover { color: var(--bright); text-shadow: var(--glow); }
.content a { border-bottom: 1px solid var(--line); }
.content a:hover { border-bottom-color: var(--beam); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 8000;
  backdrop-filter: blur(3px);
  background: linear-gradient(to bottom, rgba(17,19,26,0.94), rgba(17,19,26,0.62));
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; gap: 1rem; position: relative;
}
.brand { display: flex; align-items: center; gap: 0.7rem; border: 0 !important; }
.brand svg { width: 30px; height: 30px; }
.brand .brand-cube { filter: drop-shadow(0 0 3px rgba(58,168,98,0.55)); }
.brand-block { display: flex; flex-direction: column; align-items: flex-start; gap: 0.32rem; line-height: 1.1; }
/* the site logotype: the green Knight TV pixel wordmark (assets/wordmark.svg).
   align-self:flex-start + fixed width stop the flex column stretching it. */
.brand-mark { display: block; height: 16px; width: 58px; align-self: flex-start;
  filter: drop-shadow(0 0 3px rgba(58,168,98,0.45)); }
.brand-tagline { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 1px; color: var(--ink-dim); text-transform: uppercase; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: none; border: 1px solid var(--line); color: var(--beam);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 7px 13px; border-radius: 3px; cursor: pointer;
}
.nav-toggle:hover { border-color: var(--beam); color: var(--bright); text-shadow: var(--glow); }
.nav-toggle .bars { font-size: 0.95rem; line-height: 1; }

/* ---------- nav: mobile-first hamburger panel with accordion groups ---------- */
.site-nav {
  position: absolute; top: calc(100% + 7px); right: 0;
  display: none; flex-direction: column;
  min-width: 220px; max-width: min(300px, 90vw); padding: 0.4rem 0;
  background: rgba(20,23,31,0.985); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.8px; text-transform: uppercase;
}
.site-nav.open { display: flex; }
.nav-group { position: static; display: flex; flex-direction: column; }
.nav-top {
  background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--ink-dim); padding: 0.6rem 1.2rem; text-decoration: none;
  display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; width: 100%;
}
.nav-top:hover, .nav-top:focus-visible { color: var(--beam); text-shadow: var(--glow); background: rgba(87,192,138,0.08); outline: none; }
.nav-top .caret { font-size: 0.7em; opacity: 0.7; transition: transform 0.15s ease; }
.nav-top[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-menu { display: none; flex-direction: column; background: rgba(87,192,138,0.045); }
.nav-menu.open { display: flex; }
.nav-menu a { color: var(--ink-dim); border: 0; padding: 0.5rem 1.2rem 0.5rem 2rem; text-decoration: none; }
.nav-menu a:hover { color: var(--beam); text-shadow: var(--glow); background: rgba(87,192,138,0.08); }
/* sets "The dialogue" apart from the rest of the SHRDLU group, the primary artefact */
.nav-menu a.divider { border-top: 1px solid var(--line); margin-top: 0.3rem; padding-top: 0.7rem; }

/* ---------- nav: desktop horizontal bar with click dropdowns ---------- */
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static; display: flex; flex-direction: row; align-items: center; gap: 0.1rem;
    min-width: 0; max-width: none; padding: 0; background: none; border: 0; box-shadow: none;
  }
  .nav-group { position: relative; display: inline-block; }
  .nav-top { width: auto; justify-content: center; padding: 0.55rem 0.7rem; }
  .nav-menu {
    position: absolute; top: 100%; left: 0; margin-top: 0; min-width: 180px;
    background: rgba(20,23,31,0.985); border: 1px solid var(--line); border-radius: 4px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.6); padding: 0.3rem 0; z-index: 9000;
  }
  .nav-group:focus-within .nav-menu, .nav-menu.open { display: flex; }
  .nav-menu a { padding: 0.5rem 1.1rem; white-space: nowrap; }
  .site-nav > .nav-group:last-of-type .nav-menu { left: auto; right: 0; }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: 80vh; display: flex; align-items: center; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
#blockworld { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
/* narrow screens: the hero text stacks full-width over the scene, so fade the
   blocks world down to wallpaper-level so it stops competing with the words */
@media (max-width: 880px) { #blockworld { opacity: 0.4; } }
.hero-inner { position: relative; z-index: 2; padding: 8vh 0; }
.boot { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 3px; color: var(--ink-dim); text-transform: uppercase; margin-bottom: 1.4rem; }
.cursor { display: inline-block; width: 0.55em; height: 1.05em; vertical-align: -0.15em; background: var(--shrdlu); box-shadow: 0 0 8px var(--shrdlu); animation: blink 1.06s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

.hero h1 {
  font-family: var(--mono); font-weight: 800;
  font-size: clamp(2.8rem, 11vw, 7rem); line-height: 0.92;
  margin: 0; letter-spacing: 0px; color: var(--bright);
  text-shadow: 0 2px 0 rgba(0,0,0,0.35);
}
.hero .sub { font-family: var(--mono); font-size: clamp(0.85rem, 2.2vw, 1.05rem); letter-spacing: 2px; color: var(--ink); margin-top: 0.6rem; text-transform: uppercase; }
.hero .tagline { max-width: 44ch; margin-top: 1.6rem; font-size: 1.15rem; color: var(--ink); }
.hero-actions { margin-top: 2.2rem; display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 0.8rem 1.5rem; border: 1px solid var(--beam); color: var(--beam);
  background: rgba(87,192,138,0.06); border-radius: 2px; transition: all 0.18s ease;
}
.btn:hover { background: var(--beam); color: var(--bg); box-shadow: var(--glow); }
.btn.ghost { border-color: var(--line); color: var(--ink-dim); background: transparent; }
.btn.ghost:hover { border-color: var(--ink); color: var(--bright); background: rgba(231,228,218,0.05); box-shadow: none; }

/* ---------- content ---------- */
.content { padding: 5rem 0; }
section.block { margin: 0 auto 5rem; }
section.block:last-child { margin-bottom: 0; }

.kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 3px; text-transform: uppercase; color: var(--beam); margin-bottom: 0.9rem; display: block; }

h2 { font-family: var(--mono); font-weight: 700; font-size: clamp(1.5rem, 4vw, 2.1rem); color: var(--bright); letter-spacing: -0.3px; margin: 0 0 1.2rem; }
/* the page's own h1: same voice as h2, one size up */
h1.page-title { font-family: var(--mono); font-weight: 700; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--bright); letter-spacing: -0.3px; margin: 0 0 1.2rem; }
h3 { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: var(--bright); letter-spacing: 0.4px; margin: 0 0 0.5rem; }
.lede p { font-size: 1.28rem; line-height: 1.6; color: var(--ink); max-width: 60ch; }
.content p { max-width: 68ch; }
.content p + p { margin-top: 1.1rem; }

/* a rule with a small stacked-blocks motif */
.rule { display: flex; align-items: center; gap: 1rem; margin: 3.5rem 0; color: var(--ink-dim); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 2px; }
.rule::before, .rule::after { content: ""; height: 1px; flex: 1; background: linear-gradient(to right, transparent, var(--line), transparent); }

/* card grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; margin-top: 1.5rem; }
.card {
  border: 1px solid var(--line-soft); background: var(--panel);
  padding: 1.4rem; border-radius: 3px; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
}
.card:hover { border-color: var(--beam); box-shadow: inset 0 0 30px rgba(87,192,138,0.05), var(--glow); transform: translateY(-2px); }
.card .obj { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-dim); margin: 0 0 0.6rem; }
.card p { font-size: 0.95rem; color: var(--ink); margin: 0; max-width: none; }
.card h3 a { border: 0; }

/* a coloured tick on cards keyed to the blocks-world palette */
.card.r { border-top: 2px solid var(--blk-red); }
.card.g { border-top: 2px solid var(--blk-green); }
.card.b { border-top: 2px solid var(--blk-blue); }
.card.y { border-top: 2px solid var(--pyr-amber); }

/* ---------- the dialogue / teletype transcript ---------- */
.dialogue {
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.5;
  background: rgba(0,0,0,0.42); border: 1px solid var(--line-soft); border-left: 2px solid var(--shrdlu);
  padding: 1.3rem 1.4rem; border-radius: 3px; margin-top: 1.5rem; overflow-x: auto;
}
.turn { display: grid; grid-template-columns: 4.6rem 1fr; gap: 0.4rem 0.8rem; padding: 0.18rem 0; }
.turn .who { text-align: right; font-size: 0.62rem; letter-spacing: 1px; text-transform: uppercase; padding-top: 0.18rem; user-select: none; }
/* each exchange (person turn) is individually citable; the number is a quiet
   permalink, visible on row hover, so a scholar can link to "exchange 20" */
.turn.person[id] { scroll-margin-top: 92px; }
.x-num { border: 0 !important; opacity: 0; font-variant-numeric: tabular-nums; color: var(--ink-dim); margin-right: 0.3em; transition: opacity 0.15s ease; }
.turn.person:hover .x-num, .x-num:focus { opacity: 1; }
.turn.person:target { background: rgba(87,192,138,0.08); margin: 0 -0.6rem; padding: 0.18rem 0.6rem; border-radius: 3px; }
.turn.person:target .x-num { opacity: 1; color: var(--beam); }
.turn.person .who { color: var(--you); }
.turn.shrdlu .who { color: var(--shrdlu); }
.turn.person .msg { color: var(--ink); }
.turn.shrdlu .msg { color: var(--shrdlu); text-transform: uppercase; text-shadow: 0 0 5px rgba(111,220,140,0.3); }
.turn .stage { color: var(--ink-dim); font-style: normal; opacity: 0.7; }
.dialogue .gap { height: 0.5rem; }

/* method list */
.method { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.method li { padding-left: 2.4rem; position: relative; }
.method li::before { content: attr(data-n); position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 0.8rem; color: var(--pyr-amber); border: 1px solid var(--line); border-radius: 50%; width: 1.7rem; height: 1.7rem; display: flex; align-items: center; justify-content: center; }
.method b { color: var(--bright); font-family: var(--mono); font-weight: 700; font-size: 0.95rem; }

/* CTA */
.cta { border: 1px solid var(--line); background: linear-gradient(135deg, rgba(87,192,138,0.07), rgba(87,192,138,0.01)); padding: 2.6rem; border-radius: 4px; text-align: center; }
.cta h2 { margin-bottom: 0.6rem; }
.cta p { margin: 0 auto 1.6rem; }

/* further reading */
.reading ul { list-style: none; padding: 0; margin: 1rem 0 2rem; }
.reading li { padding: 0.55rem 0; border-bottom: 1px solid var(--line-soft); }
.reading li::before { content: "› "; color: var(--beam); font-family: var(--mono); }
.reading h3 { margin-top: 2rem; color: var(--beam); }
.reading p, .reading li { font-size: 0.95rem; }

/* inline link rows */
.links { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 0.65rem; }
.links li { padding-left: 1.3rem; position: relative; }
.links li::before { content: "→"; position: absolute; left: 0; color: var(--beam); font-family: var(--mono); }
.links .meta { color: var(--ink-dim); font-size: 0.9rem; }

/* callout */
.callout { border: 1px solid var(--line-soft); border-left: 3px solid var(--pyr-amber); background: linear-gradient(110deg, rgba(242,171,60,0.07), rgba(242,171,60,0.01)); padding: 1.8rem 2rem; border-radius: 3px; }
.callout .kicker { color: var(--pyr-amber); }
.callout p { margin: 0; }
.callout p + p { margin-top: 0.8rem; }

/* pull quote (Winograd "demo or die") */
.pull { border-left: 3px solid var(--shrdlu); padding: 0.4rem 0 0.4rem 1.4rem; margin: 1.8rem 0; font-family: var(--serif); font-size: 1.15rem; font-style: italic; color: var(--bright); max-width: 60ch; }
.pull cite { display: block; font-family: var(--mono); font-style: normal; font-size: 0.72rem; letter-spacing: 1px; color: var(--ink-dim); margin-top: 0.7rem; text-transform: uppercase; }

/* stat strip */
.stat-strip { display: flex; flex-wrap: wrap; gap: 0; margin-top: 1.6rem; border: 1px solid var(--line-soft); border-radius: 3px; overflow: hidden; }
.stat { flex: 1 1 140px; padding: 1.1rem 1.2rem; border-right: 1px solid var(--line-soft); background: rgba(231,228,218,0.02); }
.stat:last-child { border-right: 0; }
.stat .n { font-family: var(--mono); font-size: 1.5rem; color: var(--bright); line-height: 1.1; }
.stat .l { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-dim); margin-top: 0.4rem; }

/* hardware / illustration two-up */
.hardware { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; margin-top: 1.8rem; }
.hardware svg { width: 100%; height: auto; }
@media (max-width: 700px) { .hardware { grid-template-columns: 1fr; } }

/* contacts */
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-top: 1.5rem; }
.contact { border: 1px solid var(--line-soft); padding: 1.3rem 1.4rem; border-radius: 3px; background: var(--panel); }
.contact .role { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-dim); }
.contact .name { font-family: var(--mono); color: var(--bright); font-size: 1.02rem; margin: 0.3rem 0; }
.contact .aff { font-size: 0.9rem; color: var(--ink); }
.contact a { font-family: var(--mono); font-size: 0.82rem; }
@media (max-width: 620px) { .contacts { grid-template-columns: 1fr; } }

/* bibliography */
.bib .ref { font-family: var(--serif); font-size: 0.95rem; line-height: 1.5; padding-left: 1.7rem; text-indent: -1.7rem; margin: 0 0 0.75rem; max-width: 74ch; color: var(--ink); }
.bib h3 { margin-top: 2.2rem; color: var(--beam); }
.bib .ref a { border-bottom: 1px solid var(--line-soft); word-break: break-word; }
.bib .ref a:hover { border-bottom-color: var(--beam); }

/* listing (code) */
.listing {
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.55;
  background: rgba(0,0,0,0.45); border: 1px solid var(--line-soft); border-left: 2px solid var(--blk-blue);
  padding: 1.2rem 1.3rem; border-radius: 3px; overflow-x: auto; color: var(--ink); margin-top: 1.5rem;
}
.listing .com { color: var(--ink-dim); }
.listing .kw { color: var(--blk-blue); }
.listing .str { color: var(--pyr-amber); }

/* footer */
.site-footer { border-top: 1px solid var(--line-soft); padding: 1.4rem 0; margin-top: 2.5rem; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-dim); letter-spacing: 0.5px; }
.site-footer .wrap { display: flex; flex-direction: column; gap: 0.35rem; }
.site-footer a { color: var(--ink-dim); border: 0; }
.site-footer a:hover { color: var(--beam); }

.micro { font-size: 0.66rem; color: var(--ink-dim); letter-spacing: 0.4px; line-height: 1.5; }
.micro a { color: var(--ink-dim); border: 0; }
.micro a:hover { color: var(--beam); }

/* footnotes: numbered, backlinked, set in .micro */
.fn { font-size: 0.65rem; line-height: 1.7; margin-top: 1rem; }
.fn + .fn { margin-top: 0.6rem; }

@media (max-width: 620px) {
  .brand-tagline { display: none; }
  .content { padding: 3rem 0; }
  .turn { grid-template-columns: 3.4rem 1fr; }
}
</content>
