/* ------------------------------------------------------------------
   dickgentry.com front door: the landing page, the blog index, the
   posts and the DoomFunnel holding page.

   This is the quiet half of the site. The arcade (arcade/core.css) is
   the loud half and keeps its own system on purpose; the two share only
   the mono label voice and the hand-built feel. Nothing here links
   core.css and nothing in the arcade links this file.

   Tokens first. The page is dark by default and follows the OS to light;
   site.js lets the visitor pin either with html[data-theme]. Every colour
   is a token so a canvas can read it (see --contour in site.js).
   ------------------------------------------------------------------ */

:root {
  color-scheme: dark;
  --bg: #0c1014;
  --bg-2: #11161c;
  --panel: #141a21;
  --panel-2: #1a2129;
  --line: #1f272f;
  --line-2: #2c3640;
  --text: #e9edf1;
  --muted: #98a4b0;
  --dim: #5d6975;
  --accent: #f1b35b;
  --accent-ink: #1a1206;
  --accent-soft: rgba(241, 179, 91, .14);
  --contour: 150, 168, 186;       /* rgb triplet: contour lines on the field */
  --contour-hot: 241, 179, 91;    /* the lines near the pointer */
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);

  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --top-h: 64px;
  --r: 16px;
}

/* Light theme: the OS asks for it and the visitor has not pinned dark,
   or the visitor pinned light. Both blocks must say the same thing. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f5f3ee;
    --bg-2: #ece9e2;
    --panel: #fffdf9;
    --panel-2: #f3f0e9;
    --line: #e2ddd3;
    --line-2: #cfc8bb;
    --text: #181c21;
    --muted: #5d6670;
    --dim: #9aa3ab;
    --accent: #96500f;      /* 5.0:1 or better on every light surface; #b8661a read nicer but failed text contrast */
    --accent-ink: #fff8ee;
    --accent-soft: rgba(150, 80, 15, .12);
    --contour: 92, 104, 116;
    --contour-hot: 150, 80, 15;
    --shadow: 0 24px 60px rgba(40, 30, 10, .14);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f3ee;
  --bg-2: #ece9e2;
  --panel: #fffdf9;
  --panel-2: #f3f0e9;
  --line: #e2ddd3;
  --line-2: #cfc8bb;
  --text: #181c21;
  --muted: #5d6670;
  --dim: #9aa3ab;
  --accent: #96500f;      /* 5.0:1 or better on every light surface; #b8661a read nicer but failed text contrast */
  --accent-ink: #fff8ee;
  --accent-soft: rgba(150, 80, 15, .12);
  --contour: 92, 104, 116;
  --contour-hot: 150, 80, 15;
  --shadow: 0 24px 60px rgba(40, 30, 10, .14);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + 12px);
  overflow-x: clip;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.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;
}

/* ---------- The field ----------
   One fixed canvas behind everything. site.js draws the contour map on it
   and fades it under the content; the page reads fine without it. */
.field {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
/* Keeps text legible where lines run under it: a soft pool of page colour. */
.field-fade {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 40%, var(--bg) 0%, transparent 100%),
    linear-gradient(to bottom, transparent 55%, var(--bg) 100%);
  opacity: .78;
}

/* ---------- Mono label voice ---------- */
.kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 0 0 20px;
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.kicker b { font-weight: 500; color: var(--text); }
.kicker .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.kicker .live {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text);
}
.kicker .live::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  height: var(--top-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .top { background: var(--bg); border-bottom-color: var(--line); }
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: -.02em; font-size: 17px;
}
.wordmark i {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font: 800 12px/1 var(--font-mono); font-style: normal; letter-spacing: 0;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.wordmark:hover i { transform: rotate(-8deg) scale(1.06); }
.wordmark em { font-style: normal; color: var(--muted); font-weight: 500; }

.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  position: relative;
  padding: 9px 12px; border-radius: 999px;
  font: 500 13.5px/1 var(--font-sans);
  color: var(--muted);
  transition: color .15s, background .15s;
}
.nav a:hover, .nav a.active, .nav a[aria-current] { color: var(--text); background: var(--bg-2); }
/* --muted, not --dim: the numbers are read, and --dim is below 4.5:1 on both themes. */
.nav a span { display: inline-block; margin-right: 7px; font: 500 10px/1 var(--font-mono); color: var(--muted); letter-spacing: .08em; }

.theme {
  display: grid; place-items: center;
  width: 36px; height: 36px; margin-left: 6px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--panel); color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, transform .15s;
}
.theme:hover { color: var(--text); border-color: var(--muted); transform: rotate(15deg); }
.theme svg { width: 16px; height: 16px; }
.theme .sun { display: none; }
:root[data-theme="light"] .theme .sun { display: block; }
:root[data-theme="light"] .theme .moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme .sun { display: block; }
  :root:not([data-theme]) .theme .moon { display: none; }
}

