/* ============================================================
   Natthawin Tamprasert — Portfolio
   Design system: Anthropic / Claude — warm editorial
   Cream canvas · coral accent · dark navy surfaces
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand */
  --primary:          #cc785c;
  --primary-active:   #a9583e;
  --primary-soft:     rgba(204,120,92,0.12);
  --accent-teal:      #5db8a6;
  --accent-amber:     #e8a55a;
  --success:          #5db872;

  /* Light theme (default) */
  --canvas:           #faf9f5;
  --surface-soft:     #f5f0e8;
  --surface-card:     #efe9de;
  --surface-strong:   #e8e0d2;
  --surface-dark:     #181715;
  --surface-dark-el:  #252320;
  --surface-dark-soft:#1f1e1b;

  --ink:              #141413;
  --body-strong:      #252523;
  --body:             #3d3d3a;
  --muted:            #6c6a64;
  --muted-soft:       #8e8b82;
  --on-primary:       #ffffff;
  --on-dark:          #faf9f5;
  --on-dark-soft:     #a09d96;

  --hairline:         #e6dfd8;
  --hairline-soft:    #ebe6df;

  /* Typography */
  --font-display: "Fraunces", "Tiempos Headline", "EB Garamond", Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 24px;
  --r-pill: 9999px;

  /* Spacing */
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-2xl: 48px;
  --s-section: 84px;

  --maxw: 1200px;
  --nav-h: 64px;

  --shadow-soft: 0 1px 3px rgba(20,20,19,0.06), 0 8px 24px rgba(20,20,19,0.05);
  --shadow-lift: 0 4px 12px rgba(20,20,19,0.08), 0 16px 40px rgba(20,20,19,0.10);
}

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  --canvas:           #14130f;
  --surface-soft:     #1b1a16;
  --surface-card:     #201e19;
  --surface-strong:   #262420;
  --surface-dark:     #0e0d0b;
  --surface-dark-el:  #1c1a16;
  --surface-dark-soft:#131210;

  --ink:              #f7f4ec;
  --body-strong:      #ece7db;
  --body:             #c9c4b6;
  --muted:            #9a9488;
  --muted-soft:       #7c766b;
  --on-primary:       #ffffff;
  --on-dark:          #f7f4ec;
  --on-dark-soft:     #9a9488;

  --hairline:         #2c2a24;
  --hairline-soft:    #242219;
  --primary-soft:     rgba(204,120,92,0.16);

  --shadow-soft: 0 1px 3px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lift: 0 4px 12px rgba(0,0,0,0.5), 0 16px 40px rgba(0,0,0,0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas:           #14130f;
    --surface-soft:     #1b1a16;
    --surface-card:     #201e19;
    --surface-strong:   #262420;
    --surface-dark:     #0e0d0b;
    --surface-dark-el:  #1c1a16;
    --surface-dark-soft:#131210;
    --ink:              #f7f4ec;
    --body-strong:      #ece7db;
    --body:             #c9c4b6;
    --muted:            #9a9488;
    --muted-soft:       #7c766b;
    --on-dark:          #f7f4ec;
    --on-dark-soft:     #9a9488;
    --hairline:         #2c2a24;
    --hairline-soft:    #242219;
    --primary-soft:     rgba(204,120,92,0.16);
    --shadow-soft: 0 1px 3px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.35);
    --shadow-lift: 0 4px 12px rgba(0,0,0,0.5), 0 16px 40px rgba(0,0,0,0.55);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--canvas);
  color: var(--body);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
