@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin.woff2) format('woff2');
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --panel: #12121a;
  --text: #dcd8d0;
  --text-bright: #f4f0ea;
  --dim: #a39dba;      /* was #5a5470 (2.8:1); now about 7.4:1 on --bg */
  --rule: #34304a;
  --green: #4af626;
  --green-dim: rgba(74, 246, 38, 0.12);
  --orange: #f0955c;   /* slightly lifted for link contrast */
  --orange-dim: rgba(232, 134, 74, 0.12);
  --orange-glow: rgba(232, 134, 74, 0.3);
  --lavender: #b3a8dc;
  --cyan: #62bde8;
  --yellow: #f5b547;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--mono);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(232, 134, 74, 0.3); color: var(--text-bright); }

body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
  opacity: 0.4;
}

.skip { position: absolute; left: -9999px; top: 0; background: var(--orange); color: var(--bg); padding: .5rem 1rem; z-index: 10000; }
.skip:focus { left: 1rem; top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ik { position: fixed; top: 6px; left: 7px; font-size: 1px; color: transparent; pointer-events: none; user-select: none; }

/* Top bar */
.term-bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.term-bar nav {
  max-width: 86ch; margin: 0 auto; padding: .6rem 1.5rem;
  display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .875rem;
}
.term-bar a { color: var(--dim); border: 0; padding: .2rem 0; }
.term-bar a::before { content: './'; color: var(--rule); }
.term-bar a:hover, .term-bar a:focus-visible { color: var(--orange); }

.terminal { max-width: 86ch; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

/* Boot */
.boot { padding-bottom: 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--rule); }
.boot-line { font-size: .8rem; color: var(--dim); line-height: 1.9; opacity: 0; animation: bootLine .3s ease forwards; }
.boot-line:nth-child(1) { animation-delay: .1s; }
.boot-line:nth-child(2) { animation-delay: .25s; }
.boot-line:nth-child(3) { animation-delay: .4s; }
.boot-line:nth-child(4) { animation-delay: .55s; }
.boot-line:nth-child(5) { animation-delay: .7s; }
.ok { color: var(--green); }
.warn { color: var(--yellow); }
@keyframes bootLine { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Prompt */
.prompt { font-size: .875rem; color: var(--dim); margin-bottom: .75rem; overflow-wrap: anywhere; }
.prompt .u { color: var(--green); }
.prompt .h { color: var(--cyan); }
.prompt .p { color: var(--lavender); }
.prompt .c { color: var(--text-bright); font-weight: 500; }

.block { margin-bottom: 3.5rem; scroll-margin-top: 4rem; }

h1 { font-size: 1.9rem; line-height: 1.2; color: var(--text-bright); letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 1.15rem; color: var(--text-bright); font-weight: 700; margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .08em; }
h2::after { content: ''; display: block; margin-top: .4rem; border-bottom: 1px dashed var(--rule); }
h3 { font-size: 1.05rem; color: var(--text-bright); font-weight: 700; line-height: 1.4; }
p { margin-bottom: .9rem; max-width: 72ch; }
strong { color: var(--text-bright); font-weight: 600; }
code { font-family: var(--mono); font-size: .92em; color: var(--green); background: var(--green-dim); padding: .05em .35em; border-radius: 3px; overflow-wrap: anywhere; }

.role { color: var(--orange); margin: .35rem 0 1rem; }
.lead { font-size: 1.05rem; color: var(--text); }
.open {
  border-left: 3px solid var(--green); background: var(--green-dim);
  padding: .7rem 1rem; border-radius: 0 4px 4px 0;
}
.dot {
  display: inline-block; width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px rgba(74,246,38,.6); margin-right: .25rem;
  animation: pulse 2.5s ease-in-out infinite;
}
.links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.note { color: var(--dim); }

/* Links */
a { color: var(--orange); text-decoration: none; border-bottom: 1px solid rgba(240, 149, 92, 0.4); transition: color .2s, border-color .2s; }
a:hover { color: var(--text-bright); border-bottom-color: var(--orange); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 2px; }

/* Project index */
.index { list-style: none; margin: 1rem 0 2.5rem; }
.index li { display: grid; grid-template-columns: 15ch 1fr; gap: .5rem; padding: .2rem 0; counter-increment: idx; }
.index li::before { content: none; }
.index a { font-weight: 500; justify-self: start; }
.index span { color: var(--dim); }

/* Project article */
.project {
  border-top: 1px solid var(--rule);
  padding-top: 1.75rem; margin-top: 1.75rem;
  scroll-margin-top: 4rem;
}
.project h3 { font-size: 1.35rem; margin-bottom: .2rem; }
.tag { color: var(--dim); }
.badge {
  display: inline-block; vertical-align: middle; margin-left: .5ch;
  font-size: .72rem; font-weight: 500; letter-spacing: .03em;
  padding: .1em .6em; border-radius: 3px; white-space: nowrap;
}
.badge.rel  { color: var(--green);  background: var(--green-dim); border: 1px solid rgba(74,246,38,.3); }
.badge.live { color: var(--cyan);   background: rgba(98,189,232,.1); border: 1px solid rgba(98,189,232,.35); }
.badge.dor  { color: var(--yellow); background: rgba(245,181,71,.1); border: 1px solid rgba(245,181,71,.35); }

figure { margin: 1.25rem 0 1.5rem; }
figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 4px; background: #000;
}
figure.svg img { background: #f7f5f0; max-width: 760px; }
figcaption { font-size: .85rem; color: var(--dim); margin-top: .5rem; }

dl { display: grid; grid-template-columns: 14ch 1fr; gap: .9rem 1.5rem; }
dt { color: var(--lavender); font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; padding-top: .1rem; }
dd ul { list-style: none; }
dd li { position: relative; padding-left: 1.5ch; margin-bottom: .35rem; }
dd li::before { content: '-'; position: absolute; left: 0; color: var(--orange); }

.also { margin-top: 2.5rem; border-top: 1px solid var(--rule); padding-top: 1.75rem; }
.also h3 { margin-bottom: .75rem; }
.plain { list-style: none; }
.plain li { position: relative; padding-left: 2ch; margin-bottom: .7rem; max-width: 76ch; }
.plain li::before { content: '>'; position: absolute; left: 0; color: var(--orange); }

/* Experience */
.xp h3 { margin-top: 1.4rem; margin-bottom: .3rem; }
.xp h3:first-child { margin-top: 0; }
.when { font-weight: 400; font-size: .85rem; color: var(--orange); margin-left: .5ch; white-space: nowrap; }

/* Timeline */
.timeline { list-style: none; margin-top: .5rem; }
.timeline li {
  position: relative; padding: 0 0 1.4rem 2rem; border-left: 1px solid var(--rule);
  color: var(--dim); max-width: 70ch;
}
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  content: ''; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid rgba(232,134,74,.5);
}
.timeline .tl { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); }
.timeline .win::before { background: rgba(232,134,74,.15); border-color: var(--orange); box-shadow: 0 0 6px rgba(232,134,74,.3); }
.timeline .hit::before { border-color: var(--lavender); border-style: dashed; }
.timeline .hit .tl { color: var(--lavender); }
.timeline .now::before { background: var(--orange); border-color: var(--orange); animation: pulse 2.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(232,134,74,.15), 0 0 10px rgba(232,134,74,.3); }
  50% { box-shadow: 0 0 0 5px rgba(232,134,74,.1), 0 0 18px rgba(232,134,74,.4); }
}

