/* ==========================================================================
   styles.css — theme tokens first, then layout, then components.
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root {
  --bg: #fff7f1;            /* warm cream */
  --bg-alt: #fde9df;
  --surface: #ffffff;
  --text: #2a1114;
  --muted: #6e4f52;
  --border: #f1d6cc;
  --accent: #c2171b;        /* red (AA on cream/white) */
  --accent-soft: #ffd3c7;   /* soft coral-peach */
  --plum: #5c0d12;          /* deep burgundy */
  --on-accent: #ffffff;
  --shadow: 0 10px 30px rgba(120, 15, 20, 0.10);
  --shadow-lg: 0 18px 44px rgba(120, 15, 20, 0.20);
  --hero-bg: linear-gradient(118deg, #d7928f 0%, #e1a591 48%, #e8b79b 100%);
  --menu-bg: #b64552;
  --hero-rose: #bd4a57;

  /* avatar */

  --radius: 20px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Poppins", "Inter", system-ui, sans-serif;
  --font-script: "Caveat", "Segoe Script", cursive;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --term-bg: #1a0b0e;
  --term-bar: #2a1217;
  --term-text: #f7e9e5;
  --term-dim: #d9b8b3;
  --term-accent: #ff8a75;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #170a0c;
  --bg-alt: #200e11;
  --surface: #2a1215;
  --text: #fbeceb;
  --muted: #d1aeb0;
  --border: #43212a;
  --accent: #ff7a66;
  --accent-soft: #4d1d22;
  --plum: #ffc1b6;
  --on-accent: #2a0a0a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.5);
  --hero-bg: linear-gradient(118deg, #5a2a33 0%, #7a3a40 50%, #8d4a48 100%);
  --hero-rose: #6b2b37;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background-color .3s, color .3s;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

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

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(860px, 100% - 32px); }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--plum); color: #fff; padding: 10px 16px; border-radius: 10px;
}
.skip-link:focus { top: 12px; }
.noscript { text-align: center; padding: 1rem; }

