/* ============================================================
   zander · design system
   warm paper #f4f1ea / ink #161513 / ember #ff4a17, hairline borders,
   square corners, Geist + Departure Mono.
   ============================================================ */

/* Geist and Geist Mono; Vercel, SIL Open Font License 1.1 */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 300 700;
  font-display: block;
  src: url("fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 300 700;
  font-display: block;
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: block;
  src: url("fonts/geistmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: block;
  src: url("fonts/geistmono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Departure Mono; Helena Zhang, SIL Open Font License 1.1 */
@font-face {
  font-family: "Departure Mono";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/departuremono.woff2") format("woff2");
}

:root {
  --background: #f4f1ea;
  --foreground: #161513;
  --border: rgba(22, 21, 19, 0.14);

  /* ember: --accent fills surfaces, --accent-ink is accent used as text
     (the pure ember only hits 3:1 on paper, the ink variant clears 4.5:1) */
  --accent: #ff4a17;
  --accent-ink: #c8340a;
  --on-accent: #12100e;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: "Departure Mono", "Geist Mono", ui-monospace, monospace;

  --shell: 72rem;
  --pad-x: 2rem;
  --pad-y: 4rem;
}

html.dark {
  --background: #12100e;
  --foreground: #f4f1ea;
  --border: rgba(244, 241, 234, 0.14);
  --accent-ink: #ff6a3d;
}

@media (min-width: 640px) {
  :root {
    --pad-x: 4rem;
    --pad-y: 6rem;
  }
}

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

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pixel {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.025em;
  line-height: 1;
}

.mono {
  font-family: var(--font-mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------- shell ---------------- */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  max-width: var(--shell);
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

/* ---------------- nav ---------------- */

.nav {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: var(--background);
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav > * {
  flex: 0 0 auto;
  border-right: 1px solid var(--border);
}

.nav-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  color: var(--foreground);
}

.nav-mark svg {
  width: 26px;
  height: 26px;
}

.nav-brand {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: lowercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  text-transform: lowercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-link[aria-current="page"]:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.nav-link[aria-current="page"] {
  color: var(--accent-ink);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-right: 0;
  background: none;
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

html:not(.dark) .icon-sun,
html.dark .icon-moon {
  display: none;
}

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 32rem;
  overflow: hidden;
}

/* the disassembly field is masked away from the bottom-left so the
   hero copy always sits on clean paper */
#disasm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: radial-gradient(
    118% 95% at 0% 100%,
    transparent 0%,
    transparent 30%,
    #000 76%
  );
  mask-image: radial-gradient(
    118% 95% at 0% 100%,
    transparent 0%,
    transparent 30%,
    #000 76%
  );
}

.hero-body {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 3rem 2rem;
  pointer-events: none;
}

.hero-body > * {
  pointer-events: auto;
}

@media (min-width: 640px) {
  .hero-body {
    padding: 5rem 4rem;
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4rem, 15vw, 10rem);
  line-height: 0.95;
  text-transform: lowercase;
  letter-spacing: 0.025em;
}

.hero h2 {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 5.5vw, 3rem);
  line-height: 1;
  text-transform: lowercase;
  letter-spacing: 0.025em;
  color: color-mix(in srgb, var(--foreground) 80%, transparent);
}

.hero p {
  margin-top: 2rem;
  max-width: 36rem;
  font-size: clamp(1.125rem, 2.4vw, 1.5rem);
  color: color-mix(in srgb, var(--foreground) 90%, transparent);
}

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-block;
  border: 1px solid var(--foreground);
  background: transparent;
  color: var(--foreground);
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  background: var(--foreground);
  color: var(--background);
}

.btn-accent {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.btn-accent:hover {
  background: transparent;
  color: var(--accent-ink);
}

@media (min-width: 640px) {
  .btn {
    font-size: 1.125rem;
  }
}

.btn-sm {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

@media (min-width: 640px) {
  .btn-sm {
    font-size: 1rem;
  }
}

/* ---------------- sections ---------------- */

.section {
  position: relative;
  padding: var(--pad-y) var(--pad-x);
}

.section + .section,
.section.bordered {
  border-top: 1px solid var(--border);
}

.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.25rem, 11vw, 6rem);
  line-height: 1;
  text-transform: lowercase;
  letter-spacing: 0.025em;
}

.title-sm {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  line-height: 1;
  text-transform: lowercase;
  letter-spacing: 0.025em;
}

.lede {
  margin-top: 2rem;
  max-width: 42rem;
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  color: color-mix(in srgb, var(--foreground) 90%, transparent);
}

.prose {
  margin-top: 2.5rem;
  max-width: 42rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  color: color-mix(in srgb, var(--foreground) 90%, transparent);
}

.prose a {
  border-bottom: 1px solid var(--accent);
  color: var(--accent-ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.prose a:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.inline-ico {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  vertical-align: middle;
}

.inline-ico svg {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
}

.accent {
  color: var(--accent-ink);
}

.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--foreground) 50%, transparent);
}

/* ---------------- work rows ---------------- */

.rows {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0.25rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease, color 0.15s ease,
    padding-left 0.25s ease;
}

.rows .row:last-child {
  border-bottom: 0;
}

a.row:hover {
  background: var(--accent);
  color: var(--on-accent);
  padding-left: 1.25rem;
}

.row-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1;
  text-transform: lowercase;
  letter-spacing: 0.025em;
}

