:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #ffffff;
  --panel-strong: #101820;
  --ink: #151719;
  --muted: #66707a;
  --line: #ded8cb;
  --teal: #006d77;
  --teal-soft: #d7efef;
  --coral: #e76f51;
  --amber: #f2b84b;
  --green: #2a9d8f;
  --shadow: 0 22px 60px rgba(36, 31, 25, 0.12);
  --radius: 8px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(246, 244, 239, 0.9);
  border-bottom: 1px solid rgba(222, 216, 203, 0.8);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; }

.nav {
  justify-self: center;
  display: flex;
  gap: 8px;
  padding: 4px;
  background: #fff8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.nav a, .mobile-nav a, .nav-cta, .button, .filter { border-radius: var(--radius); transition: background 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease; }
.nav a { padding: 8px 12px; color: var(--muted); font-weight: 700; font-size: 14px; }
.nav a:hover, .nav a:focus-visible { background: var(--panel-strong); color: #fff; }
.nav-cta, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-weight: 800;
}
.nav-cta:hover, .button:hover { transform: translateY(-1px); border-color: var(--ink); }
.button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.menu-button { display: none; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); min-height: 42px; padding: 8px 12px; font-weight: 800; }
.mobile-nav { display: none; position: sticky; top: 71px; z-index: 19; padding: 10px 18px 16px; background: rgba(246, 244, 239, 0.96); border-bottom: 1px solid var(--line); }
.mobile-nav.open { display: grid; gap: 8px; }
.mobile-nav a { padding: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; }

.section-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr); gap: clamp(28px, 5vw, 56px); align-items: center; min-height: calc(100vh - 72px); padding: 64px 0 42px; }
.eyebrow { margin: 0 0 10px; color: var(--teal); font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 830px; margin-bottom: 18px; font-size: clamp(42px, 7vw, 76px); line-height: 0.98; letter-spacing: 0; }
h2 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: 0; }
h3 { margin-bottom: 8px; font-size: 18px; }
.hero-text { max-width: 680px; color: var(--muted); font-size: 18px; }
.hero-actions, .contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.profile-panel { display: grid; gap: 16px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.profile-header { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.16); }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric-grid article, .proof-strip article, .skill-board article, .timeline article { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.metric-grid article { padding: 16px; }
.metric-grid strong { display: block; font-size: 28px; line-height: 1; }
.metric-grid span, .proof-strip span { color: var(--muted); font-size: 13px; font-weight: 700; }
.terminal-card { overflow: hidden; border-radius: var(--radius); background: #101820; color: #edf7f4; }
.terminal-bar { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 999px; background: var(--coral); }
.terminal-bar span:nth-child(2) { background: var(--amber); }
.terminal-bar span:nth-child(3) { background: var(--green); }
pre { margin: 0; padding: 16px; overflow: auto; font-family: "JetBrains Mono", monospace; font-size: 12px; line-height: 1.7; }

.proof-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 10px 0 70px; }
.proof-strip article { padding: 16px; }
.proof-strip strong { display: block; margin-top: 4px; font-size: 18px; }
.projects-section, .skills-section, .experience-section, .contact-section { padding: 64px 0; }
.section-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 24px; }
.section-heading p:not(.eyebrow) { max-width: 680px; color: var(--muted); }
.section-heading.compact { display: block; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--muted); font-weight: 850; }
.filter.active, .filter:hover { color: #fff; background: var(--panel-strong); border-color: var(--panel-strong); }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-card { display: flex; min-height: 520px; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(36, 31, 25, 0.08); }
.project-preview { position: relative; height: 190px; overflow: hidden; background: var(--teal-soft); border-bottom: 1px solid var(--line); }
.project-preview iframe { width: 1440px; height: 900px; border: 0; pointer-events: none; transform: scale(0.24); transform-origin: top left; }
.project-preview::after { content: ""; position: absolute; inset: 0; border: 10px solid rgba(255, 255, 255, 0.28); pointer-events: none; }
.project-body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 18px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 8px; border-radius: 999px; background: #f0ede5; color: #4f5961; font-size: 12px; font-weight: 800; }
.project-body p { color: var(--muted); }
.project-links { display: flex; gap: 8px; margin-top: auto; }
.project-links a { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); text-align: center; font-weight: 850; }
.project-links a:first-child { background: var(--teal); border-color: var(--teal); color: #fff; }

.skill-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skill-board article, .timeline article { padding: 20px; }
.skill-board p, .timeline p { color: var(--muted); }
.timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.timeline span { display: inline-block; margin-bottom: 10px; color: var(--teal); font-weight: 900; font-size: 13px; }
.contact-section { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding-bottom: 86px; }
.contact-links a { padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-weight: 850; }

@media (max-width: 1040px) {
  .hero, .contact-section { grid-template-columns: 1fr; }
  .project-grid, .skill-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 10px; padding: 12px 16px; }
  .nav, .nav-cta { display: none; }
  .menu-button { display: inline-flex; align-items: center; justify-content: center; }
  .brand small { display: none; }
  .hero { min-height: auto; padding-top: 42px; }
  .project-grid, .skill-board, .timeline, .proof-strip, .metric-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .filters { margin-top: 18px; }
  .project-card { min-height: auto; }
  .project-preview { height: 170px; }
}