/* =============================================================================
   DIGITAL PORCH — Phosphor Lab Notebook
   Andy Giles · Asheville, NC
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colors — core */
  --color-bg: #120F0A;
  --color-bg-alt: #1A1512;
  --color-surface: #211C16;
  --color-surface-raised: #2A231B;
  --color-border: #3D3025;
  --color-border-glow: rgba(232, 160, 32, 0.45);

  /* Colors — brand */
  --color-primary: #E8A020;
  --color-primary-dark: #C07A10;
  --color-primary-light: rgba(232, 160, 32, 0.10);
  --color-secondary: #4DEEEA;
  --color-accent: #39FF14;
  --color-accent-dim: rgba(57, 255, 20, 0.18);
  --color-copper: #C4622D;
  --color-violet: #2D1B69;
  --color-violet-light: #3D2A80;

  /* Colors — text */
  --color-text: #F2ECD8;
  --color-text-2: #C8B99A;
  --color-text-muted: #8A7A63;
  --color-text-inverse: #120F0A;

  /* Colors — semantic */
  --color-success: #39FF14;
  --color-warning: #E8A020;
  --color-error: #FF4444;

  /* Tag colors */
  --tag-audio: #E8A020;
  --tag-coding: #4DEEEA;
  --tag-electronics: #C4622D;
  --tag-video: #9B7FE8;
  --tag-writing: #F2ECD8;
  --tag-experiment: #39FF14;

  /* Typography */
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale */
  --fs-d1: clamp(2.75rem, 7vw, 4.5rem);
  --fs-d2: clamp(2.25rem, 5vw, 3.25rem);
  --fs-h1: clamp(2rem, 4vw, 2.75rem);
  --fs-h2: clamp(1.625rem, 3vw, 2rem);
  --fs-h3: 1.5rem;
  --fs-h4: 1.25rem;
  --fs-base: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;

  /* Line heights */
  --leading-display: 1.05;
  --leading-heading: 1.2;
  --leading-body: 1.65;
  --leading-mono: 1.55;

  /* Letter spacing */
  --tracking-display: -0.02em;
  --tracking-eyebrow: 0.18em;
  --tracking-mono: 0.04em;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --section-padding: 96px;
  --section-padding-mobile: 56px;

  /* Radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.8);
  --shadow-glow-amber: 0 0 16px rgba(232, 160, 32, 0.35), 0 0 40px rgba(232, 160, 32, 0.15);
  --shadow-glow-green: 0 0 12px rgba(57, 255, 20, 0.4), 0 0 32px rgba(57, 255, 20, 0.15);
  --shadow-glow-blue: 0 0 12px rgba(77, 238, 234, 0.3), 0 0 28px rgba(77, 238, 234, 0.1);
  --shadow-text-glow: 0 0 8px rgba(232, 160, 32, 0.6), 0 0 24px rgba(232, 160, 32, 0.25);

  /* Layout */
  --max-w: 1200px;
  --max-w-narrow: 760px;
  --nav-h: 64px;
  --gutter: 24px;
  --gutter-mobile: 16px;
}

/* -----------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Scanlines + grain overlay — fixed full-viewport pseudo-elements */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(18, 15, 10, 0.18) 3px,
    rgba(18, 15, 10, 0.18) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("assets/texture-grain-overlay.webp");
  background-size: 400px 400px;
  background-repeat: repeat;
  opacity: 0.18;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 9999;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--color-primary); text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--color-text); text-decoration: underline; text-decoration-color: var(--color-primary); }

::selection { background: var(--color-primary); color: var(--color-text-inverse); }

button { font: inherit; cursor: pointer; }
input, textarea, select, button { font-family: inherit; }