/* ---------- Layout ---------- */
main { position: relative; z-index: 1; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--top-h));
  display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(56px, 10vh, 120px);
  padding-bottom: clamp(40px, 8vh, 96px);
}
.hero .kicker { margin-bottom: 28px; }
.title {
  font-size: clamp(3.4rem, 11.5vw, 9.6rem);
  font-weight: 800; line-height: .92; letter-spacing: -.045em;
  margin: 0 0 28px -.04em;
}
.title span { display: inline-block; white-space: pre; }
.title .alt { color: var(--muted); }
.lede {
  max-width: 560px;
  font-size: clamp(1.15rem, 2.1vw, 1.45rem);
  line-height: 1.4; font-weight: 500;
  color: var(--muted);
  margin-bottom: 36px;
}
.lede b { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-foot {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: clamp(48px, 9vh, 96px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font: 500 11px/1.5 var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.hero-foot .cue::after {
  content: '\2193'; display: inline-block; margin-left: 10px; color: var(--accent);
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 22px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 14.5px/1 var(--font-sans);
  border: 1px solid transparent;
  /* --mx/--my are written by site.js for the magnetic pull. */
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), background .15s, box-shadow .2s;
  box-shadow: 0 10px 30px -12px var(--accent);
  cursor: pointer;
}
.btn i { font-style: normal; transition: transform .2s; }
.btn:hover { box-shadow: 0 16px 36px -12px var(--accent); }
.btn:hover i { transform: translateX(4px); }
.btn--ghost {
  background: transparent; color: var(--text);
  border-color: var(--line-2);
  box-shadow: none;
}
.btn--ghost:hover { border-color: var(--muted); background: var(--bg-2); box-shadow: none; }
button.btn { font-family: inherit; }

/* ---------- Doors: the four destinations ---------- */
.doors { padding-bottom: clamp(56px, 8vw, 96px); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.section-head .kicker { margin: 0; }

.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
  perspective: 1600px;
}
.door {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 300px;
  padding: 22px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  overflow: hidden;
  /* rx/ry written by site.js on pointermove; reset on leave. */
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .2s ease-out, border-color .2s, box-shadow .25s;
  will-change: transform;
}
.door:hover, .door:focus-within { border-color: var(--line-2); box-shadow: var(--shadow); }
/* The whole card is the link: the title's anchor stretches over it. */
.door-link::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: var(--r); }
.door-link:focus-visible { outline: none; }
.door:has(.door-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

.door-art {
  position: relative;
  height: 120px; margin: -22px -24px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
}
.door-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.door-art::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent 70%, var(--panel) 100%);
}
.door .kicker { margin-bottom: 10px; }
.door h3 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 8px; transition: color .15s; }
.door:hover h3 { color: var(--accent); }
.door p { color: var(--muted); font-size: 15.5px; line-height: 1.5; margin: 0 0 16px; flex: 1; }
.door-go {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 13px/1 var(--font-sans);
  color: var(--text);
}
.door-go i { font-style: normal; color: var(--accent); transition: transform .2s; }
.door:hover .door-go i { transform: translateX(5px); }
.door-glare {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), var(--accent-soft), transparent 65%);
  opacity: 0; transition: opacity .25s;
}
.door:hover .door-glare { opacity: 1; }

/* Latest posts inside the blog door: titles only, so the door stays a door. */
.door-list { list-style: none; margin: 0 0 16px; padding: 0; }
.door-list li { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14.5px; }
.door-list li:first-child { border-top: 0; }
.door-list time { flex: none; font: 500 11px/1.6 var(--font-mono); letter-spacing: .06em; color: var(--muted); }
.door-list span { color: var(--text); font-weight: 500; }

.door--soon { border-style: dashed; }
.door--soon .door-go { color: var(--muted); }
.door--soon .door-go i { color: var(--dim); }
.badge {
  display: inline-block; padding: 5px 9px; border-radius: 999px;
  font: 600 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
}

/* ---------- Contact ---------- */
.contact {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--line);
}
.contact-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.contact h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -.03em; }
.contact h2 small { display: block; margin-top: 6px; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 16px; border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  font: 600 13.5px/1 var(--font-sans);
  color: var(--text);
  transition: border-color .15s, background .15s, transform .15s;
}
.chip svg { width: 15px; height: 15px; color: var(--muted); transition: color .15s; }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.chip:hover svg { color: var(--accent); }

