/* 2BIT || ! 2BIT — site styles */
:root {
  --bg: #0e100c;
  --bg-elev: #161910;
  --bg-soft: #1c2016;
  --bg-invert: #f3efe4;
  --text: #f3efe4;
  --text-inv: #14160f;
  --muted: #a39e90;
  --faint: #6f6b5e;
  --line: rgba(243, 239, 228, 0.10);
  --line-strong: rgba(243, 239, 228, 0.18);
  --accent: #d2f25c;
  --accent-hot: #ff8f5a;
  --accent-ink: #14160f;
  --link: #d2f25c;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --radius-sm: 12px;
  --font-sans: "Bricolage Grotesque", system-ui, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1160px;
  --prose: 41.5rem;
  --header-h: 4.25rem;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="light"] {
  --bg: #f3efe4;
  --bg-elev: #fffcf6;
  --bg-soft: #e7e1d2;
  --bg-invert: #0e100c;
  --text: #16170f;
  --text-inv: #f3efe4;
  --muted: #5c594e;
  --faint: #8a8578;
  --line: rgba(22, 23, 15, 0.10);
  --line-strong: rgba(22, 23, 15, 0.16);
  --accent: #c8ed4a;
  --accent-hot: #c45a28;
  --accent-ink: #14160f;
  --link: #3f5606;
  --shadow: 0 20px 50px rgba(40, 36, 20, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1.0625rem;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(ellipse at 10% -10%, rgba(210, 242, 92, 0.07), transparent 45%),
    radial-gradient(ellipse at 100% 0%, rgba(255, 143, 90, 0.05), transparent 40%);
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; border-radius: 8px; z-index: 100;
  font-weight: 600;
}
.skip:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  background-color: #0e100c;
  background-color: var(--bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
[data-theme="light"] .site-header {
  background-color: #f3efe4;
  background-color: var(--bg);
}
.header-inner, .wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}
.header-inner {
  display: flex; align-items: center; gap: 1.25rem;
  width: min(var(--max), calc(100% - 2.5rem));
}
.logo {
  display: flex; align-items: center; gap: .7rem;
  text-decoration: none; color: inherit; font-weight: 700;
  letter-spacing: -0.03em; flex: 0 0 auto;
}
.logo-mark {
  width: 2rem; height: 2rem; border-radius: 8px;
  border: 1.5px solid var(--accent);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.logo-word { font-size: 1.05rem; }
.logo-word .or {
  color: var(--accent);
  padding: 0 .15rem;
  font-weight: 800;
}
/* Header brand: 7-segment maker board (inline SVG). Segments are drawn and animated by /js/seg7.js. */
.logo { line-height: 0; }
.logo-board {
  display: block; height: 48px; width: auto; max-width: 100%;
  overflow: visible; transition: filter .25s ease;
}
.logo-board .s7-seg { fill: #161b10; }
.logo-board .s7-seg.on { fill: #d2f25c; }
.logo-board .lb-led-glow { fill: rgba(210, 242, 92, .35); }
[data-theme="light"] .logo-board .lb-edge { stroke: #3f5606; }

/* Power LED: blinks briefly on load, then holds. */
@keyframes lb-led {
  0% { opacity: .1; }
  8% { opacity: 1; }
  18% { opacity: .1; }
  30% { opacity: 1; }
  40% { opacity: .1; }
  55%, 100% { opacity: 1; }
}
.logo-board .lb-led { animation: lb-led .9s linear .1s both; }

/* Hover / focus: soft glow. */
@media (hover: hover) {
  .logo:hover .logo-board, .logo:focus-visible .logo-board { filter: drop-shadow(0 0 7px rgba(210, 242, 92, .45)); }
  [data-theme="light"] .logo:hover .logo-board, [data-theme="light"] .logo:focus-visible .logo-board { filter: drop-shadow(0 0 6px rgba(63, 86, 6, .4)); }
}
@media (max-width: 760px) { .logo-board { height: 38px; } }
@media (max-width: 380px) { .logo-board { height: 34px; } }

.nav {
  margin-left: auto;
  display: flex; align-items: center; gap: .15rem 1.15rem;
}
@supports not (gap: 1px) {
  .nav { gap: 0; }
  .nav a { margin-left: 1.15rem; }
  .nav a:first-child { margin-left: 0; }
}
.nav a {
  color: var(--text); text-decoration: none;
  font-size: .95rem; font-weight: 500;
  opacity: 0.82;
}
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; color: var(--accent); }
.icon-btn {
  appearance: none; border: 1px solid var(--line-strong);
  background: var(--bg-elev); color: var(--text);
  width: 2.35rem; height: 2.35rem; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer;
  padding: 0;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 1.15rem; height: 1.15rem; }
.theme-btn .icon-sun { display: none; }
[data-theme="light"] .theme-btn .icon-sun { display: block; }
[data-theme="light"] .theme-btn .icon-moon { display: none; }
.nav-toggle { display: none; }

/* Layout */
main { position: relative; z-index: 1; }
.section { padding: 4.5rem 0; }
.section + .section { padding-top: 0; }
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
  margin: 0 0 .6rem;
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); }
h3 { font-size: 1.15rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 38rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .8rem 1.2rem; border-radius: 999px;
  font-weight: 650; font-size: .95rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), background .2s, color .2s;
  letter-spacing: -0.01em;
  -webkit-appearance: none;
  appearance: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary,
a.btn-primary:link,
a.btn-primary:visited,
a.btn-primary:hover,
a.btn-primary:active {
  background-color: #d2f25c;
  background: var(--accent);
  color: #14160f;
  color: var(--accent-ink);
}
[data-theme="light"] .btn-primary,
[data-theme="light"] a.btn-primary:link,
[data-theme="light"] a.btn-primary:visited {
  background-color: #c8ed4a;
  background: var(--accent);
}
.btn-primary:hover, a.btn-primary:hover { color: var(--accent-ink); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }

/* Hero */
.hero {
  padding: 4.2rem 0 3.5rem;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 { margin-bottom: .9rem; }
.bit-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .25rem; }
.bit-title .or { color: var(--accent); font-weight: 800; }
/* Hero title as a 7-segment display (replaces the font text when JS runs; text stays for SEO / no-JS). */
.s7-title { display: none; }
html.js .bit-title { flex-wrap: nowrap; align-items: center; min-height: 1.15em; }
html.js .bit-title .t-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
html.js .s7-title { display: block; height: .72em; width: calc(.72em * var(--ar)); max-width: 100%; overflow: visible; }
.s7-title .s7-seg { fill: currentColor; opacity: .08; }
.s7-title .s7-acc .s7-seg { fill: var(--accent); }
.s7-title .s7-seg.on { opacity: 1; }
.hero-card {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  min-height: 420px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.hero-card img.portrait {
  width: 100%; height: 420px; object-fit: contain; object-position: center;
  background: var(--bg-elev);
}
.hero-float {
  position: absolute; right: 1rem; bottom: 1rem;
  width: 118px; height: 118px; border-radius: 22px;
  border: 3px solid var(--bg);
  background: #ffbf3c;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-float img { width: 100%; height: 100%; object-fit: cover; }
.hero-chip {
  position: absolute; left: 1rem; bottom: 1rem;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: .45rem .75rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: .72rem;
}

.hero-lab {
  display: flex;
  align-items: stretch;
  background:
    radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 45%),
    var(--bg-elev);
}
/* Hero terminal (board "plugged in over USB"): avrdude flash, then a serial monitor. Driven by /js/terminal.js. */
.hero-lab .term { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.term-schematic {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden;
  color: var(--accent); opacity: 0.20; z-index: 0;
}
.term-schematic svg { width: 100%; height: 100%; display: block; }
.term-schematic::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%,
    transparent 18%,
    color-mix(in srgb, var(--bg-elev) 55%, transparent) 58%,
    var(--bg-elev) 88%);
  pointer-events: none;
}
[data-theme="light"] .term-schematic { color: #3f5606; opacity: 0.18; }
.hero-lab .term { position: relative; z-index: 1; }
.term-bar {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 45%, transparent);
}
.term-dots { display: inline-flex; gap: .4rem; }
.term-dots i { width: .62rem; height: .62rem; border-radius: 50%; background: var(--line-strong); display: block; }
.term-dots i:first-child { background: var(--accent); opacity: .85; }
.term-title { font-family: var(--font-mono); font-size: .72rem; color: var(--faint); letter-spacing: .02em; }
.term-screen {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: .85rem 1rem 1rem;
  font-family: var(--font-mono); font-size: .74rem; line-height: 1.55;
  color: var(--text);
}
.term-screen .tl { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.55em; flex: none; opacity: .86; }
.term-screen .tp { color: var(--link); opacity: .75; }
.term-screen .tl-cmd { color: var(--link); opacity: 1; }
.term-screen .tl-bar { color: var(--link); opacity: .95; }
.term-screen .tt { color: var(--faint); }
.term-screen .tl-tail { opacity: 1; color: var(--link); }
.term-caret {
  display: inline-block;
  width: .55ch;
  height: 1em;
  margin-left: .1em;
  background: var(--link);
  vertical-align: -0.12em;
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}


/* Topics */
.topics { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip, .tag {
  display: inline-flex; align-items: center; gap: .15rem;
  padding: .3rem .7rem; border-radius: 999px;
  border: 1px solid var(--line-strong);
  text-decoration: none; color: var(--text);
  font-size: .8rem; font-weight: 550;
  background: var(--bg-elev);
}
.chip .count {
  margin-left: .15rem;
  padding-left: .45rem;
  border-left: 1px solid var(--line-strong);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.tag:hover, .chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }

/* Cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.card {
  position: relative;
  cursor: pointer;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform .25s var(--ease), border-color .25s;
}
.card:hover, a.card:hover, html.js .card.is-in:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; color: inherit; }
html.js .card.is-in:hover { transition: transform .25s var(--ease), border-color .25s, opacity .6s ease-out; transition-delay: 0s; }
a.stretched {
  color: inherit;
  text-decoration: none;
}
a.stretched:hover { color: inherit; text-decoration: none; }
a.stretched::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card .topics,
.project-links,
.exp-card a:not(.stretched),
.product a:not(.stretched) {
  position: relative;
  z-index: 2;
}
.card-media { aspect-ratio: 16/10; background: var(--bg-soft); overflow: hidden; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media.letter {
  display: grid; place-items: center;
  font-size: 3rem; font-weight: 800; color: var(--accent);
  letter-spacing: -0.05em;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    var(--bg-soft);
}
.card-body { padding: 1.15rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-meta {
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--faint); display: flex; gap: .6rem; flex-wrap: wrap;
}
.card-body h3 { font-size: 1.15rem; }
.card-body p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Project cards */
.project {
  position: relative;
  cursor: pointer;
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: 0; align-items: stretch;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.project + .project { margin-top: 1.15rem; }
.project-media { min-height: 240px; background: var(--bg-soft); }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 1.6rem 1.7rem; display: flex; flex-direction: column; gap: .7rem; }
.project-body p { margin: 0; color: var(--muted); }
.project-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: .6rem; }

/* Mosaic */
.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 140px;
  gap: .65rem;
}
.mosaic figure { margin: 0; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.mosaic figure:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 3; }
.mosaic figure:nth-child(2) { grid-column: 3 / 5; }
.mosaic figure:nth-child(5) { grid-column: 2 / 4; }

/* About */
.about-hero {
  display: grid; grid-template-columns: .85fr 1.15fr;
  gap: 3rem; align-items: start; padding: 3.5rem 0 2rem;
}
.about-photo { position: relative; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.about-photo img { width: 100%; height: 520px; object-fit: contain; object-position: center; background: var(--bg-elev); }
.essay {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 40rem;
}
.essay p { margin: 0 0 1.1rem; }
.signoff { font-style: italic; color: var(--muted); }

.skill-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.skill-list span {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 999px; padding: .35rem .75rem; font-size: .85rem;
}

.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.exp-card {
  position: relative;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem 1.35rem;
}
.exp-card:has(> h3 .stretched),
.product:has(.stretched) { cursor: pointer; }
.exp-card h3 { margin-bottom: .45rem; font-size: 1.05rem; }
.exp-card p { margin: 0; color: var(--muted); font-size: .95rem; }

.placeholder {
  border: 1.5px dashed color-mix(in srgb, var(--accent-hot) 55%, var(--line-strong));
  background: color-mix(in srgb, var(--accent-hot) 7%, var(--bg-elev));
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  position: relative;
}
.placeholder-flag, .placeholder .flag {
  font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-hot); margin: 0 0 .45rem;
}
.placeholder h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.placeholder p { margin: 0; color: var(--muted); font-size: .95rem; }

.contact-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; list-style: none; padding: 0; margin: 0; }
.contact-list a {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 14px; padding: .85rem 1rem;
  text-decoration: none; color: inherit; font-weight: 600;
}
.contact-list a:hover { border-color: var(--accent); }
.contact-list span { color: var(--muted); font-weight: 500; font-size: .85rem; }