/* -----------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-display);
  color: var(--color-text);
  margin: 0 0 var(--space-md);
}

.text-d1 { font-size: var(--fs-d1); line-height: var(--leading-display); }
.text-d2 { font-size: var(--fs-d2); line-height: var(--leading-display); }
h1, .text-h1 { font-size: var(--fs-h1); }
h2, .text-h2 { font-size: var(--fs-h2); }
h3, .text-h3 { font-size: var(--fs-h3); }
h4, .text-h4 { font-size: var(--fs-h4); }
h5, .text-h5 { font-size: 1.125rem; }
h6, .text-h6 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; }

p {
  margin: 0 0 var(--space-md);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--leading-body);
  color: var(--color-text-2);
}

.lead {
  font-size: 1.1875rem;
  color: var(--color-text);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

small, .text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-muted { color: var(--color-text-muted); }
.text-mono { font-family: var(--font-mono); letter-spacing: var(--tracking-mono); }
.text-glow { text-shadow: var(--shadow-text-glow); }

strong { color: var(--color-text); font-weight: 600; }
em { font-style: italic; color: var(--color-text-2); }

blockquote {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--color-primary);
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-h4);
  color: var(--color-text-2);
  background: var(--color-primary-light);
}
blockquote p:last-child { margin-bottom: 0; }
blockquote cite {
  display: block;
  margin-top: var(--space-sm);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-mono);
}

ul, ol { padding-left: 1.5em; margin: 0 0 var(--space-md); color: var(--color-text-2); }
ul { list-style: none; padding-left: 0; }
ul li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: var(--space-xs);
}
ul li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-family: var(--font-mono);
}
ol { list-style: none; counter-reset: ol-counter; padding-left: 0; }
ol li {
  position: relative;
  padding-left: 2em;
  margin-bottom: var(--space-xs);
  counter-increment: ol-counter;
}
ol li::before {
  content: counter(ol-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

ul.list-check li::before { content: "✓"; color: var(--color-accent); }

hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border) 20%,
    var(--color-border) 80%,
    transparent
  );
  margin: var(--space-xl) 0;
}

/* -----------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--narrow { max-width: var(--max-w-narrow); }

.section {
  padding: var(--section-padding) 0;
  position: relative;
}
.section--alt { background: var(--color-bg-alt); }
.section--compact { padding: var(--space-2xl) 0; }
.section--flush { padding-top: 0; }
.section--article { padding: var(--space-3xl) 0 calc(var(--space-3xl) + var(--space-xl)); }

/* Article body — longform reading: larger type, generous spacing around media */
.article { padding-left: max(var(--gutter), 1.5rem); padding-right: max(var(--gutter), 1.5rem); }
.article p,
.article ul,
.article ol {
  font-size: 1.1875rem;
  line-height: 1.75;
  margin-bottom: var(--space-lg);
}
.article p { color: var(--color-text); }
.article picture,
.article > img {
  display: block;
  margin: var(--space-2xl) 0;
}
.article picture img,
.article > img { width: 100%; height: auto; border-radius: var(--radius-md); }
.article .card__tags { margin-bottom: var(--space-xl); }
.article h2 { margin-top: var(--space-2xl); margin-bottom: var(--space-md); }
.article h3 { margin-top: var(--space-xl); margin-bottom: var(--space-sm); }

@media (max-width: 768px) {
  .section--article { padding: var(--space-2xl) 0; }
  .article p,
  .article ul,
  .article ol { font-size: 1.0625rem; line-height: 1.7; }
  .article picture,
  .article > img { margin: var(--space-xl) 0; }
}

.section__header { margin-bottom: var(--space-2xl); }
.section__header--centered { text-align: center; max-width: 760px; margin-left: auto; margin-right: auto; }
.section__title { margin-bottom: var(--space-sm); }
.section__subtitle {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: var(--color-text-2);
  margin: 0;
}

@media (max-width: 768px) {
  .section { padding: var(--section-padding-mobile) 0; }
  .container { padding: 0 var(--gutter-mobile); }
}

