/* =========================================================
   Haruyoshie Ecima — Portfolio
   Plain CSS, no build step. Colors live in :root.
   ========================================================= */

:root {
  --bg: #0e0f11;
  --bg-2: #15171a;
  --surface: #1b1d21;
  --surface-2: #23262b;
  --border: #2c2f35;
  --text: #f2f3f0;
  --text-muted: #a3a7ad;
  --text-dim: #6f747b;
  --accent: #d2e874;        /* lime, from the original site */
  --accent-ink: #11140a;
  --accent-soft: rgba(210, 232, 116, 0.12);
  --purple: #9074e8;        /* secondary, from the original buttons */
  --purple-soft: rgba(144, 116, 232, 0.14);

  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

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

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #e0f28f; }

.btn--ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--text-muted); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(14, 15, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.93rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav .nav__cta {
  color: var(--accent-ink);
  background: var(--accent);
  margin-left: 8px;
  font-weight: 500;
}
.nav .nav__cta:hover { background: #e0f28f; color: var(--accent-ink); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.is-open .nav-toggle .icon-open { display: none; }
.is-open .nav-toggle .icon-close { display: block; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px var(--gutter) 24px;
    background: rgba(14, 15, 17, 0.97);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .is-open .nav { opacity: 1; transform: none; visibility: visible; }
  .nav a { padding: 12px 14px; font-size: 1.05rem; }
  .nav .nav__cta { margin: 8px 0 0; text-align: center; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 120px) 0; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--border); }

.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.section-head p { color: var(--text-muted); margin: 14px 0 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(48px, 8vw, 96px)) 0 clamp(56px, 8vw, 96px);
  overflow: hidden;
}
.hero::before {
  /* subtle grid, like an editor viewport */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 20%, transparent 75%);
  opacity: 0.45;
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.hero__greeting { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 8px; }

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.hero h1 .accent { color: var(--accent); }

.hero__role {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: var(--text);
  margin: 22px 0 14px;
}
.hero__lead { color: var(--text-muted); max-width: 540px; font-size: 1.05rem; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero__social { display: flex; gap: 10px; margin-top: 28px; }

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.icon-link svg { width: 18px; height: 18px; }
.icon-link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.hero__photo { position: relative; justify-self: end; width: 100%; max-width: 440px; }
.hero__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 30% center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero__photo::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  opacity: 0.5;
  z-index: -1;
}

.status-chip {
  position: absolute;
  left: -20px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(21, 23, 26, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}
.status-chip strong { display: block; font-weight: 600; }
.status-chip small { color: var(--text-muted); }
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: none;
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__photo { justify-self: start; max-width: 360px; order: -1; }
  .status-chip { left: 12px; bottom: 12px; }
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}
.stat { padding: 24px 26px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}
.stat__label { color: var(--text-muted); font-size: 0.9rem; margin-top: 6px; line-height: 1.45; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.about__text p { color: var(--text-muted); font-size: 1.04rem; }
.about__text p:first-child { color: var(--text); font-size: 1.2rem; line-height: 1.6; }

.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.about__aside { position: sticky; top: calc(var(--header-h) + 24px); }
.side-card + .side-card { margin-top: 16px; }
.side-card h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.side-card dl { margin: 0; display: grid; gap: 14px; }
.side-card dt { font-size: 0.82rem; color: var(--text-dim); }
.side-card dd { margin: 2px 0 0; font-weight: 500; line-height: 1.45; }

.skill-group + .skill-group { margin-top: 18px; }
.skill-group h4 { font-size: 0.9rem; font-weight: 500; color: var(--text); margin-bottom: 10px; font-family: var(--font-body); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.tag--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.tag--purple { background: var(--purple-soft); border-color: transparent; color: #b6a4f2; }

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__aside { position: static; }
}

/* ---------- Experience ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--border);
}

.job { position: relative; padding-left: 44px; }
.job + .job { margin-top: 18px; }
.job::before {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--text-dim);
}
.job--current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }

.job details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}
.job details[open], .job details:hover { border-color: #3a3e45; }

.job summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 20px;
  align-items: center;
}
.job summary::-webkit-details-marker { display: none; }

.job__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.job__company { color: var(--accent); font-weight: 500; }
.job__date { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8rem; grid-column: 2; grid-row: 1; text-align: right; }
.job__toggle {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}
.job__toggle svg { width: 14px; height: 14px; }
details[open] .job__toggle { transform: rotate(45deg); color: var(--accent); border-color: var(--accent); }

.job__body { padding: 0 24px 22px; color: var(--text-muted); }
.job__body ul { margin: 0; padding-left: 18px; }
.job__body li { margin-bottom: 8px; }
.job__body li::marker { color: var(--accent); }
.job__body strong { color: var(--text); font-weight: 500; }

.badge-now {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
}

@media (max-width: 600px) {
  .job { padding-left: 32px; }
  .job summary { grid-template-columns: 1fr auto; padding: 18px; }
  .job__date { grid-column: 1; grid-row: auto; text-align: left; }
  .job__toggle { grid-row: 1; }
  .job__body { padding: 0 18px 18px; }
}

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter:hover { color: var(--text); border-color: var(--text-dim); }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.filter .count { opacity: 0.6; margin-left: 4px; font-family: var(--font-mono); font-size: 0.78rem; }

.projects {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.project-card { grid-column: span 3; }
.project-card--wide { grid-column: span 6; }
.projects.is-filtered .project-card { grid-column: span 3; }
.project-card[hidden] { display: none; }

@media (max-width: 760px) {
  .projects { grid-template-columns: 1fr; }
  .project-card, .project-card--wide, .projects.is-filtered .project-card { grid-column: auto; }
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card-link:hover { transform: translateY(-4px); border-color: #42464e; box-shadow: var(--shadow); }

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
}
.project-card--wide .card-media { aspect-ratio: 21 / 8; }
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.card-link:hover .card-media img { transform: scale(1.04); }

.card-media .play {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  backdrop-filter: blur(6px);
}
.card-media .play svg { width: 12px; height: 12px; }

/* Tool cards: no screenshots yet, so the metric is the visual */
.card-media--metric {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  background:
    radial-gradient(circle at 85% 15%, var(--purple-soft), transparent 55%),
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--bg-2);
}
.card-media--metric .terminal-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: auto;
}
.card-media--metric .terminal-line b { color: var(--accent); font-weight: 400; }
.metric-big {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.metric-big .from { color: var(--text-dim); text-decoration: line-through; text-decoration-thickness: 2px; }
.metric-big .arrow { color: var(--text-dim); font-size: 0.6em; }
.metric-big .to { color: var(--accent); }
.metric-caption { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }

.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.card-kicker { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.card-body h3 { font-size: 1.35rem; margin-bottom: 10px; }
.card-body p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 18px; }
.card-body .tags { margin-top: auto; }
.card-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}
.card-more svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.card-link:hover .card-more svg { transform: translateX(4px); }