::selection { background: var(--primary-soft); color: var(--primary-active); }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--s-section) 0; }
.section-tight { padding: 64px 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--primary);
  display: inline-block;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--ink);
  font-optical-sizing: auto;
}
.section-lead {
  font-size: 17px;
  color: var(--muted);
  max-width: 620px;
  margin-top: 16px;
}
.section-head { margin-bottom: 56px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-md);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-active); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
}
.btn-secondary:hover { border-color: var(--muted); background: var(--surface-soft); }
.btn svg { width: 18px; height: 18px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--hairline); }
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.brand .spike { width: 18px; height: 18px; color: var(--primary); flex: none; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--r-md);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-soft); }
.nav-right { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.3s ease;
}
.theme-toggle:hover { background: var(--surface-soft); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.nav-toggle { display: none; width: 40px; height: 40px; border-radius: var(--r-md); color: var(--ink); align-items: center; justify-content: center; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: calc(var(--nav-h) + 72px); padding-bottom: 80px; position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  top: -20%; right: -10%;
  width: 620px; height: 620px;
  background: radial-gradient(circle, var(--primary-soft) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  color: var(--body-strong);
  font-size: 13px; font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 26px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -2px;
  color: var(--ink);
  font-optical-sizing: auto;
}
.hero h1 .accent { color: var(--primary); font-style: italic; }
.hero-role {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--body-strong);
  margin-top: 22px;
  display: flex; flex-wrap: wrap; gap: 8px 14px;
}
.hero-role span { display: inline-flex; align-items: center; gap: 8px; }
.hero-role span::before { content: "·"; color: var(--primary); }
.hero-role span:first-child::before { display: none; }
.hero-desc { font-size: 17px; color: var(--body); margin-top: 24px; max-width: 520px; }
.hero-desc strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 34px; color: var(--muted); font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 16px; height: 16px; color: var(--primary); }

/* Hero image card */
.hero-visual { position: relative; }
.hero-photo {
  border-radius: var(--r-2xl);
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-lift);
  background: var(--surface-dark);
  aspect-ratio: 4 / 3.1;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.hero-float {
  position: absolute;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
}
.hero-float .big { font-family: var(--font-display); font-size: 26px; color: var(--ink); line-height: 1; }
.hero-float .lbl { font-size: 12px; color: var(--muted); line-height: 1.3; }
.hero-float.medal { bottom: 22px; left: -20px; }
.hero-float.medal .emoji { font-size: 26px; }
.hero-float.wins { top: 22px; right: -18px; }
.hero-float.wins .big { color: var(--primary); }

