:root {
  --bg: #f2f7f4;
  --surface: #ffffff;
  --surface-2: #e6efea;
  --text: #16201b;
  --muted: #5a6a62;
  --line: #d6e3dc;
  --grid: rgba(22, 32, 27, .07);
  --accent: #7a3b78;
  --accent-soft: #efdfee;
  --accent-ink: #ffffff;
  --code-bg: #e5eee9;
  --serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --sans: "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1512;
    --surface: #141d19;
    --surface-2: #1b2621;
    --text: #e4eee9;
    --muted: #90a49a;
    --line: #24322c;
    --grid: rgba(228, 238, 233, .05);
    --accent: #d99cd5;
    --accent-soft: #33213a;
    --accent-ink: #1d0f1d;
    --code-bg: #17211d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1512;
  --surface: #141d19;
  --surface-2: #1b2621;
  --text: #e4eee9;
  --muted: #90a49a;
  --line: #24322c;
  --grid: rgba(228, 238, 233, .05);
  --accent: #d99cd5;
  --accent-soft: #33213a;
  --accent-ink: #1d0f1d;
  --code-bg: #17211d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}
a { color: inherit; }
::selection { background: var(--accent-soft); }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }
main { flex: 1; padding-top: 72px; padding-bottom: 96px; outline: none; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: var(--serif); font-size: 21px; font-weight: 600; text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav > a {
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; transition: color .15s, background .15s;
}
.nav > a:hover { color: var(--text); }
.nav > a.active { color: var(--accent); background: var(--accent-soft); }
.nav-tools { display: flex; align-items: center; gap: 10px; margin-left: 12px; }

.lang { display: flex; gap: 2px; }
.lang button {
  font: 600 11px/1 var(--sans); letter-spacing: .04em;
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 8px; border-radius: 6px; cursor: pointer;
}
.lang button:hover { color: var(--text); }
.lang button.active { background: var(--accent); color: var(--accent-ink); }

.theme-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.theme-btn:hover { color: var(--text); background: var(--surface-2); }
.theme-btn .i-sun { display: none; }
.is-dark .theme-btn .i-sun { display: block; }
.is-dark .theme-btn .i-moon { display: none; }

.menu-btn { display: none; }

/* Typography */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.page-title { font-size: clamp(40px, 6vw, 56px); margin-bottom: 12px; }
.page-lead { color: var(--muted); font-size: 17px; max-width: 620px; margin: 0 0 48px; }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* Hero */
.hero { padding-top: 40px; max-width: 760px; }
.status {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
.dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
.hero h1 { font-size: clamp(52px, 10vw, 88px); line-height: 1.02; }
.rule { width: 56px; height: 1px; background: var(--accent); margin: 32px 0 22px; }
.hero .role { font-family: var(--serif); font-style: italic; font-size: clamp(26px, 4vw, 34px); color: var(--accent); margin: 0 0 18px; }
.hero .lead { font-size: 18px; color: var(--muted); max-width: 560px; margin: 0 0 36px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }

.btn-line {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px;
  text-decoration: none; padding-bottom: 4px; border-bottom: 1.5px solid var(--accent);
}
.btn-line .arr { transition: transform .2s; }
.btn-line:hover .arr { transform: translateX(4px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted);
  text-decoration: none; padding-bottom: 4px; border-bottom: 1.5px solid transparent;
}
.btn-ghost:hover { color: var(--text); border-bottom-color: var(--line); }

/* Home sections */
.section { margin-top: 112px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { font-size: 32px; }
.section-head a { font-size: 14px; color: var(--muted); text-decoration: none; }
.section-head a:hover { color: var(--accent); }

/* Projects */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px -18px rgba(0,0,0,.25); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card-cover {
  height: 148px; display: grid; place-items: center; position: relative;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-size: 64px; color: var(--accent); opacity: .95;
}
.card-cover .badge {
  position: absolute; top: 14px; right: 14px;
  font: 600 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 6px 9px; border-radius: 999px;
}
.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.card-title h3 { font-size: 24px; }
.metric { font-size: 13px; color: var(--muted); white-space: nowrap; }
.card p { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.stack-label { margin-top: auto; margin-bottom: 8px; font-size: 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
.card-links { display: flex; gap: 18px; margin-top: 18px; }
.card-links a { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.card-links a:hover { text-decoration: underline; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 300px; gap: 64px; }
.about-intro { font-family: var(--serif); font-size: 22px; line-height: 1.55; margin: 0 0 56px; max-width: 640px; }
.block { margin-bottom: 48px; }
.block .eyebrow { display: block; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.timeline { border-left: 1.5px solid var(--line); margin-left: 5px; }
.item { position: relative; padding: 0 0 26px 24px; }
.item:last-child { padding-bottom: 4px; }
.item::before {
  content: ""; position: absolute; left: -6.5px; top: 7px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--accent);
}
.item .period { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item h3 { font-size: 21px; margin: 2px 0 2px; }
.item .place { display: block; color: var(--accent); font-size: 14px; }
.item p { margin: 6px 0 0; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px dashed var(--line); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.contact-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.contact-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.contact-list .k { color: var(--muted); font-size: 14px; }
.contact-list .v { font-weight: 500; transition: color .15s; overflow-wrap: anywhere; text-align: right; }
.contact-list a:hover .v { color: var(--accent); }

.form { display: grid; gap: 14px; }
.form label { font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
.form input, .form textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn {
  justify-self: start; font: 600 15px var(--sans); border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); padding: 12px 22px; border-radius: 999px;
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }

.empty { color: var(--muted); padding: 40px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* Page transition */
.fade-in > * { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.fade-in > *:nth-child(2) { animation-delay: .05s; }
.fade-in > *:nth-child(3) { animation-delay: .1s; }
.fade-in > *:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 860px) {
  .menu-btn {
    display: grid; gap: 6px; width: 40px; height: 40px; place-content: center;
    background: transparent; border: 0; cursor: pointer; margin-right: -8px;
  }
  .menu-btn span { display: block; width: 20px; height: 1.5px; background: var(--text); transition: transform .2s; }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px 16px 18px; display: none;
  }
  .nav.open { display: flex; }
  .nav > a { padding: 10px 12px; border-radius: 10px; font-size: 15px; }
  .nav-tools { margin: 10px 0 0; justify-content: space-between; padding: 0 4px; }
  .grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-grid { gap: 8px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  main { padding-top: 40px; padding-bottom: 64px; }
  .hero { padding-top: 16px; }
  .section { margin-top: 80px; }
  .card-body { padding: 20px; }
}
