/* Self-hosted fonts (SIL Open Font License; see static/fonts/OFL-*.txt). */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/space-grotesk-400.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/space-grotesk-500.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/space-grotesk-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/jetbrains-mono-600.woff2") format("woff2"); }

:root {
  --bg: #0f0c29;
  --bg-deep: #07061a;
  --card: #1a1640;
  --line: #2e2860;
  --text: #f4f1ff;
  --muted: #c9c3ea;
  --dim: #b9b3d9;
  --pink: #ff4d9d;
  --lime: #c8ff3d;
  --cyan: #3de0ff;
  --yellow: #ffd23f;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
}

a { color: var(--lime); }
a:hover { color: #e4ff9a; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 28px 0; }
.prompt { font-family: var(--mono); color: var(--lime); }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-left: auto; }
.nav-links > a { color: var(--text); text-decoration: none; }
.icons { display: flex; gap: 10px; }
.icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
}
.icon svg { width: 20px; height: 20px; fill: currentColor; }
.contact .icon { width: 52px; height: 52px; border-radius: 14px; }
.contact .icon svg { width: 24px; height: 24px; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding: 72px 0 96px; }
.hero-text { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.chip {
  align-self: flex-start; font-family: var(--mono); font-size: 14px;
  color: var(--bg); background: var(--yellow); padding: 6px 12px; border-radius: 999px;
}
h1 { margin: 0; font-size: clamp(56px, 9vw, 120px); line-height: 0.95; letter-spacing: -0.03em; }
h1 .accent { color: var(--pink); }
.lead { margin: 0; font-size: 22px; line-height: 1.5; color: var(--muted); max-width: 620px; }
.buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.button {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px;
  border-radius: 12px; font-weight: 700; text-decoration: none;
}
.button.primary { background: var(--pink); color: var(--bg); }
.button.primary:hover { color: var(--bg); filter: brightness(1.1); }
.button.outline { border: 2px solid var(--lime); color: var(--lime); }

/* Terminal */
.terminal { flex: 1 1 340px; min-width: 0; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.terminal-bar { display: flex; gap: 8px; padding: 12px 16px; background: var(--card); }
.terminal-bar span { width: 12px; height: 12px; border-radius: 50%; }
.terminal-bar span:nth-child(1) { background: var(--pink); }
.terminal-bar span:nth-child(2) { background: var(--yellow); }
.terminal-bar span:nth-child(3) { background: var(--lime); }
.terminal pre {
  margin: 0; padding: 20px; font-family: var(--mono); font-size: 14px;
  line-height: 1.7; color: var(--muted); white-space: pre-wrap;
}
.t-lime { color: var(--lime); }
.t-cyan { color: var(--cyan); }
.t-pink { color: var(--pink); }

/* Sections */
section { padding: 48px 0 96px; display: flex; flex-direction: column; gap: 32px; }
h2 { margin: 0; font-size: clamp(40px, 6vw, 56px); letter-spacing: -0.02em; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.comment { font-family: var(--mono); font-size: 14px; color: var(--dim); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.project {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
.project-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tag { font-family: var(--mono); font-size: 13px; color: var(--bg); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.tag.pink { background: var(--pink); }
.tag.cyan { background: var(--cyan); }
.tag.yellow { background: var(--yellow); }
.tag.lime { background: var(--lime); }
.note { font-size: 14px; color: var(--dim); }
.stars { font-size: 14px; color: var(--yellow); font-weight: 700; }
.project h3 { margin: 0; font-size: 28px; }
.project p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--muted); }
.project a { margin-top: auto; font-weight: 700; text-decoration: none; }

/* Experience */
.jobs { border-top: 1px solid var(--line); }
/* Fixed columns so every row lines up, whatever the company name's length. */
.job {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 12rem;
  align-items: baseline; gap: 8px 24px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.job-company { font-size: 24px; font-weight: 700; }
.job-title { font-size: 18px; color: var(--muted); }
.job .job-dates { text-align: right; }
.job-dates { font-family: var(--mono); font-size: 15px; color: var(--lime); }

/* Contact (home page) */
section.contact { padding-top: 64px; border-top: 1px solid var(--line); gap: 14px; }
.contact h2 { font-size: 40px; }
.email { font-size: 22px; font-weight: 700; text-decoration: none; }

/* Footer (every page) */
.site-footer {
  padding: 24px 0 40px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  font-family: var(--mono); font-size: 13px; color: var(--dim);
}
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--lime); }

/* Error pages */
a.prompt { text-decoration: none; }
.error { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding: 56px 0 120px; }
.error-text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.error-code {
  font-family: var(--mono); font-weight: 600; line-height: 1;
  font-size: clamp(96px, 16vw, 180px); color: var(--pink);
}
.error-code.teapot { color: var(--yellow); }
.error h1 { font-size: clamp(40px, 6vw, 72px); }

/* Resume */
.resume { display: flex; flex-wrap: wrap; gap: 48px; padding-bottom: 96px; }
.resume-main { flex: 999 1 560px; min-width: 0; padding: 0; gap: 0; }
.resume-main h2 { margin-bottom: 8px; }
.resume-side { flex: 1 1 220px; display: flex; flex-direction: column; gap: 28px; padding-top: 72px; }
.resume-job { padding: 28px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.resume-job-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.resume-job h3 { margin: 0; font-size: 24px; }
.resume-role { font-weight: 500; color: var(--muted); }
.resume-intro { margin: 4px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.resume-highlights { margin: 4px 0 0; padding-left: 20px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.resume-highlights li { margin: 6px 0; }
.resume-highlights li::marker { color: var(--pink); }
.resume-highlights ul { padding-left: 20px; }
.resume-highlights ul li::marker { color: var(--cyan); }
.resume-skills h3 { margin: 0 0 10px; font-family: var(--mono); font-size: 14px; color: var(--yellow); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.resume-skills ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 17px; }

/* Phones */
@media (max-width: 640px) {
  .nav { gap: 16px; }
  .job { grid-template-columns: 1fr; gap: 4px; }
  .job .job-dates { text-align: left; }
  .prompt { order: 1; }
  .nav > .icons { order: 2; margin-left: auto; }
  .nav-links { order: 3; width: 100%; margin-left: 0; gap: 24px; }
  .hero { padding: 32px 0 64px; gap: 40px; }
  section { padding: 24px 0 64px; }
  .terminal pre { font-size: 12.5px; padding: 16px; }
  .project { padding: 24px; }
  .error { padding: 32px 0 80px; }
}

/* Project and content pages */
.more { align-self: flex-start; font-size: 18px; font-weight: 700; text-decoration: none; }
.page-head { padding: 56px 0 32px; gap: 20px; }
.page-title { font-size: clamp(48px, 8vw, 96px); }
.page-head .project-meta { justify-content: flex-start; }
.back { text-decoration: none; }
.back:hover { color: var(--lime); }
.status { margin: 0; font-family: var(--mono); font-size: 15px; color: var(--muted); }
.prose p { margin: 0; max-width: 760px; font-size: 20px; line-height: 1.6; color: var(--muted); }
.highlights { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.highlights li { position: relative; padding-left: 28px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.highlights li::before { content: "→"; position: absolute; left: 0; color: var(--pink); font-family: var(--mono); }
@media (max-width: 640px) {
  .page-head { padding: 24px 0 16px; }
  .resume-side { padding-top: 0; }
}

/* About this site */
.status-box { max-width: 680px; flex: none; }
/* Content pages (about, projects): tighter spacing between sections. */
.page-head ~ section { padding: 16px 0 40px; gap: 20px; }
.highlights code { font-family: var(--mono); font-size: 0.9em; color: var(--lime); }

/* Nav hover effects */
.nav-links > a { position: relative; padding: 6px 0; transition: color 0.2s ease; }
.nav-links > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--lime));
  transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nav-links > a:hover, .nav-links > a:focus-visible { color: var(--lime); }
.nav-links > a:hover::after, .nav-links > a:focus-visible::after { transform: scaleX(1); }

.icon { transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.icon:hover, .icon:focus-visible {
  color: var(--pink); border-color: var(--pink);
  transform: translateY(-3px) rotate(-6deg);
  box-shadow: 0 8px 20px rgba(255, 77, 157, 0.35);
}

.prompt::after { content: "▋"; margin-left: 2px; opacity: 0; }
.prompt:hover::after, .prompt:focus-visible::after { animation: blink 1s steps(1) infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .nav-links > a::after, .icon { transition: none; }
  .icon:hover, .icon:focus-visible { transform: none; }
  .prompt:hover::after, .prompt:focus-visible::after { animation: none; opacity: 1; }
}

/* Print: black on white, without the nav, footer and buttons. Tuned for the
   résumé page; /resume.pdf is the typeset version. */
.print-only { display: none; }
@media print {
  @page { margin: 0.6in; }
  :root {
    --bg: #fff; --bg-deep: #fff; --card: #fff; --line: #ccc;
    --text: #000; --muted: #222; --dim: #555;
    --pink: #000; --lime: #000; --cyan: #000; --yellow: #000;
  }
  body { font-size: 10.5pt; }
  .nav, .site-footer, .comment, .buttons, .terminal, .formats { display: none; }
  .print-only { display: inline; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  /* Paper can't be clicked, so links in the résumé print their address. */
  .resume a[href^="http"]::after {
    content: " (" attr(href) ")"; font-size: 0.85em; color: var(--dim); word-break: break-all;
  }
  /* Browsers drop background colors when printing, so tags get an outline. */
  .tag, .chip { color: #000; background: none; border: 1px solid #000; }

  section { padding: 12pt 0; gap: 12pt; }
  h1 { font-size: 32pt; }
  h2 { font-size: 18pt; }
  .page-head { padding: 0 0 12pt; gap: 6pt; }
  .page-title { font-size: 26pt; }
  .lead { font-size: 11pt; max-width: none; }
  .status { font-size: 9.5pt; }

  /* Skills move above the experience, as one row. */
  .resume { flex-direction: column; gap: 0; padding-bottom: 0; }
  /* In a column, the screen flex-basis would become a minimum height. */
  .resume-main, .resume-side { flex: none; }
  .resume-side { order: -1; flex-direction: row; flex-wrap: wrap; gap: 6pt 24pt; padding: 0 0 8pt; }
  .resume-skills h3 { margin-bottom: 3pt; font-size: 8.5pt; }
  .resume-skills ul { flex-direction: row; flex-wrap: wrap; gap: 0 10pt; font-size: 10pt; }
  .resume-main h2 { font-size: 15pt; margin: 4pt 0 0; }
  .resume-job { padding: 8pt 0; gap: 2pt; }
  .resume-job:last-child { border-bottom: none; }
  /* Keep a job's heading on the same page as its first highlights. */
  .resume-job-head, .resume-job > .note, .resume-intro { break-after: avoid; }
  .resume-job h3 { font-size: 12pt; }
  .job-dates, .note { font-size: 9pt; }
  .resume-intro, .resume-highlights { font-size: 9.5pt; line-height: 1.35; }
  .resume-highlights li { margin: 2pt 0; break-inside: avoid; }
}