/* ---------- Navbar ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { font: 700 1.35rem var(--font-head); color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .98rem;
  transition: background .2s, color .2s;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a[aria-current="true"] { color: var(--text); background: var(--accent-soft); }
.nav-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.nav-burger { display: none; }

@media (max-width: 820px) {
  .nav-burger { display: grid; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; padding: 12px 16px 18px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
}

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--plum); color: var(--bg); }
[data-theme="dark"] .btn-secondary { color: #2a0f2a; }
.btn-ghost { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-sm { padding: 8px 16px; font-size: .92rem; }
.btn[disabled] { opacity: .7; cursor: wait; transform: none; }

/* ---------- Navbar over the hero ---------- */
.site-header { transition: background .3s, border-color .3s; }
.brand { font: 700 2rem/1 var(--font-script); }
.site-header.on-hero { background: transparent; backdrop-filter: none; border-color: transparent; }
.on-hero .brand, .on-hero .nav-links a { color: #fff; }
.on-hero .brand span { color: #fff; }
.brand .heart { font: 400 1rem var(--font-body); vertical-align: top; }
.on-hero .nav-links a:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.on-hero .icon-btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); color: #fff; }
@media (max-width: 820px) {
  .nav-links { background: var(--menu-bg); border-color: transparent; }
  .nav-links a, .nav-links a:hover { color: #fff; }
  .nav-links a:hover, .nav-links a[aria-current="true"] { background: rgba(255, 255, 255, .16); }
}

/* ---------- Hero ---------- */
.hero {
  margin-top: -66px; padding-top: 66px; position: relative; overflow: hidden;
  min-height: min(100svh, 840px); display: flex; color: #fff; background: var(--hero-bg);
}
.hero-grid {
  width: min(1360px, 100% - 40px); margin-inline: auto; display: grid;
  grid-template-columns: minmax(0, 4.3fr) minmax(0, 5.4fr) minmax(0, 2.9fr); align-items: stretch;
}
.hero-copy { align-self: center; padding: 48px 0; position: relative; z-index: 2; }
.eyebrow { display: block; font: 600 .95rem var(--font-body); letter-spacing: .18em; text-transform: uppercase; margin-bottom: .6rem; }
.hero h1 { font-size: inherit; margin: 0; color: #fff; }
.script { display: block; font: 700 clamp(3.2rem, 6.2vw, 5.6rem)/.98 var(--font-script); transform: rotate(-3deg); transform-origin: left; }
.emph { position: relative; display: inline-block; }
.emph svg { position: absolute; left: 4%; right: 0; bottom: -.12em; width: 92%; height: .16em; color: #fff; }
.hero .lead { color: rgba(255, 255, 255, .95); font-size: 1.12rem; max-width: 34ch; margin-top: .6rem; }
.hero .btn-row { margin-top: 1.4rem; }
.hero .btn { align-items: center; padding: 11px 16px; font-size: .94rem; gap: 6px; }
.hero .btn-row { gap: 10px; }
.hero .btn-primary { background: #fff; color: #a10d15; }
.hero .btn-secondary { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .7); }
.hero .btn-ghost { border-color: #fff; color: #fff; }
.hand-note { font: 500 1.7rem/1.1 var(--font-script); max-width: 7em; margin: 2.2rem 0 0 .5rem; transform: rotate(-8deg); opacity: .95; }
.hand-note::after { content: " ♥"; font-size: 1rem; }

.hero-art { position: relative; align-self: end; justify-self: center; width: 112%; max-width: 540px; margin: 0 -6% -30px; }
.doodle { position: absolute; z-index: 3; pointer-events: none; }
.d-lines { width: 54px; top: 12%; right: 6%; }
.d-cursor { width: 44px; top: 30%; left: 3%; }

.hero-extras { align-self: center; display: grid; gap: 28px; justify-items: center; padding: 48px 0; position: relative; z-index: 2; }
.glass-card {
  width: 190px; padding: 20px 22px; border-radius: 26px; transform: rotate(5deg);
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .38);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 14px 34px rgba(90, 0, 10, .25);
}
.glass-card ul { list-style: none; margin: 10px 0 6px; padding: 0; font: 600 1.35rem/1.45 var(--font-script); }
.card-arrow { color: #fff; text-decoration: none; font-size: 1.3rem; }
.motto { list-style: none; margin: 0; padding: 0; font: 600 1.7rem/1.2 var(--font-script); transform: rotate(-9deg); text-align: center; }
.motto li + li::before { content: "•"; display: block; font-size: .9rem; line-height: .8; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; }
.socials a {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; transition: transform .2s, background .2s;
}
.socials a:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .3); }
.hero :focus-visible { outline-color: #fff; }

@media (max-width: 1100px) { .hero-extras { display: none; } .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 820px) {
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { padding: 36px 0 8px; }
  .script { transform: none; }
  .hero .lead { margin-inline: auto; }
  .hero .btn-row { justify-content: center; }
  .hand-note { display: none; }
  .hero-art { width: min(440px, 100%); margin-inline: auto; }
}

/* ---------- Avatar animation ---------- */
.avatar { width: 100%; height: auto; cursor: pointer; touch-action: manipulation; overflow: visible; display: block; }
#head { will-change: transform; }
.lid { transform: scaleY(0); transform-box: fill-box; transform-origin: 50% 0; transition: transform .08s ease-in; }
.lash-closed { opacity: 0; transition: opacity .08s ease-in; }
.avatar.is-blinking .lid { transform: scaleY(1); }
.avatar.is-blinking .lash-closed { opacity: 1; }
.hi-bubble {
  position: absolute; left: 4%; top: 14%; margin: 0; padding: 4px 20px 8px; border-radius: 28px 28px 28px 6px;
  background: #fff; color: #b3121a; font: 700 2.4rem/1 var(--font-script); transform: rotate(-8deg) scale(.6);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1); z-index: 4;
}
.avatar.is-happy + .hi-bubble { opacity: 1; transform: rotate(-8deg) scale(1); }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section.alt { background: var(--bg-alt); }
.section-head { margin-bottom: 2.2rem; }

.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; margin-top: 1.4rem; }
.about-grid [data-render="aboutText"] p { color: var(--muted); }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.skill-head { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; }
.skill-head h3 { margin: 0; }
.skill-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: .92rem; font-weight: 500; }

.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--accent-soft); }
.project-body { padding: 22px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.project-body p { color: var(--muted); }
.project .chips { margin-bottom: 1.2rem; }
.project .chip { font-size: .8rem; padding: 4px 12px; background: var(--accent-soft); border-color: transparent; }
.project .btn-row { margin-top: auto; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 3px solid var(--accent-soft); }
.timeline > li { position: relative; margin-bottom: 28px; }
.timeline > li:last-child { margin-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -38px; top: 28px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 4px solid var(--bg-alt);
}
.timeline h3 { margin-bottom: .1rem; }
.timeline .org { color: var(--muted); margin: 0; }
.timeline ul { margin: .8rem 0 0; padding-left: 1.2rem; color: var(--muted); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.contact-links a {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  transition: transform .2s, box-shadow .2s; overflow-wrap: anywhere;
}
.contact-links a:hover { transform: translateX(6px); box-shadow: var(--shadow); }
.contact-links .skill-icon { flex: none; }

.form { display: grid; gap: 16px; }
.form:hover { transform: none; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px;
}
.field input:focus, .field textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field textarea { min-height: 140px; resize: vertical; }
.form-status { min-height: 1.4em; margin: 0; font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer { padding: 28px 0; text-align: center; color: var(--muted); border-top: 1px solid var(--border); font-size: .92rem; }
.site-footer p { margin: 0; }

/* ---------- Fade-in on scroll (only when JS is active) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .card:hover, .btn:hover, .icon-btn:hover, .contact-links a:hover { transform: none; }
}

/* ==========================================================================
   Developer touches
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--font-mono); }
.ph-note { font: 400 .78rem/1.4 var(--font-mono); color: var(--muted); margin: .8rem 0 0; }
.ph-note.inline { display: block; margin: 0; }

/* Hero: typing roles + blinking cursor after the tagline */
.roles { font: 600 1.05rem/1.4 var(--font-mono); min-height: 1.5em; margin: 1.6rem 0 0; color: #fff; }
.roles .prompt { opacity: .7; }
.tagline::after { content: ""; display: inline-block; width: .55em; height: 1.05em; margin-left: .25em; vertical-align: text-bottom; background: #fff; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 820px) { .roles { text-align: center; } }

/* Code-style section headings */
.code-title { font-family: var(--font-mono); font-weight: 600; font-size: clamp(1.45rem, 3.2vw, 2.1rem); letter-spacing: -.01em; overflow-wrap: anywhere; }
.tok-c { color: var(--muted); }
.tok-k { color: var(--accent); }
.tok-f { color: var(--plum); }
.tok-v { color: var(--accent); }

/* Terminal look (about card, contact form, help popup) */
.terminal, .form.card, .term-window { background: var(--term-bg); color: var(--term-text); font-family: var(--font-mono); }
.terminal, .form.card { border: 1px solid var(--term-bar); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; padding: 0; }
.term-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--term-bar); color: var(--term-dim); font: 400 .8rem var(--font-mono); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.term-body.sm { padding: 16px 18px 18px; font-size: .86rem; line-height: 1.6; }
.t-line { margin: 0; color: var(--term-text); }
.t-out { margin: 0 0 .7rem; color: var(--term-dim); overflow-wrap: anywhere; }
.prompt { color: var(--term-accent); }
.caret { display: inline-block; width: .6em; height: 1em; vertical-align: text-bottom; background: var(--term-text); animation: blink 1.1s steps(1) infinite; }
.about-grid { grid-template-columns: 1.3fr 1fr; }
.about-grid [data-render="aboutText"] p { color: var(--text); }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

/* Skills */
.chip.skill { display: inline-flex; align-items: center; gap: 8px; }
.chip-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #fff; color: var(--accent); flex: none; }
.chip-icon img { width: 16px; height: 16px; }
.pulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 0 rgba(47, 191, 113, .6); animation: pulse 1.8s ease-out infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(47, 191, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); } }
.legend { margin: 1.4rem 0 0; font: 400 .85rem var(--font-mono); color: var(--muted); display: flex; align-items: center; gap: 10px; }

/* Projects */
.project .hook { color: var(--text); font-weight: 500; margin-bottom: .6rem; }
.bullets { margin: 0 0 1rem; padding-left: 1.15rem; color: var(--muted); font-size: .96rem; }
.bullets li { margin-bottom: .35rem; }
.project-media { padding: 0; }
.project .project-media img, .shot-ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 0; }
.shot-ph { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--accent-soft), var(--accent-soft) 12px, transparent 12px, transparent 24px); border: 2px dashed var(--border); color: var(--muted); font: 600 .85rem var(--font-mono); text-align: center; }
.shot-ph span { background: var(--surface); padding: 4px 10px; border-radius: 6px; }
.project .code-chips .chip { font: 500 .76rem var(--font-mono); border-radius: 6px; padding: 3px 10px; background: var(--accent-soft); color: var(--text); }
.btn.is-placeholder { border-style: dashed; opacity: .75; cursor: default; }
.btn.is-placeholder:hover { transform: none; box-shadow: none; }
.projects-grid .featured, .projects-grid .wide { grid-column: 1 / -1; flex-direction: row; display: grid; grid-template-columns: 1.1fr 1fr; }
.featured .project-media, .wide .project-media { order: 2; padding: 22px; display: flex; flex-direction: column; justify-content: center; gap: 16px; background: var(--bg-alt); }
.featured .project-media img, .featured .shot-ph, .wide .shot-ph { border-radius: 12px; }
.featured .project-body { padding: 28px; }
.featured h3 { font-size: 1.45rem; }
.diagram svg { width: 100%; height: auto; }
.dg-v { display: none; max-width: 260px; margin-inline: auto; }
@media (max-width: 520px) { .dg-h { display: none; } .dg-v { display: block; } }
.dg-box { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.dg-last { fill: var(--accent-soft); }
.dg-text { fill: var(--text); font: 600 14px var(--font-mono); }
.dg-arrow { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gallery { flex-direction: row !important; gap: 14px !important; }
.gallery figure { margin: 0; flex: 1; min-width: 0; }
.gallery figcaption { font: 500 .78rem var(--font-mono); color: var(--muted); margin-top: 6px; }
.wide .project-body { padding: 24px 28px; }
@media (max-width: 820px) {
  .projects-grid .featured, .projects-grid .wide { grid-template-columns: 1fr; }
  .featured .project-media, .wide .project-media { order: 0; }
  .featured .project-body { padding: 22px; }
}
@media (max-width: 480px) { .gallery { flex-direction: column !important; } }

/* Experience as git log */
.commit .hash { font: 400 .85rem var(--font-mono); margin: 0 0 .3rem; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hash-id { color: var(--accent); font-weight: 600; }
.ref { background: var(--accent-soft); color: var(--text); padding: 1px 8px; border-radius: 6px; font-size: .75rem; }
.timeline > li::before { border-radius: 4px; transform: rotate(45deg); }

/* Contact form as a terminal */
.form.card { gap: 0; }
.form-body { display: grid; gap: 16px; padding: 22px; }
.form .field label { font: 400 .85rem var(--font-mono); color: var(--term-dim); }
.form .field label::before { content: "$ "; color: var(--term-accent); }
.form .field label::after { content: ":"; }
.form .field input, .form .field textarea { background: #0f0507; color: var(--term-text); border: 1px solid var(--term-bar); border-radius: 8px; font-family: var(--font-mono); font-size: .92rem; }
.form .field input:focus, .form .field textarea:focus { outline-color: var(--term-accent); border-color: var(--term-accent); }
.form .btn { justify-self: start; font-family: var(--font-mono); background: var(--term-accent); color: #2a0a0a; border-radius: 8px; }
.form-status { font-family: var(--font-mono); font-size: .85rem; color: var(--term-dim); }
.contact-links .ph-note { color: var(--muted); }
.contact-links a[aria-disabled="true"] { border-style: dashed; cursor: default; }
.contact-links a[aria-disabled="true"]:hover { transform: none; box-shadow: none; }

/* Footer */
.site-footer p.mono { font-size: .8rem; overflow-wrap: anywhere; padding-inline: 8px; }
.footer-hint { margin-top: .6rem !important; font-size: .78rem; opacity: .8; }
.footer-hint kbd, .footer-hint button { font: 600 .78rem var(--font-mono); background: var(--accent-soft); color: var(--text); border: 0; border-radius: 5px; padding: 1px 7px; }
.footer-hint button { cursor: pointer; text-decoration: underline; }

/* Easter egg: help terminal */
.term-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(20, 4, 6, .6); }
.term-overlay[hidden] { display: none; }
.term-window { width: min(560px, 100%); max-height: min(520px, 90svh); display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); border: 1px solid var(--term-bar); }
.term-title { flex: 1; }
.term-close { background: none; border: 0; color: var(--term-dim); font-size: 1rem; cursor: pointer; padding: 2px 6px; }
.term-body { padding: 14px 16px; overflow-y: auto; flex: 1; font-size: .88rem; }
.t-cmd { font: 600 .88rem var(--font-mono); color: var(--term-accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.term-input { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--term-bar); }
.term-input input { flex: 1; background: transparent; border: 0; color: var(--term-text); font: 400 .92rem var(--font-mono); outline: none; min-width: 0; }
.term-input:focus-within { background: #12060a; }
.term-window :focus-visible { outline-color: var(--term-accent); }

.gallery-link { display: block; color: inherit; text-decoration: none; }
.gallery figcaption .gallery-link { color: var(--accent); text-decoration: underline; }
.gallery-link:hover img { filter: brightness(1.05); }

/* Impact stats */
.stat { background: var(--surface); padding: 28px 20px; text-align: center; }
.stat p { margin: 0; }
.stat-big { font: 700 clamp(2rem, 4.2vw, 3rem)/1.1 var(--font-head); color: var(--accent); }
.stat-label { margin-top: .4rem !important; font-weight: 500; color: var(--text); }
.stat-ctx { margin-top: .35rem !important; font: 400 .74rem/1.4 var(--font-mono); color: var(--muted); }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat:last-child:nth-child(odd) { grid-column: 1 / -1; } .stat { padding: 22px 12px; } .stat-label { font-size: .95rem; } }

/* About highlights, section subtitle, timeline dates */
.hl { color: var(--accent); font-weight: 600; }
.section-sub { font: 400 .95rem var(--font-mono); color: var(--muted); margin: -.2rem 0 0; }
.commit .when { margin-left: auto; color: var(--muted); font-size: .8rem; }

/* ---------- Refinement pass ---------- */
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(6, 1fr); }
  .stat { grid-column: span 2; }
  .stat:nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat, .stat:nth-child(n+4) { grid-column: auto; }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.stat-ctx { font-size: .78rem; }
.project .code-chips .chip { font-size: .8rem; }
.ph-note { font-size: .8rem; }

/* Technical decisions on project cards */
.decisions { margin: 0 0 1.1rem; padding: 12px 14px; background: var(--bg-alt); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }
.decisions-label { font: 600 .78rem var(--font-mono); color: var(--accent); margin: 0 0 .35rem; }
.decisions ul { margin: 0; padding-left: 1.05rem; font-size: .92rem; color: var(--muted); }
.decisions li { margin-bottom: .25rem; }
.decisions li:last-child { margin-bottom: 0; }

/* Project cards: gentle image zoom; header shadow when scrolled */
.project .project-media img { transition: transform .5s ease; }
.project:hover .project-media img { transform: scale(1.03); }
.project .project-media { overflow: hidden; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(90, 0, 10, .12); }
@media (prefers-reduced-motion: reduce) { .project:hover .project-media img { transform: none; } }

/* ==========================================================================
   Hero motion (all disabled by the reduced-motion rule at the bottom)
   ========================================================================== */
.hero-grid { position: relative; z-index: 1; }

/* Drifting glow behind the portrait */
.hero::before {
  content: ""; position: absolute; z-index: 0; width: min(620px, 70vw); aspect-ratio: 1; left: 50%; top: 52%;
  translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 190, 160, .55), rgba(255, 120, 95, .18) 60%, transparent 72%);
  animation: glow-drift 14s ease-in-out infinite alternate;
}
@keyframes glow-drift { from { transform: translate(-6%, -3%) scale(.94); } to { transform: translate(6%, 4%) scale(1.06); } }

/* Entrance: copy rises in one line at a time, portrait pops up */
@keyframes rise { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes pop-in { from { opacity: 0; translate: 0 44px; scale: .95; } to { opacity: 1; translate: 0 0; scale: 1; } }
.hero-copy .eyebrow  { animation: rise .7s cubic-bezier(.2, .8, .2, 1) .05s backwards; }
.hero-copy .script   { animation: rise .8s cubic-bezier(.2, .8, .2, 1) .15s backwards; }
.hero-copy .roles    { animation: rise .7s cubic-bezier(.2, .8, .2, 1) .40s backwards; }
.hero-copy .tagline  { animation: rise .7s cubic-bezier(.2, .8, .2, 1) .50s backwards; }
.hero-copy .btn-row  { animation: rise .7s cubic-bezier(.2, .8, .2, 1) .62s backwards; }
.hero-copy .hand-note { animation: rise .8s cubic-bezier(.2, .8, .2, 1) .85s backwards; }
.hero-art { animation: pop-in 1s cubic-bezier(.2, .8, .2, 1) .1s backwards; }
.hero-extras .socials    { animation: rise .8s cubic-bezier(.2, .8, .2, 1) .95s backwards; }

/* Headline underline draws itself */
.emph svg path { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 1s ease-out .9s backwards; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Waving hand */
.wave { display: inline-block; transform-origin: 70% 80%; animation: wave 2.6s ease-in-out 1.2s infinite; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-10deg); } 50% { transform: rotate(8deg); } }

/* Cursor parallax (JS sets --gx/--gy from the gaze) and scroll parallax (--sy) */
.hero-art { translate: calc(var(--gx, 0) * -5px) calc(var(--sy, 0) * -.05px); }
.glass-card { translate: calc(var(--gx, 0) * -12px) calc(var(--gy, 0) * -9px); animation-name: rise, float-card; animation-duration: .8s, 7s; animation-delay: .55s, 1.4s; animation-iteration-count: 1, infinite; animation-timing-function: cubic-bezier(.2, .8, .2, 1), ease-in-out; animation-fill-mode: backwards, none; }
@keyframes float-card { 0%, 100% { transform: rotate(5deg) translateY(0); } 50% { transform: rotate(5deg) translateY(-9px); } }
.motto { translate: calc(var(--gx, 0) * -7px) calc(var(--gy, 0) * -5px); animation-name: rise, float-motto; animation-duration: .8s, 8s; animation-delay: .75s, 1.6s; animation-iteration-count: 1, infinite; animation-timing-function: cubic-bezier(.2, .8, .2, 1), ease-in-out; animation-fill-mode: backwards, none; }
@keyframes float-motto { 0%, 100% { transform: rotate(-9deg) translateY(0); } 50% { transform: rotate(-9deg) translateY(7px); } }
.d-lines { translate: calc(var(--gx, 0) * 16px) calc(var(--gy, 0) * 10px); animation: nudge 3.2s ease-in-out infinite; }
.d-cursor { translate: calc(var(--gx, 0) * -14px) calc(var(--gy, 0) * -8px); animation: nudge 4.1s ease-in-out .6s infinite reverse; }
@keyframes nudge { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(4deg); } }
.hand-note { translate: calc(var(--gx, 0) * 6px) calc(var(--gy, 0) * 4px); }

