/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --bg: #160f1e;          /* dark plum */
  --surface: #1f1629;
  --surface-2: #2a1e37;
  --line: #3a2b4a;
  --ink: #f4eef8;
  --muted: #b6a6c4;
  --accent: #ff8a65;      /* coral */
  --accent-ink: #1a0f14;
  --signal: #ffd166;      /* amber: the streaming cursor */
  --dot: rgba(255, 138, 101, 0.12);

  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-lg: 20px;
  --radius: 12px;
  --radius-sm: 8px;
  color-scheme: dark;
}

/* ───────────────────────── Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0; }
svg { width: 1em; height: 1em; flex: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ───────────────────────── Nav ───────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.nav__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 12px var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.nav__mark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 600; letter-spacing: -0.01em;
}
.nav__monogram {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.05rem;
}
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a {
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-size: 0.95rem; font-weight: 500;
}
.nav__links a:hover { color: var(--ink); background: var(--surface-2); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; font-size: 1.1rem; text-decoration: none;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn--lg { width: 46px; height: 46px; font-size: 1.15rem; }

/* ───────────────────────── Buttons ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 0.98rem/1 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.08); }

/* ───────────────────────── Hero ───────────────────────── */
.hero {
  position: relative;
  padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 8vw, 104px);
  isolation: isolate;
}
.hero::before {
  /* dot grid, faded toward the edges */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 70% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 70% at 70% 40%, #000 30%, transparent 75%);
}
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px); align-items: stretch;
}
/* Left column fills the console's height: name at the top, actions at the bottom */
.hero__intro { display: flex; flex-direction: column; justify-content: space-between; padding: 6px 0; }
.hero__name {
  font-size: clamp(2.4rem, 3.9vw, 3.4rem);
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.05;
  white-space: nowrap;
}
.hero__points {
  list-style: none; margin: 28px 0; padding: 0; display: grid; gap: 12px;
  color: var(--ink); font-size: 1rem;
}
.hero__points li { display: flex; align-items: center; gap: 12px; }
.hero__points svg {
  box-sizing: content-box; padding: 8px; border-radius: 10px; flex: none;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 1.05rem;
}
.hero__role {
  margin-top: 16px; max-width: 30ch;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.45; color: var(--muted);
}
.hero__actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* The streaming console */
.console {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 22px 54px;
  box-shadow: 0 30px 80px -40px color-mix(in srgb, var(--accent) 45%, transparent);
}
.console__ask, .console__answer { display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start; }
.console__ask {
  padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px dashed var(--line);
  color: var(--muted); font-family: var(--mono); font-size: 0.92rem; line-height: 1.6;
}
.console__ask p { padding-top: 5px; }
.console__avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--surface-2); color: var(--muted); font: 600 0.95rem/1 var(--mono);
}
.console__avatar--ai { background: color-mix(in srgb, var(--signal) 18%, transparent); color: var(--signal); font-size: 1.05rem; }
.console__answer p {
  min-height: 9.6em; padding-top: 4px;
  font-size: clamp(1.05rem, 1.5vw, 1.18rem); line-height: 1.6;
}
.console__answer p.is-streaming::after,
.console__answer p.is-done::after {
  content: ""; display: inline-block; width: 0.55em; height: 1.05em; margin-left: 3px;
  vertical-align: -0.16em; border-radius: 2px; background: var(--signal);
}
.console__answer p.is-streaming::after { animation: none; }
.console__answer p.is-done::after { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.console__replay {
  position: absolute; right: 14px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font: 500 0.82rem/1 var(--font); cursor: pointer;
}
.console__replay:hover { color: var(--ink); border-color: var(--accent); }

/* ───────────────────────── Sections ───────────────────────── */
.section { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.section__title {
  font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* Experience timeline (a real sequence, so a rail with dates) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.job { display: grid; grid-template-columns: 200px 1fr; gap: 32px; position: relative; padding-bottom: 40px; }
.job:last-child { padding-bottom: 0; }
.job__when { color: var(--muted); font-size: 0.95rem; padding-top: 16px; font-variant-numeric: tabular-nums; }
.job__body { position: relative; padding-left: 32px; border-left: 2px solid var(--line); }
.job:last-child .job__body { border-left-color: transparent; }
.job__body::before {
  content: ""; position: absolute; left: -8px; top: 19px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted);
}
.job:first-child .job__body::before { border-color: var(--signal); background: var(--signal); box-shadow: 0 0 0 5px color-mix(in srgb, var(--signal) 22%, transparent); }
.job__head { display: flex; align-items: center; gap: 16px; }
.job__logo {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 112px; height: 52px; padding: 9px 12px; overflow: hidden;
  border-radius: 12px; background: #fff; border: 1px solid var(--line);
}
.job__logo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; }
.job__title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.job__org { color: var(--accent); font-weight: 500; font-size: 1rem; margin-top: 2px; }
.job ul { margin: 14px 0 0; padding-left: 1.1em; display: grid; gap: 8px; color: var(--muted); max-width: 72ch; }
.job li::marker { color: var(--line); }

/* Education */
.creds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cred {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.cred__icon {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 12px;
  background: var(--surface-2); color: var(--brand, var(--accent)); font-size: 1.35rem;
}
.cred h3 { font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.cred p { margin-top: 4px; color: var(--muted); }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.skillset { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.skillset--wide { grid-column: 1 / -1; }
.skillset__title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em;
}
.skillset__title svg { color: var(--accent); font-size: 1.25rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid transparent;
  font-size: 0.95rem; font-weight: 500; line-height: 1.2;
}
.chips li svg { color: var(--brand, var(--ink)); font-size: 1.15rem; }
.chips--small li { padding: 5px 11px 5px 8px; font-size: 0.86rem; gap: 7px; }
.chips--small li svg { font-size: 1rem; }

/* Projects */
.project {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 48px);
  align-items: center;
}
.project__shot { display: block; text-decoration: none; border-radius: var(--radius-lg); }
.frame {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 40px 90px -50px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform 0.35s ease;
}
.project__shot:hover .frame { transform: translateY(-4px); }
.frame__bar {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.frame__dots { display: inline-flex; gap: 6px; }
.frame__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.frame__url {
  flex: 1; max-width: 300px; margin: 0 auto; padding: 4px 12px; border-radius: 999px;
  background: var(--bg); color: var(--muted); font: 0.8rem/1.4 var(--mono); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.frame img { width: 100%; height: auto; }
.frame__empty { display: none; }
.frame--empty img { display: none; }
.frame--empty .frame__empty {
  display: grid; place-content: center; gap: 6px; text-align: center; aspect-ratio: 1800 / 1172;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 55%),
    radial-gradient(circle at 75% 70%, color-mix(in srgb, var(--signal) 20%, transparent), transparent 50%),
    var(--surface);
}
.frame__empty span { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; }
.frame__empty small { color: var(--muted); font-family: var(--mono); }
.project__name { font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 800; letter-spacing: -0.035em; }
.project__lede { margin-top: 14px; font-size: 1.1rem; line-height: 1.6; }
.project__points { margin: 18px 0 22px; padding-left: 1.1em; display: grid; gap: 8px; color: var(--muted); }
.project__points li::marker { color: var(--signal); }
.project .chips { margin-bottom: 26px; }

/* Contact */
.contact { border-top: 0; padding-top: clamp(24px, 4vw, 48px); }
.contact__panel {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line); border-radius: 28px;
  background:
    radial-gradient(520px 320px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(420px 300px at 100% 100%, color-mix(in srgb, var(--signal) 10%, transparent), transparent 70%),
    var(--surface);
}
.contact__panel::before {
  /* the same dot grid as the hero, faded in from the top-left */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 55%);
  mask-image: linear-gradient(135deg, #000, transparent 55%);
}
.contact__intro, .contact__channels { position: relative; }
.contact__title {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.04;
  max-width: 13ch;
}
.contact__text { margin-top: 18px; color: var(--muted); font-size: 1.1rem; line-height: 1.6; max-width: 46ch; }
.contact__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.contact__where {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.92rem;
}
.contact__where svg { color: var(--accent); }

/* Copy-email button: swaps its label after copying */
#copy-email .copy__idle, #copy-email .copy__done { display: inline-flex; align-items: center; gap: 8px; }
#copy-email .copy__done { display: none; color: var(--signal); }
#copy-email.is-copied .copy__idle { display: none; }
#copy-email.is-copied .copy__done { display: inline-flex; }
#copy-email.is-copied { border-color: var(--signal); }

/* Channel list */
.contact__channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact__channels a {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 16px; text-decoration: none;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.contact__channels a:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.channel__icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-2); color: var(--brand, var(--ink)); font-size: 1.2rem;
}
.channel__text { display: grid; min-width: 0; }
.channel__text strong { font-weight: 700; font-size: 1rem; }
.channel__text span { color: var(--muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel__go { color: var(--muted); font-size: 1.1rem; transition: transform 0.2s ease, color 0.2s ease; }
.contact__channels a:hover .channel__go { color: var(--accent); transform: translate(2px, -2px); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 0.92rem; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__intro { justify-content: flex-start; padding: 0; }
  .hero__name { font-size: clamp(2.3rem, 7vw, 3.4rem); }
  .project { grid-template-columns: 1fr; }
  .contact__panel { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
  .job { grid-template-columns: 1fr; gap: 6px; }
  .job__when { padding: 0 0 8px 32px; border-left: 2px solid var(--line); }
  .job__logo { width: 96px; height: 46px; }
  .job:last-child .job__when { border-left-color: var(--line); }
  .creds, .skills { grid-template-columns: 1fr; }
  .skillset { padding: 20px; }
  .console { padding: 18px 18px 52px; }
  .console__answer p { min-height: 12em; }
}
@media (max-width: 420px) {
  .hero__name { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame { transition: none; }
  .contact__channels a, .channel__go { transition: none; }
  .console__answer p.is-done::after { animation: none; }
}
