/* ==========================================================================
   riNN.dev: the matrix pages (index.html, _template, 404)
   ========================================================================== */

:root,
[data-theme="dark"] {
  /* Dark: the matrix */
  --void: #000000;
  --deep: #00160a;     /* panels */
  --line: #12371f;     /* rules and borders */
  --muted: #5a9e6e;    /* secondary text, 6:1 on black */
  --text: #a8f0bc;     /* body text */
  --ghost: #e6ffec;    /* headings, the brightest text */
  --phosphor: #00ff41; /* the one loud colour */
  --on-phosphor: #000000;
  --glow: rgba(0, 255, 65, .55);
  --err: #ff5f56;

  --rain-bg: #000000;
  --rain-trail: #0b8a2c;
  --rain-body: #00ff41;
  --rain-head: #e6ffec;
  --rain-word: #5dff86;
  --rain-flash: #f2fff5;
  --rain-dim: .5;
  --rain-tile: none;
  color-scheme: dark;
}

[data-theme="light"] {
  /* Light: blue code on white */
  --void: #ffffff;
  --deep: #f1f6fd;
  --line: #d5e2f3;
  --muted: #47607f;    /* 6.3:1 on white */
  --text: #17304f;
  --ghost: #06142b;
  --phosphor: #0b5bd3; /* 5.9:1 on white */
  --on-phosphor: #ffffff;
  --glow: rgba(25, 105, 230, .3);
  --err: #b3261e;

  --rain-bg: #ffffff;
  --rain-trail: #d3e4fa;
  --rain-body: #6ea8f2;
  --rain-head: #0a2a66;
  --rain-word: #ffffff;      /* glyphs on the tiles */
  --rain-flash: #0a2a66;     /* glyphs still decoding */
  --rain-tile: #0b5bd3;
  --rain-tile-flash: #3f8cff;
  --rain-dim: .45;
  color-scheme: light;
}

:root {
  --font: "Martian Mono", "M PLUS 1 Code", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --glyph: "M PLUS 1 Code", var(--font);
  --wrap: 1180px;
  --pad: clamp(20px, 5vw, 56px);
  --gap-section: clamp(64px, 9vw, 112px);
}

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

html {
  background: var(--void);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  transition: background-color .35s ease, color .35s ease;
}
body {
  margin: 0;
  font-family: var(--font);
  font-stretch: 87.5%;
  font-size: 0.9375rem;   /* 15px */
  line-height: 1.7;
  background: var(--void);
  transition: background-color .35s ease;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { margin: 0; font-weight: 700; }
[hidden] { display: none !important; }

::selection { background: var(--phosphor); color: var(--on-phosphor); }
:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--phosphor);
  color: var(--on-phosphor);
  text-decoration: none;
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Top bar ---------- */

.topnav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 36px);
  height: 64px;
  padding: 0 var(--pad);
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease, opacity .6s ease;
}
.topnav.is-solid { background: var(--void); border-bottom-color: var(--line); }
html.js .home .topnav { opacity: 0; }
html.js.hero-formed .home .topnav { opacity: 1; }
.topnav-home {
  font-weight: 700;
  font-stretch: 112.5%;
  color: var(--ghost);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.topnav nav { margin-left: auto; }
.topnav ul { display: flex; gap: clamp(14px, 3vw, 36px); }
.topnav nav a { color: var(--text); text-decoration: none; font-size: 0.8125rem; white-space: nowrap; }
.topnav nav a:hover { color: var(--phosphor); }
.theme-toggle, .lang-toggle {
  --tt-track: var(--deep);
  --tt-border: var(--line);
  --tt-knob: var(--phosphor);
  --tt-icon-on: var(--on-phosphor);
  color: var(--muted);
}

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

.hero {
  position: relative;
  height: clamp(560px, 84vh, 800px);
  height: clamp(560px, 84svh, 800px);
  overflow: hidden;
  background: var(--void);
}
.hero-rain, .hero-word { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-word { filter: drop-shadow(0 0 4px var(--glow)); pointer-events: none; }
[data-theme="light"] .hero-word { filter: drop-shadow(0 6px 14px rgba(11, 91, 211, .22)); }

/* Who, what and how to reach me: readable over the rain. */
.hero-card {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: clamp(20px, 4vh, 36px);
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
  gap: 16px clamp(24px, 5vw, 72px);
  align-items: end;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 22px 26px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--void) 88%, transparent);
  backdrop-filter: blur(3px);
}
.hero-name {
  display: grid;
  gap: 2px;
  font-size: clamp(1.5rem, 3vw, 2.375rem);
  font-weight: 700;
  font-stretch: 100%;
  line-height: 1.15;
  color: var(--ghost);
}
.hero-role {
  font-size: clamp(1rem, 1.7vw, 1.3125rem);
  font-weight: 600;
  color: var(--phosphor);
}
.hero-pitch { max-width: 56ch; margin-top: 12px; color: var(--text); }
.hero-links { display: grid; gap: 6px; }
.hero-links li { display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: 12px; align-items: baseline; }
.hero-link-label { color: var(--muted); font-size: 0.8125rem; }
.hero-link {
  color: var(--ghost);
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line);
}
.hero-link:hover { color: var(--phosphor); border-color: var(--phosphor); }

