/* Homepage only. The shared case-study theme remains in site.css. */
@font-face {
  font-family: 'Matrix Sans Video';
  src: url('MatrixSansVideo-Regular.otf') format('opentype');
  font-weight: 400 900;
  font-display: swap;
}
.home {
  --h-ink: #23241f;
  --h-cream: #eeeee7;
  --h-paper: #e4e5dc;
  --h-card: #f3f3ec;
  --h-inksoft: #54564e;
  --h-mut: #60635b;
  --h-line: #bec0b5;
  --h-accent: #23241f;
  --h-btn: #eeeee7;
  --h-tldate: #23241f;
  --h-portrait-color: transparent;
  font-family: 'IBM Plex Sans', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  .home:not([data-theme="light"]) {
    --h-ink: #e3e5d9;
    --h-cream: #161815;
    --h-paper: #1b1e19;
    --h-card: #1b1e19;
    --h-inksoft: #b3b7a9;
    --h-mut: #a0a797;
    --h-line: #42483d;
    --h-accent: #e3e5d9;
    --h-btn: #20251d;
    --h-tldate: #e3e5d9;
    --h-portrait-color: transparent;
  }
}
.home .h-section-inner, .home .h-footer { max-width: 1180px; }
.home a:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 5px; }
.home .h-hero {
  display: block;
  min-height: 0;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  background: var(--h-cream);
  border-bottom: 1px solid var(--h-line);
}
.h-masthead { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--h-line); }
.h-owner { font-size: 14px; font-weight: 600; }
.h-owner span { color: var(--h-mut); font-weight: 400; }
.home .h-hero-nav { margin: 0; gap: 30px; font-size: 12px; letter-spacing: .04em; }
.home .h-hero-nav a { color: var(--h-ink); }
.home .h-hero-nav a:hover { color: var(--h-accent); }
.h-hero-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px,5vw,80px); padding: 56px 0 64px; align-items: center; }
.h-system-label, .h-portrait-label, .h-portrait figcaption { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.h-system-label { display: flex; align-items: center; gap: 10px; color: var(--h-mut); margin-bottom: 26px; }
.h-status-dot { width: 7px; height: 7px; background: var(--h-accent); }
.home .h-hero-title { color: var(--h-ink); background: transparent; padding: 0; font-size: clamp(38px,4.8vw,67px); line-height: 1.04; letter-spacing: -.035em; animation: none; text-wrap: balance; }
.h-hero-statement { font-size: 23px; line-height: 1.3; font-weight: 500; margin: 26px 0 12px; }
.home .h-hero-intro { background: transparent; color: var(--h-inksoft); padding: 0; max-width: 39ch; font-size: 16px; line-height: 1.65; }
.home .h-hero-action { margin-top: 25px; }
.h-portrait { margin: 0; position: relative; }
.h-portrait-label, .h-portrait figcaption { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; color: var(--h-mut); }
.h-portrait-label { border-bottom: 1px solid var(--h-line); }
.h-portrait figcaption { border-top: 1px solid var(--h-line); font-size: 9px; }
.h-portrait-screen { position: relative; overflow: hidden; aspect-ratio: 1 / 1.18; background: var(--h-portrait-color); isolation: isolate; }
.h-portrait-screen img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: grayscale(1); }
.h-portrait-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 3px, #1112 3px 4px); }
.h-portrait-screen .h-portrait-slice { position: absolute; inset: 0; opacity: 0; animation: portrait-signal 9s steps(1) infinite; }
.h-portrait-screen .slice-a { clip-path: inset(22% 0 64%); --shift: 22px; filter: grayscale(1); }
.h-portrait-screen .slice-b { clip-path: inset(49% 0 44%); --shift: -28px; animation-delay: .12s; filter: grayscale(1); }
.h-portrait-screen .slice-c { clip-path: inset(75% 0 18%); --shift: 12px; animation-delay: .24s; }
.h-signal-pixels { position: absolute; right: 8%; top: 32%; width: 10px; height: 10px; background: var(--h-ink); box-shadow: 10px 0 var(--h-ink), 20px -10px var(--h-ink); opacity: 0; animation: portrait-signal 9s steps(1) infinite; --shift: 8px; }
@keyframes portrait-signal {
  0%, 76%, 89%, 100% { opacity: 0; transform: none; }
  77%, 81% { opacity: .85; transform: translateX(var(--shift)); }
  79%, 85% { opacity: .65; transform: translateX(calc(var(--shift) * -.5)); }
  87% { opacity: .4; transform: translateX(2px); }
}
.home .h-section { padding: 64px 24px; }
.home .h-section h2, .home .h-card-title, .home .h-about-text h3, .home .h-contact-big, .home .h-feat-stat-num { font-family: 'IBM Plex Sans', Arial, sans-serif; }
.home .h-section h2 { display: flex; align-items: center; gap: 18px; font-size: 28px; font-weight: 500; margin-bottom: 30px; }
.home .h-section h2::after { content: ''; height: 1px; flex: 1; margin-left: 12px; background: var(--h-line); }
.home .h-section-index { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 400; }
.home .h-feat { padding: 24px; gap: 32px; border: 1px solid var(--h-line); box-shadow: none; position: relative; }
.home .h-feat-media { flex: 1 1 48%; min-width: 0; min-height: 300px; background: var(--h-paper); box-shadow: none; border: 1px solid var(--h-line); display: flex; align-items: center; }
.home .h-feat-media { height: 380px; align-self: center; overflow: hidden; }
.home .h-feat-media img { object-fit: cover; object-position: top; height: 100%; }
.home .h-feat-badge { top: 0; left: 0; background: var(--h-ink); color: var(--h-cream); padding: 7px 10px; font: 10px 'JetBrains Mono', monospace; box-shadow: none; }
.home .h-feat-body { flex: 1 1 300px; gap: 16px; }
.home .h-card-meta { gap: 12px; }
.home .h-card-tags { display: grid; grid-template-columns: 1fr auto; flex: 1; gap: 7px 14px; font: 9px/1.5 'JetBrains Mono', monospace; letter-spacing: .015em; }
.home .h-card-tags .co { grid-column: 1 / -1; font-size: 11px; color: var(--h-inksoft); letter-spacing: .06em; }
.home .h-card-n { font: 10px/1.5 'JetBrains Mono', monospace; color: var(--h-mut); opacity: 1; padding-left: 12px; border-left: 1px solid var(--h-line); }
.home .h-card-title { font-weight: 500; line-height: 1.2; letter-spacing: -.025em; }
.home .h-feat .h-card-title { font-size: clamp(25px,2.6vw,34px); }
.home .h-card-desc { font-size: 15px; line-height: 1.65; max-width: 55ch; }
.home .h-feat-stat { padding: 16px 0; margin: 0; border-top: 1px solid var(--h-line); gap: 16px; }
.home .h-feat-stat-num { font-size: 44px; font-weight: 500; letter-spacing: -.05em; color: var(--h-accent); }
.home .h-feat-stat-label { font-size: 13px; line-height: 1.4; }
.home .h-grid { gap: 0; margin-top: 28px; grid-template-columns: minmax(0,1fr); border: 1px solid var(--h-line); }
.home .h-grid-card {
  display: grid;
  grid-template-columns: 1fr 1.25fr auto;
  align-items: start;
  border: 0;
  border-bottom: 1px solid var(--h-line);
  padding: 24px;
  gap: 18px 32px;
  min-height: 0;
  background: transparent;
}
.home .h-grid-card:last-child { border-bottom: 0; }
.home .h-grid-card .h-card-meta { grid-column: 1 / -1; }
.home .h-grid-card .h-card-tags { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; }
.home .h-grid-card .h-card-tags .co { order: -1; min-width: 160px; }
.home .h-grid-card .h-btn { margin: 0; align-self: end; }
.home .h-grid-card:hover, .home .h-grid-card:focus-within { background: var(--h-paper); }
.home .h-grid-card:hover .h-card-n::before { content: '> '; }