/* Blog / prose */
.post-hero { padding: 3rem 0 1.5rem; max-width: var(--prose); }
.post-hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); margin: .4rem 0 1rem; }
.prose {
  font-family: var(--font-serif);
  font-size: 1.14rem; line-height: 1.75;
  max-width: var(--prose);
}
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote { margin: 0 0 1.2rem; }
.prose h2, .prose .post-subhead { font-family: var(--font-sans); font-size: 1.45rem; margin: 2rem 0 .8rem; }
.prose figure, .prose .post-figure { margin: 1.6rem 0; }
.prose img { border-radius: 14px; border: 1px solid var(--line); }
.prose figcaption { font-family: var(--font-sans); font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.prose pre, .prose code {
  font-family: var(--font-mono); font-size: .88rem;
}
.prose pre {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; padding: 1rem 1.1rem; overflow-x: auto;
}
.prose .btn { font-family: var(--font-sans); }
.video-embed {
  position: relative; padding-bottom: 56.25%; height: 0;
  margin: 1.6rem 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gif-wrap { position: relative; }
.gif-wrap button {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
}

/* Parts / ads */
.parts-box {
  margin: 2.5rem 0;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem;
}
.parts-box h2 { font-size: 1.25rem; margin-bottom: .35rem; }
.parts-disc { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
.parts-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.parts-list li {
  display: grid; grid-template-columns: 72px 1fr auto;
  gap: .9rem; align-items: center;
  padding: .6rem; border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.parts-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: #fff; }
.parts-list h3 { font-size: .95rem; margin: 0 0 .25rem; font-weight: 650; }
.placeholder-link {
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--accent-hot);
}
.ad-slot { margin: 2rem 0; }
.ad-slot-inner {
  border: 1px dashed var(--line-strong);
  border-radius: 12px; min-height: 90px;
  display: grid; place-items: center;
  color: var(--faint); font-size: .85rem;
  background: color-mix(in srgb, var(--bg-soft) 60%, transparent);
  text-align: center; padding: 1rem; gap: .2rem;
}
.ad-label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }

/* Store */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.product {
  position: relative;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.product img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; padding: .8rem; }
.product-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.product-body h3 { font-size: 1rem; }

/* Subscribe */
.subscribe {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 2.2rem 2.2rem;
  display: grid; grid-template-columns: 1.3fr 1fr;
  gap: 2rem; align-items: center;
}
.subscribe h2 { margin-bottom: .5rem; }

/* Footer */
.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  padding: 3rem 0 2rem;
  margin-top: 3rem;
  color: var(--muted);
  font-size: .92rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem; margin-bottom: 2rem;
}
.footer-brand { color: var(--text); font-weight: 700; letter-spacing: -0.03em; font-size: 1.15rem; margin-bottom: .4rem; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.legal { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; border-top: 1px solid var(--line); padding-top: 1.1rem; font-size: .85rem; }

#placeholder-toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--bg-invert); color: var(--text-inv);
  padding: .75rem 1rem; border-radius: 12px; z-index: 80;
  font-size: .9rem; box-shadow: var(--shadow); max-width: min(32rem, calc(100% - 2rem));
}

/* Legal pages */
.legal-page { max-width: 42rem; padding: 3rem 0 4rem; }
.legal-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 1rem; }
.legal-page h2 { font-size: 1.3rem; margin: 2rem 0 .6rem; }
.legal-page p, .legal-page li { color: var(--muted); }
.legal-page ul { padding-left: 1.15rem; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 4rem 1rem; }
.notfound h1 { font-family: var(--font-mono); font-size: clamp(3rem, 10vw, 6rem); color: var(--accent); }

