/* ============================================================
   Nick Land & the CCRU — archive
   Art direction: dark occult-cybernetic terminal.
   Display: Syne · Body: Newsreader · Mono/labels: IBM Plex Mono
   Accents: technocapital ember (red) + phosphor terminal (green)
   ============================================================ */

:root {
  --bg:        #08090c;
  --bg-2:      #0c0e13;
  --surface:   #101219;
  --surface-2: #14171f;
  --line:      rgba(255,255,255,0.09);
  --line-2:    rgba(255,255,255,0.16);

  --text:      #d9dbe3;
  --text-dim:  #8a8f9e;
  --text-mute: #62677a;
  --heading:   #f2f0ea;

  --ember:     #ff4d2e;
  --ember-2:   #ff7a54;
  --phosphor:  #56efc0;

  --maxw: 1120px;
  --radius: 14px;
  --ease: cubic-bezier(.2,.7,.2,1);

  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Newsreader", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.075rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- ambient background ---------- */
.bg-grain, .bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg-glow {
  background:
    radial-gradient(60% 45% at 78% 8%, rgba(255,77,46,0.16), transparent 60%),
    radial-gradient(55% 50% at 12% 92%, rgba(86,239,192,0.08), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.bg-grain {
  opacity: 0.05; mix-blend-mode: screen;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.5) 0, rgba(255,255,255,0.5) 1px, transparent 1px, transparent 3px);
}

main, .site-nav, .site-footer { position: relative; z-index: 1; }

/* ---------- skip link ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ember); color: #180400; padding: .6rem 1rem;
  font-family: var(--font-mono); font-size: .8rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem clamp(1rem, 4vw, 2.4rem);
  background: rgba(8,9,12,0.72);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono); font-weight: 500; letter-spacing: .14em;
  font-size: .92rem; color: var(--heading); text-decoration: none;
}
.brand-mark { color: var(--ember); font-size: 1.1rem; line-height: 1; }
.brand-dim { color: var(--text-mute); }
.brand:hover .brand-mark { color: var(--ember-2); }

.nav-links {
  list-style: none; display: flex; gap: .35rem; margin: 0; padding: 0;
}
.nav-links a {
  display: inline-flex; align-items: baseline; gap: .5rem;
  text-decoration: none; color: var(--text-dim);
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .02em;
  padding: .5rem .7rem; border-radius: 8px; transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--heading); background: rgba(255,255,255,0.05); }
.nav-links a[aria-current="true"] { color: var(--heading); }
.nav-links a[aria-current="true"] .nav-idx { color: var(--phosphor); }
.nav-idx { color: var(--ember); font-size: .7rem; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-2); color: var(--text);
  font-size: 1.3rem; line-height: 1; padding: .3rem .6rem; border-radius: 8px; cursor: pointer;
}

/* ---------- layout ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.15rem, 4vw, 2.4rem);
  border-top: 1px solid var(--line);
}
.section-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.6rem; }
.section-idx {
  font-family: var(--font-mono); color: var(--ember); font-size: .95rem;
  border: 1px solid var(--line-2); border-radius: 6px; padding: .1rem .5rem; flex: none;
}
h2 {
  font-family: var(--font-display); font-weight: 700; color: var(--heading);
  font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.04; letter-spacing: -.01em; margin: 0;
}
.section-lede, .section-head + .prose { }
.section-lede {
  max-width: 60ch; color: var(--text-dim); font-size: 1.08rem;
  margin: 0 0 2.4rem; padding-left: calc(1rem + 2.4ch);
}
@media (max-width: 620px){ .section-lede { padding-left: 0; } }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(3.5rem, 9vw, 7rem) clamp(1.15rem, 4vw, 2.4rem) clamp(2.5rem, 6vw, 4.5rem);
  min-height: min(88vh, 760px);
}
.eyebrow {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .22em;
  font-size: .74rem; color: var(--phosphor); margin: 0 0 1.4rem;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 800; color: var(--heading);
  font-size: clamp(2.4rem, 8vw, 6.4rem); line-height: .92; letter-spacing: -.02em;
  margin: 0 0 1.5rem; overflow-wrap: break-word;
}
.hero h1 .amp { color: var(--ember); font-weight: 600; font-style: italic; }
.hero-tagline {
  max-width: 46ch; color: var(--text-dim); font-size: 1.16rem; line-height: 1.6;
  margin: 0 0 2.2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.btn {
  display: inline-block; text-decoration: none; font-family: var(--font-mono);
  font-size: .85rem; letter-spacing: .04em; padding: .8rem 1.4rem; border-radius: 10px;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn-primary { background: var(--ember); color: #1a0500; font-weight: 500; border: 1px solid var(--ember); }
.btn-primary:hover { background: var(--ember-2); transform: translateY(-2px); }
.btn-ghost { color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--phosphor); color: var(--phosphor); transform: translateY(-2px); }

/* ---------- numogram motif ---------- */
.hero-motif { display: flex; justify-content: center; align-items: center; }
.numogram { width: min(100%, 420px); height: auto; filter: drop-shadow(0 0 30px rgba(255,77,46,0.18)); }
.ng-ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.ng-ring-outer { stroke: rgba(255,77,46,0.35); stroke-dasharray: 2 6; }
.ng-ring-inner { stroke: rgba(86,239,192,0.28); }
.ng-links line { stroke: rgba(217,219,227,0.22); stroke-width: 1; }
.ng-links line.cur { stroke: rgba(255,77,46,0.55); stroke-width: 1.4; }
.ng-node circle { fill: var(--bg-2); stroke: var(--line-2); stroke-width: 1.2; }
.ng-node text {
  fill: var(--text); font-family: var(--font-mono); font-size: 13px; text-anchor: middle;
  dominant-baseline: central; font-weight: 500;
}
.ng-node.hot circle { stroke: var(--ember); }
.ng-node.hot text { fill: var(--ember-2); }
.ng-node.cool circle { stroke: var(--phosphor); }
.ng-node.cool text { fill: var(--phosphor); }
.ng-rot { transform-origin: 200px 200px; animation: ngspin 90s linear infinite; }
.ng-core-glow { animation: ngpulse 6s ease-in-out infinite; transform-origin: 200px 200px; }
@keyframes ngspin { to { transform: rotate(360deg); } }
@keyframes ngpulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
/* counter-rotate node labels so numerals stay upright */
.ng-node { animation: ngspin-rev 90s linear infinite; transform-origin: 200px 200px; }
@keyframes ngspin-rev { to { transform: rotate(-360deg); } }

/* ---------- prose ---------- */
.prose { max-width: 72ch; }
.prose p { margin: 0 0 1.35rem; }
.prose strong { color: var(--heading); font-weight: 600; }
.prose em { color: var(--text); }
.note-box {
  margin-top: 2rem; padding: 1.2rem 1.4rem; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--ember);
  border-radius: 0 var(--radius) var(--radius) 0; font-size: 1rem; color: var(--text-dim);
}
.note-tag {
  display: inline-block; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ember); border: 1px solid rgba(255,77,46,0.4);
  padding: .12rem .5rem; border-radius: 5px; margin-right: .6rem; vertical-align: middle;
}

