/* codenamev.com
   The original identity, struck again: black ground, bolt yellow, the hole it leaves. */

:root {
  --black: #000;
  --char: #131313;          /* the old navbar */
  --ash: #1f1f1f;           /* the old rules */
  --line: rgba(255, 255, 255, 0.12);
  --white: #f4f4ef;
  --grey: #a6a6a0;
  --bolt: #ffe11a;
  --bolt-deep: #f2c200;
  --bolt-glow: rgba(255, 225, 26, 0.35);

  --type: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --max: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--type);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--bolt); }
:focus-visible { outline: 2px solid var(--bolt); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--bolt); color: var(--black); }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 60; background: var(--bolt); color: var(--black); padding: 0.5rem 1rem; }
.skip:focus { top: 1rem; }

/* ---------- Wordmark ---------- */

.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--bolt); }
.wordmark-mark { width: 36px; height: 36px; }
.wordmark-text { font-weight: 900; font-stretch: 125%; font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1; }
.wordmark-v { width: 20px; height: 22px; margin: -0.5rem 0 0 -0.45rem; }
.wordmark:hover { color: var(--bolt); }

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

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0 var(--gutter);
  overflow: hidden;
  isolation: isolate;
}
.hero-ground { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-strike {
  position: absolute;
  z-index: -1;
  right: max(var(--gutter), 9vw);
  top: 0;
  height: 74%;
  aspect-ratio: 1 / 3;
  filter: drop-shadow(0 0 24px var(--bolt-glow)) drop-shadow(0 0 80px rgba(255, 225, 26, 0.18));
}
.hero-bolt {
  display: block; width: 100%; height: 100%;
  /* Out of the dark sky, below the nav. The glow on .hero-strike follows this fade. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 9%, #000 30%);
  mask-image: linear-gradient(to bottom, transparent 9%, #000 30%);
}
.hero-flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: #fffbe0; opacity: 0; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 0;
}
.nav ul { display: flex; gap: clamp(1rem, 2.5vw, 2rem); list-style: none; margin: 0; padding: 0; }
.nav ul a { font-size: 0.95rem; text-decoration: none; color: var(--grey); }
.nav ul a:hover { color: var(--bolt); }

.hero-copy {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  align-self: end;
  padding-bottom: clamp(3rem, 9vh, 6.5rem);
}
.hero h1 {
  margin: 0 0 1.75rem;
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.02em;
  font-size: clamp(3.4rem, 12vw, 10.5rem);
}
.hero h1 span { display: block; }
.hero h1 .first { font-stretch: 125%; font-weight: 200; letter-spacing: -0.04em; }
.hero h1 .last { font-stretch: 62%; font-weight: 900; font-size: 1.34em; line-height: 0.82; color: var(--bolt); }

.hero-line { margin: 0 0 1rem; max-width: 28ch; font-size: clamp(1.35rem, 2.4vw, 1.85rem); line-height: 1.25; font-weight: 500; font-stretch: 105%; }
.hero-about { margin: 0 0 2rem; max-width: 50ch; color: var(--grey); }
.hero-links { display: flex; flex-wrap: wrap; gap: 0.75rem; list-style: none; margin: 0; padding: 0; }
.hero-links a {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  background: rgba(19, 19, 19, 0.7);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.hero-links a:hover { background: var(--bolt); border-color: var(--bolt); color: var(--black); }

/* ---------- Sections ---------- */

.section { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(4.5rem, 11vw, 8.5rem) var(--gutter) 0; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 3rem;
  align-items: end;
  padding: 0.6rem 0 1.25rem;
  margin-bottom: 2.5rem;
  border-top: 1px solid var(--ash);
  border-bottom: 1px solid var(--ash);
}
/* The old site's thin uppercase headings, at poster size. */
.section-head h2 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 100;
  font-stretch: 125%;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.section-head p { margin: 0; color: var(--grey); max-width: 44ch; justify-self: end; }

/* ---------- Ventures: each plate keeps its own brand ---------- */

.plates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); }
.plate { position: relative; display: flex; flex-direction: column; padding: clamp(1.75rem, 3.5vw, 3rem); min-height: 34rem; }
.plate h3 { margin: 2rem 0 0.25rem; line-height: 1; }
.plate h3 a { text-decoration: none; }
.plate-art { width: 88px; height: 88px; }
.plate-art svg { width: 100%; height: 100%; display: block; }
.plate-tagline { margin: 0 0 1.25rem; font-size: 1.2rem; font-style: italic; }
.plate-summary { margin: 0 0 1.5rem; max-width: 46ch; }
.plate-highlights { margin: 0 0 2rem; padding: 0; list-style: none; font-size: 0.95rem; }
.plate-highlights li { padding: 0.6rem 0; border-top: 1px solid var(--plate-rule); }
.plate-links { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-weight: 600; }

