/* ==========================================================================
   Gaurav Chaudhary — shared design system
   "Phase Space": an oscilloscope signal that lives behind every page.
   Used by every page. Homepage sections live in home.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts: self-hosted latin subsets (SIL Open Font License), plus fallbacks whose
   metrics are tuned to match, so swapping in the web font doesn't shift layout.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 300 800;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  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: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  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: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-var.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  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: "Archivo Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 98.27%;
  ascent-override: 89.35%;
  descent-override: 21.37%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Instrument Serif Fallback";
  src: local("Georgia"), local("Times New Roman");
  size-adjust: 76.9%;
  ascent-override: 128.74%;
  descent-override: 40.31%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "JetBrains Mono Fallback";
  src: local("Consolas"), local("Menlo"), local("Courier New");
  size-adjust: 109.13%;
  ascent-override: 93.47%;
  descent-override: 27.49%;
  line-gap-override: 0%;
}

:root {
  /* Canvas */
  --bg: #07080a;
  --bg-2: #0b0d10;
  --bg-3: #111419;
  --panel: rgba(238, 235, 227, 0.025);
  --panel-2: rgba(238, 235, 227, 0.045);

  /* Ink */
  --ink: #eeebe3;
  --ink-2: #b6b2a8;
  --ink-3: #8a877f;
  --line: rgba(238, 235, 227, 0.1);
  --line-2: rgba(238, 235, 227, 0.18);

  /* Oscilloscope channels */
  --ch1: #ffb547; /* amber  · hero, about, credentials, contact */
  --ch2: #5ce1ff; /* cyan   · experience, Tokins */
  --ch3: #ff5fa2; /* magenta· stack, lab */
  --ch4: #a493ff; /* violet · work, Chills */
  --chm: #7cf0a8; /* green  · math channel, Lastone */
  --ch: var(--ch1); /* current channel, set per section */

  /* Type */
  --font-sans: "Archivo", "Archivo Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Instrument Serif Fallback", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Layout */
  --gutter: clamp(16px, 4.2vw, 64px);
  --maxw: 1480px;
  --header-h: 68px;
  --radius: 14px;
  --radius-sm: 8px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* -------------------------------------------------------------------------- */
/* Base                                                                        */
/* -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  font-variation-settings: "wdth" 100;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* fallback for browsers without overflow: clip */
  overflow-x: clip;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

::selection {
  background: var(--ch1);
  color: #111;
}

main:focus,
section:focus,
[tabindex="-1"]:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--ch1);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ch1);
  color: #111;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--font-mono);
}

/* -------------------------------------------------------------------------- */
/* Background: graticule, glow, oscilloscope canvas, grain                     */
/* -------------------------------------------------------------------------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

.bg > * {
  position: absolute;
  inset: 0;
}

/* Soft light that follows the signal. Position is a transform (compositor only). */
.bg-glow {
  inset: auto;
  left: 0;
  top: 0;
  width: 120vmax;
  height: 120vmax;
  margin: -60vmax 0 0 -60vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--glow-rgb, 255 181 71) / 0.16), rgb(var(--glow-rgb, 255 181 71) / 0.05) 45%, transparent 72%);
  transform: translate3d(65vw, 45vh, 0);
  will-change: transform;
}