/* ---------- Marquee logos strip ---------- */
.trust {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 26px 0;
  background: var(--surface-soft);
}
.trust-inner { display: flex; align-items: center; gap: 14px 40px; flex-wrap: wrap; justify-content: center; }
.trust-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-soft); }
.trust-item { font-weight: 600; color: var(--muted); font-size: 15px; letter-spacing: 0.2px; }

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 30px 26px;
}
.stat-num { font-family: var(--font-display); font-size: 46px; line-height: 1; color: var(--ink); letter-spacing: -1.5px; }
.stat-num .unit { color: var(--primary); }
.stat-label { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.code-window {
  background: var(--surface-dark);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--surface-dark-el);
}
.code-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--surface-dark-el); }
.code-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.code-bar .dot.r { background: #ff5f57; } .code-bar .dot.y { background: #febc2e; } .code-bar .dot.g { background: #28c840; }
.code-bar .fname { margin-left: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--on-dark-soft); }
.code-body { padding: 24px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75; color: var(--on-dark); overflow-x: auto; }
.code-body .kw { color: #c586c0; } .code-body .cls { color: #4ec9b0; } .code-body .fn { color: #dcdcaa; }
.code-body .str { color: #ce9178; } .code-body .self { color: #9cdcfe; } .code-body .cm { color: #6a9955; }
.code-body .num { color: #b5cea8; }

.about-text .section-title { margin-bottom: 20px; }
.about-text p { font-size: 16.5px; color: var(--body); margin-bottom: 16px; }
.about-text p strong { color: var(--ink); font-weight: 600; }
.about-focus { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  color: var(--body-strong);
  font-size: 13px; font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--r-pill);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* ============================================================
   EXPERIENCE
   ============================================================ */
.exp-card {
  background: var(--surface-dark);
  color: var(--on-dark);
  border-radius: var(--r-2xl);
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
  border: 1px solid var(--surface-dark-el);
}
.exp-tag { display: inline-flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-amber); margin-bottom: 18px; }
.exp-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.12; letter-spacing: -0.6px; color: var(--on-dark); }
.exp-org { color: var(--on-dark-soft); margin-top: 8px; font-size: 15px; }
.exp-card p.exp-desc { color: #d7d2c6; margin-top: 20px; font-size: 15.5px; }
.exp-card p.exp-desc strong { color: #fff; }
.exp-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.exp-metrics > div { background: var(--surface-dark-soft); border: 1px solid var(--surface-dark-el); border-radius: var(--r-md); padding: 14px; }
.exp-metrics b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 28px; color: var(--on-dark); line-height: 1; letter-spacing: -0.5px; }
.exp-metrics small { font-family: var(--font-body); font-size: 14px; color: var(--primary); margin-left: 1px; }
.exp-metrics span { display: block; font-size: 12px; color: var(--on-dark-soft); margin-top: 7px; line-height: 1.3; }
.exp-impact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.exp-impact .pill { background: var(--surface-dark-el); color: var(--on-dark); font-size: 13px; padding: 8px 14px; border-radius: var(--r-pill); font-weight: 500; }
.exp-impact .pill.coral { background: var(--primary-soft); color: #f0b8a5; }

.pipeline { display: flex; flex-direction: column; gap: 10px; }
.pipe-step {
  background: var(--surface-dark-soft);
  border: 1px solid var(--surface-dark-el);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.pipe-step .n { font-family: var(--font-mono); font-size: 12px; color: var(--primary); border: 1px solid var(--primary); border-radius: 6px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; flex: none; }
.pipe-step .st-title { font-size: 14px; font-weight: 600; color: var(--on-dark); }
.pipe-step .st-tech { font-family: var(--font-mono); font-size: 11.5px; color: var(--on-dark-soft); margin-top: 2px; }
.exp-card { align-items: start; }
.exp-right { align-self: stretch; display: flex; flex-direction: column; }
.exp-right .pipeline { flex: 1; }
.exp-right .pipe-step { flex: 1; }
.exp-arch { margin-top: 28px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--surface-dark-el); background: #fff; cursor: zoom-in; }
.exp-arch img { width: 100%; }
.exp-arch-cap { text-align: center; font-size: 13px; color: var(--on-dark-soft); margin-top: 10px; }
:root[data-theme="dark"] .exp-card { background: var(--surface-card); border-color: var(--hairline); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .exp-card { background: var(--surface-card); border-color: var(--hairline); } }

/* ============================================================
   CASE STUDY CARD (Floodtir)
   ============================================================ */
.case-card {
  display: grid; grid-template-columns: 0.95fr 1.05fr;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-2xl);
  overflow: hidden;
}
.case-media { position: relative; cursor: zoom-in; min-height: 100%; background: var(--surface-dark); }
.case-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; transition: transform 0.45s ease; }
.case-media:hover img { transform: scale(1.03); }
.case-badge {
  position: absolute; left: 16px; top: 16px;
  background: var(--canvas); color: var(--ink);
  font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-soft);
}
.case-body { padding: 36px 40px; }
.case-org { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--primary); }
.case-body h3 { font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--ink); letter-spacing: -0.5px; line-height: 1.15; margin-top: 10px; }
.case-body h3 span { color: var(--muted); font-size: 0.7em; }
.case-lead { font-size: 15.5px; margin-top: 14px; }
.case-lead strong { color: var(--ink); font-weight: 600; }
.case-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.case-metrics > div { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 12px 14px; }
.case-metrics b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 26px; color: var(--ink); line-height: 1; letter-spacing: -0.5px; }
.case-metrics small { font-family: var(--font-body); font-size: 12px; color: var(--primary); }
.case-metrics span { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.3; }
.case-list { margin-top: 20px; display: flex; flex-direction: column; gap: 9px; }
.case-list li { font-size: 14px; padding-left: 20px; position: relative; line-height: 1.5; }
.case-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.case-list li strong { color: var(--ink); font-weight: 600; }
.case-more { margin-top: 22px; border-top: 1px solid var(--hairline); padding-top: 14px; }
.case-more summary {
  cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 500; color: var(--primary);
  display: inline-flex; align-items: center; gap: 8px;
}
.case-more summary::-webkit-details-marker { display: none; }
.case-more summary::after { content: "+"; font-family: var(--font-mono); font-size: 16px; line-height: 1; }
.case-more[open] summary::after { content: "−"; }
.case-more-body { margin-top: 16px; }
.case-steps { list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 6px; }
.case-steps li { counter-increment: st; font-size: 13.5px; display: flex; gap: 10px; align-items: baseline; }
.case-steps li::before { content: counter(st); font-family: var(--font-mono); font-size: 11px; color: var(--primary); border: 1px solid var(--primary); border-radius: 5px; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.case-steps b { color: var(--ink); font-weight: 600; }
.case-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.case-fig { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--hairline); background: #fff; cursor: zoom-in; aspect-ratio: 16 / 9; }
.case-fig img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.case-note { font-size: 13px; color: var(--muted); margin-top: 14px; }

/* Hackathon role line */
.hack-role { font-size: 13px; font-weight: 600; color: var(--primary); margin-top: 6px; }

/* ============================================================
   AI BUILDERS FEATURE
   ============================================================ */
.aib-card {
  display: grid; grid-template-columns: 340px 1fr;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-2xl);
  overflow: hidden;
  margin-bottom: 24px;
}
.aib-photo { position: relative; cursor: zoom-in; background: var(--surface-dark); }
.aib-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; transition: transform 0.45s ease; }
.aib-photo:hover img { transform: scale(1.03); }
.aib-body { padding: 36px 40px; }
.aib-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.aib-badge { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; background: var(--primary); color: var(--on-primary); padding: 5px 11px; border-radius: var(--r-pill); }
.aib-badge.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.aib-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--ink); letter-spacing: -0.5px; line-height: 1.15; }
.aib-sub { display: block; font-family: var(--font-body); font-size: 14px; letter-spacing: 0; color: var(--muted); margin-top: 6px; }
.aib-lead { font-size: 15.5px; margin-top: 14px; }
.aib-lead strong { color: var(--ink); font-weight: 600; }
.aib-acc { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; padding: 16px 18px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); }
.aa-row { display: grid; grid-template-columns: 170px 1fr 40px; gap: 14px; align-items: center; font-size: 12.5px; }
.aa-lbl { color: var(--muted); }
.aa-bar { height: 10px; background: var(--surface-strong); border-radius: var(--r-pill); overflow: hidden; }
.aa-bar span { display: block; height: 100%; background: var(--muted-soft); border-radius: inherit; }
.aa-bar span.up { background: var(--primary); }
.aa-val { font-family: var(--font-mono); color: var(--muted); text-align: right; }
.aa-val.up { color: var(--primary); font-weight: 500; }
.aib-list { margin-top: 20px; display: flex; flex-direction: column; gap: 9px; }
.aib-list li { font-size: 14px; padding-left: 20px; position: relative; line-height: 1.5; }
.aib-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.aib-list li strong { color: var(--ink); font-weight: 600; }
.aib-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hairline); }