.plate-autogenetica {
  --plate-rule: rgba(31, 42, 68, 0.22);
  background: #f4efe4;
  color: #1c1a17;
  font-family: "Source Serif 4", Georgia, serif;
  box-shadow: inset 0 0 0 1px rgba(196, 169, 98, 0.6), inset 0 0 0 8px #f4efe4, inset 0 0 0 9px rgba(139, 46, 42, 0.35);
}
.plate-autogenetica .plate-art { color: #8b2e2a; }
.plate-autogenetica h3 { font-family: "Cinzel", "Trajan Pro", Georgia, serif; font-weight: 600; font-size: clamp(2rem, 3.6vw, 2.9rem); letter-spacing: 0.04em; color: #1f2a44; }
.plate-autogenetica .plate-tagline, .plate-autogenetica a { color: #8b2e2a; }
.plate-autogenetica a:hover { color: #6e211f; }
.plate-autogenetica :focus-visible { outline-color: #8b2e2a; }

.plate-minerva {
  --plate-rule: rgba(245, 158, 11, 0.18);
  background: radial-gradient(ellipse at 15% 0%, #1a2138 0%, transparent 60%), radial-gradient(ellipse at 90% 100%, #2b1a08 0%, transparent 60%), #0d0d14;
  color: #e2e8f0;
  font-family: "Iowan Old Style", "Hoefler Text", Georgia, serif;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.plate-minerva .plate-art { color: #f59e0b; }
.plate-minerva h3 { font-family: "Didot", "Bodoni 72", "Big Caslon", Georgia, serif; font-weight: 400; font-size: clamp(2.3rem, 4vw, 3.2rem); letter-spacing: 0.01em; }
.plate-minerva .plate-tagline { color: #f5b544; }
.plate-minerva .plate-summary, .plate-minerva .plate-highlights { color: #b8c2d1; }
.plate-minerva a { color: #f59e0b; }
.plate-minerva a:hover { color: #fbbf24; }
.plate-minerva .plate-art::after {
  content: ""; position: absolute;
  top: clamp(1.75rem, 3.5vw, 3rem); right: clamp(1.75rem, 3.5vw, 3rem);
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e;
}

/* ---------- Products ---------- */

.manifest { list-style: none; margin: 0; padding: 0; }
.manifest-row { border-bottom: 1px solid var(--ash); }
.manifest-row a {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) 7.5rem;
  gap: 0.5rem 2rem;
  align-items: baseline;
  padding: 1.4rem 0.25rem;
  text-decoration: none;
  transition: background-color 0.25s, padding 0.25s;
}
.manifest-row a:hover { background: var(--char); padding-left: 1rem; color: inherit; }
.manifest-row a:hover .manifest-name { color: var(--bolt); }
.manifest-name { font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 800; font-stretch: 80%; line-height: 1.05; letter-spacing: -0.01em; transition: color 0.2s; }
.manifest-summary { color: var(--grey); }
.manifest-status { justify-self: end; font-size: 0.9rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.45em; color: var(--grey); }
.manifest-status svg { width: 0.55em; height: 1.4em; fill: none; stroke: var(--grey); stroke-width: 14; }
.is-live .manifest-status { color: var(--white); }
.is-live .manifest-status svg { fill: var(--bolt); stroke: none; filter: drop-shadow(0 0 4px var(--bolt-glow)); }

/* ---------- Open source ---------- */

.gems {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ash);
  border-left: 1px solid var(--ash);
}
.gems li { border-right: 1px solid var(--ash); border-bottom: 1px solid var(--ash); }
.gem {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: 0.6rem 1rem;
  height: 100%;
  padding: 1.5rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.gem:hover { background: var(--bolt); color: var(--black); }
.gem:hover .gem-summary, .gem:hover .gem-repo, .gem:hover .gem-stars { color: var(--black); }
.gem-name { font-size: 1.3rem; font-weight: 800; font-stretch: 88%; line-height: 1.15; }
.gem-stars { font-size: 0.9rem; display: inline-flex; gap: 0.3em; align-items: center; color: var(--grey); font-variant-numeric: tabular-nums; }
.gem-stars svg { width: 0.9em; height: 0.9em; fill: currentColor; }
.gem-summary { grid-column: 1 / -1; color: var(--grey); font-size: 0.95rem; line-height: 1.5; }
.gem-repo { grid-column: 1 / -1; font-stretch: 80%; font-size: 0.85rem; color: #8a8a83; }

.orgs { margin-top: 3rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem 3rem; }
.orgs h3, .bench-col h3 { margin: 0; font-size: 1.35rem; font-weight: 700; font-stretch: 110%; }
.orgs ul, .bench-col ul { list-style: none; margin: 0; padding: 0; }
.orgs li { padding: 0.85rem 0; border-top: 1px solid var(--ash); display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; }
.orgs li:first-child { border-top: 0; padding-top: 0; }
.orgs a { font-weight: 700; }
.orgs span { color: var(--grey); }

/* ---------- Workbench ---------- */

.bench { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(2rem, 6vw, 5rem); }
.bench-col h3 { margin-bottom: 1rem; }
.bench-col li { padding: 0.75rem 0; border-top: 1px solid var(--ash); }
.bench-col li > a, .bench-col li > strong { display: block; margin-bottom: 0.15rem; font-weight: 700; }
.bench-col span { display: block; color: var(--grey); }
/* Ideas are sketched, not built: dashed rules, lighter weight. */
.bench-sketch li { border-top-style: dashed; border-top-color: #333; }
.bench-sketch li > strong { font-weight: 400; font-style: italic; }

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

.footer { max-width: calc(var(--max) + 2 * var(--gutter)); margin: clamp(5rem, 12vw, 9rem) auto 0; padding: 0 var(--gutter) 3rem; overflow: hidden; }
.footer-big {
  display: flex;
  align-items: flex-end;
  margin: 0 0 1.5rem;
  padding: 2rem 0 1.5rem;
  border-top: 1px solid var(--ash);
  border-bottom: 1px solid var(--ash);
  color: var(--bolt);
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(2.5rem, 11.2vw, 9.6rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
}
.footer-big img { height: 1.3em; width: auto; margin: 0 0 -0.04em -0.06em; }
.footer ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; list-style: none; margin: 0 0 1.5rem; padding: 0; font-weight: 500; }
.footer-small { margin: 0; color: var(--grey); font-size: 0.9rem; }

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

@media (max-width: 960px) {
  .gems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manifest-row a { grid-template-columns: minmax(0, 1fr) auto; }
  .manifest-summary { grid-column: 1 / -1; grid-row: 2; }
  .manifest-status { grid-column: 2; grid-row: 1; }
}
@media (max-width: 760px) {
  .nav ul { display: none; }
  .hero-strike { height: 36%; right: 8vw; }
  .section-head { grid-template-columns: 1fr; }
  .section-head p { justify-self: start; }
  .plates, .bench, .orgs { grid-template-columns: 1fr; }
  .plate { min-height: 0; }
  .gems { grid-template-columns: 1fr; }
  .orgs li { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* ---------- The strike ---------- */
/* Dark until the bolt lands, then the lights flicker on. Only with motion allowed;
   otherwise (and without JS) the page is simply lit. */

.js .hero-bolt { clip-path: inset(0 0 100% 0); }
.js.struck .hero-bolt { animation: strike 0.22s cubic-bezier(0.7, 0, 0.9, 0.4) forwards; }
.js.flashing .hero-flash { animation: flash 0.9s ease-out 0.18s; }
.js.soft-flash .hero-flash { animation: soft-flash 0.6s ease-out 0.18s; }
@keyframes strike { to { clip-path: inset(0 0 0 0); } }
@keyframes flash { 0% { opacity: 0.55; } 12% { opacity: 0.05; } 20% { opacity: 0.3; } 100% { opacity: 0; } }
@keyframes soft-flash { 0% { opacity: 0.18; } 100% { opacity: 0; } }

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background: radial-gradient(ellipse 60% 50% at 72% 78%, rgba(255, 225, 26, 0.09), transparent 70%);
  transition: opacity 1.4s ease-out;
}
.hero { background: var(--black); }

@media (prefers-reduced-motion: no-preference) {
  .js:not(.lit) .hero::before { opacity: 0; }
  .js .nav, .js .hero-copy > *, .js .hero h1 span, .js main, .js .footer { opacity: 0; }
  .js .hero h1 { opacity: 1; }
  .js.lit .nav, .js.lit .hero-copy > *, .js.lit .hero h1 span {
    animation: lights-on 0.9s linear forwards;
    animation-delay: var(--on, 0s);
  }
  .js.lit .nav { --on: 0.05s; }
  .js.lit .hero h1 .first { --on: 0.15s; }
  .js.lit .hero h1 .last { --on: 0.3s; animation: lights-on 0.9s linear var(--on) forwards, neon 2.4s ease-out var(--on) forwards; }
  .js.lit .hero-line { --on: 0.5s; }
  .js.lit .hero-about { --on: 0.6s; }
  .js.lit .hero-links { --on: 0.7s; }
  .js.lit main, .js.lit .footer { opacity: 1; transition: opacity 1s ease-out 0.8s; }
}
@keyframes lights-on {
  0% { opacity: 0; } 8% { opacity: 0.9; } 12% { opacity: 0.1; } 20% { opacity: 1; }
  24% { opacity: 0.35; } 32%, 100% { opacity: 1; }
}
@keyframes neon {
  0% { text-shadow: none; }
  15% { text-shadow: 0 0 40px rgba(255, 225, 26, 0.9), 0 0 4px rgba(255, 255, 220, 0.9); }
  100% { text-shadow: 0 0 28px rgba(255, 225, 26, 0.28); }
}
.hero h1 .last { text-shadow: 0 0 28px rgba(255, 225, 26, 0.28); }
/* Click the sky to strike again. */
.js.lit .hero { cursor: crosshair; }
.js.lit .hero a { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .hero-bolt { clip-path: none !important; }
}

/* ---------- Writing ---------- */

.posts { list-style: none; margin: 0; padding: 0; }
.posts li { border-bottom: 1px solid var(--ash); }
.post {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.35rem 2rem;
  padding: 1.6rem 0.25rem;
  text-decoration: none;
  transition: background-color 0.25s, padding 0.25s;
}
.post:hover { background: var(--char); padding-left: 1rem; color: inherit; }
.post-meta { grid-row: span 2; color: var(--grey); font-size: 0.9rem; line-height: 1.4; padding-top: 0.45rem; font-variant-numeric: tabular-nums; }
.post-title { font-size: clamp(1.5rem, 3vw, 2.3rem); font-weight: 700; font-stretch: 90%; line-height: 1.1; letter-spacing: -0.01em; max-width: 30ch; transition: color 0.2s; }
.post:hover .post-title { color: var(--bolt); }
.post-summary { color: var(--grey); max-width: 60ch; }
.posts-more { margin: 1.5rem 0 0; font-weight: 600; }
.posts-more a { color: var(--bolt); }
@media (max-width: 760px) {
  .post { grid-template-columns: 1fr; }
  .post-meta { grid-row: auto; padding-top: 0; }
}

/* ---------- Now reading: a dense two-column log ---------- */

.reading {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 4rem);
}
.reading li { border-bottom: 1px solid var(--ash); }
.read {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.2rem 1rem;
  padding: 1rem 0;
  text-decoration: none;
}
.read time { grid-row: span 2; color: var(--bolt); font-size: 0.9rem; font-weight: 600; padding-top: 0.15rem; font-variant-numeric: tabular-nums; }
.read-title { font-weight: 600; line-height: 1.35; transition: color 0.2s; }
.read:hover { color: inherit; }
.read:hover .read-title { color: var(--bolt); }
.read-by { color: var(--grey); font-size: 0.9rem; }
@media (max-width: 760px) {
  .reading { grid-template-columns: 1fr; }
}

.posts-older { margin-top: 0.5rem; }
.posts-older summary {
  cursor: pointer;
  padding: 1rem 0.25rem;
  font-weight: 600;
  color: var(--bolt);
  list-style: none;
}
.posts-older summary::-webkit-details-marker { display: none; }
.posts-older summary::before { content: "+"; display: inline-block; width: 1.2em; font-weight: 400; }
.posts-older[open] summary::before { content: "\2212"; }
.posts-older .post-title { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