/* Oscilloscope graticule: 10 × 8 divisions with a finer centre scale. */
.bg-grid {
  --div: max(72px, 10vmin);
  background-image:
    linear-gradient(to right, rgba(238, 235, 227, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(238, 235, 227, 0.045) 1px, transparent 1px);
  background-size: var(--div) var(--div);
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 50% 45%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 80% 75% at 50% 45%, #000 30%, transparent 85%);
}

.bg-grid::before,
.bg-grid::after {
  content: "";
  position: absolute;
  background-repeat: repeat;
  opacity: 0.8;
}

/* Minor ticks on the centre axes, like a real scope screen */
.bg-grid::before {
  left: 0;
  right: 0;
  top: calc(50% - 4px);
  height: 9px;
  background-image: linear-gradient(to right, rgba(238, 235, 227, 0.09) 1px, transparent 1px);
  background-size: calc(var(--div) / 5) 9px;
  background-position: center;
}

.bg-grid::after {
  top: 0;
  bottom: 0;
  left: calc(50% - 4px);
  width: 9px;
  background-image: linear-gradient(to bottom, rgba(238, 235, 227, 0.09) 1px, transparent 1px);
  background-size: 9px calc(var(--div) / 5);
  background-position: center;
}

/* Cursor lens: a brighter copy of the grid revealed around the pointer.
   The lens and its inner layer move with transforms only. */
.bg-lens {
  inset: auto;
  left: 0;
  top: 0;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.6s ease;
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  will-change: transform;
}

.bg-lens.is-on {
  opacity: 1;
}

.bg-lens-inner {
  --div: max(72px, 10vmin);
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-image:
    linear-gradient(to right, rgb(var(--glow-rgb, 255 181 71) / 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(var(--glow-rgb, 255 181 71) / 0.22) 1px, transparent 1px);
  background-size: var(--div) var(--div);
  background-position: center center;
  will-change: transform;
}

.bg-scope {
  width: 100%;
  height: 100%;
}

.fg-scope {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bg-grain {
  inset: -50%;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' 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.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-3%, 2%, 0); }
  40% { transform: translate3d(2%, -3%, 0); }
  60% { transform: translate3d(-2%, -1%, 0); }
  80% { transform: translate3d(3%, 3%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.bg-vignette {
  background:
    radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(to bottom, rgba(7, 8, 10, 0) 70%, rgba(7, 8, 10, 0.5));
}

/* RUN/STOP freezes all ambient motion */
html[data-motion="stopped"] .bg-grain,
html[data-motion="stopped"] [data-ambient] {
  animation-play-state: paused !important;
}

/* Everything above the background */
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* -------------------------------------------------------------------------- */
/* Scroll progress                                                             */
/* -------------------------------------------------------------------------- */

.progress {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 100%;
  height: 2px;
  pointer-events: none;
}

.progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--ch1), rgb(var(--glow-rgb, 255 181 71)));
  box-shadow: 0 0 12px rgb(var(--glow-rgb, 255 181 71) / 0.8);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* -------------------------------------------------------------------------- */
/* Header + navigation                                                         */
/* -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding-inline: var(--gutter);
  transition: transform 0.5s var(--ease-out), background-color 0.4s ease;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -24px 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(7, 8, 10, 0.92), rgba(7, 8, 10, 0.6) 60%, rgba(7, 8, 10, 0));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.site-header.is-scrolled::before {
  opacity: 1;
}

.site-header.is-hidden {
  transform: translateY(-110%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin-right: auto;
  min-height: 44px;
}

.brand-mark {
  width: 34px;
  height: 18px;
  overflow: visible;
}

.brand-mark path {
  fill: none;
  stroke: var(--ch1);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-dasharray: 18 100;
  animation: brand-trace 3.2s linear infinite;
}

.brand-mark .brand-mark-base {
  stroke: rgba(238, 235, 227, 0.28);
  stroke-dasharray: none;
  animation: none;
}

@keyframes brand-trace {
  to { stroke-dashoffset: -118; }
}

.brand-name {
  font-size: 0.95rem;
}

.brand-name small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
  line-height: 1.2;
}

.nav ul {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 28px);
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.25s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--ch);
  box-shadow: 0 0 10px var(--ch);
  transform: scale(0);
  transition: transform 0.35s var(--ease-out);
}

.nav a:hover,
.nav a[aria-current="true"],
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a[aria-current="true"]::after,
.nav a[aria-current="page"]::after {
  transform: scale(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.header-link:hover {
  color: var(--ink);
}

.menu-btn {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.menu-btn-lines {
  position: relative;
  width: 16px;
  height: 8px;
}

.menu-btn-lines::before,
.menu-btn-lines::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.4s var(--ease-out), top 0.4s var(--ease-out);
}

.menu-btn-lines::before { top: 0; }
.menu-btn-lines::after { top: 6.5px; }

.menu-btn[aria-expanded="true"] .menu-btn-lines::before { top: 3.25px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn-lines::after { top: 3.25px; transform: rotate(-45deg); }

/* Full-screen mobile menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 24px) var(--gutter) max(28px, env(safe-area-inset-bottom));
  background: rgba(7, 8, 10, 0.97);
  clip-path: circle(0% at calc(100% - 48px) 34px);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-in-out), visibility 0s linear 0.7s;
}

.menu.is-open {
  clip-path: circle(150% at calc(100% - 48px) 34px);
  visibility: visible;
  transition: clip-path 0.8s var(--ease-in-out), visibility 0s;
}

.menu-links li {
  border-bottom: 1px solid var(--line);
}

.menu-links a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 500;
  font-variation-settings: "wdth" 85;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.menu-links a span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.menu-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-2);
}

.menu-foot a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

@media (max-width: 1080px) {
  .nav,
  .header-link {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 520px) {
  .brand-name small {
    display: none;
  }

  .header-actions .btn-sm {
    display: none;
  }
}

/* Chrome details shared by every page */
.brand-mark .brand-mark-base {
  fill: none;
  stroke: rgba(238, 235, 227, 0.22);
  stroke-width: 1.7;
}

.footer-sig svg {
  fill: none;
  stroke: var(--ch1);
  stroke-width: 1.6;
}

.nav a::after {
  background: rgb(var(--glow-rgb, 255 181 71));
  box-shadow: 0 0 10px rgb(var(--glow-rgb, 255 181 71));
}

.bg-glow {
  transition: transform 1.1s var(--ease-out), opacity 1.1s ease;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.08em 0.36em;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--ink);
}

.inline-link {
  color: var(--ink);
  background-image: linear-gradient(var(--ch1), var(--ch1));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color 0.25s ease;
}

.inline-link:hover {
  color: var(--ch1);
}

/* -------------------------------------------------------------------------- */
/* Buttons + links                                                             */
/* -------------------------------------------------------------------------- */

.btn {
  --btn-c: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-out);
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: none;
}

.btn:hover,
.btn:focus-visible {
  color: var(--bg);
  border-color: var(--ink);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 0.4s var(--ease-out);
}

.btn:hover svg {
  transform: translate(2px, 0);
}

.btn-primary {
  background: var(--ch1);
  border-color: var(--ch1);
  color: #121212;
  box-shadow: 0 0 0 0 rgb(255 181 71 / 0.4), 0 10px 40px -12px rgb(255 181 71 / 0.55);
}

.btn-primary::before {
  background: var(--ink);
}

.btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.85rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 500;
  color: var(--ink);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 calc(100% - 10px);
  background-repeat: no-repeat;
  transition: background-size 0.45s var(--ease-out), color 0.25s ease;
}

.link-arrow:hover,
.link-arrow:focus-visible {
  background-size: 100% 1px;
}

.link-arrow svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.ext::after {
  content: "\2197";
  display: inline-block;
  margin-left: 0.25em;
  font-size: 0.85em;
  transition: transform 0.3s var(--ease-out);
}

.ext:hover::after {
  transform: translate(2px, -2px);
}

/* -------------------------------------------------------------------------- */
/* Section scaffolding                                                         */
/* -------------------------------------------------------------------------- */

.section {
  position: relative;
  padding-block: clamp(96px, 14vw, 200px);
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.kicker-idx {
  display: inline-grid;
  place-items: center;
  min-width: 2.4em;
  height: 1.9em;
  padding-inline: 0.5em;
  border: 1px solid var(--ch);
  border-radius: 999px;
  color: var(--ch);
}

.kicker-meta {
  color: var(--ink-3);
}

.kicker-meta::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  margin-right: 12px;
  vertical-align: middle;
  background: var(--line-2);
}

.display {
  font-size: clamp(2.6rem, 7vw, 6.8rem);
  font-weight: 600;
  font-variation-settings: "wdth" 88;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.display .serif {
  font-weight: 400;
  letter-spacing: -0.02em;
  font-variation-settings: normal;
}

.lede {
  max-width: 58ch;
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-2);
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 1.8;
  color: var(--ink-2);
}

.tagline b {
  font-weight: 500;
  color: var(--ink);
}

/* Text split by JS into words / chars for masked reveals.
   The padding/negative margin pair keeps descenders and italic overhangs unclipped. */
.word-mask {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: top;
  padding: 0.08em 0.12em 0.16em 0.04em;
  margin: -0.08em -0.12em -0.16em -0.04em;
}

.word,
.char {
  display: inline-block;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* -------------------------------------------------------------------------- */
/* HUD: the scope's on-screen readouts                                         */
/* -------------------------------------------------------------------------- */

/* Desktop: a vertical rail in the left margin, reading bottom-to-top like a scope's side scale. */
.hud {
  position: fixed;
  left: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 40;
  width: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hud > * {
  pointer-events: auto;
}

.hud-readout,
.hud .hud-run {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.hud-readout {
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.hud .hud-run {
  min-height: 0;
  min-width: 34px;
  padding: 12px 0;
}

@media (max-width: 1100px) {
  .hud {
    display: none;
  }
}

.hud-ch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgb(var(--glow-rgb, 255 181 71) / 0.55);
  color: rgb(var(--glow-rgb, 255 181 71));
}

.hud-ch::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.hud-val {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.hud-run {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(7, 8, 10, 0.6);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.hud-run:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}

.hud-run-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chm);
  box-shadow: 0 0 10px var(--chm);
}

.hud-run[data-stopped="true"] .hud-run-led {
  background: #ff5f5f;
  box-shadow: 0 0 10px #ff5f5f;
}

.footer-run {
  align-self: center;
}

@media (min-width: 1101px) {
  .footer-run {
    display: none;
  }
}

.word {
  white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                      */
/* -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(7, 8, 10, 0.72), rgba(7, 8, 10, 0.92));
  padding: 40px 0 calc(72px + env(safe-area-inset-bottom));
  font-size: 0.9rem;
  color: var(--ink-2);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 32px;
  align-items: start;
}

.footer-sig {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-weight: 500;
}

.footer-sig svg {
  width: 44px;
  height: 22px;
}

.footer-sig svg path {
  fill: none;
  stroke: var(--ch1);
  stroke-width: 1.6;
}

.footer-note {
  margin-top: 12px;
  max-width: 40ch;
  font-size: 0.82rem;
  color: var(--ink-3);
}

.footer-col h2 {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.footer-col a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  transition: color 0.25s ease;
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-col li + li {
  margin-top: 2px;
}

.rewind {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 18px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color 0.3s ease;
}

.rewind:hover {
  border-color: var(--ch1);
}

.rewind-dial {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
}

.rewind-dial svg {
  width: 14px;
  height: 14px;
  transition: transform 0.5s var(--ease-out);
}

.rewind:hover .rewind-dial svg {
  transform: translateY(-3px);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.site-footer .wrap > .footer-base:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* -------------------------------------------------------------------------- */
/* Sub-page scaffolding (projects, experience, blog, 404)                      */
/* -------------------------------------------------------------------------- */

.page-hero {
  padding: calc(var(--header-h) + clamp(56px, 10vw, 140px)) 0 clamp(40px, 6vw, 80px);
}

.page-hero .display {
  margin-top: 22px;
}

.page-hero .lede {
  margin-top: 22px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.back-link:hover {
  color: var(--ink);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}

.chip[aria-pressed="true"] {
  color: #111;
  background: var(--ch1);
  border-color: var(--ch1);
}

/* -------------------------------------------------------------------------- */
/* Blog                                                                        */
/* The post card is shared by the home "Notes" strip, /blog.html and the        */
/* prev/next footer on a post, so the three can never drift apart.             */
/* Markup comes from assets/js/blog-core.js.                                   */
/* -------------------------------------------------------------------------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 20px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.86);
  overflow: hidden;
  transition: border-color 0.35s ease, transform 0.6s var(--ease-out);
  animation: card-in 0.7s var(--ease-out) both;
  animation-delay: calc(var(--n, 0) * 60ms);
}

/* A channel-coloured trace that draws itself across the top edge on hover. */
.post-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--c, var(--ch1));
  opacity: 0.8;
  transition: transform 0.6s var(--ease-out);
}

.post-card:hover,
.post-card:focus-visible {
  border-color: var(--line-2);
  transform: translateY(-4px);
}

.post-card:hover::after,
.post-card:focus-visible::after {
  transform: scaleX(1);
}

.post-card[hidden] {
  display: none;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
}

.post-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out), opacity 0.4s ease;
}

.post-card:hover .post-media img {
  transform: scale(1.04);
}

/* No cover image in the CMS: a quiet graticule with the site's Lissajous mark,
   so the gap reads as a choice rather than a broken image. */
.post-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-image:
    linear-gradient(to right, rgba(238, 235, 227, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(238, 235, 227, 0.05) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 50%, rgb(255 255 255 / 0.05), transparent 70%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  background-position: center;
}

.post-ph svg {
  width: 34%;
  height: auto;
  fill: none;
  stroke: var(--c, var(--ch1));
  stroke-width: 1.2;
  opacity: 0.75;
}

.post-ph span {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 20px 22px 18px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post-cat {
  color: var(--c, var(--ch1));
}

.post-title {
  font-size: 1.3rem;
  font-weight: 600;
  font-variation-settings: "wdth" 88;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

.post-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.94rem;
  color: var(--ink-2);
}

.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.post-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  transition: color 0.25s ease;
}

.post-read svg {
  width: 13px;
  height: 13px;
  transition: transform 0.4s var(--ease-out);
}

.post-card:hover .post-read {
  color: var(--c, var(--ch1));
}

.post-card:hover .post-read svg {
  transform: translateX(4px);
}

/* The newest post leads the archive: full width, media beside the copy. */
@media (min-width: 860px) {
  .post-card--featured {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: stretch;
  }

  .post-card--featured .post-media {
    flex: 0 0 52%;
    aspect-ratio: auto;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .post-card--featured .post-body {
    gap: 14px;
    padding: clamp(26px, 3vw, 40px);
    justify-content: center;
  }

  .post-card--featured .post-title {
    font-size: clamp(1.7rem, 2.6vw, 2.5rem);
    letter-spacing: -0.035em;
  }

  .post-card--featured .post-excerpt {
    -webkit-line-clamp: 4;
    line-clamp: 4;
    font-size: 1.02rem;
  }
}

/* Loading placeholders that hold the grid's height, so nothing jumps when the
   CMS answers. */
.post-skel {
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.5);
  overflow: hidden;
}

.post-skel-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
}

.post-skel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
}

