/* ==========================================================================
   Girish Maharana — portfolio
   Tokens → base → components → sections → motion
   Radius scale: panels 28 · cards 18 · controls 12 · pills 999
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --accent-light: #2748e6;
  --accent-dark: #7c96ff;

  --font: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-panel: 28px;
  --r-card: 18px;
  --r-ctl: 12px;
  --container: 1180px;
  --gutter: clamp(20px, 5vw, 40px);
  --header-h: 68px;
  --section-y: clamp(72px, 10vw, 128px);

  --bg: #f5f6fb;
  --bg-alt: #eceef8;
  --surface: #ffffff;
  --surface-2: #f1f3fb;
  --line: rgba(16, 22, 43, 0.1);
  --line-strong: rgba(16, 22, 43, 0.2);
  --text: #10162b;
  --muted: #535c7a;
  --accent: var(--accent-light);
  --on-accent: #ffffff;
  --spark: #a86200;
  --coffee: #ffbf3f;
  --ok: #0b7a55;
  --danger: #c0264a;
  --glass: rgba(245, 246, 251, 0.8);
  --shadow-card: 0 1px 2px rgba(16, 22, 43, 0.05), 0 8px 24px -12px rgba(22, 34, 90, 0.14);
  --shadow-pop: 0 30px 70px -28px rgba(22, 34, 90, 0.42);
  --grid-dot: rgba(16, 22, 43, 0.14);
  --inverse-bg: #0e1530;
  --inverse-text: #eef1fb;
  --inverse-muted: #a2abc9;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-alt: #0e1429;
  --surface: #131b35;
  --surface-2: #1a2342;
  --line: rgba(170, 185, 255, 0.13);
  --line-strong: rgba(170, 185, 255, 0.26);
  --text: #eef1fb;
  --muted: #a2abc9;
  --accent: var(--accent-dark);
  --on-accent: #0b1020;
  --spark: #f5b544;
  --ok: #4fd3a1;
  --danger: #ff7d9c;
  --glass: rgba(11, 16, 32, 0.74);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 30px -18px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 36px 80px -30px rgba(0, 0, 0, 0.8);
  --grid-dot: rgba(170, 185, 255, 0.16);
  --inverse-bg: #131b35;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  /* no-JavaScript fallback: follow the system */
  :root:not([data-theme]) {
    --bg: #0b1020; --bg-alt: #0e1429; --surface: #131b35; --surface-2: #1a2342;
    --line: rgba(170, 185, 255, 0.13); --line-strong: rgba(170, 185, 255, 0.26);
    --text: #eef1fb; --muted: #a2abc9; --accent: var(--accent-dark); --on-accent: #0b1020;
    --spark: #f5b544; --ok: #4fd3a1; --danger: #ff7d9c; --glass: rgba(11, 16, 32, 0.74);
    --grid-dot: rgba(170, 185, 255, 0.16); --inverse-bg: #131b35;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, blockquote, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3 { font-stretch: 84%; letter-spacing: -0.022em; line-height: 1.05; text-wrap: balance; }
h2 { font-size: clamp(2rem, 3.4vw + 0.8rem, 3.25rem); font-weight: 680; }
h3 { font-size: 1.1875rem; font-weight: 640; line-height: 1.25; letter-spacing: -0.01em; font-stretch: 92%; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section-head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { margin-top: 16px; color: var(--muted); font-size: 1.125rem; max-width: 38rem; }

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 200; padding: 10px 16px;
  background: var(--accent); color: var(--on-accent); border-radius: var(--r-ctl); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.icon { flex: none; }

/* ---------- buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--r-ctl);
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 0.9375rem; }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.0625rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -12px var(--accent); }
.btn-primary:hover { box-shadow: 0 14px 28px -10px var(--accent); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-strong); background: transparent; color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.btn-coffee { background: var(--coffee); color: #2a1a00; box-shadow: 0 10px 24px -12px #c98a00; }
.btn-coffee:hover { transform: translateY(-1px); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: transparent; color: var(--text);
  text-decoration: none; transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none;
  color: var(--text); font-weight: 600; font-size: 0.9375rem; text-decoration: underline;
  text-decoration-color: var(--line-strong); text-underline-offset: 5px; text-decoration-thickness: 1.5px;
}
.link-btn:hover { text-decoration-color: var(--accent); color: var(--accent); }

.chip {
  min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; font-weight: 550; font-size: 0.9375rem; white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { border-color: var(--text); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600; line-height: 1;
}
.badge-featured { background: var(--coffee); color: #2a1a00; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list li {
  padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 0.8125rem; font-weight: 550; color: var(--muted);
}
.social-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  border-bottom: 1px solid transparent; transition: background-color 0.2s ease, border-color 0.2s ease;
}
.site-header.is-stuck, .site-header.is-open {
  background: var(--glass); border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 680; font-size: 1.0625rem; letter-spacing: -0.01em; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-size: 0.875rem; font-weight: 720; letter-spacing: 0;
}
.brand-logo { height: 36px; width: auto; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-desktop { display: flex; gap: 4px; margin-left: auto; }
.nav-desktop a {
  padding: 8px 12px; border-radius: 10px; text-decoration: none; font-size: 0.9688rem; font-weight: 520; color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-desktop a:hover, .nav-desktop a.is-current { color: var(--text); }
.nav-desktop a.is-current { background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle [data-theme-icon] { display: none; }
:root[data-theme-choice="light"] .theme-toggle [data-theme-icon="light"],
:root[data-theme-choice="dark"] .theme-toggle [data-theme-icon="dark"],
:root[data-theme-choice="system"] .theme-toggle [data-theme-icon="system"],
:root:not([data-theme-choice]) .theme-toggle [data-theme-icon="system"] { display: block; }
.menu-toggle { display: none; }
.menu-toggle-close { display: none; }
.site-header.is-open .menu-toggle-open { display: none; }
.site-header.is-open .menu-toggle-close { display: block; }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); overflow-y: auto;
  padding-block: 12px calc(32px + env(safe-area-inset-bottom, 0px));
}
.mobile-menu-inner { display: flex; flex-direction: column; }
.mobile-menu-inner > a:not(.btn) {
  display: flex; align-items: center; min-height: 60px; border-bottom: 1px solid var(--line);
  font-size: 1.625rem; font-weight: 640; font-stretch: 84%; letter-spacing: -0.02em; text-decoration: none;
}
.mobile-menu-inner .btn { margin-top: 28px; }
.mobile-menu-inner .social-row { margin-top: 24px; }

@media (max-width: 960px) {
  .nav-desktop, .header-cta { display: none; }
  .header-actions { margin-left: auto; }
  .menu-toggle { display: inline-grid; }
}
@media (min-width: 961px) { .mobile-menu { display: none !important; } }

/* ---------- hero ---------- */
.hero { position: relative; padding-top: calc(var(--header-h) + clamp(40px, 7vw, 88px)); padding-bottom: clamp(56px, 8vw, 104px); }
.hero-backdrop {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 78% 30%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 0) 0 0 / 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); gap: clamp(36px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.625rem, 4.6vw + 1rem, 4.5rem); font-weight: 720; font-stretch: 80%; letter-spacing: -0.03em; line-height: 0.98; }
.hero-lead { margin-top: 24px; max-width: 34rem; font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 24px; padding: 7px 14px 7px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font-size: 0.9063rem; font-weight: 550;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-pill.is-open .status-dot { background: #1fb97a; box-shadow: 0 0 0 4px rgba(31, 185, 122, 0.2); }
.hero-metrics { display: flex; flex-wrap: wrap; gap: 0; margin-top: 44px; }
.hero-metrics > div { padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--line-strong); }
.hero-metrics > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero-metrics dt { font-size: 1.75rem; font-weight: 700; font-stretch: 84%; letter-spacing: -0.02em; line-height: 1.1; }
.hero-metrics dd { font-size: 0.875rem; color: var(--muted); max-width: 9.5rem; line-height: 1.35; margin-top: 2px; }

/* build window (always dark: it is a code editor) */
.build { position: relative; min-width: 0; }
.build::before {
  content: ""; position: absolute; inset: 8% -4% -6% 6%; z-index: -1; border-radius: 40px;
  background: color-mix(in srgb, var(--accent) 45%, transparent); filter: blur(60px); opacity: 0.45;
}
.build-window {
  border-radius: 20px; overflow: hidden; background: #0e1530; color: #dfe5ff;
  border: 1px solid rgba(170, 185, 255, 0.2); box-shadow: var(--shadow-pop);
}
.build-bar { display: flex; align-items: center; gap: 4px; padding: 0 14px; height: 44px; background: #0a0f24; border-bottom: 1px solid rgba(170, 185, 255, 0.12); }
.build-dots { display: inline-flex; gap: 6px; margin-right: 12px; }
.build-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(170, 185, 255, 0.28); }
.build-tab { font-family: var(--mono); font-size: 0.75rem; padding: 6px 12px; border-radius: 8px; color: #dfe5ff; background: rgba(170, 185, 255, 0.1); }
.build-tab-preview { margin-left: auto; background: none; color: #8f9ac4; font-family: var(--font); font-size: 0.8125rem; font-weight: 550; }
.build-body { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.build-code {
  margin: 0; padding: 20px 6px 20px 18px; font-family: var(--mono); font-size: clamp(0.6875rem, 0.55vw + 0.45rem, 0.8125rem);
  line-height: 1.9; overflow: hidden; border-right: 1px solid rgba(170, 185, 255, 0.12);
}
.build-code code { font: inherit; display: flex; flex-direction: column; font-variant-ligatures: none; }
.ln { display: block; white-space: pre; }
.tk-v { color: #9db4ff; } .tk-k { color: #ff9ecb; } .tk-c { color: #7fe0c3; } .tk-f { color: #ffd479; } .tk-s { color: #b6e88a; } .tk-p { color: #7fe0c3; }

.build-preview { padding: 16px; background: #0a0f24; min-width: 0; }
.pv-chrome {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 28px; padding: 0 10px;
  border-radius: 10px 10px 0 0; background: #e8ebf7; color: #535c7a; font-size: 0.6875rem; font-weight: 550;
}
.pv-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-live { display: inline-flex; align-items: center; gap: 5px; color: #0b7a55; font-weight: 700; }
.pv-live i { width: 6px; height: 6px; border-radius: 50%; background: #1fb97a; }
.pv-page { display: grid; gap: 10px; padding: 12px; border-radius: 0 0 10px 10px; background: #ffffff; min-height: 196px; align-content: start; }
.pv-nav { display: flex; align-items: center; gap: 6px; }
.pv-nav b { width: 18px; height: 8px; border-radius: 3px; background: #10162b; margin-right: auto; }
.pv-nav span { width: 16px; height: 4px; border-radius: 2px; background: #c9cfe6; }
.pv-hero { position: relative; display: grid; gap: 7px; padding: 14px 12px; border-radius: 8px; border: 1.5px dashed #c9cfe6; overflow: hidden; }
.pv-fill { position: absolute; inset: -2px; background: linear-gradient(135deg, var(--accent-light), #6f86ff); }
.pv-line { position: relative; height: 7px; border-radius: 3px; background: #c9cfe6; }
.pv-fill ~ .pv-line { background: rgba(255, 255, 255, 0.9); }
.pv-line.w70 { width: 70%; } .pv-line.w45 { width: 45%; height: 5px; opacity: 0.75; }
.pv-btn { position: relative; width: 44px; height: 13px; margin-top: 3px; border-radius: 4px; background: #ffbf3f; }
.pv-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.pv-cards div { padding: 5px; border-radius: 6px; border: 1px solid #e2e6f4; }
.pv-cards i { display: block; aspect-ratio: 4 / 3; border-radius: 4px; background: #eceef8; }
.pv-cards span { display: block; height: 4px; width: 70%; margin-top: 5px; border-radius: 2px; background: #c9cfe6; }
.pv-checks { display: flex; flex-wrap: wrap; gap: 5px; }
.pv-checks li { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 999px; background: #e3f6ee; color: #0b6a4a; font-size: 0.625rem; font-weight: 650; }
.build-term {
  padding: 12px 18px; font-family: var(--mono); font-size: 0.75rem; background: #0a0f24; border-top: 1px solid rgba(170, 185, 255, 0.12);
  color: #8f9ac4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.build-term-out { color: #7fe0c3; margin-left: 12px; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .build { max-width: 620px; }
}
@media (max-width: 520px) {
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .hero-metrics > div { padding: 0 0 0 12px; margin: 0; border-right: 0; border-left: 1px solid var(--line-strong); }
  .hero-metrics dt { font-size: 1.5rem; }
  .hero-metrics dd { font-size: 0.8125rem; max-width: none; }
  .build-body { grid-template-columns: minmax(0, 1fr); }
  .build-code { border-right: 0; border-bottom: 1px solid rgba(170, 185, 255, 0.12); font-size: 0.75rem; padding: 16px; }
  .build-tab-preview { display: none; }
  .pv-page { min-height: 0; }
}

/* ---------- about ---------- */
.about { background: var(--bg-alt); }
.about-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.portrait { position: relative; position: sticky; top: calc(var(--header-h) + 24px); }
.portrait img, .portrait-ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-panel); }
.portrait-ph {
  display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.16) 1px, transparent 0) 0 0 / 22px 22px,
    var(--inverse-bg);
}
.portrait-ph span { font-size: clamp(5rem, 12vw, 9rem); font-weight: 760; font-stretch: 76%; letter-spacing: -0.05em; color: #fff; }
.portrait-card {
  position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  padding: 14px 18px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.portrait-card strong { font-weight: 660; }
.portrait-card span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.9375rem; }
.about-copy .section-head { margin-bottom: 24px; }
.about-name { font-size: 1.375rem; font-weight: 660; font-stretch: 90%; letter-spacing: -0.01em; }
.role-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.role-list li { padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; font-size: 0.9063rem; }
.about-bio { margin-top: 24px; font-size: clamp(1.1875rem, 0.8vw + 1rem, 1.4375rem); line-height: 1.45; letter-spacing: -0.008em; max-width: 40rem; }
.about-text { margin-top: 18px; color: var(--muted); max-width: 38rem; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 40px; }
.fact { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 16px 18px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.fact-icon { grid-row: span 2; margin-top: 3px; color: var(--accent); }
.fact dt { font-size: 0.875rem; color: var(--muted); }
.fact dd { font-size: 1.25rem; font-weight: 680; font-stretch: 88%; letter-spacing: -0.015em; line-height: 1.2; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .portrait { position: relative; top: 0; max-width: 420px; }
  .portrait img, .portrait-ph { aspect-ratio: 5 / 4; }
}

/* ---------- services ---------- */
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service-card {
  display: grid; gap: 18px; align-content: start; padding: 26px; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.service-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-2px); }
.service-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.service-card p { margin-top: 8px; color: var(--muted); font-size: 0.9688rem; line-height: 1.55; }
.service-card .service-price { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.9063rem; }
.service-price strong { color: var(--text); font-weight: 680; }
@media (max-width: 960px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .service-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .service-card { grid-template-columns: auto 1fr; gap: 16px; padding: 18px; }
  .service-card p { margin-top: 4px; }
}

/* ---------- skills ---------- */
.skills { background: var(--bg-alt); }
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.skill {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 12px; padding: 18px 20px;
  border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line);
}
.skill-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); color: var(--text); }
.skill-name { font-weight: 620; }
.skill-level { font-size: 0.9063rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.skill-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.skill-bar i { display: block; height: 100%; width: var(--level); border-radius: inherit; background: var(--accent); transform-origin: left; }
@media (max-width: 960px) { .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .skill-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; } .skill { padding: 14px 16px; } }

/* ---------- projects ---------- */
.projects-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; margin-bottom: clamp(28px, 4vw, 48px); }
.projects-head .section-head { margin-bottom: 0; }
.filter-bar { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding-bottom: 4px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.project-card {
  display: flex; flex-direction: column; border-radius: var(--r-card); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card);
}
.project-cover { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--surface-2); aspect-ratio: 16 / 10; overflow: hidden; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.project-cover:hover img { transform: scale(1.03); }
.project-cover:focus-visible { outline-offset: -3px; border-radius: var(--r-card) var(--r-card) 0 0; }
.project-cover .badge { position: absolute; top: 12px; left: 12px; }
.cover-ph {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; padding: 16px; text-align: left;
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--accent) 60%, transparent), transparent 65%),
    var(--inverse-bg);
  color: #fff;
}
.cover-ph-bar { display: flex; gap: 5px; justify-content: flex-end; }
.cover-ph-bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.cover-ph-title { align-self: end; font-size: clamp(1.375rem, 2.2vw, 2rem); font-weight: 700; font-stretch: 80%; letter-spacing: -0.02em; line-height: 1.05; max-width: 14ch; }
.cover-ph-lines { display: grid; gap: 5px; }
.cover-ph-lines i { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); }
.cover-ph-lines i:nth-child(1) { width: 62%; } .cover-ph-lines i:nth-child(2) { width: 44%; } .cover-ph-lines i:nth-child(3) { width: 28%; }
.project-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 20px; flex: 1; }
.project-body h3 { font-size: 1.3125rem; }
.project-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.875rem; color: var(--muted); }
.project-meta span { color: var(--accent); font-weight: 620; }
.project-summary { color: var(--muted); font-size: 0.9688rem; line-height: 1.55; }
.project-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: auto; padding-top: 8px; }
.project-empty { padding: 40px 0; color: var(--muted); }

@media (max-width: 680px) {
  /* phones: swipeable rail instead of a long stack */
  .project-rail-wrap { padding-inline: 0; }
  .project-grid {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    padding: 4px var(--gutter) 18px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .project-grid::-webkit-scrollbar { display: none; }
  .project-card { flex: 0 0 min(84vw, 340px); scroll-snap-align: start; }
  .project-empty { padding-inline: var(--gutter); }
}

.project-dialog {
  width: min(1000px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line-strong);
  border-radius: var(--r-panel); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); overflow: hidden;
}
.project-dialog::backdrop { background: rgba(6, 9, 20, 0.66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.project-dialog[open] { display: flex; animation: dialog-in 0.22s ease; }
.pd-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); width: 100%; overflow-y: auto; position: relative; }
.pd-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }
.pd-media { background: var(--surface-2); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-height: 240px; }
.pd-media img[data-pd-image] { width: 100%; border-radius: 14px; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-alt); }
.pd-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.pd-thumbs button { flex: 0 0 76px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: none; aspect-ratio: 16 / 10; }
.pd-thumbs button[aria-current="true"] { border-color: var(--accent); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-media.is-empty { display: none; }
.pd-media.is-empty + .pd-content { grid-column: 1 / -1; }
.pd-content { display: flex; flex-direction: column; gap: 14px; padding: 32px 30px 28px; }
.pd-content h3 { font-size: 1.75rem; font-weight: 700; font-stretch: 82%; letter-spacing: -0.022em; line-height: 1.08; padding-right: 44px; }
.pd-summary { font-size: 1.0625rem; }
.pd-description { color: var(--muted); font-size: 0.9688rem; white-space: pre-line; }
.pd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; padding: 14px 0; border-block: 1px solid var(--line); }
.pd-facts:empty { display: none; }
.pd-facts dt { font-size: 0.8125rem; color: var(--muted); }
.pd-facts dd { font-weight: 620; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@media (max-width: 760px) {
  .project-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .pd-inner { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .pd-content { padding: 24px var(--gutter) 32px; }
  .pd-actions .btn { flex: 1 1 100%; }
}

/* ---------- why ---------- */
.why { background: var(--bg-alt); }
.why-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border-radius: var(--r-panel); overflow: hidden;
  background: var(--line); border: 1px solid var(--line);
}
.why-item { padding: 30px 26px 32px; background: var(--surface); transition: background-color 0.2s ease; }
.why-item:hover { background: var(--surface-2); }
.why-icon { color: var(--accent); margin-bottom: 22px; }
.why-item p { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
@media (max-width: 1020px) { .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .why-grid { grid-template-columns: minmax(0, 1fr); border-radius: var(--r-card); }
  .why-item { display: grid; grid-template-columns: auto 1fr; gap: 0 16px; padding: 20px; }
  .why-icon { grid-row: span 2; margin: 2px 0 0; }
}

/* ---------- process ---------- */
.process-list { position: relative; display: grid; grid-template-columns: repeat(var(--steps, 6), minmax(0, 1fr)); gap: 0 20px; counter-reset: step; }
.process-list::before { content: ""; position: absolute; left: 0; right: 0; top: 78px; height: 1px; background: var(--line-strong); }
.process-step { position: relative; display: grid; align-content: start; }
.process-num {
  font-size: 2.75rem; font-weight: 740; font-stretch: 76%; letter-spacing: -0.03em; line-height: 1; height: 56px;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--muted) 55%, transparent);
}
.process-node {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 20px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--accent);
}
.process-step p { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
@media (max-width: 1100px) {
  .process-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
  .process-list::before { display: none; }
}
@media (max-width: 640px) {
  .process-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .process-step { grid-template-columns: 44px 1fr; gap: 0 18px; padding-bottom: 30px; }
  .process-step::before { content: ""; position: absolute; left: 21.5px; top: 44px; bottom: 0; width: 1px; background: var(--line-strong); }
  .process-step:last-child { padding-bottom: 0; }
  .process-step:last-child::before { display: none; }
  .process-num { grid-column: 2; grid-row: 1; font-size: 0.9375rem; height: auto; color: var(--muted); -webkit-text-stroke: 0; font-stretch: 100%; letter-spacing: 0.02em; font-weight: 600; margin-bottom: 2px; }
  .process-node { grid-column: 1; grid-row: 1 / span 3; margin: 0; }
  .process-step h3, .process-step p { grid-column: 2; }
}

/* ---------- stats ---------- */
.stats { padding-block: 0 var(--section-y); }
.stats-panel {
  padding: clamp(32px, 5vw, 60px); border-radius: var(--r-panel); background: var(--inverse-bg); color: var(--inverse-text);
  background-image: radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--accent-dark) 30%, transparent), transparent 60%);
  border: 1px solid var(--line);
}
.stats-panel h2 { font-size: 1.25rem; font-weight: 600; font-stretch: 95%; letter-spacing: -0.005em; color: var(--inverse-muted); margin-bottom: clamp(24px, 4vw, 40px); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px 24px; }
.stat { display: flex; flex-direction: column; }
.stat dd { order: -1; font-size: clamp(2.75rem, 5vw + 1rem, 4.5rem); font-weight: 740; font-stretch: 78%; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat dt { margin-top: 10px; font-weight: 620; font-size: 1.0625rem; }
.stat p { color: var(--inverse-muted); font-size: 0.9063rem; margin-top: 2px; }
@media (max-width: 480px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- testimonials ---------- */
.testimonials { padding-top: 0; }
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.testimonial { display: flex; flex-direction: column; gap: 16px; padding: 28px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.stars { display: flex; gap: 2px; color: var(--line-strong); }
.stars .is-on { color: var(--spark); fill: currentColor; }
.testimonial blockquote { font-size: 1.0625rem; line-height: 1.55; flex: 1; }
.testimonial footer { display: flex; align-items: center; gap: 12px; }
.testimonial footer img, .avatar-ph { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-ph { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 700; font-size: 0.9375rem; }
.testimonial footer span { display: grid; line-height: 1.3; }
.testimonial footer small { color: var(--muted); font-size: 0.875rem; }
@media (max-width: 680px) {
  .testimonial-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 16px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .testimonial-grid::-webkit-scrollbar { display: none; }
  .testimonial { flex: 0 0 min(86vw, 360px); scroll-snap-align: start; }
}

/* ---------- support ---------- */
.support { padding-top: 0; }
.support-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px clamp(32px, 6vw, 80px);
  padding: clamp(32px, 5vw, 60px); border-radius: var(--r-panel); border: 1px solid color-mix(in srgb, var(--coffee) 45%, var(--line));
  background: linear-gradient(120deg, color-mix(in srgb, var(--coffee) 16%, var(--surface)), var(--surface) 70%);
}
.support-copy h2 { font-size: clamp(1.875rem, 2.6vw + 1rem, 2.75rem); }
.support-copy p { margin: 16px 0 28px; color: var(--muted); max-width: 34rem; font-size: 1.0625rem; }
.cup { position: relative; width: 150px; height: 150px; margin-right: clamp(0px, 3vw, 40px); }
.cup-body { position: absolute; left: 22px; bottom: 26px; width: 88px; height: 72px; border-radius: 8px 8px 40px 40px; background: var(--text); overflow: hidden; }
.cup-coffee { position: absolute; inset: 8px 8px auto; height: 12px; border-radius: 6px; background: #6b3f16; }
.cup-handle { position: absolute; left: 104px; bottom: 50px; width: 30px; height: 36px; border: 8px solid var(--text); border-left: 0; border-radius: 0 18px 18px 0; }
.cup-saucer { position: absolute; left: 6px; bottom: 12px; width: 120px; height: 9px; border-radius: 999px; background: var(--coffee); }
.steam { position: absolute; left: 40px; top: 4px; display: flex; gap: 14px; }
.steam i { width: 6px; height: 34px; border-radius: 999px; background: linear-gradient(to top, var(--muted), transparent); opacity: 0.55; }
@media (max-width: 720px) {
  .support-panel { grid-template-columns: minmax(0, 1fr); }
  .cup { order: -1; width: 120px; height: 120px; transform: scale(0.8); transform-origin: left bottom; margin: 0; }
  .support-copy .btn { width: 100%; }
}

/* ---------- contact ---------- */
.contact { background: var(--bg-alt); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact-info .section-head { margin-bottom: 32px; }
.contact-list { display: grid; gap: 4px; margin-bottom: 28px; }
.contact-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.contact-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--accent); }
.contact-list li > span:last-child { display: grid; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.contact-list small { font-size: 0.8438rem; font-weight: 450; color: var(--muted); }
.contact-list a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.contact-list a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.contact-form { display: grid; gap: 18px; padding: clamp(22px, 3.5vw, 36px); border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; align-content: start; }
.field label { font-size: 0.9375rem; font-weight: 600; }
.optional { font-weight: 450; color: var(--muted); font-size: 0.8438rem; margin-left: 4px; }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong);
  background: var(--bg); font-size: 1rem; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.8; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field-error { font-size: 0.875rem; color: var(--danger); font-weight: 550; }
.field-error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: 14px 16px; border-radius: var(--r-ctl); font-weight: 600; font-size: 0.9688rem; }
.form-status.is-success { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.form-status.is-error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-loading { display: none; align-items: center; gap: 10px; }
.btn-label { display: inline-flex; align-items: center; gap: 10px; }
.btn.is-loading { pointer-events: none; opacity: 0.85; }
.btn.is-loading .btn-label { display: none; }
.btn.is-loading .btn-loading { display: inline-flex; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- footer ---------- */
.site-footer { padding: 56px 0 calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto; gap: 28px 56px; align-items: start; }
.footer-brand p { margin-top: 14px; color: var(--muted); max-width: 26rem; font-size: 0.9688rem; }
.footer-nav { display: grid; grid-template-columns: repeat(2, auto); gap: 4px 32px; }
.footer-nav a { padding: 5px 0; text-decoration: none; color: var(--muted); font-size: 0.9688rem; }
.footer-nav a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9063rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } .footer-nav { justify-content: start; } }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
@keyframes type-line { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes stage-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fill-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes steam { 0% { transform: translateY(6px) scaleY(0.8); opacity: 0; } 40% { opacity: 0.6; } 100% { transform: translateY(-10px) scaleY(1.1); opacity: 0; } }
@keyframes grow-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: no-preference) {
  /* The one orchestrated moment: code types out and the site assembles beside it. */
  .ln { animation: type-line 0.55s steps(26, end) both; }
  .l1 { animation-delay: 0.5s; } .l2 { animation-delay: 1s; } .l3 { animation-delay: 1.15s; } .l4 { animation-delay: 1.8s; }
  .l5 { animation-delay: 2.45s; } .l6 { animation-delay: 3.1s; } .l7 { animation-delay: 3.75s; }
  .st3, .st5, .st6 { animation: stage-in 0.45s ease both; }
  .st4, .st7 { animation: fill-in 0.5s ease both; }
  .st3 { animation-delay: 1.7s; } .st4 { animation-delay: 2.35s; } .st5 { animation-delay: 3s; } .st6 { animation-delay: 3.65s; } .st7 { animation-delay: 4.35s; }

  .steam i { animation: steam 2.8s ease-in-out infinite; }
  .steam i:nth-child(2) { animation-delay: 0.5s; } .steam i:nth-child(3) { animation-delay: 1s; }

  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
  .js [data-skills].is-visible .skill-bar i { animation: grow-bar 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media print {
  .site-header, .build, .hero-backdrop, .project-dialog, .contact-form, .support { display: none !important; }
  body { background: #fff; color: #000; }
}