/* ---------- Footer ---------- */
.foot {
  position: relative; z-index: 1;
  padding: 24px var(--gutter) 32px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.foot-row {
  max-width: var(--wrap); margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  font: 500 11.5px/1.6 var(--font-mono);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.foot-row nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-row a:hover { color: var(--accent); }

/* ---------- Reveal on scroll ----------
   Gated on html.js (set by an inline script in <head>): with JS off nothing
   is hidden. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .door.reveal.in { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: opacity .6s ease, transform .2s ease-out, border-color .2s, box-shadow .25s; }
.grid .reveal:nth-child(2) { transition-delay: .07s; }
.grid .reveal:nth-child(3) { transition-delay: .14s; }
.grid .reveal:nth-child(4) { transition-delay: .21s; }

/* ---------- Blog index ---------- */
.page-head { padding-top: clamp(48px, 9vh, 96px); padding-bottom: clamp(28px, 4vw, 44px); }
.page-head h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: -.04em; margin-bottom: 18px; }
.page-head .lede { margin-bottom: 0; }

.posts { list-style: none; margin: 0 0 clamp(56px, 8vw, 96px); padding: 0; border-top: 1px solid var(--line); }
.post-row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) auto;
  align-items: baseline; gap: 8px 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.post-row time { font: 500 12px/1.6 var(--font-mono); letter-spacing: .08em; color: var(--muted); }
.post-row h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); letter-spacing: -.025em; margin-bottom: 8px; transition: color .15s; }
.post-row p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; max-width: 620px; }
.post-row .tag { align-self: start; }
.post-row:hover h2 { color: var(--accent); }
.tag {
  display: inline-block; padding: 5px 9px; border-radius: 999px;
  font: 600 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-2);
}

/* ---------- Post ---------- */
.post {
  max-width: calc(720px + var(--gutter) * 2);
  margin: 0 auto;
  padding: clamp(40px, 8vh, 80px) var(--gutter) 0;
}
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin-bottom: 22px;
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.post-meta .idx { color: var(--accent); }
.post h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); letter-spacing: -.04em; line-height: .98; margin-bottom: 22px; }
.post-dek { font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.35; font-weight: 500; color: var(--text); margin-bottom: 16px; }
.post-by {
  padding-bottom: 26px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font: 500 12px/1.6 var(--font-mono);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.post-body { font-size: 18px; line-height: 1.72; }
.post-body p { margin: 0 0 1.25em; }
.post-body h2 {
  margin: 2.2em 0 .7em;
  font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.15;
}
.post-body a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 3px; transition: text-decoration-color .15s; }
.post-body a:hover { text-decoration-color: var(--accent); }
.post-body code {
  font: 500 .86em var(--font-mono);
  padding: 2px 6px; border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--line);
}

/* Numbered roster: index and name in the mono voice, one line of body each.
   Markup is <dl class="post-roster"><div><dt><span>02</span>Name</dt><dd>..</dd></div>. */
.post-roster { margin: 0 0 1.6em; border-top: 1px solid var(--line); }
.post-roster div {
  display: grid; grid-template-columns: 170px 1fr; gap: 4px 18px; align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.post-roster dt { font: 600 13px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.post-roster dt span { display: inline-block; width: 34px; color: var(--accent); }
.post-roster dd { margin: 0; font-size: 16.5px; line-height: 1.55; color: var(--muted); }
@media (max-width: 560px) { .post-roster div { grid-template-columns: 1fr; } }

/* The thing the post is about, playable from the page. */
.play-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px;
  margin: 2.4em 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  transition: border-color .15s, box-shadow .2s, transform .2s;
}
.play-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.play-id {
  padding: 8px 10px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  font: 700 11px/1 var(--font-mono); letter-spacing: .1em;
}
.play-card b { display: block; font-size: 18px; letter-spacing: -.01em; }
.play-card small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.play-card i { font-style: normal; color: var(--accent); font-size: 20px; transition: transform .2s; }
.play-card:hover i { transform: translateX(5px); }

.post-foot {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: clamp(40px, 7vw, 72px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ---------- Holding page ---------- */
.hold { min-height: calc(100svh - var(--top-h)); display: flex; align-items: center; padding-top: 60px; padding-bottom: 60px; }
.hold h1 { font-size: clamp(2.6rem, 8vw, 6rem); letter-spacing: -.045em; margin-bottom: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .door { min-height: 0; }
  .post-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .post-row .tag { grid-row: 1; justify-self: start; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .top { gap: 10px; }
  .wordmark em { display: none; }
  .nav a { padding: 8px 9px; font-size: 13px; }
  .nav a span { display: none; }
  .nav a[data-hide-narrow] { display: none; }
  .hero { min-height: 0; padding-top: 56px; }
  .hero-foot span:last-child { display: none; }
  .door-art { height: 100px; }
  .post-body { font-size: 17px; }
  .play-card { grid-template-columns: auto minmax(0, 1fr); }
  .play-card i { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .door { transform: none; }
  .hero-foot span:last-child { display: none; } /* clicks don't ping the field here */
}
