/* ===== Design tokens ===== */
:root {
  --bg: #faf7f2;
  --bg-alt: #f2ede3;
  --ink: #201d2b;
  --ink-soft: #55506a;
  --line: #e4ddce;

  --lavender: #cdb8f0;
  --lavender-deep: #9c85d8;
  --mint: #a8ddc8;
  --mint-vivid: #2fae72;
  --peach: #f4c9a8;
  --sky: #a9cbe8;
  --coral: #f0a6a0;
  --gold: #e8c15c;

  --card: #ffffff;
  --shadow: 0 20px 60px -25px rgba(32, 29, 43, 0.25);
  --radius: 22px;

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17151f;
    --bg-alt: #1e1b29;
    --ink: #f3f0ea;
    --ink-soft: #b8b2c9;
    --line: #322d42;
    --card: #211e2d;
    --shadow: 0 20px 60px -25px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  --bg: #17151f;
  --bg-alt: #1e1b29;
  --ink: #f3f0ea;
  --ink-soft: #b8b2c9;
  --line: #322d42;
  --card: #211e2d;
  --shadow: 0 20px 60px -25px rgba(0, 0, 0, 0.6);
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; }
::selection { background: var(--lavender); color: var(--ink); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > * { transition-delay: calc(var(--i, 0) * 70ms); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--lavender-deep);
  border-radius: 2px;
}

.section {
  position: relative;
  padding: 130px 8vw;
  max-width: 1280px;
  margin: 0 auto;
}
.section-head {
  max-width: 640px;
  margin-bottom: 60px;
}
.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}
.section-head p {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 52ch;
}

