/* ========== Tokens ========== */
:root {
  --bg: #0b0f17;
  --bg-alt: #0f1521;
  --surface: #141b29;
  --surface-2: #1a2334;
  --border: #233047;
  --text: #e6ebf3;
  --muted: #94a3b8;
  --accent: #6aa7ff;
  --accent-2: #8b7bff;
  --accent-3: #2fd3b4;
  --gold: #f6c453;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-alt: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --border: #dde3ee;
  --text: #0f172a;
  --muted: #5b6678;
  --accent: #2563eb;
  --accent-2: #6d4aff;
  --accent-3: #0f9f86;
  --gold: #b7791f;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

/* ========== Base ========== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 28px; } }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

.muted { color: var(--muted); }
.center { text-align: center; margin-top: 24px; }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ========== Buttons / chips ========== */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .8em 1.3em; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 24px rgba(106, 167, 255, .3); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--sm { padding: .55em 1em; font-size: .85rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span, .tag {
  font-size: .75rem; font-family: var(--mono); padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.chip-btn {
  font: 600 .85rem var(--font); padding: .5em 1em; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border); transition: all .15s;
}
.chip-btn:hover { color: var(--text); border-color: var(--accent); }
.chip-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }

/* ========== Nav ========== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.nav__brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.nav__brand:hover { text-decoration: none; }
.nav__logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: .85rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800;
}
.nav__links { display: flex; gap: 4px; }
.nav__links a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .93rem; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: var(--surface); text-decoration: none; }
.nav__actions { display: flex; gap: 8px; }
.nav__menu { display: none; }
@media (max-width: 860px) {
  .nav__menu { display: grid; }
  .nav__links {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; padding: 12px 16px 20px;
    background: var(--bg); border-bottom: 1px solid var(--border); display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px; }
}

/* ========== Hero ========== */
.hero { position: relative; padding: 72px 0 40px; overflow: hidden; }
.hero__glow {
  position: absolute; inset: -20% -10% auto; height: 640px; pointer-events: none; z-index: -1;
  background:
    radial-gradient(500px 300px at 20% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(500px 300px at 80% 10%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 70%);
}
.hero__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--accent-3);
  background: color-mix(in srgb, var(--accent-3) 12%, transparent); padding: 6px 12px; border-radius: 999px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 0 0 var(--accent-3); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.9rem); font-weight: 800; margin: 18px 0; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 620px; }
.lead strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }

.socials { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; }
.socials a {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); transition: all .15s;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.socials--sm a { width: 36px; height: 36px; border-radius: 10px; }