/* ---------- concept cards ---------- */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem;
}
.card {
  position: relative; background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.7rem 1.6rem 1.5rem; overflow: hidden;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--ember), transparent 70%); opacity: .6;
}
.card:hover {
  transform: translateY(-4px); border-color: var(--line-2);
  box-shadow: 0 18px 40px -24px rgba(255,77,46,0.4);
}
.card-num {
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; color: var(--phosphor);
  text-transform: uppercase;
}
.card h3 {
  font-family: var(--font-display); font-weight: 700; color: var(--heading);
  font-size: 1.32rem; line-height: 1.15; margin: .4rem 0 .7rem; letter-spacing: -.01em;
}
.card p { margin: 0; color: var(--text-dim); font-size: 1rem; line-height: 1.66; }
.card p em { color: var(--text); font-style: italic; }
.card p strong { color: var(--text); font-weight: 600; }

/* ---------- link lists ---------- */
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.link-list.two-col { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.link-list a {
  display: block; text-decoration: none; padding: 1.1rem 1.3rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.link-list a:hover, .link-list a:focus-visible {
  transform: translateX(4px); border-color: var(--ember); background: var(--surface-2);
}
.ll-title {
  display: block; font-family: var(--font-display); font-weight: 600; color: var(--heading);
  font-size: 1.06rem; margin-bottom: .3rem; letter-spacing: -.005em;
}
.ll-ext { color: var(--ember); font-family: var(--font-mono); font-size: .85em; }
.ll-desc { display: block; color: var(--text-dim); font-size: .96rem; line-height: 1.55; }
.ll-desc em { color: var(--text-mute); font-style: italic; }
.link-list a:hover .ll-title { color: var(--ember-2); }

/* ---------- videos ---------- */
.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem;
}
.video-card {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.video-card:hover {
  transform: translateY(-4px); border-color: var(--line-2);
  box-shadow: 0 18px 40px -26px rgba(86,239,192,0.35);
}
.video-screen {
  position: relative; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(255,77,46,0.16), transparent 55%),
    linear-gradient(135deg, #0c0f16 0%, #14181f 100%);
  border-bottom: 1px solid var(--line);
}
.video-screen::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 4px);
}
.video-play {
  width: 58px; height: 58px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: 50%; color: var(--heading); font-size: 1.1rem;
  padding-left: 4px; background: rgba(8,9,12,0.5); transition: all .25s var(--ease); z-index: 1;
}
.video-card:hover .video-play {
  color: #10251d; background: var(--phosphor); border-color: var(--phosphor);
  box-shadow: 0 0 26px rgba(86,239,192,0.5);
}
.video-kind {
  position: absolute; top: .7rem; left: .7rem; z-index: 1;
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .16em; color: var(--phosphor);
  border: 1px solid rgba(86,239,192,0.35); padding: .16rem .45rem; border-radius: 4px;
  background: rgba(8,9,12,0.6);
}
.video-meta { padding: 1.05rem 1.2rem 1.25rem; }
.video-title {
  display: block; font-family: var(--font-display); font-weight: 600; color: var(--heading);
  font-size: 1.04rem; line-height: 1.25; margin-bottom: .4rem;
}
.video-desc { display: block; color: var(--text-dim); font-size: .93rem; line-height: 1.55; }
.video-card:hover .video-title { color: var(--phosphor); }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--maxw); margin: 0 auto; padding: 3rem clamp(1.15rem, 4vw, 2.4rem) 4rem;
  border-top: 1px solid var(--line); text-align: center;
}
.footer-motif {
  font-family: var(--font-mono); letter-spacing: .3em; color: var(--text-mute);
  font-size: .8rem; margin-bottom: 1.6rem;
}
.footer-note { max-width: 68ch; margin: 0 auto 1rem; color: var(--text-dim); font-size: .96rem; }
.footer-note strong { color: var(--text); }
.footer-meta { font-family: var(--font-mono); font-size: .74rem; color: var(--text-mute); letter-spacing: .04em; }

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2);
  font-size: 1.1rem; opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--ember); border-color: var(--ember); transform: translateY(-3px); }

/* ---------- focus ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--phosphor); outline-offset: 2px; border-radius: 4px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: left; min-height: auto; }
  .hero-motif { order: -1; max-width: 340px; margin: 0 0 .5rem; }
}
@media (max-width: 760px) {
  .nav-links {
    position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; gap: 0; padding: .5rem;
    background: rgba(8,9,12,0.97); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .8rem 1rem; border-radius: 8px; }
  .nav-toggle { display: inline-block; }
}
@media (max-width: 420px) {
  body { font-size: 1.02rem; }
  .section-head { gap: .7rem; }
}

/* ---------- motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ng-rot, .ng-node, .ng-core-glow { animation: none !important; }
  * { transition-duration: .01ms !important; }
}
