/* ==========================================================================
   Amir Pourmohammadi · Amir Tech Lab — Portfolio styles
   --------------------------------------------------------------------------
   PALETTE: "A — Coastal Engineering Lab"
   To switch palettes later, edit the --c-* variables in :root below.
   One dominant color (Off-White bg + Ocean Blue), one secondary (Aqua Mist),
   one restrained accent (Coral). Nothing else fights for attention.
   ========================================================================== */

:root {
  /* ---- Palette A colors (edit these to re-theme the whole site) ---- */
  --c-off-white: #F4F1EC;   /* main background */
  --c-ocean:     #213F54;   /* headings, nav, strong text */
  --c-slate:     #303C43;   /* body text */
  --c-aqua:      #9CB8B8;   /* secondary / quiet surfaces & lines */
  --c-coral:     #D38368;   /* accent: buttons, active states (use sparingly) */
  --c-sand:      #D6C1AF;   /* warm surface tint */
  --c-olive:     #7F8266;   /* muted labels */
  --c-lilac:     #ADA0BD;   /* optional rare detail */

  /* ---- Derived / functional tokens ---- */
  --bg:           var(--c-off-white);
  --bg-panel:     #FBFAF6;
  --bg-sunk:      #ECE7DE;
  --text:         var(--c-slate);
  --text-strong:  var(--c-ocean);
  --line:         #DAD3C7;
  --line-strong:  #C7BEAE;
  --accent:       var(--c-coral);
  --accent-deep:  #BE6F55;

  /* ---- Type ---- */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  /* ---- Scale & rhythm ---- */
  --maxw: 1140px;
  --gap: clamp(1rem, 2vw, 1.75rem);
  --section-pad: clamp(3.5rem, 8vw, 6.5rem);
  --radius: 4px;          /* deliberately small — engineering, not glassy */
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(33, 63, 84, .06), 0 8px 24px -12px rgba(33, 63, 84, .18);
  --shadow-lift: 0 2px 4px rgba(33, 63, 84, .08), 0 18px 40px -16px rgba(33, 63, 84, .28);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---- Grid-paper backdrop, echoing the cutting mat in the build photos ---- */
.grid-paper {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: -1px -1px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  font-weight: 600;
}

p { margin: 0 0 1rem; }
a { color: var(--accent-deep); text-decoration-color: var(--c-sand); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

/* Accessible skip link */
.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--c-ocean); color: #fff;
  padding: .6rem 1rem; border-radius: var(--radius); z-index: 200;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; color: #fff; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* The eyebrow / monospace label — a recurring lab-notebook device */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-olive);
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--line-strong);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  --btn-bg: var(--c-ocean);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .98rem;
  letter-spacing: -0.01em;
  padding: .8rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s var(--ease), background .18s var(--ease),
              box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--btn-fg); }
.btn:active { transform: translateY(0); }

.btn--accent { --btn-bg: var(--accent); }
.btn--accent:hover { --btn-bg: var(--accent-deep); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-ocean);
  border-color: var(--line-strong);
}
.btn--ghost:hover { --btn-fg: var(--c-ocean); border-color: var(--c-ocean); background: var(--bg-panel); }

.btn--small { padding: .55rem 1rem; font-size: .9rem; }

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}

.brand { display: flex; flex-direction: column; line-height: 1; text-decoration: none; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.06rem;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.brand__tag {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-olive);
  margin-top: .25rem;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: .35rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav__link {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-strong);
  text-decoration: none;
  padding: .5rem .8rem;
  border-radius: var(--radius);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: .8rem; right: .8rem; bottom: .32rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease);
}
.nav__link:hover { color: var(--accent-deep); }
.nav__link.is-active { color: var(--c-ocean); }
.nav__link.is-active::after { transform: scaleX(1); }

.nav__cta { margin-left: .4rem; }