/* Grid utilities */
.grid { display: grid; gap: var(--gutter); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}
.two-col--reverse .two-col__media { order: 2; }
.two-col__media img { border-radius: var(--radius-lg); border: 1px solid var(--color-border); }
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; gap: var(--space-xl); }
  .two-col--reverse .two-col__media { order: 0; }
}

.stack > * + * { margin-top: var(--space-md); }
.stack--lg > * + * { margin-top: var(--space-lg); }
.stack--xl > * + * { margin-top: var(--space-xl); }

/* -----------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.875em 1.5em;
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-glow-amber);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--secondary:hover {
  background: var(--color-primary-light);
  color: var(--color-text);
  border-color: var(--color-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: transparent;
  padding: 0.5em 0;
}
.btn--ghost:hover {
  color: var(--color-text);
  background: transparent;
}
.btn--ghost .btn__arrow {
  transition: transform 200ms ease;
}
.btn--ghost:hover .btn__arrow { transform: translateX(4px); }

.btn--large { font-size: 1.125rem; padding: 1em 1.75em; }
.btn--block { display: flex; width: 100%; justify-content: center; }

/* -----------------------------------------------------------------------------
   6. Navigation / header
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  width: 100%;
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav__brand:hover { color: var(--color-text); text-decoration: none; }
.nav__brand-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: var(--shadow-glow-green);
  animation: phosphor-pulse 2.4s ease-in-out infinite;
}
@keyframes phosphor-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list li { padding: 0; margin: 0; }
.nav__list li::before { content: none; }
.nav__link {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--color-text-2);
  text-decoration: none;
  letter-spacing: 0.02em;
  position: relative;
  padding: var(--space-xs) 0;
  transition: color 150ms ease;
}
.nav__link:hover { color: var(--color-primary); text-decoration: none; }
.nav__link[aria-current="page"] {
  color: var(--color-primary);
}
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--color-primary);
  box-shadow: 0 0 8px rgba(232, 160, 32, 0.6);
}

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-primary);
  box-shadow: 0 0 4px rgba(232, 160, 32, 0.7);
  transition: transform 200ms ease, opacity 200ms ease;
}

@media (max-width: 768px) {
  .nav__toggle { display: inline-flex; }
  .nav__list {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-lg);
    background: rgba(18, 15, 10, 0.97);
    backdrop-filter: blur(2px);
    padding: var(--space-3xl) var(--gutter);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 300ms ease, opacity 300ms ease;
    z-index: 99;
  }
  .nav__list.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__link {
    font-size: var(--fs-h2);
    text-align: center;
  }
  .nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

/* -----------------------------------------------------------------------------
   7. Hero (homepage)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: var(--space-2xl) 0;
  background: var(--color-bg);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(45, 27, 105, 0.25), transparent 60%),
    radial-gradient(ellipse at 85% 15%, rgba(232, 160, 32, 0.08), transparent 55%);
  pointer-events: none;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}
.hero__media {
  position: relative;
}
.hero__media picture {
  display: block;
  width: 100%;
}
.hero__media img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}
.hero__content {
  width: 100%;
  padding: 0;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}
.hero__eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--color-primary);
}
.hero__title {
  font-family: var(--font-display);
  font-size: var(--fs-d1);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  margin: 0 0 var(--space-md);
  color: var(--color-text);
  text-shadow: var(--shadow-text-glow);
  max-width: 18ch;
}
.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1.8vw, 1.3125rem);
  line-height: 1.5;
  color: var(--color-text);
  margin: 0 0 var(--space-xl);
  max-width: 56ch;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
@media (max-width: 900px) {
  .hero { padding: var(--space-xl) 0; }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .hero__title { max-width: none; }
  .hero__subtitle { max-width: none; }
}

/* -----------------------------------------------------------------------------
   8. Page header (interior pages)
   -------------------------------------------------------------------------- */
