/* =========================================================================
   Tokens
   ========================================================================= */
:root {
  --void:   #0b0b0d;
  --ink:    #16151a;
  --ink-2:  #1e1c22;
  --paper:  #ece7e0;
  --paper-dim: #a9a49f;
  --crimson:#e8175f;
  --blood:  #7a1030;
  --ash:    #77747c;

  --display: 'Archivo Black', sans-serif;
  --body:    'IBM Plex Sans', sans-serif;
  --mono:    'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--paper);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

a { color: inherit; }

::selection { background: var(--crimson); color: var(--void); }

/* subtle film-grain overlay for texture */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: radial-gradient(rgba(255,255,255,0.9) 1px, transparent 1px);
  background-size: 3px 3px;
}

/* =========================================================================
   Nav
   ========================================================================= */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 6vw;
  background: rgba(11,11,13,0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(236,231,224,0.08);
}
.nav-mark {
  font-family: var(--display);
  color: var(--crimson);
  font-size: 20px;
  border: 1px solid var(--crimson);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--paper-dim);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--crimson); }
.nav-cta {
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--paper);
  border: 1px solid var(--paper);
  padding: 8px 16px;
  transition: all 0.2s;
}
.nav-cta:hover { background: var(--crimson); border-color: var(--crimson); color: var(--void); }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  padding: 12vh 6vw 8vh;
  text-align: center;
  overflow: hidden;
}
.hero-halftone {
  position: absolute; inset: -10% -10% auto -10%; height: 70%;
  background-image: radial-gradient(circle, var(--blood) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, black 30%, transparent 75%);
  opacity: 0.35;
  pointer-events: none;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--crimson);
  margin: 0 0 18px;
}
.hero-title {
  font-family: var(--display);
  font-size: clamp(56px, 11vw, 128px);
  line-height: 0.92;
  margin: 0;
  letter-spacing: -0.01em;
}
.hero-title .outline {
  -webkit-text-stroke: 1.5px var(--paper);
  color: transparent;
}
.hero-sub {
  max-width: 44ch;
  margin: 28px auto 0;
  color: var(--paper-dim);
  font-size: 17px;
}
.hero-sub strong { color: var(--paper); }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-top: 36px; }
.btn {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 13px 26px;
  transition: all 0.2s;
}
.btn-solid { background: var(--crimson); color: var(--void); }
.btn-solid:hover { background: var(--paper); }
.btn-ghost { border: 1px solid var(--ash); color: var(--paper); }
.btn-ghost:hover { border-color: var(--paper); }

/* terminal panel */
.hero-panel { margin-top: 64px; display: flex; justify-content: center; }
.panel-frame {
  position: relative;
  width: min(640px, 100%);
  border: 1px solid rgba(236,231,224,0.18);
  background: var(--ink);
}
.tick { position: absolute; width: 14px; height: 14px; }
.tick::before, .tick::after { content: ""; position: absolute; background: var(--crimson); }
.tick-tl { top: -1px; left: -1px; }
.tick-tr { top: -1px; right: -1px; }
.tick-bl { bottom: -1px; left: -1px; }
.tick-br { bottom: -1px; right: -1px; }
.tick::before { width: 100%; height: 2px; }
.tick::after { width: 2px; height: 100%; }
.tick-tl::before, .tick-tl::after { top: 0; left: 0; }
.tick-tr::before { top: 0; right: 0; }
.tick-tr::after { top: 0; right: 0; }
.tick-bl::before { bottom: 0; left: 0; }
.tick-bl::after { bottom: 0; left: 0; }
.tick-br::before { bottom: 0; right: 0; }
.tick-br::after { bottom: 0; right: 0; }