/* ============================================================
   HACKATHONS
   ============================================================ */
.hack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.hack-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hack-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--primary) 40%, var(--hairline)); }
.hack-body { padding: 24px 28px 28px; }

/* Certificate thumbnail embedded at top of each card */
.hack-cert {
  display: block;
  position: relative;
  aspect-ratio: 16 / 8.4;
  overflow: hidden;
  background: var(--surface-strong);
  cursor: zoom-in;
  border-bottom: 1px solid var(--hairline);
}
.hack-cert img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform 0.45s ease; }
.hack-card:hover .hack-cert img { transform: scale(1.045); }
.zoom-hint {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(20,20,19,0.62); color: #fff;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.3px;
  padding: 5px 9px; border-radius: var(--r-pill);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.25s ease;
}
.zoom-hint svg { width: 12px; height: 12px; }
.hack-card:hover .zoom-hint { opacity: 1; }
.hack-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.medal-badge { font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.medal-badge .m { font-size: 22px; }
.rank-pill { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; padding: 5px 10px; border-radius: var(--r-pill); background: var(--surface-strong); color: var(--body-strong); white-space: nowrap; }
.rank-pill.gold { background: rgba(212,160,23,0.16); color: #a07d06; }
.rank-pill.silver { background: rgba(140,140,140,0.16); color: var(--muted); }
:root[data-theme="dark"] .rank-pill.gold { color: #e8c56a; }
.hack-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.2; letter-spacing: -0.3px; color: var(--ink); }
.hack-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.hack-card ul { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.hack-card li { font-size: 14px; color: var(--body); padding-left: 20px; position: relative; line-height: 1.5; }
.hack-card li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.hack-card li strong { color: var(--ink); font-weight: 600; }

.hack-sub { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-soft); margin: 20px 0 -4px; display: flex; align-items: center; gap: 12px; }
.hack-sub::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* Awards sub-heading (Programs / Moments) */
.awards-sub {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted-soft);
  display: flex; align-items: center; gap: 14px;
  margin: 48px 0 22px;
}
.awards-sub:first-of-type { margin-top: 8px; }
.awards-sub::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.awards-sub .n { color: var(--primary); }

/* ============================================================
   PROJECTS
   ============================================================ */
.proj-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.proj-grid > .proj-card { grid-column: span 2; }
.proj-grid > .proj-card:nth-child(4), .proj-grid > .proj-card:nth-child(5) { grid-column: span 3; }
.proj-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 26px;
  display: flex; flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  min-height: 260px;
}
.proj-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--primary) 40%, var(--hairline)); }
.proj-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.proj-icon { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.proj-lang { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.proj-lang .dot { width: 9px; height: 9px; border-radius: 50%; }
.proj-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 21px; letter-spacing: -0.3px; color: var(--ink); line-height: 1.2; }
.proj-card p { font-size: 14px; color: var(--body); margin-top: 10px; flex: 1; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.proj-tags span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--surface-soft); padding: 4px 9px; border-radius: var(--r-sm); }
.proj-foot { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hairline-soft); }
.proj-link { font-size: 13px; font-weight: 500; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; transition: gap 0.2s ease; }
.proj-link:hover { gap: 10px; }
.proj-link svg { width: 15px; height: 15px; }
.proj-star { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.proj-star svg { width: 14px; height: 14px; }

/* ============================================================
   TECH STACK
   ============================================================ */
.tech-wrap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.tech-group { background: var(--surface-card); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 26px 28px; }
.tech-group h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-tags span { font-size: 13.5px; font-weight: 500; color: var(--body-strong); background: var(--canvas); border: 1px solid var(--hairline); padding: 7px 13px; border-radius: var(--r-md); transition: transform 0.15s ease, border-color 0.2s ease; }
.tech-tags span:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--primary); }