.page-header {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--color-border);
}
.page-header__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.page-header__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-header__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 15, 10, 0.45) 0%, rgba(18, 15, 10, 0.85) 100%),
    radial-gradient(ellipse at 70% 80%, rgba(45, 27, 105, 0.4), transparent 60%);
  z-index: 1;
}
.page-header__content {
  position: relative;
  padding: var(--space-2xl) 0 var(--space-xl);
  width: 100%;
}
.page-header__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}
.page-header__title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  margin: 0 0 var(--space-sm);
  color: var(--color-text);
  text-shadow: var(--shadow-text-glow);
}
.page-header__subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--color-text-2);
  margin: 0;
  max-width: 60ch;
}

@media (max-width: 768px) {
  .page-header { min-height: 240px; }
}

/* -----------------------------------------------------------------------------
   9. Project cards
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 250ms ease, transform 250ms ease;
  text-decoration: none;
  color: inherit;
}
.card:hover {
  border-color: var(--color-border-glow);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(232, 160, 32, 0.18);
  transform: translateY(-2px);
  text-decoration: none;
}
.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.card:hover .card__media img { transform: scale(1.04); }

.card__body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}
.card__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-mono);
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.card__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.25;
}
.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-xs) 0 0;
}
.card__summary {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--color-text-2);
  margin: var(--space-xs) 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__footer {
  margin-top: auto;
  padding-top: var(--space-md);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}
.card__footer .btn__arrow { transition: transform 200ms ease; }
.card:hover .card__footer .btn__arrow { transform: translateX(4px); }

/* Featured project card variant */
.card--featured {
  background: linear-gradient(180deg, var(--color-surface), var(--color-bg-alt));
  box-shadow: var(--shadow-glow-amber);
  border-color: rgba(232, 160, 32, 0.35);
}
.card--featured .card__media {
  aspect-ratio: 16 / 10;
}
.card--featured .card__body { padding: var(--space-xl); }
.card--featured .card__title { font-size: var(--fs-h2); }
.card--featured:hover { transform: scale(1.015); }

.card__badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-text);
  background: rgba(45, 27, 105, 0.85);
  border: 1px solid var(--color-violet-light);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  z-index: 2;
}

/* -----------------------------------------------------------------------------
   10. Tag chips + filter bar
   -------------------------------------------------------------------------- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: lowercase;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  background: transparent;
  cursor: default;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}
.tag-chip--audio { color: var(--tag-audio); background: rgba(232, 160, 32, 0.10); }
.tag-chip--coding { color: var(--tag-coding); background: rgba(77, 238, 234, 0.10); }
.tag-chip--electronics { color: var(--tag-electronics); background: rgba(196, 98, 45, 0.12); }
.tag-chip--video { color: var(--tag-video); background: rgba(155, 127, 232, 0.12); }
.tag-chip--writing { color: var(--tag-writing); background: rgba(242, 236, 216, 0.08); }
.tag-chip--experiment { color: var(--tag-experiment); background: rgba(57, 255, 20, 0.10); }
.tag-chip--all { color: var(--color-primary); background: rgba(232, 160, 32, 0.10); }

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-xl);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.tag-filter .tag-chip {
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease;
  border-width: 1px;
  font-size: var(--fs-sm);
  padding: 6px 14px;
}
.tag-filter .tag-chip:hover { filter: brightness(1.15); }
.tag-filter .tag-chip[aria-pressed="true"],
.tag-filter .tag-chip.is-active {
  background: currentColor;
  position: relative;
}
.tag-filter .tag-chip[aria-pressed="true"]::after,
.tag-filter .tag-chip.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.tag-filter .tag-chip--all[aria-pressed="true"],
.tag-filter .tag-chip--all.is-active { color: var(--color-text-inverse); background: var(--color-primary); }
.tag-filter .tag-chip--audio[aria-pressed="true"],
.tag-filter .tag-chip--audio.is-active { color: var(--color-text-inverse); background: var(--tag-audio); }
.tag-filter .tag-chip--coding[aria-pressed="true"],
.tag-filter .tag-chip--coding.is-active { color: var(--color-text-inverse); background: var(--tag-coding); }
.tag-filter .tag-chip--electronics[aria-pressed="true"],
.tag-filter .tag-chip--electronics.is-active { color: var(--color-text-inverse); background: var(--tag-electronics); }
.tag-filter .tag-chip--video[aria-pressed="true"],
.tag-filter .tag-chip--video.is-active { color: var(--color-text-inverse); background: var(--tag-video); }
.tag-filter .tag-chip--writing[aria-pressed="true"],
.tag-filter .tag-chip--writing.is-active { color: var(--color-text-inverse); background: var(--tag-writing); }
.tag-filter .tag-chip--experiment[aria-pressed="true"],
.tag-filter .tag-chip--experiment.is-active { color: var(--color-text-inverse); background: var(--tag-experiment); }

/* -----------------------------------------------------------------------------
   11. Audio player
   -------------------------------------------------------------------------- */