.row-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--foreground) 55%, transparent);
  transition: color 0.15s ease;
}

a.row:hover .row-meta {
  color: color-mix(in srgb, var(--on-accent) 85%, transparent);
}

.row-arrow {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 1rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

a.row:hover .row-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ---------------- hairline grid ---------------- */

.grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  background: var(--border);
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.75rem;
  background: var(--background);
  transition: background-color 0.25s ease, color 0.25s ease;
}

a.cell:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.cell-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: color-mix(in srgb, var(--foreground) 45%, transparent);
  transition: color 0.25s ease;
}

a.cell:hover .cell-num,
a.cell:hover .cell-text {
  color: color-mix(in srgb, var(--on-accent) 85%, transparent);
}

.cell-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1;
  text-transform: lowercase;
  letter-spacing: 0.025em;
}

.cell-text {
  font-size: 0.9375rem;
  color: color-mix(in srgb, var(--foreground) 70%, transparent);
  transition: color 0.25s ease;
}

/* ---------------- feature panel (grainy blue) ---------------- */

.grainy {
  position: relative;
  margin-top: 3rem;
  overflow: hidden;
  background-color: #8f1d00;
  background-image: radial-gradient(
      circle at 15% 20%,
      #d43e08 0%,
      transparent 55%
    ),
    radial-gradient(circle at 85% 15%, #b02a30 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, #4a0e00 0%, transparent 60%),
    radial-gradient(circle at 90% 85%, #c2410c 0%, transparent 55%),
    linear-gradient(135deg, #8f1d00 0%, #a83208 50%, #8f1d00 100%);
}

.grainy::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.grainy-inner {
  position: relative;
  z-index: 1;
  padding: 3rem 2rem;
  color: #f4f1ea;
}

@media (min-width: 640px) {
  .grainy-inner {
    padding: 5rem 4rem;
  }
}

.grainy-inner .title-sm {
  color: #f4f1ea;
}

.grainy-inner p {
  margin-top: 1.5rem;
  max-width: 38rem;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: rgba(238, 238, 238, 0.9);
}

.grainy-stats {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(238, 238, 238, 0.3);
  border-left: 1px solid rgba(238, 238, 238, 0.3);
}

@media (min-width: 720px) {
  .grainy-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat {
  padding: 1.5rem;
  border-right: 1px solid rgba(238, 238, 238, 0.3);
  border-bottom: 1px solid rgba(238, 238, 238, 0.3);
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.025em;
}

.stat span {
  display: block;
  margin-top: 0.625rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(238, 238, 238, 0.75);
}

.feat-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid rgba(238, 238, 238, 0.3);
}

.feat + .feat {
  border-top: 1px solid rgba(238, 238, 238, 0.3);
}

@media (min-width: 720px) {
  .feat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feat + .feat {
    border-top: 0;
    border-left: 1px solid rgba(238, 238, 238, 0.3);
  }
}

.feat {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 2rem;
}

.feat h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1;
  text-transform: lowercase;
  letter-spacing: 0.025em;
}

.feat .label {
  color: rgba(238, 238, 238, 0.7);
}

.feat p {
  margin: 0;
  font-size: 1rem;
  color: rgba(238, 238, 238, 0.9);
}

.btn-light {
  margin-top: 0.5rem;
  border-color: #f4f1ea;
  color: #f4f1ea;
  font-size: 0.9375rem;
  padding: 0.625rem 1.25rem;
}

.btn-light:hover {
  background: #f4f1ea;
  color: #8f1d00;
}

/* ---------------- timeline / list rows ---------------- */

.list {
  margin-top: 2.5rem;
  max-width: 46rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0.25rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease, color 0.15s ease,
    padding-left 0.25s ease;
}

.list .list-item:last-child {
  border-bottom: 0;
}

a.list-item:hover {
  background: var(--accent);
  color: var(--on-accent);
  padding-left: 1.25rem;
}

.list-item h4 {
  font-size: 1.0625rem;
  font-weight: 500;
}

.list-item p {
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  color: color-mix(in srgb, var(--foreground) 60%, transparent);
  transition: color 0.15s ease;
}

a.list-item:hover p,
a.list-item:hover .list-year {
  color: color-mix(in srgb, var(--on-accent) 85%, transparent);
}

.list-year {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--foreground) 50%, transparent);
  transition: color 0.15s ease;
}