.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(236,231,224,0.1);
}
.terminal-bar span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ash); opacity: 0.5;
}
.terminal-bar p {
  margin: 0 0 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-dim);
}
.terminal-body {
  margin: 0;
  padding: 22px 20px 26px;
  text-align: left;
  font-family: var(--mono);
  font-size: 13.5px;
  color: #c9e6c9;
  min-height: 130px;
  white-space: pre-wrap;
  word-break: break-word;
}
.cursor { color: var(--crimson); animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* torn panel-break divider */
.tear {
  height: 46px;
  background: var(--void);
  clip-path: polygon(0% 40%, 4% 60%, 8% 35%, 13% 65%, 18% 30%, 23% 55%, 28% 40%,
    33% 70%, 38% 35%, 43% 60%, 48% 30%, 53% 65%, 58% 40%, 63% 55%, 68% 35%,
    73% 60%, 78% 30%, 83% 65%, 88% 40%, 93% 55%, 100% 40%, 100% 100%, 0% 100%);
}
.tear-flip { transform: scaleY(-1); }

/* =========================================================================
   Sections
   ========================================================================= */
.section { padding: 4vh 6vw 6vh; max-width: 1080px; margin: 0 auto; }
.section-title {
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 36px);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 40px;
}
.tag-number { color: var(--crimson); }

/* Arcs (experience) */
.arcs { display: flex; flex-direction: column; gap: 2px; }
.arc {
  display: grid; grid-template-columns: 90px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid rgba(236,231,224,0.1);
}
.arc:last-child { border-bottom: 1px solid rgba(236,231,224,0.1); }
.arc-number {
  font-family: var(--display);
  font-size: 48px;
  color: transparent;
  -webkit-text-stroke: 1px var(--blood);
}
.arc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; margin-bottom: 10px; }
.arc-head h3 { margin: 0; font-size: 20px; }
.arc-meta { font-family: var(--mono); font-size: 12.5px; color: var(--crimson); }
.arc-when { font-family: var(--mono); font-size: 12px; color: var(--ash); margin-left: auto; }
.arc ul { margin: 0; padding-left: 18px; color: var(--paper-dim); }
.arc li { margin-bottom: 6px; font-size: 15px; }

@media (max-width: 640px) {
  .arc { grid-template-columns: 1fr; }
  .arc-number { font-size: 30px; }
}

/* Projects */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.project {
  position: relative;
  border: 1px solid rgba(236,231,224,0.14);
  background: var(--ink);
  padding: 28px;
  overflow: hidden;
}
.project-halftone {
  position: absolute; top: -30px; right: -30px; width: 120px; height: 120px;
  background-image: radial-gradient(circle, var(--crimson) 1.5px, transparent 1.5px);
  background-size: 10px 10px;
  opacity: 0.25;
  border-radius: 50%;
}
.project h3 { margin: 0 0 4px; font-size: 19px; }
.project-when { font-family: var(--mono); font-size: 12px; color: var(--ash); }
.project ul { margin: 16px 0; padding-left: 18px; color: var(--paper-dim); font-size: 14.5px; }
.project li { margin-bottom: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 5px 10px;
  border: 1px solid var(--blood);
  color: var(--crimson);
}

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.skill-group h4 {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--crimson);
  margin: 0 0 14px;
  border-bottom: 1px solid rgba(236,231,224,0.12);
  padding-bottom: 10px;
}
.skill-group ul { list-style: none; margin: 0; padding: 0; }
.skill-group li {
  font-size: 14.5px;
  color: var(--paper-dim);
  padding: 6px 0;
}
.skill-group li::before { content: "— "; color: var(--ash); }

/* Footer */
.footer {
  position: relative;
  padding: 8vh 6vw 6vh;
  text-align: center;
  border-top: 1px solid rgba(236,231,224,0.08);
}
.footer-stamp {
  position: absolute; top: 24px; right: 6vw;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--blood);
  border: 2px solid var(--blood);
  padding: 4px 10px;
  transform: rotate(-8deg);
}
.footer h2 { font-family: var(--display); font-size: clamp(28px, 5vw, 44px); margin: 0 0 32px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin-bottom: 28px; }
.footer-links a {
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--paper-dim);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--crimson); }
.footer-fine { font-family: var(--mono); font-size: 11.5px; color: var(--ash); }