html.js .hero [data-decode] { visibility: hidden; }
html.js .hero [data-decode].is-on { visibility: visible; }
html.js .hero-card { opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
html.js.hero-formed .hero-card { opacity: 1; transform: none; }
html.js .hero-links { opacity: 0; transition: opacity .5s ease .3s; }
html.js.hero-formed .hero-links { opacity: 1; }

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

.section {
  max-width: calc(var(--wrap) + 2 * var(--pad));
  margin: 0 auto;
  padding: var(--gap-section) var(--pad) 0;
}
.section-title {
  margin-bottom: clamp(24px, 4vw, 44px);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-stretch: 112.5%;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ghost);
}
.section-title.is-scrambled { font-family: var(--glyph); color: var(--phosphor); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  margin-bottom: clamp(24px, 4vw, 44px);
}
.section-head .section-title { margin-bottom: 0; }
.section-note { color: var(--muted); font-size: 0.8125rem; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: stretch;
}
.about-text { display: grid; gap: 20px; }
#about-bio { display: grid; gap: 16px; max-width: 62ch; }
.lead {
  font-size: clamp(1rem, 1.6vw, 1.1875rem);
  font-stretch: 100%;
  line-height: 1.6;
  color: var(--ghost);
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.facts dt { color: var(--muted); font-size: 0.75rem; }
.facts dd { color: var(--ghost); }

/* The console */
.term {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--deep);
  font-size: 0.875rem;
}
.term-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}
.term.is-busy .term-bar-state { color: var(--phosphor); }
.term-body {
  flex: 1 1 auto;
  height: 300px;
  min-height: 300px;
  overflow-y: auto;
  padding: 16px 18px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  cursor: text;
}
.t-line { min-height: 1.7em; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.t-cmd { color: var(--ghost); }
.t-user { color: var(--phosphor); }
.t-path { color: var(--muted); }
.t-key { color: var(--muted); white-space: pre; }
.t-val { color: var(--ghost); }
.t-err { color: var(--err); }
.t-line a { color: var(--phosphor); text-underline-offset: 3px; }
.term-line { display: flex; align-items: baseline; gap: .6ch; }
.term-line[hidden] { display: none; }
.term-prompt { flex: 0 0 auto; color: var(--ghost); white-space: nowrap; }
.term-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ghost);
  font: inherit;
  caret-color: var(--phosphor);
}
.term:focus-within { border-color: var(--phosphor); }
.term-hint {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}
.term-hint kbd {
  padding: 0 5px;
  border: 1px solid var(--line);
  color: var(--phosphor);
  font: inherit;
}
.term:not(.is-ready) .term-hint { visibility: hidden; }


/* Skills: four short groups */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.skill-col { padding: 22px 22px 6px; }
.skill-col:first-child { padding-left: 0; }
.skill-col + .skill-col { border-left: 1px solid var(--line); }
.skill-group { margin-bottom: 12px; font-size: 1rem; font-stretch: 100%; color: var(--phosphor); }
.skill-items { display: grid; gap: 6px; }
.skill { display: flex; align-items: baseline; gap: 10px; color: var(--text); }
.skill--main { color: var(--ghost); font-weight: 600; }
.skill-tag {
  padding: 0 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 400;
}