/* Hamburger */
.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-panel);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav__toggle-bars, .nav__toggle-bars::before, .nav__toggle-bars::after {
  display: block;
  width: 20px; height: 2px;
  background: var(--c-ocean);
  position: relative;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav__toggle-bars::before, .nav__toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav__toggle-bars::before { top: -6px; }
.nav__toggle-bars::after  { top: 6px; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: .5rem clamp(1.1rem, 4vw, 2rem) 1.1rem;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav__link { padding: .85rem .4rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav__link::after { display: none; }
  .nav__link.is-active { color: var(--accent-deep); }
  .nav__cta { margin: .9rem 0 0; justify-content: center; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: var(--section-pad);
  background:
    radial-gradient(120% 90% at 85% -10%, color-mix(in srgb, var(--c-aqua) 26%, transparent), transparent 60%),
    var(--bg);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.hero__intro p {
  font-size: 1.15rem;
  max-width: 46ch;
  color: var(--text);
}
.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 3.9rem);
  margin-bottom: 1.1rem;
}
.hero h1 .accentword { color: var(--accent-deep); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* Hero specs row — monospace, like a parts list header */
.hero__specs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.4rem;
  margin-top: 2.2rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--c-olive);
  text-transform: uppercase;
}
.hero__specs span { display: inline-flex; align-items: center; gap: .5rem; }
.hero__specs span::before { content: "▸"; color: var(--c-aqua); }

/* Hero media: photo framed like a lab plate, with a circuit-trace overlay */
.hero__media { position: relative; }
.hero__plate {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  padding: 12px;
  box-shadow: var(--shadow-lift);
}
.hero__plate img {
  border-radius: var(--radius);
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.hero__plate-tag {
  position: absolute;
  left: 12px; bottom: 12px;
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  background: color-mix(in srgb, var(--c-ocean) 88%, transparent);
  padding: .35rem .6rem;
  border-radius: var(--radius);
}
.hero__circuit {
  position: absolute;
  inset: -18px -18px auto auto;
  width: 160px; height: 160px;
  z-index: -1;
  color: var(--c-aqua);
  opacity: .9;
}
.hero__circuit path, .hero__circuit line { stroke: currentColor; stroke-width: 1.4; fill: none; }
.hero__circuit circle { fill: var(--accent); }

/* Animated trace (respects reduced motion) */
.trace {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: trace-draw 3.4s var(--ease) forwards;
}
@keyframes trace-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .trace { animation: none; stroke-dashoffset: 0; }
}

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; max-width: 460px; }
}

/* ==========================================================================
   Generic section scaffolding
   ========================================================================== */
.section { padding-block: var(--section-pad); }
.section--sunk { background: var(--bg-sunk); border-block: 1px solid var(--line); }
.section__head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.section__head p { color: var(--text); font-size: 1.08rem; }

/* ==========================================================================
   Project cards
   ========================================================================== */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2rem);
}
@media (max-width: 720px) { .projects__grid { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }

.card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-sunk); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }

.card__badge {
  position: absolute; top: .7rem; left: .7rem;
  font-family: var(--font-mono);
  font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  background: var(--accent); color: #fff;
  padding: .28rem .55rem; border-radius: var(--radius);
}
.card__video-flag {
  position: absolute; top: .7rem; right: .7rem;
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--font-mono);
  font-size: .64rem; letter-spacing: .08em; text-transform: uppercase;
  background: color-mix(in srgb, var(--c-ocean) 86%, transparent); color: #fff;
  padding: .28rem .5rem; border-radius: var(--radius);
}
.card__video-flag svg { width: 12px; height: 12px; }

.card__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.4rem; margin-bottom: .35rem; }
.card__problem { font-size: .95rem; color: var(--c-olive); font-style: italic; margin-bottom: .75rem; }
.card__desc { font-size: .98rem; margin-bottom: 1.1rem; }

/* monospace spec strip — the signature component label */
.card__specs {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--c-ocean);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .5rem .65rem;
  margin-bottom: 1.1rem;
}

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.3rem; }
.tag {
  font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .04em;
  color: var(--c-slate);
  background: transparent;
  border: 1px solid var(--line-strong);
  padding: .22rem .55rem;
  border-radius: 100px;
}

.card__foot { margin-top: auto; }

/* ==========================================================================
   About
   ========================================================================== */