/* ===== Top nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 6vw;
  mix-blend-mode: difference;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.nav * { pointer-events: auto; }
.nav__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}
.nav__links { display: flex; gap: 28px; }
.nav__links a { position: relative; padding: 4px 0; }
.nav__links a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100svh;
  --content-w: min(870px, 61vw);
  --blob-w: clamp(225px, 38vw, 345px);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 120px 6vw 30px;
  overflow: hidden;
  isolation: isolate;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--gold) 45%, transparent) 0%, transparent 42%),
    radial-gradient(circle at 82% 15%, color-mix(in srgb, var(--sky) 50%, transparent) 0%, transparent 40%),
    radial-gradient(circle at 75% 78%, color-mix(in srgb, var(--peach) 55%, transparent) 0%, transparent 45%),
    radial-gradient(circle at 15% 80%, color-mix(in srgb, var(--mint) 55%, transparent) 0%, transparent 42%),
    var(--bg);
  filter: blur(10px) saturate(115%);
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  mask-image: radial-gradient(circle at 50% 40%, black 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black 10%, transparent 72%);
}
.hero__grid pre {
  margin: 0;
  height: 100%;
  column-count: 4;
  column-gap: 48px;
  column-fill: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: color-mix(in srgb, var(--ink) 22%, transparent);
}

.hero__blob {
  position: absolute;
  width: var(--blob-w);
  left: min(calc(6vw + var(--content-w) + 48px), calc(100% - var(--blob-w) - 4vw));
  top: 50%;
  --drift-x: 0px;
  --drift-y: 0px;
  transform: translateY(calc(-50% + var(--drift-y))) translateX(var(--drift-x));
  z-index: -1;
  pointer-events: none;
}
.hero__ide {
  width: 100%;
  background: #1e1e1e;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.55);
  font-family: var(--font-mono);
  animation: terminalFloat 6s ease-in-out infinite;
}
.hero__ide-tabbar {
  display: flex;
  align-items: stretch;
  background: #2d2d30;
}
.hero__ide-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #1e1e1e;
  border-top: 2px solid #b084eb;
  font-size: 0.7rem;
  color: #d4d4d4;
  letter-spacing: 0.01em;
}
.hero__ide-tab .file-icon {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: #684fa3;
  color: #fff;
  font-size: 0.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero__ide-tab .close {
  margin-left: 4px;
  opacity: 0.45;
  font-size: 0.85rem;
  line-height: 1;
}
.hero__ide-body {
  display: flex;
}
.hero__ide-gutter {
  padding: 12px 8px 12px 12px;
  text-align: right;
  color: #5a5a5a;
  font-size: 0.6rem;
  line-height: 1.8;
  white-space: pre;
  user-select: none;
}
.hero__ide-code {
  flex: 1;
  margin: 0;
  padding: 12px 15px 12px 8px;
  font-size: 0.6rem;
  line-height: 1.8;
  color: #d4d4d4;
  white-space: pre-wrap;
  word-break: break-word;
}
.hero__ide-code .tk-kw { color: #569cd6; }
.hero__ide-code .tk-type { color: #4ec9b0; }
.hero__ide-code .tk-str { color: #ce9178; }
.hero__ide-code .tk-num { color: #b5cea8; }
.hero__ide-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: #d4d4d4;
  animation: cursorBlink 1s steps(1) infinite;
}
@keyframes cursorBlink {
  50% { opacity: 0; }
}
@keyframes terminalFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(-1.5deg); }
}

.hero__content {
  max-width: var(--content-w);
  align-self: center;
}

.hero__title {
  font-size: clamp(2.6rem, 5.1vw, 4.3rem);
  letter-spacing: -0.02em;
  overflow: hidden;
}
.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
}
.hero__title .line span {
  display: inline-block;
  transform: translateY(115%);
  animation: rise 1s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise {
  to { transform: translateY(0); }
}
.hero__title .accent {
  font-style: italic;
  background: linear-gradient(100deg, var(--lavender-deep), var(--coral) 60%, var(--peach));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__role {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.1vw, 0.95rem);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) forwards;
  animation-delay: 0.75s;
}
.hero__role-text {
  flex: 1 1 auto;
  min-width: 0;
}
.hero__role .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mint-vivid);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint-vivid) 25%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.35; }
}

.hero__location {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  color: var(--ink-soft);
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) forwards;
  animation-delay: 0.82s;
}
.hero__location svg {
  width: 19px;
  height: 19px;
  color: var(--lavender-deep);
  flex-shrink: 0;
}

.hero__desc {
  margin-top: 20px;
  max-width: 54ch;
  font-size: clamp(0.92rem, 1.15vw, 1.02rem);
  color: var(--ink-soft);
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) forwards;
  animation-delay: 0.9s;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero__tags {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) forwards;
  animation-delay: 1.05s;
}
.hero__tags span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  backdrop-filter: blur(6px);
}

.scroll-cue {
  display: flex;
  justify-self: center;
  color: var(--ink-soft);
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) forwards;
  animation-delay: 1.3s;
}
.scroll-cue__arrow {
  width: 24px;
  height: 24px;
  color: var(--lavender-deep);
  animation: arrowBounce 1.6s ease-in-out infinite;
}
@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(7px); opacity: 1; }
}

/* ===== About ===== */
.about {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 70px;
  align-items: start;
}
@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; gap: 40px; }
}
.about__lead {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.35;
}
.about__lead em { font-style: italic; color: var(--lavender-deep); }
.about__body p { color: var(--ink-soft); font-size: 1.02rem; margin-bottom: 16px; }
.about__stats {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 34px;
}
.about__stats div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--ink);
}
.about__stats div > span {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

/* ===== Skills ===== */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
  gap: 20px;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.45s var(--ease), border-color 0.3s;
}
.skill-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent, var(--lavender-deep));
}
.skill-card__icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent, var(--lavender));
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  margin-bottom: 18px;
}
.skill-card h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
}
.skill-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-card li {
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 8px;
}

/* ===== Experience timeline ===== */
.timeline {
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(var(--line), transparent 95%);
}
@media (max-width: 720px) {
  .timeline::before { left: 7px; }
}
.timeline-item {
  position: relative;
  padding-left: 54px;
  margin-bottom: 56px;
}
@media (max-width: 720px) {
  .timeline-item { padding-left: 34px; }
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 3px; top: 6px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--lavender-deep);
}
@media (max-width: 720px) {
  .timeline-item::before { left: 0px; width: 15px; height: 15px; }
}
.timeline-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.timeline-item__meta .period {
  color: var(--lavender-deep);
}
.timeline-item h3 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  margin-bottom: 4px;
}
.timeline-item .company {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.timeline-item p.desc {
  color: var(--ink-soft);
  max-width: 68ch;
  margin-bottom: 14px;
}
.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stack-pills span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--bg-alt);
}

