:root {
  --bg: #000;
  --fg: #c8c8c8;
  --bright: #f2f2f2;
  --muted: #5f5f5f;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.term {
  position: relative;
  z-index: 1; /* above the card, so the card can grow out from behind a row */
  max-width: 760px;
  padding: clamp(20px, 5vw, 56px) clamp(16px, 5vw, 56px) 80px;
}

.ps1 { color: var(--muted); user-select: none; }
.cmd { color: var(--bright); }
.out { margin-bottom: 1.6em; }

h1 {
  font: inherit;
  color: var(--fg);
}

/* On wide screens, keep the terminal in the left half so the pane never covers it. */
@media (min-width: 768px) {
  .term { max-width: min(760px, 50vw); }
}

.word canvas {
  display: block;
  width: min(550px, 100%);
  margin: 0.4em 0 0.6em;
}

/* Experience / logo lists */
.list { list-style: none; padding: 0; }
.list.inline { display: flex; flex-wrap: wrap; gap: 0 24px; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 0 4px;
  margin-left: -4px;
}

.row .name { min-width: 8ch; color: var(--fg); }
.list.inline .name { min-width: 0; }
.row .detail { color: var(--muted); }

.logo {
  width: 14px;
  height: 14px;
  object-fit: contain;
  border-radius: 3px;
  filter: grayscale(1) brightness(1.3);
  opacity: 0.85;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.row:hover .logo,
.row.active .logo { filter: none; opacity: 1; }

.row[data-pane] { cursor: default; }
.row[data-pane]:hover,
.row[data-pane]:focus-visible,
.row.active { background: var(--fg); outline: none; }
.row[data-pane]:hover .name,
.row[data-pane]:hover .detail,
.row[data-pane]:focus-visible .name,
.row[data-pane]:focus-visible .detail,
.row.active .name,
.row.active .detail { color: var(--bg); }

/* Wyrm's Rock: live 3D scene behind the whole page. It starts small in the lower right;
   zoom in and it spreads out under the text. Same layer as the card but earlier in the
   page, so the card opens over it. */
.scene3d {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border: 0;
  z-index: 0;
  background: var(--bg);
  opacity: 0;
  pointer-events: none; /* while it tests itself, invisible */
  transition: opacity 1.4s ease;
}
.scene3d.ready { opacity: 1; pointer-events: auto; }
@media (max-width: 767px) {
  .scene3d { display: none; }
}
/* While the scene is showing, drags and scrolls on empty parts of the terminal reach it;
   links, rows and the word still take the pointer. (scene-on is set by the embed script.) */
@media (min-width: 768px) {
  body.scene-on .term { pointer-events: none; }
  body.scene-on .term a, body.scene-on .term .row, body.scene-on .term canvas { pointer-events: auto; }
}

/* Shared preview card. Position and size are driven by pane.js (spring). */
.card {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0; /* behind the text: it emerges from under the highlighted row */
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  border-radius: 12px;
  background: #0a0a0a;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  will-change: transform;
}

.card-inner { position: absolute; left: 0; top: 0; will-change: transform; }

/* Phones: the card is a bottom sheet over the page. */
@media (max-width: 767px) {
  .card { z-index: 10; }
}

/* Each pane's content is a layer; switching rows crossfades layers inside the same card. */
.layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  filter: blur(6px);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.35s ease;
}
.layer.show { opacity: 1; transform: none; filter: none; }

.slides { position: relative; flex: 1; overflow: hidden; } /* keeps the oversized globe off the notes */

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.9s ease, transform 2.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.slide.on { opacity: 1; transform: scale(1); }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; display: block; }

.slide.photo { background: #111; }

/* Live visual slides (viz.js draws into the canvas behind the label). */
.slide.viz {
  background: radial-gradient(120% 110% at 85% 0%, #1c0305 0%, #0a0a0a 60%);
}
.slide.viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.globe-box {
  /* Oversized and pushed off the right edge, so it reads as a planet, not a widget. */
  position: absolute;
  height: 165%;
  aspect-ratio: 1;
  right: -24%;
  top: -12%;
}
.viz .label {
  position: absolute;
  left: 24px;
  top: 20px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 46%;
  pointer-events: none;
}
.viz .label b {
  font: 900 clamp(48px, 6.4vw, 96px) / 0.85 Geist, sans-serif;
  letter-spacing: -0.055em;
  color: #e50914;
}
.viz .label b.sm { font-size: clamp(30px, 3.6vw, 52px); letter-spacing: -0.04em; }
.viz .label span { color: var(--fg); font-size: 12px; line-height: 1.5; text-shadow: 0 1px 8px #000; }
.viz .axis {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 14px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 767px) {
  .viz .label { left: 16px; top: 16px; max-width: 58%; }
  .viz .label b { font-size: 44px; }
}

.notes {
  list-style: none;
  padding: 12px 16px 10px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--fg);
}
.notes li::before { content: "- "; color: var(--muted); }
.notes li.todo { color: var(--muted); }
.notes li.todo::before { content: "# "; }

/* Netflix intro: pane.js dithers the N in and out on the canvas. The black backing fades
   out as the dots dissolve (timed to match DITHER_IN/HOLD/OUT in pane.js), uncovering the globe. */
.intro {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #000;
}
.intro canvas { display: block; width: 100%; height: 100%; }
.intro.play { animation: n-out 0.45s ease 1.4s forwards; }

@keyframes n-out { to { opacity: 0; visibility: hidden; } }

.caption {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--fg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.caption .count { color: var(--muted); }

a:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}

.note { color: var(--muted); }

.links { display: flex; flex-wrap: wrap; gap: 0 24px; }

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
}

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

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.15em;
  vertical-align: -0.2em;
  background: var(--fg);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
