/* ============ 1. DESIGN TOKENS ============
   Change colours here and the whole site follows. */
:root {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #182033;
  --border: #24304a;
  --text: #e7ebf3;
  --muted: #97a3ba;
  --accent: #5b8cff;      /* primary blue */
  --accent-2: #36d3a8;    /* success green for metrics */
  --accent-hover: #4677f0;
  --border-hover: #3a4a70;
  --nav-bg: rgba(11, 15, 23, .85);
  --tag-bg: rgba(91, 140, 255, .12);
  --ask-border: rgba(91, 140, 255, .45);
  --ask-bg: linear-gradient(135deg, rgba(91, 140, 255, .14), rgba(54, 211, 168, .06));
  --article-text: #c9d1e0;
  --radius: 14px;
  --max: 1120px;
  color-scheme: dark;
}

/* Light theme: set by js/site.js as <html data-theme="light"> */
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --border: #dbe1ec;
  --text: #0f1729;
  --muted: #536079;
  --accent: #2f5fe0;
  --accent-2: #0b8a69;
  --accent-hover: #244fc4;
  --border-hover: #aab6cf;
  --nav-bg: rgba(246, 247, 251, .85);
  --tag-bg: rgba(47, 95, 224, .1);
  --ask-border: rgba(47, 95, 224, .35);
  --ask-bg: linear-gradient(135deg, rgba(47, 95, 224, .08), rgba(11, 138, 105, .05));
  --article-text: #2b3548;
  color-scheme: light;
}
body { transition: background-color .25s, color .25s; }

/* ============ 2. BASE ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.section-title { font-size: clamp(28px, 4vw, 40px); margin-bottom: 16px; }
.section-lead { color: var(--muted); max-width: 640px; font-size: 18px; }

/* ============ 3. NAV ============ */
nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: "Fraunces", serif; font-size: 20px; font-weight: 600; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; font-size: 15px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.menu-btn, .theme-btn {
  display: none; background: none; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); width: 44px; height: 44px; font-size: 20px; cursor: pointer;
}
.theme-btn { display: inline-flex; align-items: center; justify-content: center; }
.menu-btn:hover, .theme-btn:hover { border-color: var(--muted); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .moon { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .moon { display: block; }

/* ============ 4. BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 500; font-size: 15px;
  border: 1px solid var(--border); transition: all .2s;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost:hover { border-color: var(--muted); }

/* ============ 5. HERO ============ */
.hero { padding: 120px 0 80px; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); max-width: 860px; margin-bottom: 24px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 20px; color: var(--muted); max-width: 640px; margin-bottom: 36px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ 6. METRICS STRIP ============ */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-top: 72px;
}
.metric { padding: 28px; border-right: 1px solid var(--border); }
.metric:last-child { border-right: none; }
.metric strong { display: block; font-family: "Fraunces", serif; font-size: 36px; color: var(--accent-2); }
.metric span { color: var(--muted); font-size: 14px; }

/* ============ 7. PROJECTS ============ */
.projects { display: grid; gap: 28px; margin-top: 56px; }
.project {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px;
  transition: border-color .2s;
}
.project:hover { border-color: var(--border-hover); }
.tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--tag-bg); color: var(--accent); margin-bottom: 14px;
}
.project h3 { font-size: 30px; margin-bottom: 6px; }
.project .sub { color: var(--muted); margin-bottom: 20px; }
.project dl { display: grid; gap: 14px; }
.project dt { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.project dd { font-size: 15px; }
.kpis { display: flex; gap: 24px; flex-wrap: wrap; margin: 22px 0; }
.kpis div strong { display: block; font-family: "Fraunces", serif; font-size: 26px; color: var(--accent-2); }
.kpis div span { font-size: 13px; color: var(--muted); }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.stack span {
  font-size: 13px; padding: 5px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.links { display: flex; gap: 10px; flex-wrap: wrap; }
.links .btn { padding: 9px 16px; font-size: 14px; }
.note { font-size: 12px; color: var(--muted); margin-top: 16px; }

/* Project screenshot: spans both columns, framed like a browser window */
.shot {
  grid-column: 1 / -1;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--surface-2);
}
.shot .bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.shot .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.shot img { display: block; width: 100%; height: auto; }

/* ============ 8. CAPABILITIES ============ */
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.cap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.cap h3 { font-size: 20px; margin-bottom: 10px; }
.cap p { color: var(--muted); font-size: 15px; }

/* ============ 8b. ABOUT ============ */
#about { padding: 88px 0 0; }
#about + .hero { padding-top: 88px; }
.about { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: center; }
.about img {
  width: 240px; height: 240px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border);
}
.about dl { display: grid; gap: 20px; margin-top: 28px; }
.about dt { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.about dd { color: var(--muted); font-size: 17px; }

/* ============ 9. TIMELINE ============ */
.timeline { margin-top: 48px; border-left: 2px solid var(--border); padding-left: 28px; display: grid; gap: 32px; }
.t-item { position: relative; }
.t-item::before {
  content: ""; position: absolute; left: -36px; top: 7px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.t-item time { font-size: 13px; color: var(--accent); font-weight: 600; }
.t-item h3 { font-size: 20px; margin: 4px 0; }
.t-item p { color: var(--muted); font-size: 15px; }

/* ============ 9b. BUILDING NEXT ============ */
.ask {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-top: 28px; padding: 32px; border-radius: var(--radius);
  border: 1px solid var(--ask-border);
  background: var(--ask-bg);
}
.ask h3 { font-size: 24px; margin-bottom: 6px; }
.ask p { color: var(--muted); }

/* ============ 9c. BLOG ============ */
.page-head { padding: 96px 0 24px; }
.page-head h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 16px; }
.posts { display: grid; gap: 20px; margin: 40px 0 96px; }
.post-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; transition: border-color .2s;
}
.post-card:hover { border-color: var(--border-hover); }
.post-card time, .post-meta { font-size: 13px; color: var(--accent); font-weight: 600; }
.post-card h2 { font-size: 24px; margin: 6px 0 8px; }
.post-card p { color: var(--muted); font-size: 15px; }
.empty { color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; }