/* ============================================================
   CERTIFICATES GALLERY
   ============================================================ */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gcard {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--surface-card);
  cursor: zoom-in;
  position: relative;
  aspect-ratio: 4 / 3;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gcard:hover { transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow-lift); }
.gcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gcard:hover img { transform: scale(1.05); }
.gcard .gcap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 14px 12px;
  background: linear-gradient(to top, rgba(20,20,19,0.88), transparent);
  color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.35;
}
.gcard.tall { aspect-ratio: 3 / 4; }
.gcard.wide { grid-column: span 2; aspect-ratio: 16 / 9; }

/* Masonry wall — keeps each image's natural aspect ratio */
.masonry { columns: 4; column-gap: 16px; }
.masonry .gcard {
  break-inside: avoid;
  margin: 0 0 16px;
  display: block;
  width: 100%;
  aspect-ratio: auto;
}
.masonry .gcard img { height: auto; }
@media (max-width: 1024px) { .masonry { columns: 3; } }
@media (max-width: 600px)  { .masonry { columns: 2; } }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,10,9,0.92);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: var(--r-md); box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.lightbox-cap { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #eae5d8; font-size: 14px; }
.lightbox-close { position: absolute; top: 22px; right: 26px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.1); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.1); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav.prev { left: 20px; } .lightbox-nav.next { right: 20px; }