/* Projects: the same fields for every project */
.work-list { display: grid; gap: 16px; }
.work {
  /* matrix colours by default */
  --c-bg: var(--void);
  --c-mid: var(--deep);
  --c-line: var(--line);
  --c-fg: var(--text);
  --c-ac: var(--phosphor);
  --c-act: var(--phosphor);
  --c-ac2: var(--muted);
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(240px, 1fr);
  gap: clamp(20px, 3vw, 40px);
  padding: clamp(20px, 2.6vw, 30px);
  border: 1px solid var(--line);
  color: var(--text);
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
.work-head { display: grid; gap: 10px; margin-bottom: 18px; }
.work-title { font-size: clamp(1.625rem, 3vw, 2.25rem); font-stretch: 112.5%; line-height: 1.1; letter-spacing: -0.02em; }
.work-title a { display: inline-flex; align-items: center; gap: 14px; color: var(--ghost); text-decoration: none; transition: color .35s ease; }
.work-title a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.work-logo { flex: 0 0 auto; width: 1.05em; height: 1.05em; overflow: visible; }
.work-logo .cv-bg { fill: var(--c-bg); }
.work-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  padding: 1px 8px;
  border: 1px solid var(--c-line);
  color: var(--c-fg);
  font-size: 0.75rem;
  transition: border-color .35s, color .35s;
}
.badge--status { border-color: var(--c-act); color: var(--c-act); }
.work-facts { display: grid; gap: 10px; }
.work-facts > div { display: grid; grid-template-columns: 11ch minmax(0, 1fr); gap: 16px; }
.work-facts dt { color: var(--muted); font-size: 0.8125rem; padding-top: 2px; transition: color .35s; }
.work-facts dd { max-width: 70ch; }
.work-stack { display: flex; flex-wrap: wrap; gap: 4px 0; }
.work-stack li:not(:last-child)::after { content: "/"; margin: 0 9px; opacity: .5; }

.work-main, .work-side { min-width: 0; }
.work-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.work-cover {
  display: block;
  aspect-ratio: 240 / 150;
  overflow: hidden;
  border: 1px solid var(--c-line);
  transition: border-color .35s ease;
}
.work-cover svg { width: 100%; height: 100%; }
.work-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; }
.work-open {
  padding: 8px 14px;
  background: var(--c-act);
  color: var(--c-bg);
  font-weight: 700;
  text-decoration: none;
  transition: background-color .35s, color .35s;
}
.work-open:hover { filter: brightness(1.1); }
.work-link { color: var(--c-act); text-underline-offset: 4px; transition: color .35s; }
.work-block-label { margin-bottom: 4px; color: var(--muted); font-size: 0.8125rem; transition: color .35s; }
.work-run pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--c-line);
  background: var(--c-mid);
  color: var(--c-fg);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.7;
  transition: background-color .35s, color .35s, border-color .35s;
}

/* Pointing at a project swaps the matrix for that project's own colours,
   the dark or light version to match the current theme. */
[data-theme="dark"] .work:hover,
[data-theme="dark"] .work:focus-within {
  --c-bg: var(--wd-bg); --c-mid: var(--wd-mid); --c-line: var(--wd-line); --c-fg: var(--wd-fg);
  --c-ac: var(--wd-ac); --c-act: var(--wd-act); --c-ac2: var(--wd-ac2);
}
[data-theme="light"] .work:hover,
[data-theme="light"] .work:focus-within {
  --c-bg: var(--wl-bg); --c-mid: var(--wl-mid); --c-line: var(--wl-line); --c-fg: var(--wl-fg);
  --c-ac: var(--wl-ac); --c-act: var(--wl-act); --c-ac2: var(--wl-ac2);
}
.work:hover, .work:focus-within { background: var(--c-bg); color: var(--c-fg); border-color: var(--c-line); }
.work:hover .work-title a, .work:focus-within .work-title a { color: var(--c-act); }
.work:hover .work-facts dt, .work:focus-within .work-facts dt,
.work:hover .work-block-label, .work:focus-within .work-block-label { color: var(--c-fg); opacity: .7; }

/* Touch screens can't hover: covers show the project's colours right away. */
@media (hover: none) {
  [data-theme="dark"] .work-cover { --c-bg: var(--wd-bg); --c-mid: var(--wd-mid); --c-line: var(--wd-line); --c-fg: var(--wd-fg); --c-ac: var(--wd-ac); --c-ac2: var(--wd-ac2); }
  [data-theme="light"] .work-cover { --c-bg: var(--wl-bg); --c-mid: var(--wl-mid); --c-line: var(--wl-line); --c-fg: var(--wl-fg); --c-ac: var(--wl-ac); --c-ac2: var(--wl-ac2); }
  .section-note--hover { display: none; }
}

/* Cover drawing classes (see covers.js) */
.work-cover *, .work-logo * { transition: fill .35s ease, stroke .35s ease; }
.cv-bg { fill: var(--c-bg); }
.cv-mid { fill: var(--c-mid); }
.cv-fg { fill: var(--c-fg); }
.cv-ac { fill: var(--c-ac); }
.cv-ac2 { fill: var(--c-ac2); }
.cv-stroke { stroke: var(--c-line); stroke-width: 1; }
.cv-line { stroke: var(--c-line); stroke-width: 1; }
.cv-glyph { font: 700 96px var(--font); fill: var(--c-ac); }
.cv-beam { fill: none; stroke: var(--c-fg); stroke-width: 4; stroke-linecap: round; }
.cv-rays path { fill: none; stroke: var(--c-ac); stroke-width: 3.6; stroke-linecap: round; }
.cv-prism { fill: var(--c-bg); stroke: var(--c-fg); stroke-width: 4; stroke-linejoin: round; }
.cv-smile { fill: none; stroke: var(--c-ac); stroke-width: 4; stroke-linecap: round; }

