/* ===== Tokens ===== */
:root {
  --bg: #fbf7f4;
  --surface: #ffffff;
  --surface-2: #f6eee9;
  --text: #2a2230;
  --muted: #74687a;
  --line: #eadfd8;
  --accent: #c2577a;
  --accent-2: #7b5cd6;
  --accent-soft: #f7dfe6;
  --code-bg: #2a2230;
  --code-text: #f3e9ef;
  --shadow: 0 10px 30px -12px rgba(90, 40, 70, 0.18);
  --radius: 20px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15111a;
    --surface: #1e1825;
    --surface-2: #261f2e;
    --text: #f2ebf3;
    --muted: #a99db0;
    --line: #322a3a;
    --accent: #f08aab;
    --accent-2: #a98bff;
    --accent-soft: #3a2433;
    --code-bg: #0f0c13;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

main { max-width: 1080px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ===== Background blobs ===== */
.bg-blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45;
  animation: float 18s ease-in-out infinite;
}
.b1 { width: 420px; height: 420px; background: var(--accent-soft); top: -120px; right: -80px; }
.b2 { width: 360px; height: 360px; background: color-mix(in srgb, var(--accent-2) 25%, transparent); top: 40%; left: -140px; animation-delay: -6s; }
.b3 { width: 300px; height: 300px; background: color-mix(in srgb, var(--accent) 18%, transparent); bottom: -100px; right: 20%; animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.08); }
}

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1080px; margin: 0 auto; padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.logo { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.nav nav { display: flex; gap: 28px; font-size: .92rem; color: var(--muted); }
.nav nav a { position: relative; transition: color .2s; }
.nav nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--accent); border-radius: 2px; transition: width .25s;
}
.nav nav a:hover { color: var(--text); }
.nav nav a:hover::after { width: 100%; }

.resume-pill {
  font-size: .82rem; padding: 8px 14px; border-radius: 999px;
  border: 1px dashed var(--accent); color: var(--accent);
  cursor: not-allowed; white-space: nowrap; user-select: none;
}
.resume-pill em { font-style: normal; opacity: .75; }

/* ===== Hero ===== */
.hero {
  min-height: calc(100vh - 80px);
  display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; align-content: center;
  column-gap: 48px; padding: 48px 0 80px;
}
.hero > :not(.terminal) { grid-column: 1; }
.hero .terminal { grid-column: 2; grid-row: 1 / span 4; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content;
  font-size: .85rem; font-weight: 500; color: var(--muted);
  padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3fbf7f; box-shadow: 0 0 0 4px rgba(63,191,127,.18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(63,191,127,0); } }

h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.3rem, 5.2vw, 4rem); line-height: 1.12; letter-spacing: -.025em;
  margin: 22px 0 20px;
}
h1 .name {
  font-weight: 600;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h1 em { font-style: italic; color: var(--accent); }
.code-word { font-family: var(--mono); font-size: .72em; color: var(--accent-2); }

.lead { font-size: 1.1rem; color: var(--muted); max-width: 520px; }

.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-tags span {
  font-size: .85rem; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}

/* Terminal card */
.terminal {
  background: var(--code-bg); color: var(--code-text);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transform: rotate(1.5deg);
  transition: transform .4s ease;
}
.terminal:hover { transform: rotate(0) translateY(-4px); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: rgba(255,255,255,.05); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; font-family: var(--mono); font-size: .75rem; opacity: .55; }
.terminal pre {
  font-family: var(--mono); font-size: .88rem; line-height: 1.75;
  padding: 20px 22px 26px; overflow-x: auto;
}
.terminal .c { color: #8c7f95; }
.terminal .k { color: #c792ea; }
.terminal .s { color: #f5a3bf; }
.terminal .n { color: #f7c86b; }
.cursor { animation: blink 1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* ===== Sections ===== */
.section { padding: 90px 0; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 44px; }
.num { font-family: var(--mono); font-size: .9rem; color: var(--accent); }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.7rem); letter-spacing: -.02em; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line); margin-left: 12px; transform: translateY(-8px); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about-text p { margin-bottom: 18px; font-size: 1.05rem; color: var(--muted); }
.about-text strong { color: var(--text); font-weight: 600; }
.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; display: flex; flex-direction: column; gap: 4px;
  transition: transform .25s, box-shadow .25s;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat b { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; color: var(--accent); }
.stat span { font-size: .85rem; color: var(--muted); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.skill-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--accent); }
.icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.25rem; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.skill-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 14px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.chips li {
  font-size: .78rem; padding: 4px 10px; border-radius: 8px;
  background: var(--surface-2); color: var(--muted);
}

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.project {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .3s, box-shadow .3s;
}
.project:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.project-art {
  height: 170px; display: grid; place-items: center; position: relative; overflow: hidden;
}
.project-art span {
  font-family: var(--mono); font-size: 2.6rem; color: #fff; opacity: .92;
  transition: transform .4s;
}
.project:hover .project-art span { transform: scale(1.15) rotate(-4deg); }
.art-1 { background: linear-gradient(135deg, #f3a6c0, #c2577a); }
.art-2 { background: linear-gradient(135deg, #b9a4ff, #7b5cd6); }
.art-3 { background: linear-gradient(135deg, #ffc9a8, #e57f6b); }
.art-4 { background: linear-gradient(135deg, #9fd9cf, #4a9e9a); }
.project-art::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.25) 1px, transparent 1px);
  background-size: 16px 16px;
}
.project-body { padding: 24px 24px 26px; }
.project-tag { font-family: var(--mono); font-size: .75rem; color: var(--accent); margin-bottom: 6px; }
.project-body h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; margin-bottom: 8px; }
.project-body p:not(.project-tag) { color: var(--muted); font-size: .95rem; }
.stack { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.stack li { font-family: var(--mono); font-size: .72rem; padding: 3px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }

/* Timeline */
.timeline { list-style: none; position: relative; padding-left: 0; }
.timeline::before {
  content: ""; position: absolute; left: 110px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 2px; opacity: .5;
}
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 36px; padding-bottom: 40px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: 104px; top: 8px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.when { font-family: var(--mono); font-size: .85rem; color: var(--accent); padding-top: 2px; }
.timeline h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; }
.timeline p { color: var(--muted); }

/* Learning */
.learn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 48px; }
.learn span { font-weight: 500; font-size: .95rem; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.bar i {
  display: block; height: 100%; width: var(--w); border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: grow 1.6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes grow { from { width: 0; } }

blockquote {
  margin-top: 70px; text-align: center;
  font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--muted);
}

/* Footer */
.footer {
  position: relative; z-index: 1;
  text-align: center; padding: 50px 24px 60px; border-top: 1px solid var(--line);
  max-width: 1080px; margin: 40px auto 0; color: var(--muted); font-size: .92rem;
}
.footer span { color: var(--accent); font-weight: 500; }
.footer .small { font-size: .8rem; margin-top: 6px; opacity: .75; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .nav nav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 32px; }
  .hero > :not(.terminal), .hero .terminal { grid-column: 1; grid-row: auto; }
  .terminal { transform: none; margin-top: 12px; }
  .about-grid { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .learn-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  main, .nav { padding-left: 16px; padding-right: 16px; }
  .skills-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .timeline::before { left: 6px; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; padding-left: 30px; }
  .timeline li::before { left: 0; }
  .resume-pill { font-size: .75rem; padding: 6px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