.hero__card { display: flex; flex-direction: column; align-items: center; }
.avatar {
  width: 168px; height: 168px; border-radius: 50%; padding: 4px; margin-bottom: -40px; z-index: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
}
.avatar img, .avatar__fallback {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface);
  border: 4px solid var(--bg);
}
.avatar__fallback { display: grid; place-items: center; font-size: 3rem; font-weight: 800; color: var(--accent); }
.terminal {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; padding-top: 36px;
}
.terminal__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.terminal__bar span { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.terminal__bar span:nth-child(2) { background: #febc2e; }
.terminal__bar span:nth-child(3) { background: #28c840; }
.terminal__bar code { margin-left: auto; font: .75rem var(--mono); color: var(--muted); }
.terminal pre { margin: 0; padding: 16px 18px; font: .82rem/1.7 var(--mono); overflow-x: auto; color: var(--text); }
.terminal k { color: var(--accent); }
.terminal s { color: var(--accent-3); text-decoration: none; }
.terminal n { color: var(--gold); }

.stats {
  margin: 56px 0 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;
}
.stats > div { background: var(--surface); padding: 22px 18px; text-align: center; }
.stats dt { color: var(--muted); font-size: .8rem; order: 2; }
.stats dd { margin: 0 0 4px; font-size: 1.9rem; font-weight: 800; }
.stats > div { display: flex; flex-direction: column-reverse; }

@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__card { max-width: 440px; width: 100%; margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:last-child { grid-column: span 2; }
}

/* ========== Logos ========== */
.logos { padding: 28px 0; }
.logos__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 36px; }
.logos__label { color: var(--muted); font-size: .85rem; width: 100%; text-align: center; }
.logo-word { font-weight: 800; font-size: 1.25rem; color: var(--muted); opacity: .75; letter-spacing: -.01em; }
@media (min-width: 720px) { .logos__label { width: auto; } }

/* ========== Sections ========== */
.section { padding: 88px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__head { margin-bottom: 40px; max-width: 720px; }
.section__head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.kicker { font: 500 .8rem var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.subhead { margin: 56px 0 20px; font-size: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
@media (max-width: 720px) { .section { padding: 64px 0; } }

/* ========== About ========== */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.about__text p { font-size: 1.05rem; color: var(--muted); }
.about__text strong { color: var(--text); }
.impact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 28px; }
.impact__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; }
.impact__item span { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.impact__item p { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.about__side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; align-self: start; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.checklist li { display: flex; gap: 14px; }
.checklist i { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.checklist strong { display: block; }
.checklist span { color: var(--muted); font-size: .9rem; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }

/* ========== Timeline ========== */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 180px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline__item { display: grid; grid-template-columns: 180px 1fr; gap: 36px; margin-bottom: 28px; position: relative; }
.timeline__item::before {
  content: ""; position: absolute; left: 174px; top: 26px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg-alt);
}
.timeline__meta { padding-top: 20px; text-align: right; padding-right: 8px; }
.timeline__date { display: block; font-weight: 700; font-size: .92rem; }
.timeline__place { color: var(--muted); font-size: .85rem; }
.timeline .card h3 { font-size: 1.15rem; }
.at { color: var(--muted); font-weight: 500; }
.timeline ul { margin: 10px 0 16px; padding-left: 18px; color: var(--muted); }
.timeline li li { margin-bottom: 6px; }
.timeline strong { color: var(--text); font-weight: 600; }
@media (max-width: 760px) {
  .timeline::before { left: 6px; }
  .timeline__item { grid-template-columns: 1fr; gap: 8px; padding-left: 28px; }
  .timeline__item::before { left: 0; top: 4px; }
  .timeline__meta { text-align: left; padding: 0; }
  .timeline__date, .timeline__place { display: inline; margin-right: 8px; }
}

/* ========== Projects ========== */
.featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 48px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.search { position: relative; flex: 1 1 240px; max-width: 320px; }
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.search input {
  width: 100%; padding: .65em 1em .65em 2.4em; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .9rem;
}
.search input:focus { outline: none; border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

.project {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; transition: transform .2s, border-color .2s, box-shadow .2s;
  animation: fadeUp .35s ease both;
}
.project:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: var(--shadow); }
.project__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.project__icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.project__cat { font: .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.project h3 { margin-bottom: 6px; }
.project p { color: var(--muted); font-size: .92rem; flex: 1; }
.project .chips { margin-bottom: 16px; }
.project__links { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .85rem; font-weight: 600; }
.project__links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.project__links a:hover { color: var(--accent); text-decoration: none; }
.project__links a.live { color: var(--accent-3); }

.project--featured { padding: 26px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 60%); }
.project--featured .project__icon { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.badge { font: 600 .7rem var(--mono); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); padding: 2px 8px; border-radius: 999px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) { .featured, .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .featured, .grid { grid-template-columns: 1fr; } .search { max-width: none; } }

/* ========== Open source ========== */
.oss { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.oss__card {
  display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; color: var(--text); transition: all .2s;
}
.oss__card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); }
.oss__card > i { font-size: 1.4rem; color: var(--accent); margin-bottom: 6px; }
.oss__card h3 { font-size: 1rem; word-break: break-word; }
.oss__card p { color: var(--muted); font-size: .9rem; flex: 1; }
.oss__card .tag { align-self: flex-start; }
@media (max-width: 980px) { .oss { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .oss { grid-template-columns: 1fr; } }

/* ========== Talks ========== */
.talks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.talk {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; border-top: 3px solid var(--accent);
}
.talk:nth-child(2) { border-top-color: var(--accent-2); }
.talk:nth-child(3) { border-top-color: var(--accent-3); }
.talk__type { font: 500 .78rem var(--mono); color: var(--muted); margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.talk__event { color: var(--accent); font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.talk > p:not(.talk__event) { color: var(--muted); font-size: .92rem; flex: 1; }
.talk .chips { margin-bottom: 12px; }
.link { font-weight: 600; font-size: .9rem; display: inline-flex; gap: 6px; align-items: center; }
.link i { transition: transform .15s; }
.link:hover i { transform: translateX(3px); }

.courses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.course {
  display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px; color: var(--text); transition: border-color .15s;
}
.course:hover { text-decoration: none; border-color: var(--accent); }
.course > i { font-size: 1.4rem; width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); }
.course strong, .hack__item strong { display: block; }
.course span, .hack__item span { color: var(--muted); font-size: .88rem; }

.hack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.hack__item { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.hack__item > i { font-size: 1.3rem; color: var(--muted); width: 28px; text-align: center; }
.hack__item--gold { border-color: color-mix(in srgb, var(--gold) 50%, var(--border)); }
.hack__item--gold > i { color: var(--gold); }
@media (max-width: 900px) { .talks { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .courses, .hack { grid-template-columns: 1fr; } }

/* ========== Posts ========== */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; color: var(--text); transition: all .2s; animation: fadeUp .35s ease both;
}
.post:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); }
.post__meta { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.post__meta i { font-size: 1rem; }
.post__meta .fa-linkedin-in { color: #0a66c2; }
.post__meta .fa-medium { color: var(--text); }
.post__meta time { margin-left: auto; font-family: var(--mono); }
.post h3 { font-size: 1.02rem; }
.post p { color: var(--muted); font-size: .9rem; flex: 1; margin-bottom: 12px; }
.post .link { color: var(--accent); }
.follow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 32px; }
@media (max-width: 980px) { .posts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .posts { grid-template-columns: 1fr; } }

/* ========== Skills ========== */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.skill h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; margin-bottom: 14px; }
.skill h3 i { color: var(--accent); }
@media (max-width: 900px) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .skills { grid-template-columns: 1fr; } }

/* ========== Education ========== */
.edu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.edu__card { display: flex; gap: 18px; }
.edu__card > i { font-size: 1.5rem; color: var(--accent); width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.edu__card .at { margin-bottom: 8px; font-size: .9rem; }
.edu__card p:last-child { color: var(--muted); font-size: .92rem; margin: 0; }
.certs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.certs li { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .88rem; }
.certs i { color: var(--accent); }
@media (max-width: 900px) { .certs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .edu, .certs { grid-template-columns: 1fr; } }

/* ========== Contact ========== */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact__list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.contact__list li { display: flex; align-items: center; gap: 14px; }
.contact__list > li > i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--accent); }
.contact__list a { color: var(--text); word-break: break-all; }
.copy { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; }
.copy:hover { color: var(--accent); }
.contact__form { display: grid; gap: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact__form label { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.contact__form input, .contact__form textarea, .contact__form select {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .75em .9em; resize: vertical;
}
.contact__form input:focus, .contact__form textarea:focus, .contact__form select:focus { outline: none; border-color: var(--accent); }
.contact__form .btn { justify-self: start; }
.form-note { font-size: .82rem; color: var(--muted); margin: 0; }
.form-note.is-error { color: #f87171; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

/* ========== Footer ========== */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; color: var(--muted); font-size: .88rem; }

.to-top {
  position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ========== Reveal on scroll ========== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

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

/* Grid children must be allowed to shrink below their content width on small screens. */
.hero__grid > *, .about > *, .contact > *, .timeline__item > * { min-width: 0; }
.hero h1 { overflow-wrap: break-word; }
@media (max-width: 520px) { .terminal pre { white-space: pre-wrap; word-break: break-word; } }
.chip-btn.is-active .muted { color: rgba(255, 255, 255, .8); }