/* ---------- Contact ---------- */
.contact {
  text-align: center;
  padding: clamp(80px, 12vw, 140px) 0;
  position: relative;
  overflow: hidden;
}
.contact::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 720px;
  height: 720px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(210, 232, 116, 0.08), transparent 60%);
  pointer-events: none;
}
.contact .eyebrow { justify-content: center; }
.contact h2 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: -0.03em;
  max-width: 820px;
  margin: 0 auto;
  position: relative;
}
.contact h2 .accent { color: var(--accent); }
.contact p { color: var(--text-muted); margin: 18px auto 32px; max-width: 520px; position: relative; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; position: relative; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--text-dim); font-size: 0.88rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { text-decoration: none; color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Project page ---------- */
.project-hero { padding: calc(var(--header-h) + clamp(32px, 6vw, 64px)) 0 clamp(32px, 5vw, 48px); }

.back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.back-link svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.back-link:hover { color: var(--accent); }
.back-link:hover svg { transform: translateX(-3px); }

.project-hero h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); letter-spacing: -0.03em; max-width: 900px; }
.project-hero .lead { color: var(--text-muted); font-size: clamp(1.05rem, 2vw, 1.2rem); max-width: 780px; margin-top: 20px; }

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  margin-top: 36px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.meta > div { background: var(--bg); padding: 18px 20px; }
.meta dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.meta dd { margin: 0; font-weight: 500; line-height: 1.45; }
.meta .tags { margin-top: 2px; }

.media-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow);
}

/* Lightweight YouTube: thumbnail first, iframe on click */
.yt {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #000 center / cover no-repeat;
  display: block;
  color: #fff;
}
.yt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.05) 60%);
}
.yt__btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  box-shadow: 0 0 0 10px rgba(210, 232, 116, 0.18);
}
.yt__btn svg { width: 28px; height: 28px; margin-left: 4px; }
.yt:hover .yt__btn { transform: translate(-50%, -50%) scale(1.08); }
.yt__label {
  position: absolute;
  left: 20px;
  bottom: 16px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.project-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  font-size: 0.9rem;
}
.toc h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a {
  display: block;
  padding: 6px 0 6px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.toc a:hover, .toc a.is-active { color: var(--accent); border-left-color: var(--accent); }

.prose { max-width: 720px; }
.prose section + section { margin-top: clamp(48px, 7vw, 72px); }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 20px; }
.prose h2 .num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); display: block; margin-bottom: 8px; font-weight: 400; letter-spacing: 0.08em; }
.prose p { color: var(--text-muted); font-size: 1.04rem; }
.prose p strong { color: var(--text); font-weight: 500; }
.prose ul { padding: 0; margin: 0 0 1em; list-style: none; }
.prose ul li {
  position: relative;
  padding-left: 28px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 10px;
  height: 2px;
  background: var(--accent);
}
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; color: var(--text); }

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
}
.callout p { margin: 0; color: var(--text); font-size: 1.08rem; }

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.result__value { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--accent); line-height: 1.1; }
.result__label { color: var(--text-muted); font-size: 0.88rem; margin-top: 6px; line-height: 1.45; }

/* Solution flow (tool pages) */
.flow { display: grid; gap: 12px; counter-reset: step; margin: 8px 0 0; padding: 0; list-style: none; }
.flow li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: var(--text-muted);
}
.flow li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.gallery button {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-2);
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery button:hover img { transform: scale(1.05); }

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 94vw;
  max-height: 92vh;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: var(--radius-sm); }
.lightbox__close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #444;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__close svg { width: 18px; height: 18px; }

.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.project-nav a {
  display: block;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.project-nav a:hover { border-color: var(--accent); background: var(--surface); }
.project-nav small { display: block; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.project-nav strong { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.project-nav .next { text-align: right; }

@media (max-width: 860px) {
  .project-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
}
@media (max-width: 560px) {
  .project-nav { grid-template-columns: 1fr; }
  .project-nav .next { text-align: left; }
}

/* ---------- 404 ---------- */
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 40px) 0 60px;
}
.not-found .code { font-family: var(--font-mono); color: var(--accent); font-size: 0.9rem; margin-bottom: 16px; }
.not-found h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); letter-spacing: -0.03em; }
.not-found p { color: var(--text-muted); margin: 16px 0 28px; max-width: 480px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