.about__grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
@media (max-width: 820px) { .about__grid { grid-template-columns: 1fr; } }
.about__lead { font-size: 1.18rem; color: var(--text-strong); }
.about__interests { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: .55rem; }
.about__interests li {
  display: flex; align-items: baseline; gap: .7rem;
  font-size: 1rem;
}
.about__interests li::before {
  content: attr(data-n);
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--accent-deep);
  flex: none;
}
.about__card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.about__card h3 { font-size: 1.05rem; margin-bottom: .8rem; }
.about__stat { font-family: var(--font-mono); font-size: .8rem; color: var(--c-olive); display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.about__stat:last-child { border-bottom: 0; }
.about__stat strong { color: var(--c-ocean); font-weight: 700; }

/* ==========================================================================
   Skills
   ========================================================================== */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}
.skill-group {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c-aqua);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.35rem 1.5rem;
}
.skill-group:nth-child(2) { border-top-color: var(--c-sand); }
.skill-group:nth-child(3) { border-top-color: var(--c-olive); }
.skill-group:nth-child(4) { border-top-color: var(--c-lilac); }
.skill-group h3 {
  font-size: 1.05rem;
  display: flex; align-items: center; gap: .6rem;
}
.skill-group__n { font-family: var(--font-mono); font-size: .72rem; color: var(--c-olive); }
.skill-group ul { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .5rem; }
.skill-group li { font-size: .95rem; display: flex; align-items: baseline; gap: .55rem; }
.skill-group li::before { content: "—"; color: var(--c-aqua); flex: none; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
@media (max-width: 820px) { .contact__grid { grid-template-columns: 1fr; } }

.contact__links { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: .85rem; }
.contact__links a {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--font-display); font-weight: 500;
  color: var(--text-strong); text-decoration: none;
}
.contact__links a:hover { color: var(--accent-deep); }
.contact__links svg { width: 20px; height: 20px; flex: none; color: var(--c-olive); }
.contact__links a:hover svg { color: var(--accent-deep); }

.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-family: var(--font-display); font-size: .9rem; font-weight: 500; color: var(--text-strong); }
.field input, .field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: .75rem .85rem;
  width: 100%;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field textarea { resize: vertical; min-height: 130px; }

/* Honeypot — visually & programmatically hidden from real users */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form__status {
  font-family: var(--font-mono);
  font-size: .82rem;
  min-height: 1.2em;
}
.form__status.is-error { color: var(--accent-deep); }
.form__status.is-ok { color: var(--c-olive); }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--c-ocean);
  color: #E8EEF1;
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.site-footer a { color: #E8EEF1; }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: flex-start; }
.footer__brand .brand__name { color: #fff; }
.footer__brand .brand__tag { color: var(--c-aqua); }
.footer__links { display: flex; gap: 1.2rem; list-style: none; margin: 0; padding: 0; }
.footer__links a { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; font-family: var(--font-display); font-size: .95rem; }
.footer__links a:hover { color: var(--c-aqua); }
.footer__links svg { width: 18px; height: 18px; }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  margin-top: 2rem; padding-top: 1.4rem;
  border-top: 1px solid color-mix(in srgb, #fff 16%, transparent);
  font-family: var(--font-mono); font-size: .76rem; color: var(--c-aqua);
}
.footer__bottom a { text-decoration: none; }
.footer__bottom a:hover { color: #fff; }
.to-top { display: inline-flex; align-items: center; gap: .4rem; }

/* ==========================================================================
   Scroll-reveal (progressive enhancement; content visible without JS)
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.js-ready .reveal { will-change: opacity, transform; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Project detail pages
   ========================================================================== */
.proj-hero {
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.proj-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.proj-hero h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
.proj-hero__summary { font-size: 1.2rem; max-width: 60ch; color: var(--text); }
.back-link {
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; color: var(--c-olive); display: inline-flex; align-items: center; gap: .45rem;
  margin-bottom: 1.3rem;
}
.back-link:hover { color: var(--accent-deep); }

.proj-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding-block: var(--section-pad);
}
@media (max-width: 880px) { .proj-layout { grid-template-columns: 1fr; } }

/* In-page contents rail (sticky on desktop) */
.proj-toc { position: sticky; top: 84px; font-family: var(--font-mono); font-size: .78rem; }
.proj-toc h2 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--c-olive); margin-bottom: .8rem; }
.proj-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; display: grid; gap: .5rem; }
.proj-toc a { display: block; text-decoration: none; color: var(--text); padding: .15rem 0 .15rem .2rem; border-left: 2px solid transparent; }
.proj-toc a:hover { color: var(--accent-deep); border-left-color: var(--c-aqua); }
@media (max-width: 880px) { .proj-toc { position: static; margin-bottom: 1rem; } .proj-toc ol { grid-auto-flow: row; } }