.email { font-size: 1.15rem; font-weight: 500; border-bottom: 1px solid var(--orange); }
.email:hover { text-shadow: 0 0 12px var(--orange-glow); }

/* Shell */
.shell { border: 1px solid var(--rule); border-radius: 6px; padding: 1rem 1.1rem; background: var(--panel); }
.shell-form { display: flex; gap: .6ch; align-items: center; margin: 0; }
.shell-form label { white-space: nowrap; }
.shell-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 1rem; color: var(--text-bright);
  background: transparent; border: 0; border-bottom: 1px dashed var(--rule); padding: .3rem .2rem;
  caret-color: var(--orange);
}
.shell-form input::placeholder { color: #8f89a6; }
.chips { margin: .75rem 0 0; font-size: .85rem; color: var(--dim); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chips button {
  font: inherit; font-size: .85rem; color: var(--text); background: var(--orange-dim);
  border: 1px solid rgba(232,134,74,.35); border-radius: 3px; padding: .25rem .6rem; cursor: pointer; min-height: 2rem;
}
.chips button:hover { border-color: var(--orange); color: var(--text-bright); }
.out { white-space: pre-wrap; font-family: var(--mono); color: var(--lavender); font-size: .9rem; margin-top: .75rem; min-height: 1px; }
.out:empty { display: none; }

.footer { border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-top: 3rem; font-size: .8rem; color: var(--dim); }
.footer p { margin-bottom: .3rem; }

.rain { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.rain span { position: absolute; top: -40px; opacity: .7; animation: emojifall 5s linear forwards; }
@keyframes emojifall { 0% { transform: translateY(0) rotate(0); opacity: .8; } 100% { transform: translateY(100vh) rotate(360deg); opacity: 0; } }
@keyframes rainbow { 0% { color: #ff6b9d; } 25% { color: #da70d6; } 50% { color: #9370db; } 75% { color: #6495ed; } 100% { color: #ff6b9d; } }
.rainbow { animation: rainbow 3s linear infinite; }
.unicorn { position: fixed; bottom: 12px; font-size: 1.4rem; opacity: 0; pointer-events: none; z-index: 100; will-change: transform; }

/* Mobile */
@media (max-width: 640px) {
  body { font-size: .95rem; }
  .terminal { padding: 1.5rem 1rem 3rem; }
  .term-bar nav { padding: .5rem 1rem; gap: .2rem 1rem; font-size: .8rem; }
  .boot { display: none; }
  h1 { font-size: 1.6rem; }
  .project h3 { font-size: 1.15rem; }
  .badge { margin-left: 0; margin-top: .3rem; }
  .index li { grid-template-columns: 1fr; gap: 0; padding: .35rem 0; }
  dl { grid-template-columns: 1fr; gap: .2rem; }
  dt { margin-top: .8rem; }
  .timeline li { padding-left: 1.4rem; }
  .shell-form { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boot-line { animation: none; opacity: 1; }
  .dot, .timeline .now::before { animation: none; }
  .unicorn { display: none; }
}

@media print {
  body::before, .boot, .unicorn, .term-bar, .shell, .skip { display: none; }
  body { background: #fff; color: #111; font-size: 10.5pt; }
  h1, h2, h3, strong, .lead { color: #000; }
  a { color: #111; border-bottom: 1px solid #999; }
  .prompt, .prompt .u, .prompt .h, .prompt .p, .prompt .c, .role, .tag, .note, dt, figcaption, .timeline li, .when, .timeline .tl { color: #333; }
  .open { background: none; border-left-color: #333; }
  .badge { color: #333; background: none; border: 1px solid #999; }
  figure { display: none; }
  .project { break-inside: avoid-page; }
}