.post-skel-body span {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(238, 235, 227, 0.05), rgba(238, 235, 227, 0.12), rgba(238, 235, 227, 0.05));
  background-size: 200% 100%;
  animation: skel 1.6s linear infinite;
}

.post-skel-body span:first-child { width: 36%; }
.post-skel-body span:nth-child(2) { width: 88%; height: 16px; }
.post-skel-body span:last-child { width: 64%; }

@keyframes skel {
  from { background-position: 180% 0; }
  to { background-position: -20% 0; }
}

/* Empty, offline and not-found states. */
.blog-note {
  grid-column: 1 / -1;
  max-width: 54ch;
  padding: 36px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--ink-2);
}

.blog-note b {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--ink);
}

/* -------------------------------------------------------------------------- */
/* Blog archive (/blog.html)                                                   */
/* -------------------------------------------------------------------------- */

.blog {
  padding-bottom: clamp(90px, 12vw, 160px);
}

.post-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-filters .chip[aria-pressed="true"] {
  color: #111;
  background: var(--c, var(--ch1));
  border-color: var(--c, var(--ch1));
}

.post-count {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 20px;
  margin-top: 22px;
}

.post-list > li {
  display: flex;
}

.post-list > li[hidden] {
  display: none;
}

.post-list > li > * {
  flex: 1;
}