.audio-player {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.audio-player__title {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}
.audio-player__waveform {
  position: relative;
  height: 96px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(232, 160, 32, 0.04) 2px, rgba(232, 160, 32, 0.04) 3px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 var(--space-md);
}
.audio-player__waveform-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 100%;
}
.audio-player__waveform-bars span {
  flex: 1;
  background: var(--color-primary);
  border-radius: 1px;
  opacity: 0.85;
  box-shadow: 0 0 4px rgba(232, 160, 32, 0.6);
}
.audio-player__controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.audio-player__play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: box-shadow 200ms ease;
  flex-shrink: 0;
}
.audio-player__play:hover { box-shadow: var(--shadow-glow-amber); }
.audio-player__time,
.audio-player__duration {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-mono);
  min-width: 4ch;
}
.audio-player__scrubber {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  position: relative;
  cursor: pointer;
}
.audio-player__scrubber::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 35%;
  background: var(--color-primary);
  border-radius: inherit;
  box-shadow: 0 0 6px rgba(232, 160, 32, 0.5);
}
.audio-player__caption {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin: 0;
}
.audio-player__source { display: none; }

/* -----------------------------------------------------------------------------
   12. Video embed
   -------------------------------------------------------------------------- */
.video-embed {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
}
.video-embed__ratio {
  position: relative;
  padding-top: 56.25%;
}
.video-embed__frame,
.video-embed__ratio iframe,
.video-embed__ratio video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-embed__caption {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  padding: var(--space-md);
  margin: 0;
}

/* -----------------------------------------------------------------------------
   13. Image gallery
   -------------------------------------------------------------------------- */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-md);
}
.image-gallery__item {
  position: relative;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.image-gallery__item:hover {
  border-color: var(--color-border-glow);
  box-shadow: var(--shadow-glow-amber);
}
.image-gallery__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 400ms ease;
}
.image-gallery__item:hover img { transform: scale(1.04); }
.image-gallery__caption {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  padding: var(--space-sm) var(--space-md);
}

/* -----------------------------------------------------------------------------
   14. Code block
   -------------------------------------------------------------------------- */
.code-block {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--leading-mono);
  color: var(--color-text);
  overflow-x: auto;
  margin: var(--space-md) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--color-surface);
}
.code-block::-webkit-scrollbar { height: 8px; }
.code-block::-webkit-scrollbar-track { background: var(--color-surface); }
.code-block::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--radius-pill);
}
.code-block code {
  font-family: inherit;
  background: transparent;
  padding: 0;
  color: inherit;
  white-space: pre;
  display: block;
}
.code-block__lang {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  background: var(--color-bg);
}

/* Syntax token classes (can be applied by hand or by a highlighter) */
.tok-kw { color: var(--color-accent); }
.tok-str { color: var(--color-primary); }
.tok-com { color: var(--color-text-muted); font-style: italic; }
.tok-op { color: var(--color-secondary); }
.tok-num { color: var(--color-copper); }
.tok-fn { color: var(--color-text); }
.tok-type { color: var(--color-secondary); }