/* ---------------- links page ---------------- */

.links {
  margin-top: 2.5rem;
  max-width: 42rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.link-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.125rem;
  color: color-mix(in srgb, var(--foreground) 90%, transparent);
  transition: background-color 0.15s ease, color 0.15s ease,
    padding-left 0.25s ease;
}

.links .link-row:last-child {
  border-bottom: 0;
}

.link-row:hover {
  background: var(--accent);
  color: var(--on-accent);
  padding-left: 1.25rem;
}

.link-row svg {
  flex: 0 0 auto;
  width: 1.375rem;
  height: 1.375rem;
}

.link-handle {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--foreground) 45%, transparent);
  transition: color 0.15s ease;
}

.link-row:hover .link-handle {
  color: color-mix(in srgb, var(--on-accent) 85%, transparent);
}

@media (min-width: 640px) {
  .link-row {
    font-size: 1.25rem;
  }
}

/* ---------------- marquee band ---------------- */

.band {
  display: flex;
  overflow: hidden;
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--foreground) 45%, transparent);
  user-select: none;
}

.band span {
  flex: 0 0 auto;
  padding-right: 1ch;
  white-space: nowrap;
  animation: slide 38s linear infinite;
}

@keyframes slide {
  to {
    transform: translateX(-100%);
  }
}

/* ---------------- footer ---------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--foreground) 50%, transparent);
}

.foot > * {
  padding: 0.875rem 1.25rem;
  border-right: 1px solid var(--border);
}

.foot > *:last-child {
  border-right: 0;
  margin-left: auto;
}

.foot a:hover {
  color: var(--accent-ink);
}

/* ---------------- entry / scroll animation ---------------- */

/* only hide things when JS is around to bring them back */
html.js .anim {
  opacity: 0;
  transform: translateY(12px);
}

html.js .nav.anim {
  transform: translateY(-12px);
}

html.js .anim-ready {
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

html.js .anim.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .anim {
    opacity: 1 !important;
    transform: none !important;
  }

  .band span {
    animation: none;
  }
}