.proj-block { margin-bottom: clamp(2.2rem, 5vw, 3.2rem); scroll-margin-top: 84px; }
.proj-block > h2 {
  font-size: 1.5rem;
  display: flex; align-items: baseline; gap: .7rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.1rem;
}
.proj-block > h2 .n { font-family: var(--font-mono); font-size: .85rem; color: var(--accent-deep); }

/* "process is valuable" callouts: revisions & failures get a real frame */
.note {
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--c-aqua);
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1rem 0;
}
.note--revision { border-left-color: var(--accent); }
.note--failure  { border-left-color: var(--c-olive); }
.note__label {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-olive); margin-bottom: .35rem; display: block;
}

/* Spec table on project pages */
.spec-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.spec-table th, .spec-table td { text-align: left; padding: .6rem .2rem; border-bottom: 1px dashed var(--line); vertical-align: top; }
.spec-table th { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .04em; color: var(--c-olive); font-weight: 400; width: 38%; }

/* Image gallery (lightbox-enabled) */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; margin: 1.1rem 0; }
.gallery figure { margin: 0; }
.gallery button.shot {
  display: block; width: 100%; padding: 0; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-sunk);
}
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transition: transform .4s var(--ease); }
.gallery button.shot:hover img { transform: scale(1.05); }
.gallery figcaption { font-family: var(--font-mono); font-size: .72rem; color: var(--c-olive); margin-top: .4rem; }

/* Placeholder frame for media not yet supplied */
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  aspect-ratio: 4 / 3;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, transparent, transparent 10px, color-mix(in srgb, var(--c-sand) 30%, transparent) 10px, color-mix(in srgb, var(--c-sand) 30%, transparent) 11px),
    var(--bg-sunk);
  color: var(--c-olive);
  text-align: center;
  padding: 1rem;
}
.placeholder__title { font-family: var(--font-display); font-weight: 600; color: var(--c-ocean); }
.placeholder code { font-family: var(--font-mono); font-size: .78rem; color: var(--accent-deep); background: var(--bg-panel); padding: .15rem .4rem; border-radius: 3px; }

/* ==========================================================================
   Video section
   ========================================================================== */
.video-block {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2vw, 1.4rem);
}
.video-block video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.video-block--square video { aspect-ratio: 1 / 1; max-width: 520px; margin-inline: auto; }
.video-block__cap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem;
  margin-top: .9rem;
}
.video-block__cap p { margin: 0; font-size: .92rem; color: var(--c-olive); }
.video-empty {
  text-align: center; padding: 2rem 1rem; color: var(--c-olive);
  font-family: var(--font-mono); font-size: .85rem;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c-slate) 88%, transparent);
  padding: 4vmin;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.lightbox__close {
  position: absolute; top: 3vmin; right: 3vmin;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.3); color: #fff;
  font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.lightbox__close:hover { background: rgba(0,0,0,.55); }
.lightbox__cap { position: absolute; bottom: 3vmin; left: 0; right: 0; text-align: center; color: #fff; font-family: var(--font-mono); font-size: .8rem; }

/* ==========================================================================
   Simple status pages (thank-you / 404)
   ========================================================================== */
.status-page {
  min-height: 70vh;
  display: flex; align-items: center;
}
.status-page__inner { max-width: 56ch; }
.status-page h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.status-page .code { font-family: var(--font-mono); color: var(--accent-deep); font-size: .9rem; letter-spacing: .1em; }
.status-page .actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

/* Utilities */
.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;
}
.mt-2 { margin-top: 2rem; }