/* Inline code */
code:not(.code-block code) {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.4em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
}

/* -----------------------------------------------------------------------------
   15. Forms
   -------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: var(--space-lg); }
.form__group { display: flex; flex-direction: column; gap: var(--space-xs); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
@media (max-width: 600px) { .form__row { grid-template-columns: 1fr; } }
.form__label {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text-2);
  letter-spacing: 0.02em;
}
.form__input,
.form__textarea,
.form__select {
  width: 100%;
  padding: 0.75em 1em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.form__textarea { min-height: 140px; resize: vertical; font-family: var(--font-body); line-height: 1.6; }
.form__select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-primary) 50%),
                    linear-gradient(135deg, var(--color-primary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5em;
}
.form__input::placeholder,
.form__textarea::placeholder { color: var(--color-text-muted); }
.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), 0 0 16px rgba(232, 160, 32, 0.25);
}
.form__hint {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}
.form__submit { align-self: flex-start; }
@media (max-width: 600px) { .form__submit { width: 100%; } }

/* -----------------------------------------------------------------------------
   16. Stats / metadata strip
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.stats__item {
  padding: var(--space-xl) var(--space-lg);
  border-left: 1px solid var(--color-border);
}
.stats__item:first-child { border-left: none; }
.stats__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
  display: block;
}
.stats__value {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--color-text-2);
  line-height: 1.5;
}
@media (max-width: 768px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats__item:nth-child(2n + 1) { border-left: none; }
  .stats__item:nth-child(n + 3) { border-top: 1px solid var(--color-border); }
}

/* -----------------------------------------------------------------------------
   17. CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  padding: var(--space-3xl) 0;
  background: var(--color-violet);
  background-image:
    radial-gradient(ellipse at 80% 20%, rgba(232, 160, 32, 0.18), transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(77, 238, 234, 0.12), transparent 50%);
  overflow: hidden;
  text-align: center;
}
.cta-band__title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  color: var(--color-text);
  text-shadow: var(--shadow-text-glow);
  margin-bottom: var(--space-md);
}
.cta-band__subtitle {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: var(--color-text-2);
  margin: 0 auto var(--space-xl);
  max-width: 56ch;
}
.cta-band__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* -----------------------------------------------------------------------------
   18. Waveform divider
   -------------------------------------------------------------------------- */
.waveform-divider {
  height: 120px;
  width: 100%;
  background-image: url("assets/texture-waveform-divider.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.45;
  pointer-events: none;
}

/* -----------------------------------------------------------------------------
   19. Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-2xl);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}
.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.footer__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}
.footer__wordmark .nav__brand-dot { width: 8px; height: 8px; }
.footer__tagline {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--color-text-muted);
  margin: 0;
  font-size: var(--fs-sm);
  max-width: 32ch;
}
.footer__heading {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-md);
}
.footer__list { list-style: none; padding: 0; margin: 0; }
.footer__list li { padding: 0; margin: 0 0 var(--space-xs); }
.footer__list li::before { content: none; }
.footer__list a {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 150ms ease;
  letter-spacing: var(--tracking-mono);
}
.footer__list a:hover { color: var(--color-primary); text-decoration: none; }
.footer__bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}
.footer__copy {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin: 0;
  letter-spacing: var(--tracking-mono);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}
.footer__copy::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: var(--shadow-glow-green);
}
.footer__location {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-mono);
  color: var(--color-text-muted);
}
@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}

/* -----------------------------------------------------------------------------
   20. Misc utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.text-center { text-align: center; }
.text-amber { color: var(--color-primary); }
.text-phosphor { color: var(--color-accent); }
.text-blue { color: var(--color-secondary); }
.text-copper { color: var(--color-copper); }

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.flex-row--center { justify-content: center; align-items: center; }

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .nav__brand-dot { animation: none; }
}