/* Responsive */
@media (max-width: 960px) {
  .hero, .about-hero, .subscribe, .project, .footer-grid, .exp-grid, .contact-list, .grid-3, .product-grid {
    grid-template-columns: 1fr;
  }
  .grid-2 { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .mosaic figure:nth-child(n) { grid-column: auto; grid-row: auto; }
  .mosaic figure:nth-child(1) { grid-column: 1 / 3; grid-row: auto; }
  .hero-card, .hero-card img.portrait, .about-photo img { min-height: 320px; height: 360px; }
  .project-media { min-height: 200px; max-height: 260px; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  body.nav-open .nav {
    display: flex; flex-direction: column;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.25rem; gap: .85rem; align-items: flex-start;
  }
  .nav-toggle { display: grid; margin-left: auto; }
  .header-inner { width: min(var(--max), calc(100% - 1.5rem)); }
  .wrap { width: min(var(--max), calc(100% - 1.5rem)); }
  .section { padding: 3rem 0; }
  .hero { padding-top: 2.2rem; }
  .parts-list li { grid-template-columns: 64px 1fr; }
  .parts-list li .btn, .parts-list li .placeholder-link { grid-column: 1 / -1; }
  body.nav-open { overflow: hidden; }
}

/* Scroll fade-in: only hidden when JS ran (html.js). Without JS, content stays visible. */
html.js .card,
html.js .project,
html.js .exp-card,
html.js .placeholder,
html.js .product,
html.js .section-head {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease-out, transform .6s ease-out;
  transition-delay: var(--stagger, 0ms);
}
html.js .card.is-in,
html.js .project.is-in,
html.js .exp-card.is-in,
html.js .placeholder.is-in,
html.js .product.is-in,
html.js .section-head.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .term-caret { animation: none; opacity: 1; }
  html.js .card,
  html.js .project,
  html.js .exp-card,
  html.js .placeholder,
  html.js .product,
  html.js .section-head {
    opacity: 1;
    transform: none;
  }
}

/* ===== Video library ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.vl-accent { color: var(--accent); }
.vl-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: center; padding: 3.5rem 0 2rem; }
.vl-hero h1 { margin-bottom: .9rem; }
.vl-counter {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--bg-soft), var(--bg-elev) 70%);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 1.1rem 1.4rem 1.3rem; box-shadow: var(--shadow);
}
.vl-counter::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, color-mix(in srgb, var(--accent) 5%, transparent) 3px 4px);
}
.vl-counter-top { display: flex; align-items: center; gap: .55rem; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; color: var(--faint); }
.vl-counter-id { margin-left: auto; }
.vl-led { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: vl-blink 2.4s ease-in-out infinite; }
@keyframes vl-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.vl-digits { display: flex; gap: .55rem; justify-content: center; padding: 1.1rem 0 .7rem; min-height: 8.4rem; position: relative; }
.vl-digits svg { height: clamp(5.2rem, 12vw, 7.4rem); width: auto; transform: skewX(-6deg); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 45%, transparent)); }
.vl-digits .on { fill: var(--accent); }
.vl-digits .off { fill: color-mix(in srgb, var(--accent) 9%, transparent); }
.vl-digits .vl-fallback { font-family: var(--font-mono); font-size: 5rem; font-weight: 700; color: var(--accent); }
.vl-digits.is-live .vl-fallback { display: none; }
.vl-counter-label { text-align: center; font-family: var(--font-mono); font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); position: relative; }

.vl-featured-wrap { padding: 1rem 0 .5rem; }
.vl-featured {
  position: relative; display: grid; grid-template-columns: 1.5fr 1fr; gap: 0;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .25s, box-shadow .3s;
}
.vl-featured:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 60px -18px color-mix(in srgb, var(--accent) 45%, transparent); }
.vl-feat-media { position: relative; display: block; aspect-ratio: 16/9; background: var(--bg-soft); overflow: hidden; }
.vl-feat-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.vl-featured:hover .vl-feat-media img { transform: scale(1.04); }
.vl-feat-body { padding: 1.6rem 1.7rem; display: flex; flex-direction: column; justify-content: center; gap: .6rem; }
.vl-feat-body h2 { font-size: clamp(1.35rem, 2.4vw, 1.9rem); }
.vl-feat-body p { margin: 0; }

.vl-play {
  position: absolute; left: 50%; top: 50%; width: 3.2rem; height: 3.2rem; margin: -1.6rem 0 0 -1.6rem;
  display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1.5px solid var(--accent);
  backdrop-filter: blur(4px); transition: transform .25s var(--ease), background .25s, box-shadow .25s; pointer-events: none;
}
.vl-play svg { width: 55%; height: 55%; fill: var(--accent); margin-left: 6%; transition: fill .25s; }
.vl-play-lg { width: 4.6rem; height: 4.6rem; margin: -2.3rem 0 0 -2.3rem; }
a:hover > .vl-play, .vl-card:hover .vl-play { transform: scale(1.12); background: var(--accent); box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 70%, transparent); }
a:hover > .vl-play svg, .vl-card:hover .vl-play svg { fill: var(--accent-ink, #10130a); }

.vl-controls { padding: 2rem 0 .5rem; display: flex; flex-direction: column; gap: 1rem; }
.vl-bar { display: flex; gap: .8rem; flex-wrap: wrap; }
.vl-search {
  flex: 1 1 16rem; display: flex; align-items: center; gap: .6rem; padding: 0 1rem;
  background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 999px; transition: border-color .2s, box-shadow .2s;
}
.vl-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.vl-search svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; flex: none; }
.vl-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: .95rem; padding: .75rem 0; }
.vl-search input::placeholder { color: var(--faint); }
.vl-sort select {
  appearance: none; background: var(--bg-elev); color: var(--text); font: inherit; font-size: .9rem;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: .72rem 1.2rem; cursor: pointer;
}
.vl-sort select:focus { outline: 0; border-color: var(--accent); }
.vl-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
button.chip { font-family: inherit; cursor: pointer; transition: border-color .2s, background .2s, color .2s, box-shadow .2s; }
button.vl-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #10130a); box-shadow: 0 0 18px -4px var(--accent); }
button.vl-chip[aria-pressed="true"]:hover { color: var(--accent-ink, #10130a); }
button.vl-chip[aria-pressed="true"] .count { border-left-color: color-mix(in srgb, var(--accent-ink, #10130a) 35%, transparent); color: inherit; }

.vl-section { padding-top: 1.2rem !important; }
.vl-status { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; color: var(--faint); margin: 0 0 1rem; }
.vl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; }
.vl-card[hidden] { display: none; }
.vl-card:hover, html.js .vl-card.is-in:hover {
  box-shadow: 0 0 0 1px var(--accent), 0 14px 44px -14px color-mix(in srgb, var(--accent) 50%, transparent);
}
.vl-thumb { position: relative; aspect-ratio: 16/9; background: var(--bg-soft); overflow: hidden; }
.vl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease), filter .3s; }
.vl-card:hover .vl-thumb img { transform: scale(1.06); filter: brightness(1.08) saturate(1.1); }
.vl-badge {
  position: absolute; left: .55rem; top: .55rem; padding: .18rem .55rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase;
  background: color-mix(in srgb, var(--bg) 78%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  backdrop-filter: blur(4px);
}
.vl-card .card-body { padding: .85rem 1rem 1.05rem; gap: .4rem; }
.vl-card h3 { font-size: .98rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vl-card .card-meta { justify-content: space-between; flex-wrap: nowrap; }
.vl-ch { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
[data-theme="light"] .vl-ch { color: var(--link); }
.vl-card .card-meta span:last-child { flex: none; }
.vl-empty { text-align: center; color: var(--muted); padding: 3rem 0; }
.vl-more { display: flex; justify-content: center; margin-top: 2rem; }

.vl-lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; }
.vl-lightbox[hidden] { display: none; }
.vl-lb-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, #050604 88%, transparent); backdrop-filter: blur(6px); animation: vl-fade .25s ease-out; }
.vl-lb-panel {
  position: relative; width: min(1080px, 100%); background: var(--bg-elev); border: 1px solid var(--accent);
  border-radius: var(--radius); overflow: hidden; animation: vl-pop .3s var(--ease);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 30px 120px -20px color-mix(in srgb, var(--accent) 45%, transparent);
}
@keyframes vl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vl-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.vl-lb-frame { aspect-ratio: 16/9; background: #000; }
.vl-lb-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.vl-lb-bar { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; flex-wrap: wrap; }
.vl-lb-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 18rem; font-size: .92rem; }
.vl-lb-info strong { line-height: 1.3; }
.vl-lb-info span { font-size: .8rem; font-family: var(--font-mono); }
.vl-lb-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.vl-lb-actions .btn { padding: .55rem 1rem; font-size: .85rem; }
body.vl-open { overflow: hidden; }

@media (max-width: 1180px) { .vl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .vl-hero { grid-template-columns: 1fr; gap: 1.6rem; padding-top: 2.2rem; }
  .vl-featured { grid-template-columns: 1fr; }
  .vl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .vl-grid { grid-template-columns: 1fr; }
  .vl-feat-body { padding: 1.2rem; }
  .vl-lightbox { padding: .5rem; }
  .vl-lb-actions { width: 100%; }
  .vl-lb-actions .btn { flex: 1; text-align: center; justify-content: center; }
  .vl-lb-actions [data-vl-yt] { flex: 2 1 100%; order: 3; }
}
@media (prefers-reduced-motion: reduce) {
  .vl-led, .vl-lb-backdrop, .vl-lb-panel { animation: none !important; }
}

/* ===== Ads, affiliate links, cookie notice ===== */
.ad-slot { margin: 0; text-align: center; }
.ad-slot-inner { display: none; }
.ad-slot .ad-label { display: none; margin-bottom: .4rem; color: var(--faint); }
.ad-slot ins.adsbygoogle { width: 100%; min-height: 0; }
.ad-slot:has(ins[data-ad-status="filled"]) { margin: 2rem 0; }
.ad-slot:has(ins[data-ad-status="filled"]) .ad-label { display: block; }
.ad-slot ins[data-ad-status="unfilled"] { display: none !important; }
.epn-box ins.epn-placement { display: block; min-height: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--accent); }
.cookie-banner {
  position: fixed; z-index: 90; left: 1rem; right: 1rem; bottom: 1rem; max-width: 640px; margin: 0 auto;
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: .9rem 1.1rem; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  font-size: .85rem; color: var(--muted);
}
.cookie-banner p { margin: 0; flex: 1 1 18rem; line-height: 1.5; }
.cookie-banner strong { color: var(--text); }
.cookie-actions { display: flex; gap: .5rem; margin-left: auto; }
.cookie-actions .btn { padding: .5rem 1rem; font-size: .85rem; }