.article { max-width: 720px; margin: 0 auto; padding: 88px 24px 96px; }
.article h1 { font-size: clamp(34px, 5vw, 48px); margin: 10px 0 18px; }
.article .lede { font-size: 20px; color: var(--muted); margin-bottom: 40px; }
.article h2 { font-size: 28px; margin: 44px 0 14px; }
.article h3 { font-size: 21px; margin: 32px 0 10px; }
.article p, .article li { font-size: 18px; color: var(--article-text); margin-bottom: 18px; }
.article ul, .article ol { padding-left: 24px; }
.article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article blockquote { border-left: 3px solid var(--accent); padding-left: 20px; color: var(--muted); margin: 24px 0; }
.article img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); margin: 12px 0 24px; }
.article pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; overflow-x: auto; font-size: 14px; margin-bottom: 24px;
}
.article code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.back { display: inline-block; color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.back:hover { color: var(--text); }

/* ============ 10. CONTACT + FOOTER ============ */
.contact {
  text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 72px 24px;
}
.contact p { color: var(--muted); max-width: 520px; margin: 0 auto 32px; font-size: 18px; }
.contact .hero-cta { justify-content: center; }
footer { padding: 40px 0; color: var(--muted); font-size: 14px; text-align: center; }

/* ============ 11. MOBILE ============ */
@media (max-width: 860px) {
  .menu-btn { display: inline-block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .nav-links a { padding: 14px 24px; border-top: 1px solid var(--border); }
  nav.open .nav-links { display: flex; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: none; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .project { grid-template-columns: 1fr; padding: 28px; gap: 24px; }
  .caps { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about img { width: 160px; height: 160px; }
  #about { padding-top: 56px; }
  #about + .hero { padding-top: 64px; }
  section { padding: 72px 0; }
  .nav-right { gap: 8px; }
  .nav-right .btn-primary { padding: 10px 14px; font-size: 14px; }
}
/* Very narrow phones: Contact is still in the menu, so drop the nav button to fit */
@media (max-width: 400px) {
  .nav-right .btn-primary { display: none; }
}