.post-list > li.is-lead {
  grid-column: 1 / -1;
}

/* -------------------------------------------------------------------------- */
/* A single post (/blog-post.html)                                             */
/* -------------------------------------------------------------------------- */

.post {
  --measure: 70ch;
  padding-bottom: clamp(80px, 10vw, 140px);
}

.post-head {
  max-width: var(--measure);
}

.post-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post-kicker .post-cat {
  padding: 4px 12px;
  border: 1px solid var(--c, var(--ch1));
  border-radius: 999px;
}

.post-h1 {
  margin-top: 18px;
  font-size: clamp(2.2rem, 5.4vw, 4rem);
  font-weight: 600;
  font-variation-settings: "wdth" 88;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.post-standfirst {
  margin-top: 20px;
  max-width: 58ch;
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-2);
}

.post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-3);
}

.post-byline b {
  font-weight: 500;
  color: var(--ink);
}

.post-byline .dot::before {
  content: "·";
  margin-right: 10px;
}

.copy-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.copy-link:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}

.copy-link svg {
  width: 14px;
  height: 14px;
}

.copy-link[data-copied="1"] {
  color: var(--chm);
  border-color: var(--chm);
}

.post-cover {
  margin: clamp(32px, 5vw, 56px) 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
}

.post-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-cover figcaption {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-3);
}