/* ===== Social / Facebook embeds ===== */
.social-hero { padding: 3.5rem 0 1.5rem; }
.social-hero h1 { margin-bottom: .9rem; }
.social-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 500px);
  gap: 2rem;
  align-items: start;
  padding: 1rem 0 3.5rem;
}
.social-col h2, .social-aside h2 { font-size: 1.25rem; margin: 0 0 1rem; }
.social-stack { display: grid; gap: 1.25rem; }
.fb-card { cursor: default; }
.fb-card:hover,
a.fb-card:hover,
html.js .fb-card.is-in:hover { transform: none; border-color: var(--line); }
.fb-card .btn-row { margin-top: .4rem; position: relative; z-index: 2; }
.fb-mount { background: var(--bg-soft); min-height: 12rem; }
.fb-card.is-loaded .fb-ph { display: none; }
.fb-card.is-loaded .fb-mount { min-height: 0; }
.fb-frame { display: block; width: 100%; max-width: 100%; background: var(--bg-soft); }
.fb-page-card .fb-mount { min-height: 500px; }
@media (max-width: 960px) {
  .social-layout { grid-template-columns: 1fr; }
  .social-hero { padding-top: 2.5rem; }
}
@media (max-width: 390px) {
  .fb-card .btn-row .btn { width: 100%; justify-content: center; }
}

.fb-open { display: none; margin: 0; padding: .7rem 1.2rem 1rem; font-size: .85rem; }
.fb-card.is-loaded .fb-open { display: block; }

.social-layout-single { grid-template-columns: 1fr; max-width: 40rem; }