.home .h-feat::before { content: ''; position: absolute; left: -1px; top: -1px; width: 9px; height: 9px; border-left: 2px solid var(--h-accent); border-top: 2px solid var(--h-accent); }
.home .h-grid-card:hover, .home .h-grid-card:focus-within { border-color: var(--h-accent); }
.home .h-grid-card .h-card-title { font-size: 25px; margin: 0; max-width: 27ch; }
.home .h-grid-strip { display: none; }
.home .h-btn, .home .h-btn-primary, .home .h-btn-secondary { font-family: var(--disp); font-size: 15px; font-weight: 400; letter-spacing: .02em; border: 1px solid var(--h-line); box-shadow: none; padding: 10px 14px; border-radius: 0; background: transparent; color: var(--h-ink); transition: color .15s, background .15s; }
.home .h-btn { gap: 26px; }
.home a.h-btn:hover, .home a.h-btn-primary:hover, .home a.h-btn-secondary:hover { transform: none; background: var(--h-ink); color: var(--h-cream); box-shadow: none; }
.home a.h-hero-action, .home a.h-btn-primary { background: var(--h-ink); color: var(--h-cream); border-color: var(--h-ink); }
.home a.h-hero-action:hover,
.home a.h-btn-primary:hover,
.home a.h-hero-action:focus-visible,
.home a.h-btn-primary:focus-visible {
  background: var(--h-cream);
  color: var(--h-ink);
  border-color: var(--h-ink);
}
.home .h-march { height: 1px; background: var(--h-line); opacity: 1; animation: none; }
.home .h-about-text h3 { font-weight: 500; }
.home .h-about-text p { font-size: 16px; line-height: 1.7; }
.home .h-skills { border: 1px solid var(--h-line); background: transparent; }
.home .h-glitch-row { transform: none; text-shadow: none; }
.home .h-contact-big { font-weight: 500; }
.home .h-contact-terminal { font-family: 'JetBrains Mono', monospace; }
.home .h-footer { padding: 24px; }
@media(max-width:900px) {
  .home .h-feat-media { flex: auto; min-height: 0; }
  .home .h-feat-body { flex: auto; }
  .h-hero-layout { gap: 28px; }
  .home .h-hero-title { font-size: 40px; }
  .h-owner span { display: none; }
}
@media(max-width:640px) {
  .h-masthead { padding: 20px 0; gap: 12px; }
  .home .h-hero-nav { gap: 16px; font-size: 10px; }
  .h-owner { font-size: 12px; }
  .h-hero-layout { grid-template-columns: minmax(0,1fr); padding: 32px 0; gap: 32px; }
  .home .h-hero-title { font-size: clamp(34px,9vw,48px); max-width: 13ch; }
  .h-portrait { max-width: 440px; width: 100%; }
  .home .h-grid { grid-template-columns: minmax(0,1fr); }
  .home .h-grid-card { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .home .h-grid-card .h-btn { justify-self: start; }
  .home .h-grid-card .h-card-tags .co { min-width: 0; }
  .home .h-grid-card, .home .h-feat { padding: 20px; }
  .home .h-section { padding: 42px 24px; }
  .home .h-card-tags { font-size: 8px; }
  .home .h-contact-buttons { width: 100%; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  .home *, .home *::before, .home *::after { animation: none !important; transition: none !important; }
}

.home .print-pending > * { opacity: 0; }
.home .print-running::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--h-ink);
  opacity: .4;
  pointer-events: none;
  animation: card-print-head 1.1s linear forwards;
}
@keyframes card-print-head {
  from { transform: translateY(0); }
  to { transform: translateY(var(--print-height)); }
}
@media(prefers-reduced-motion:reduce) {
  .home .print-pending > * { opacity: 1; }
  .home .print-running::after { display: none; }
}