/* ============================================================
   EDUCATION / TIMELINE
   ============================================================ */
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.edu-card { background: var(--surface-card); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 30px; display: flex; gap: 18px; }
.edu-icon { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 24px; flex: none; }
.edu-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 21px; color: var(--ink); letter-spacing: -0.3px; line-height: 1.2; }
.edu-card .deg { font-size: 14.5px; color: var(--body); margin-top: 8px; }
.edu-card .yr { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ============================================================
   CONTACT / CTA
   ============================================================ */
.cta-band {
  background: var(--primary);
  border-radius: var(--r-2xl);
  padding: 72px 56px;
  text-align: center;
  color: var(--on-primary);
  position: relative;
  overflow: hidden;
}
.cta-band::before, .cta-band::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.cta-band::before { width: 340px; height: 340px; top: -160px; left: -80px; }
.cta-band::after { width: 260px; height: 260px; bottom: -150px; right: -60px; }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 5vw, 44px); letter-spacing: -1px; line-height: 1.1; }
.cta-band p { font-size: 17px; opacity: 0.92; margin-top: 16px; max-width: 480px; margin-inline: auto; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.btn-on-coral { background: #fff; color: var(--primary-active); }
.btn-on-coral:hover { background: #f6ede9; }
.btn-coral-ghost { background: transparent; border: 1px solid rgba(255,255,255,0.5); color: #fff; }
.btn-coral-ghost:hover { background: rgba(255,255,255,0.12); }

/* ---------- Footer ---------- */
.footer { background: var(--surface-dark); color: var(--on-dark-soft); padding: 64px 0 32px; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; }
.footer-brand { max-width: 320px; }
.footer-brand .brand { color: var(--on-dark); margin-bottom: 14px; }
.footer-brand p { font-size: 14px; line-height: 1.6; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--on-dark); margin-bottom: 16px; }
.footer-col a { display: block; font-size: 14px; color: var(--on-dark-soft); padding: 5px 0; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--surface-dark-el); margin-top: 48px; padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted-soft); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Mobile menu sheet ---------- */
.mobile-sheet {
  position: fixed; inset: 0; z-index: 99;
  background: var(--canvas);
  padding: calc(var(--nav-h) + 24px) 24px 24px;
  display: none;
  flex-direction: column;
  gap: 4px;
}
.mobile-sheet.open { display: flex; }
.mobile-sheet a { font-family: var(--font-display); font-size: 28px; color: var(--ink); padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.mobile-sheet a:last-child { border-bottom: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  :root { --s-section: 72px; }
  .hero-grid { gap: 40px; }
  .exp-card { padding: 40px; gap: 32px; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 900px) {
  .case-card { grid-template-columns: 1fr; }
  .case-media { aspect-ratio: 16 / 9; }
  .aib-card { grid-template-columns: 1fr; }
  .aib-photo { aspect-ratio: 16 / 10; }
  .aib-photo img { object-position: center 40%; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 480px; margin: 12px auto 0; order: -1; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .exp-card { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hack-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid > .proj-card, .proj-grid > .proj-card:nth-child(4) { grid-column: span 1; }
  .proj-grid > .proj-card:nth-child(5) { grid-column: 1 / -1; }
  .tech-wrap { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; }
}

@media (max-width: 600px) {
  .container { padding: 0 18px; }
  :root { --s-section: 56px; }
  .hero { padding-top: calc(var(--nav-h) + 40px); }
  .hero h1 { letter-spacing: -1px; }
  .hero-float.medal { left: 8px; bottom: 12px; }
  .hero-float.wins { right: 8px; top: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 22px 18px; }
  .stat-num { font-size: 38px; }
  .proj-grid { grid-template-columns: 1fr; }
  .proj-grid > .proj-card:nth-child(5) { grid-column: auto; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gcard.wide { grid-column: span 2; }
  .cta-band { padding: 48px 24px; }
  .exp-card { padding: 28px 22px; }
  .exp-metrics { gap: 8px; }
  .exp-metrics > div { padding: 10px; }
  .exp-metrics b { font-size: 22px; }
  .section-head { margin-bottom: 40px; }
  .trust-inner { gap: 12px 24px; }
  .case-body { padding: 24px 20px; }
  .case-body h3 { font-size: 26px; }
  .case-metrics { gap: 8px; }
  .case-metrics > div { padding: 10px; }
  .case-metrics b { font-size: 21px; }
  .case-figs { grid-template-columns: 1fr; }
  .aib-body { padding: 24px 20px; }
  .aib-card h3 { font-size: 26px; }
  .aa-row { grid-template-columns: 1fr 44px; }
  .aa-bar { grid-column: 1 / -1; grid-row: 2; }
}

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