/* Body copy. Rendered from Contentful rich text by blog-core.js. */
.post-copy {
  max-width: var(--measure);
  margin-top: clamp(34px, 5vw, 56px);
  font-size: 1.08rem;
  line-height: 1.78;
  color: var(--ink-2);
}

.post-copy > * + * {
  margin-top: 1.15em;
}

.post-copy h2,
.post-copy h3,
.post-copy h4 {
  margin-top: 2em;
  color: var(--ink);
  font-weight: 600;
  font-variation-settings: "wdth" 90;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.post-copy h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.post-copy h3 { font-size: clamp(1.2rem, 1.8vw, 1.45rem); }
.post-copy h4 { font-size: 1.1rem; }

.post-copy strong {
  font-weight: 600;
  color: var(--ink);
}

.post-copy a {
  color: var(--ink);
  background-image: linear-gradient(var(--c, var(--ch1)), var(--c, var(--ch1)));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s var(--ease-out), color 0.25s ease;
}

.post-copy a:hover {
  color: var(--c, var(--ch1));
}

.post-copy ul,
.post-copy ol {
  padding-left: 1.5em;
}

.post-copy ul { list-style: none; }
.post-copy ol { list-style: decimal; }

.post-copy li + li {
  margin-top: 0.55em;
}

.post-copy li p {
  display: inline;
}

.post-copy ul > li {
  position: relative;
}

.post-copy ul > li::before {
  content: "";
  position: absolute;
  left: -1.1em;
  top: 0.72em;
  width: 7px;
  height: 1px;
  background: var(--c, var(--ch1));
}

.post-copy ol::marker,
.post-copy li::marker {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.post-copy blockquote {
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--c, var(--ch1));
  font-family: var(--font-serif);
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--ink);
}