/* Contact */
.contact-text { max-width: 60ch; margin-bottom: 24px; }
.contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 40px; }
.contact-item { display: grid; gap: 2px; }
.contact-label { color: var(--muted); font-size: 0.8125rem; }
.contact-link {
  justify-self: start;
  font-size: clamp(1.125rem, 2.4vw, 1.625rem);
  font-weight: 600;
  font-stretch: 100%;
  color: var(--ghost);
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 2px solid var(--line);
  transition: border-color .2s, color .2s;
}
.contact-link:hover { color: var(--phosphor); border-color: var(--phosphor); }

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(var(--wrap), 100% - 2 * var(--pad));
  margin: var(--gap-section) auto 0;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}

/* Drafts: shown only in preview (server.py --preview, or ?preview from disk) */
.work.is-draft { border-style: dashed; }
.badge--draft { border-style: dashed; border-color: var(--muted); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: .6875rem; }
.is-todo { color: var(--muted); opacity: .8; }
.is-todo::before { content: "[ "; }
.is-todo::after { content: " ]"; }
.work-stack li.is-todo::after { content: " ]"; margin: 0; opacity: 1; }

/* Hackathons: one row per event, date and result on the left */
.hack-list { border-top: 1px solid var(--line); }
.hack {
  --c-line: var(--line); --c-fg: var(--text); --c-act: var(--phosphor);
  display: grid;
  grid-template-columns: minmax(150px, .3fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(20px, 2.6vw, 28px) 0;
  border-bottom: 1px solid var(--line);
}
.hack.is-draft { border-bottom-style: dashed; }
.hack-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hack-date { color: var(--phosphor); font-weight: 700; font-stretch: 112.5%; }
.hack-place { color: var(--muted); font-size: .8125rem; }
.hack-name {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  margin-bottom: 14px;
  color: var(--ghost);
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  font-stretch: 112.5%;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.hack-org { color: var(--muted); font-size: .8125rem; font-weight: 400; font-stretch: 100%; letter-spacing: 0; }
.hack-body .work-stack { margin-top: 14px; font-size: .8125rem; }
.hack-body .work-actions { margin-top: 12px; }

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

@media (max-width: 1000px) {
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-col:nth-child(3) { padding-left: 0; border-left: 0; }
  .skill-col:nth-child(n+3) { border-top: 1px solid var(--line); }
  .work { grid-template-columns: minmax(0, 1fr); }
  .work-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .work-cover { grid-row: span 3; }
}

@media (max-width: 720px) {
  body { font-size: 0.875rem; }
  .topnav-home { display: none; }
  .topnav nav a { font-size: 0.75rem; }
  .topnav { gap: 10px; }
  .topnav ul { gap: 12px; }
  .topnav nav { flex: 1 1 auto; min-width: 0; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  .topnav nav::-webkit-scrollbar { display: none; }
  .topnav .toggles { gap: 6px; }
  .hero-card { grid-template-columns: minmax(0, 1fr); padding: 16px 18px; bottom: 16px; left: 14px; right: 14px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .term-body { height: 280px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .skills-grid { grid-template-columns: minmax(0, 1fr); }
  .skill-col, .skill-col + .skill-col { padding: 18px 0 10px; border-left: 0; border-top: 1px solid var(--line); }
  .skill-col:first-child { border-top: 0; }
  .skill-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
  .work-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .work-side { grid-template-columns: minmax(0, 1fr); }
  .work-cover { grid-row: auto; }
  .hack { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hack-meta { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
  .contact-list { grid-template-columns: minmax(0, 1fr); }
  .footer { flex-direction: column; }
}

/* ==========================================================================
   Generic project page (_template)
   ========================================================================== */

.crumbs { display: flex; gap: 10px; font-size: 0.8125rem; }
.crumbs li + li::before { content: "/"; margin-right: 10px; color: var(--muted); }
.crumbs a { color: var(--text); text-decoration: none; }
.crumbs a:hover { color: var(--phosphor); }
.crumbs [aria-current] { color: var(--ghost); }

.proj {
  width: min(var(--wrap), 100% - 2 * var(--pad));
  margin: 0 auto;
  padding-top: clamp(120px, 16vw, 180px);
}
.proj-head { max-width: 900px; }
.proj-title {
  font-size: clamp(3rem, 9vw, 6.75rem);
  font-stretch: 112.5%;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--phosphor);
  text-shadow: 0 0 22px var(--glow);
  overflow-wrap: anywhere;
}
.proj-full {
  margin-top: 14px;
  color: var(--muted);
}
.proj-summary {
  margin-top: 28px;
  max-width: 46ch;
  font-size: clamp(1.0625rem, 1.8vw, 1.3125rem);
  font-stretch: 100%;
  line-height: 1.55;
  color: var(--ghost);
}
.proj-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.proj-meta dt { color: var(--muted); font-size: 0.75rem; }
.proj-meta dd { color: var(--ghost); }
.proj-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.proj-btn {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid var(--phosphor);
  color: var(--phosphor);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color .2s, color .2s;
}
.proj-btn:hover, .proj-btn--primary { background: var(--phosphor); color: var(--void); }
.proj-btn--primary:hover { background: var(--ghost); border-color: var(--ghost); }

.proj-section { margin-top: clamp(80px, 11vw, 128px); }
.proj-h2 {
  margin-bottom: 32px;
  font-size: clamp(1.75rem, 3.4vw, 2.625rem);
  font-stretch: 112.5%;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ghost);
}
.proj-note { margin: -16px 0 28px; color: var(--muted); font-size: 0.8125rem; }

.proj-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.proj-feature {
  padding: 24px 32px 28px 0;
  border-bottom: 1px solid var(--line);
}
.proj-feature:nth-child(even) { padding-left: 32px; border-left: 1px solid var(--line); }
.proj-feature h3 {
  margin-bottom: 10px;
  font-size: 1.0625rem;
  font-stretch: 100%;
  color: var(--phosphor);
}
.proj-feature p { max-width: 54ch; }

/* Example chat */
.chat {
  display: grid;
  gap: 14px;
  max-width: 640px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--deep);
}
.msg { max-width: 82%; }
.msg--user { justify-self: end; text-align: right; }
.msg-text {
  display: inline-block;
  padding: 10px 14px;
  text-align: left;
  color: var(--ghost);
  background: var(--void);
  border: 1px solid var(--line);
}
.msg--user .msg-text { border-color: var(--phosphor); }
.msg-note { margin-top: 4px; color: var(--phosphor); font-size: 0.75rem; opacity: .8; }
.msg-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg--user .msg-buttons { justify-content: flex-end; }
.msg-button {
  padding: 4px 12px;
  border: 1px solid var(--muted);
  color: var(--text);
  font-size: 0.8125rem;
}
.msg-image {
  position: relative;
  width: min(280px, 100%);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--void);
}
.msg-image-glyphs {
  position: absolute;
  inset: 8px;
  font-family: var(--glyph);
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: .25em;
  color: var(--phosphor);
  opacity: .28;
  word-break: break-all;
}
.msg-image-cap {
  position: absolute;
  left: 0; bottom: 0;
  padding: 6px 10px;
  background: var(--void);
  color: var(--ghost);
  font-size: 0.75rem;
}

/* Structure */
.proj-built-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 32px;
  align-items: start;
}
.proj-stack { display: grid; gap: 8px; }
.proj-stack li { color: var(--ghost); }
.proj-stack li::before { content: "+ "; color: var(--phosphor); }
.proj-tree {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--deep);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--text);
}

/* Other works */
.proj-others-list { border-top: 1px solid var(--line); }
.proj-others-list li { border-bottom: 1px solid var(--line); }
.proj-others-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 20px 0;
  text-decoration: none;
}
.proj-others-title {
  font-size: clamp(1.3125rem, 2.6vw, 1.75rem);
  font-weight: 700;
  font-stretch: 112.5%;
  color: var(--ghost);
}
.proj-others-kind { color: var(--muted); }
.proj-others-list a:hover .proj-others-title { color: var(--phosphor); }

.proj-missing { display: grid; gap: 24px; justify-items: start; }

@media (max-width: 720px) {
  .project-page .topnav-home { display: inline; }
  .project-page .topnav { justify-content: space-between; }
  .proj-features { grid-template-columns: 1fr; }
  .proj-feature, .proj-feature:nth-child(even) { padding: 20px 0 22px; border-left: 0; }
  .proj-built-grid { grid-template-columns: 1fr; }
  .chat { padding: 18px; }
  .msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
  html.hero-done .caret { opacity: 1; }
}
