/* Self-hosted fonts (SIL Open Font License), so no third-party requests */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  --bg: #0B0F17;
  --bg-2: #0E1320;
  --card: #121826;
  --card-hover: #161E2F;
  --border: #1F2937;
  --border-strong: #2B3648;
  --text: #E5E7EB;
  --muted: #9CA3AF;
  --dim: #6B7280;
  --accent: #22D3EE;
  --accent-2: #2DD4BF;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
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;
}
body::before {
  /* faint grid texture */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 700; margin-bottom: 2.5rem; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0 0 1rem; }
.mono { font-family: var(--mono); }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.label {
  font-family: var(--mono); font-size: 0.85rem; color: var(--accent);
  margin-bottom: 0.75rem; letter-spacing: 0.02em;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #031317; box-shadow: 0 8px 30px -8px rgba(34,211,238,.55); }
.btn--primary:hover { box-shadow: 0 12px 36px -8px rgba(34,211,238,.75); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); background: rgba(255,255,255,0.02); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 8px 16px; font-size: 0.875rem; }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(11, 15, 23, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav__inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; }
.logo span { color: var(--accent); }
.nav nav { margin-left: auto; }
.nav__links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 0.9rem; color: var(--muted); transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--accent); background: var(--accent-soft); }
.nav__toggle { display: none; }

/* Hero */
.hero { padding: 140px 0 64px; position: relative; overflow-x: clip; }
.hero__grid {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 64px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.85rem; color: var(--muted);
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(255,255,255,0.02); margin-bottom: 1.5rem;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(45,212,191,.6); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(45,212,191,.55); }
  70% { box-shadow: 0 0 0 10px rgba(45,212,191,0); }
  100% { box-shadow: 0 0 0 0 rgba(45,212,191,0); }
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 800; margin-bottom: 1rem; }
.hero__title { font-family: var(--mono); color: var(--accent); font-size: 1rem; margin-bottom: 1.25rem; }
.hero__tagline { font-size: 1.15rem; color: var(--muted); max-width: 34ch; margin-bottom: 2rem; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__photo { position: relative; justify-self: center; width: min(400px, 100%); }
.hero__photo::before {
  content: ""; position: absolute; inset: -18%;
  background: radial-gradient(circle, rgba(34,211,238,.28) 0%, rgba(45,212,191,.08) 40%, transparent 70%);
  filter: blur(20px); z-index: -1;
}
.photo-ring {
  border-radius: 28px; padding: 3px;
  background: linear-gradient(140deg, var(--accent), transparent 45%, var(--accent-2));
  transform: rotate(-2deg);
}
.photo-ring img {
  border-radius: 25px; aspect-ratio: 1; object-fit: cover; width: 100%; height: auto;
  transform: rotate(2deg); background: var(--card);
}
.photo-badge {
  /* sits under the photo, only overlapping the bottom frame edge */
  position: relative; margin: -16px auto 0;
  width: max-content; max-width: calc(100% - 24px);
  display: flex; flex-direction: column; align-items: center; gap: 0; text-align: center;
  padding: 10px 20px; border-radius: 14px;
  background: rgba(18, 24, 38, 0.88); border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.6);
  font-size: 0.85rem; color: var(--muted);
}
.photo-badge .mono { color: var(--accent); font-size: 0.75rem; }
.photo-badge strong { color: var(--text); font-size: 0.95rem; }