/* Sparkles (created by JS) */
.spark {
  position: absolute; z-index: 2; width: calc(14px * var(--s, 1)); aspect-ratio: 1; pointer-events: none; opacity: 0;
  background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 4.8s ease-in-out var(--d, 0s) infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 45%, 55% { opacity: .85; transform: scale(1) rotate(45deg); } }

/* Hearts when she's clicked */
.heart-pop { position: absolute; z-index: 5; color: #fff; font-size: 1.5rem; pointer-events: none; opacity: 0; animation: heart-up 1.3s ease-out forwards; text-shadow: 0 2px 10px rgba(120, 0, 15, .35); }
@keyframes heart-up { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(12deg); } }

/* Button polish */
.btn > span { transition: transform .2s; }
.btn:hover > span { transform: translateX(3px); }
.hero .btn-primary:hover { box-shadow: 0 10px 26px rgba(90, 0, 10, .35); }

/* Scroll cue */
.scroll-cue { position: absolute; z-index: 3; left: 50%; bottom: 14px; translate: -50% 0; width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 14px; display: block; transition: opacity .3s; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: cue 1.8s ease-in-out infinite; }
.scroll-cue.gone { opacity: 0; pointer-events: none; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@media (max-width: 820px) { .scroll-cue { display: none; } .hero::before { top: 62%; } }
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  .spark, .heart-pop, .scroll-cue span { display: none; }
  .hero-art, .glass-card, .motto, .d-lines, .d-cursor, .hand-note { translate: none; }
}