.post-copy blockquote p + p {
  margin-top: 0.6em;
}

.post-copy code {
  padding: 0.15em 0.4em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--ink);
}

.post-copy pre {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow-x: auto;
}

.post-copy pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.85rem;
  line-height: 1.7;
}

.post-copy hr {
  height: 0;
  margin-block: 2.4em;
  border: 0;
  border-top: 1px dashed var(--line-2);
}

.post-figure {
  margin: 2em 0;
}

.post-figure img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-3);
}

.post-figure figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--ink-3);
}

.post-table {
  overflow-x: auto;
}

.post-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.post-table th,
.post-table td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.post-table th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--panel);
}

/* Prev / next, and the way back to the archive. */
.post-more {
  max-width: var(--measure);
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--line);
}

.post-more h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post-more .post-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  margin-top: 20px;
}

.post-more .post-media {
  aspect-ratio: 21 / 9;
}

.post-tail {
  margin-top: clamp(40px, 6vw, 64px);
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                              */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .bg-grain {
    animation: none;
  }

  .bg-lens {
    display: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .bg-lens {
    display: none;
  }
}

/* -------------------------------------------------------------------------- */
/* Sound + console controls (added by console.js) and the console itself        */
/* -------------------------------------------------------------------------- */

.hud-sound-icon {
  position: relative;
  width: 12px;
  height: 10px;
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 2px 40% no-repeat,
    linear-gradient(currentColor, currentColor) 5px 100% / 2px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 10px 100% / 2px 65% no-repeat;
  opacity: 0.8;
}

.hud-sound[data-on="true"] {
  color: var(--chm);
  border-color: rgb(124 240 168 / 0.6);
}

.hud-sound[data-on="true"] .hud-sound-icon {
  animation: eq 0.6s steps(3) infinite alternate;
}

@keyframes eq {
  to {
    background-size: 2px 100%, 2px 35%, 2px 90%;
  }
}

.hud-console-icon {
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ch1);
}

@media (min-width: 1101px) {
  .footer-extra {
    display: none;
  }
}

.console {
  position: fixed;
  left: max(16px, calc(var(--gutter) + 8px));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 90;
  width: min(620px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(8, 9, 11, 0.97);
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 60px -30px rgb(var(--glow-rgb, 255 181 71) / 0.6);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transform-origin: 0 100%;
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out);
}

.console.is-open {
  opacity: 1;
  transform: none;
}

.console-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

.console-dots {
  display: flex;
  gap: 6px;
}

.console-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(238, 235, 227, 0.16);
}

.console-dots i:first-child {
  background: #ff5f5f;
}

.console-title {
  flex: 1;
  font-size: 0.72rem;
}

.console-close {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  font-size: 0.68rem;
  color: var(--ink-2);
}

.console-close:hover {
  color: var(--ink);
}

.console-out {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 4px;
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 160px;
  line-height: 1.5;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.console-out .is-cmd { color: var(--ink); margin-top: 6px; }
.console-out .is-ok { color: var(--chm); }
.console-out .is-err { color: #ff8a8a; }
.console-out .is-dim { color: var(--ink-3); }

.console-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
}

.console-prompt {
  color: var(--ch1);
}

.console-input {
  flex: 1;
  min-height: 36px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  caret-color: var(--ch1);
}

.console-input:focus {
  outline: none;
}

.console-form:focus-within {
  box-shadow: inset 0 1px 0 rgb(255 181 71 / 0.5);
}