.stats {
  list-style: none; margin: 72px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18,24,38,.7), rgba(18,24,38,.35));
  overflow: hidden;
}
.stats li { padding: 24px 28px; border-right: 1px solid var(--border); }
.stats li:last-child { border-right: none; }
.stats strong { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.stats span { color: var(--muted); font-size: 0.9rem; }

/* Sections */
.section { padding: 96px 0; }

/* About */
.about__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: start; }
.about__text p { color: var(--muted); font-size: 1.05rem; }
.about__text p:first-child { color: var(--text); font-size: 1.2rem; }
.focus { display: grid; gap: 14px; }
.focus__item {
  display: flex; gap: 16px; padding: 20px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s;
}
.focus__item:hover { border-color: var(--border-strong); transform: translateX(4px); }
.focus__icon {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.focus__icon svg { width: 22px; height: 22px; }
.focus__item h3 { margin-bottom: 4px; }
.focus__item p { margin: 0; color: var(--muted); font-size: 0.925rem; line-height: 1.55; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.skill {
  padding: 22px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
  transition: border-color .25s, background .25s;
}
.skill:hover { border-color: rgba(34,211,238,.4); background: var(--card-hover); }
.skill h3 { font-size: 1rem; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.skill h3::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chip {
  font-size: 0.8rem; padding: 4px 10px; border-radius: 999px;
  color: #CBD5E1; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
}

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--border) 60%);
}
.tl { position: relative; padding-left: 44px; padding-bottom: 28px; }
.tl:last-child { padding-bottom: 0; }
.tl::before {
  content: ""; position: absolute; left: 0; top: 26px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border-strong);
}
.tl.is-current::before { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl__card {
  padding: 22px 24px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
}
.tl__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.tl__role { font-size: 1.15rem; font-weight: 600; }
.tl__company { color: var(--accent); font-weight: 500; }
.tl__period { font-family: var(--mono); font-size: 0.8rem; color: var(--dim); }
.tl__badge {
  font-family: var(--mono); font-size: 0.7rem; color: var(--accent-2);
  border: 1px solid rgba(45,212,191,.4); padding: 1px 8px; border-radius: 999px; margin-left: 8px;
}
.tl ul { margin: 14px 0 0; padding-left: 18px; color: var(--muted); }
.tl li { margin-bottom: 6px; }
.tl li::marker { color: var(--accent); }
.tl li.is-extra { display: none; }
.tl.is-open li.is-extra { display: list-item; }
.tl__more {
  margin-top: 8px; background: none; border: none; padding: 4px 0; cursor: pointer;
  color: var(--accent); font-family: var(--mono); font-size: 0.8rem;
}
.tl__more:hover { text-decoration: underline; }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project {
  position: relative; display: flex; flex-direction: column;
  padding: 28px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--border); overflow: hidden;
  transition: border-color .25s, transform .25s;
}
.project::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: .0; transition: opacity .25s;
}
.project:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.project:hover::after { opacity: 1; }
.project__domain { font-family: var(--mono); font-size: 0.78rem; color: var(--dim); margin-bottom: 8px; }
.project h3 { font-size: 1.35rem; margin-bottom: 12px; }
.roles { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.role {
  font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
}
.roles .arrow { color: var(--dim); font-size: 0.85rem; }
.project__summary { color: var(--text); }
.project ul { padding-left: 18px; color: var(--muted); margin: 0 0 20px; font-size: 0.95rem; }
.project li { margin-bottom: 6px; }
.project li::marker { color: var(--accent); }
.project .chips { margin-top: auto; }

/* Credentials */
.creds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cred {
  display: flex; gap: 16px; align-items: center;
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
}
.cred__icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,0.04); color: var(--muted);
}
.cred__icon svg { width: 22px; height: 22px; }
.cred h3 { font-size: 1rem; }
.cred p { margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; }
.cred.is-featured {
  border-color: rgba(34,211,238,.45);
  background: linear-gradient(135deg, rgba(34,211,238,.10), var(--card) 60%);
}
.cred.is-featured .cred__icon { background: var(--accent-soft); color: var(--accent); }

/* Contact */
.contact__card {
  text-align: center; padding: 64px 32px; border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(34,211,238,.16), transparent 60%),
    var(--card);
}
.contact__card h2 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 1rem; }
.contact__lead { color: var(--muted); max-width: 52ch; margin: 0 auto 2rem; font-size: 1.1rem; }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.contact__link {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-strong);
  font-weight: 500; transition: border-color .2s, color .2s, transform .2s;
}
.contact__link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.contact__link svg { width: 20px; height: 20px; flex: none; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--dim); font-size: 0.875rem; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; }
.footer__privacy { font-size: 0.8rem; }
@media (max-width: 820px) { .footer__privacy { order: 3; flex-basis: 100%; } }
.footer a:hover { color: var(--accent); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .hero__photo { order: -1; width: min(300px, 80%); }
  .hero__tagline { max-width: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(2) { border-right: none; }
  .stats li:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .about__grid { grid-template-columns: 1fr; gap: 32px; }
  .projects, .creds { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .nav__toggle {
    display: grid; place-content: center; gap: 6px; margin-left: 8px;
    width: 42px; height: 42px; border-radius: 10px;
    background: transparent; border: 1px solid var(--border-strong); cursor: pointer;
  }
  .nav__toggle span { display: block; width: 18px; height: 2px; background: var(--text); transition: transform .25s; }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav nav { margin-left: auto; }
  .nav__links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 12px 16px 20px;
    background: rgba(11,15,23,.97); border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px; font-size: 1rem; }
  .nav.menu-open { background: rgba(11,15,23,.97); }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .hero { padding-top: 108px; }
  .section { padding: 72px 0; }
  .stats li { padding: 18px; }
  .stats strong { font-size: 1.6rem; }
  .tl { padding-left: 32px; }
  .tl__card, .project { padding: 20px; }
  .contact__card { padding: 48px 20px; }
  .contact__link { width: 100%; justify-content: center; }
  .photo-badge { padding: 8px 14px; }
  .photo-badge strong { font-size: 0.875rem; }
}

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