/* ===== Certificates + Education ===== */
.dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 780px) {
  .dual { grid-template-columns: 1fr; }
}
.info-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow);
}
.info-card h3 {
  font-size: 1.1rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.info-card h3::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--peach);
}
.info-card .item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}
.info-card .item:first-of-type { border-top: none; }
.info-card .item strong { font-weight: 600; }
.info-card .item > span {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: right;
  margin-left: auto;
}
.info-card .item .sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 3px;
}
.info-card .note {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-soft);
  padding: 0 0 10px;
  margin-top: -6px;
}

/* ===== Contact / footer ===== */
.contact {
  background: var(--ink);
  color: var(--bg);
  border-radius: 32px 32px 0 0;
  margin: 0 3vw;
  padding: 120px 6vw 60px;
  text-align: center;
}
.contact .eyebrow { color: color-mix(in srgb, var(--bg) 55%, transparent); }
.contact .eyebrow::before { background: var(--peach); }
.contact h2 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  max-width: 16ch;
  margin: 0 auto;
}
.contact h2 .accent {
  font-style: italic;
  background: linear-gradient(100deg, var(--lavender), var(--coral) 60%, var(--peach));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.contact__actions {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent);
  transition: transform 0.35s var(--ease), background 0.35s;
}
.btn--solid {
  background: var(--bg);
  color: var(--ink);
}
.btn--solid:hover { transform: translateY(-3px); }
.btn--ghost:hover {
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  transform: translateY(-3px);
}
.contact__foot {
  margin-top: 90px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--bg) 50%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 900px) {
  .hero__blob { --blob-w: min(36vw, 260px); }
  .hero__ide-code { font-size: 0.66rem; line-height: 1.75; padding: 14px 16px 18px 8px; }
  .hero__ide-gutter { font-size: 0.66rem; line-height: 1.75; padding: 14px 8px 14px 10px; }
}

@media (max-width: 640px) {
  .section { padding: 90px 6vw; }
  .about__stats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .hero {
    padding: 100px 6vw 30px;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr auto;
    grid-template-areas:
      "content blob"
      "cue     cue";
    column-gap: 14px;
  }
  .hero__desc { display: none; }
  .hero__grid pre { font-size: 0.62rem; column-count: 1; color: color-mix(in srgb, var(--ink) 9%, transparent); }
  .hero__role { margin-top: 26px; width: calc(100% + 140px); font-size: 0.78rem; }
  .hero__role .dot { display: none; }
  .hero__location { margin-top: 12px; }
  .hero__tags { margin-top: 34px; width: calc(100% + 140px); }
  .hero__content { grid-area: content; min-width: 0; align-self: center; }
  .hero__blob {
    grid-area: blob;
    position: static;
    justify-self: end;
    align-self: start;
    width: clamp(90px, 32vw, 140px);
    margin: 0;
    right: auto;
    top: auto;
    transform: none;
  }
  .scroll-cue { grid-area: cue; margin-top: 20px; }
  .hero__ide-gutter { display: none; }
  .hero__ide-code { font-size: 0.3rem; line-height: 1.4; padding: 5px 5px 7px; }
  .hero__ide-tab { padding: 4px 5px; font-size: 0.34rem; gap: 3px; }
  .hero__ide-tab .file-icon { width: 7px; height: 7px; font-size: 0.26rem; border-radius: 2px; }
  .hero__ide-tab .close { display: none; }
  .hero__ide { border-radius: 5px; box-shadow: 0 14px 26px -12px rgba(0, 0, 0, 0.45); }
}

@media (max-height: 700px) {
  .hero__desc { display: none; }
}