#avatar { transform-origin: 50% 88%; will-change: transform; }


/* Comfortable tap targets on touch screens */
@media (pointer: coarse) {
  .gallery figcaption .gallery-link, .footer-hint button { display: inline-block; padding: 12px 6px; }
  .footer-hint kbd { display: none; }
  .brand { padding: 6px 0; }
}

/* ==========================================================================
   Soft pink & peach hero (restyle)
   ========================================================================== */
.hero { isolation: isolate; --bg-a: #c6606b; --bg-b: #d77a7d; --bg-c: #e9ad98; --leaf: #3c6a3a; }
[data-theme="dark"] .hero { --bg-a: #4a1f2b; --bg-b: #64303a; --bg-c: #7b4443; --leaf: #1f2a1a; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.bg-stroke-a { fill: var(--bg-a); opacity: .92; }
.bg-stroke-b { fill: var(--bg-b); opacity: .8; }
.bg-stroke-c { fill: var(--bg-c); opacity: .55; }
.bg-light { fill: #fff; opacity: .1; }
.bg-light.soft { opacity: .06; }
.bg-leaf path { fill: var(--leaf); opacity: .7; }
.hero::before { background: radial-gradient(closest-side, rgba(255, 236, 220, .6), rgba(255, 200, 175, .2) 60%, transparent 72%); }

/* Type: warm cream on rose */
.hero, .hero h1, .hero .eyebrow, .hero .lead, .roles, .hand-note, .motto, .glass-card ul, .card-arrow { color: #fff7f1; }
.hero .script { font-weight: 700; text-shadow: 0 2px 16px rgba(150, 40, 58, .55), 0 0 2px rgba(150, 40, 58, .4); }
.eyebrow { font-weight: 500; letter-spacing: .2em; }
.emph svg { color: #ffe3e0; }
.roles .prompt { color: #ffd9d4; opacity: 1; }
.tagline::after { background: #fff7f1; }
.hero .lead { font-size: 1.15rem; color: #fff7f1; text-shadow: 0 1px 10px rgba(120, 30, 45, .3); }

/* Buttons: cream fill, soft outlines */
.hero .btn-primary { background: #fff4ee; color: var(--hero-rose); }
.hero .btn-secondary { background: rgba(255, 244, 238, .18); border-color: rgba(255, 244, 238, .75); color: #fff7f1; }
.hero .btn-ghost { border-color: rgba(255, 244, 238, .85); color: #fff7f1; }
.hero .btn-primary:hover { box-shadow: 0 10px 26px rgba(120, 30, 45, .3); }

/* Nav over the hero: cream text, gentle underline instead of a pill */
.on-hero .brand, .on-hero .brand span, .on-hero .nav-links a { color: #fff7f1; }
.on-hero .nav-links a { border-radius: 0; padding: 8px 10px; margin: 0 4px; background: none; box-shadow: inset 0 -2px 0 transparent; transition: box-shadow .25s; }
.on-hero .nav-links a:hover, .on-hero .nav-links a[aria-current="true"] { background: none; box-shadow: inset 0 -2px 0 #fff7f1; }
.on-hero .icon-btn { background: rgba(255, 244, 238, .2); border-color: rgba(255, 244, 238, .55); color: #fff7f1; }
@media (max-width: 820px) {
  .nav-links { background: var(--menu-bg); }
  .nav-links a, .nav-links a:hover { color: #fff7f1; }
  .on-hero .nav-links a { margin: 0; padding: 12px 14px; }
  .on-hero .nav-links a:hover, .on-hero .nav-links a[aria-current="true"] { background: rgba(255, 255, 255, .16); box-shadow: none; }
}

/* Floating card, motto, socials */
.glass-card { background: rgba(176, 66, 82, .5); border: 1.5px solid rgba(255, 244, 238, .65); box-shadow: 0 14px 34px rgba(120, 30, 45, .2); }
.socials a { background: rgba(176, 66, 82, .45); color: #fff7f1; }
.socials a:hover { background: rgba(255, 244, 238, .4); }
.doodle path, .doodle g { stroke: #fff7f1; }
.d-cursor path:first-child { fill: #fff7f1; }
.spark { background: #fff7f1; }
.scroll-cue { border-color: rgba(255, 247, 241, .85); }
.scroll-cue span { background: #fff7f1; }
.hero :focus-visible { outline-color: #fff7f1; }

/* Portrait: a little larger now that she's full-length, with a soft grounding shadow */
.hero-art { max-width: 640px; }
.avatar { filter: drop-shadow(0 18px 28px rgba(120, 30, 45, .22)); }
@media (max-width: 820px) { .hero-art { width: min(460px, 100%); } }

.motto, .hand-note { text-shadow: 0 1px 10px rgba(150, 40, 58, .5); }

/* Phones: a deeper rose behind the stacked text so the cream type stays readable */
@media (max-width: 820px) {
  :root:not([data-theme="dark"]) .hero { background: linear-gradient(180deg, #c15d69 0%, #cb6b74 52%, #e0a08f 100%); }
  .bg-stroke-a { opacity: 0; }
  .bg-light { opacity: .07; }
}

/* Never let anything push the page sideways on phones */
html { overflow-x: hidden; }
body { overflow-x: clip; max-width: 100%; }
.hero { overflow: clip; }

/* Close-up portrait (head + shoulders): bigger, sitting on the bottom edge */
.hero-art { max-width: 780px; width: 128%; margin: 0 -14% -4px; }
@media (max-width: 1100px) { .hero-art { width: 112%; margin: 0 -6% -4px; } }
@media (max-width: 820px) { .hero-art { width: min(480px, 100%); margin-inline: auto; } }
