/* ===========================================================
   tgbagupta.com — design system
   =========================================================== */

/* ---------- [TOKENS] theme tokens — "Kotlin Sunrise, Editorial Cut" ----------
   Light is the base palette on :root. Dark is applied either by the
   system preference (prefers-color-scheme) or by an explicit
   data-theme="dark"/"light" attribute set via localStorage, which
   always wins over the media query. Both palettes are tuned on their
   own — no inversion filters, no pure #000/#fff.

   Every text-bearing color below has been contrast-checked against the
   surface it's actually used on (WCAG relative-luminance formula) and,
   where the "swatch" version of a brand color failed, a separate
   darker/brighter *-text-safe variant was derived instead of diluting
   the brand color itself. --accent-2 carries coral (text-safe shade);
   the brighter coral used for large fills/tags lives in --coral-swatch. */
:root {
  --bg: #fbf6ee;
  --bg-elevated: #f3ebdd;
  --bg-card: #fffdf9;
  --border: #eae1d0;
  --border-hover: #d9cbb0;
  --text: #1b1710;
  --text-dim: #5b5347;
  --text-faint: #6b6254;
  --accent: #2b4dff;
  --accent-2: #c43823;
  --coral-swatch: #ff5e4d;
  --violet: #6b3fe0;
  --magenta: #b5179e;
  --gradient-kotlin: linear-gradient(135deg, #7f52ff 0%, #c711e1 100%);
  --accent-soft: rgba(43, 77, 255, 0.08);
  --coral-soft: rgba(255, 94, 77, 0.1);
  --violet-soft: rgba(127, 82, 255, 0.1);
  --code-kw: #6b3fe0;
  --code-fn: #2b4dff;
  --code-str: #c43823;
  --code-com: #5b5347;
  --shadow: 0 24px 60px -28px rgba(40, 26, 10, 0.22);
  --header-bg: rgba(251, 246, 238, 0.86);
  --status-live-bg: rgba(46, 122, 76, 0.09);
  --status-live-color: #2e7a4c;
  --status-live-border: rgba(46, 122, 76, 0.28);
  --status-dev-bg: rgba(161, 91, 4, 0.09);
  --status-dev-color: #a15b04;
  --status-dev-border: rgba(161, 91, 4, 0.28);
  --grain-opacity: 0.05;
  /* cobalt is dark enough here for white text; coral/gradient swatches are
     lighter and need dark ink text — verified by luminance, not assumed */
  --on-accent: #fffdf9;
  --on-coral: #1b1710;
  --on-gradient: #fffdf9;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --max-w: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141118;
    --bg-elevated: #1c1820;
    --bg-card: #211c26;
    --border: #332c3b;
    --border-hover: #473d53;
    --text: #f3ede3;
    --text-dim: #b8afa0;
    --text-faint: #8c8172;
    --accent: #6c8cff;
    --accent-2: #ff8a72;
    --coral-swatch: #ff8a72;
    --violet: #9b7bff;
    --magenta: #e14fef;
    --gradient-kotlin: linear-gradient(135deg, #9b7bff 0%, #e14fef 100%);
    --accent-soft: rgba(108, 140, 255, 0.16);
    --coral-soft: rgba(255, 138, 114, 0.14);
    --violet-soft: rgba(155, 123, 255, 0.16);
    --code-kw: #9b7bff;
    --code-fn: #6c8cff;
    --code-str: #ff8a72;
    --code-com: #8c8172;
    --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
    --header-bg: rgba(20, 17, 24, 0.84);
    --status-live-bg: rgba(110, 231, 216, 0.12);
    --status-live-color: #6ee7d8;
    --status-live-border: rgba(110, 231, 216, 0.3);
    --status-dev-bg: rgba(255, 184, 108, 0.12);
    --status-dev-color: #ffb86c;
    --status-dev-border: rgba(255, 184, 108, 0.3);
    --grain-opacity: 0.06;
    /* dark mode's bright cobalt/coral/gradient swatches are light relative
       to the near-black page — they need dark ink text, not white */
    --on-accent: #141118;
    --on-coral: #141118;
    --on-gradient: #141118;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141118;
  --bg-elevated: #1c1820;
  --bg-card: #211c26;
  --border: #332c3b;
  --border-hover: #473d53;
  --text: #f3ede3;
  --text-dim: #b8afa0;
  --text-faint: #8c8172;
  --accent: #6c8cff;
  --accent-2: #ff8a72;
  --coral-swatch: #ff8a72;
  --violet: #9b7bff;
  --magenta: #e14fef;
  --gradient-kotlin: linear-gradient(135deg, #9b7bff 0%, #e14fef 100%);
  --accent-soft: rgba(108, 140, 255, 0.16);
  --coral-soft: rgba(255, 138, 114, 0.14);
  --violet-soft: rgba(155, 123, 255, 0.16);
  --code-kw: #9b7bff;
  --code-fn: #6c8cff;
  --code-str: #ff8a72;
  --code-com: #8c8172;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
  --header-bg: rgba(20, 17, 24, 0.84);
  --status-live-bg: rgba(110, 231, 216, 0.12);
  --status-live-color: #6ee7d8;
  --status-live-border: rgba(110, 231, 216, 0.3);
  --status-dev-bg: rgba(255, 184, 108, 0.12);
  --status-dev-color: #ffb86c;
  --status-dev-border: rgba(255, 184, 108, 0.3);
  --grain-opacity: 0.06;
  --on-accent: #141118;
  --on-coral: #141118;
  --on-gradient: #141118;
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@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; scroll-behavior: auto !important; }
}

body,
.site-header,
.card,
.project-card,
.contact-method,
.sidebar-card,
.hero-panel,
.cta-band,
.tag,
.status-badge,
.contact-form input,
.contact-form select,
.contact-form textarea,
.faq-item {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }
@media (max-width: 720px) { section { padding: 64px 0; } }

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 600;
  font-optical-sizing: auto;
}
h1 { font-size: clamp(2.6rem, 5.6vw, 4.4rem); font-weight: 560; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.3rem; font-weight: 600; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

.lede {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 640px;
}

.section-head { max-width: 700px; margin-bottom: 48px; }
.section-head p { color: var(--text-dim); margin-top: 12px; }

/* ---------- [ATOM] buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn[hidden] { display: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-coral { background: var(--coral-swatch); color: var(--on-coral); }
.btn-coral:hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-hover); background: var(--bg-elevated); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }

/* ---------- [ATOM] availability bar ---------- */
.availability-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: var(--status-live-bg);
  color: var(--status-live-color);
  border-bottom: 1px solid var(--status-live-border);
  font-size: 0.82rem;
  font-family: var(--mono);
  text-align: center;
}
.availability-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-live-color);
  flex-shrink: 0;
  animation: availabilityPulse 2s ease-in-out infinite;
}
@keyframes availabilityPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.availability-bar a { color: var(--status-live-color); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .availability-dot { animation: none; }
}
@media (max-width: 560px) {
  .availability-bar { font-size: 0.74rem; padding: 7px 12px; }
}

/* ---------- [ORGANISM] header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  transition: background-color 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-badge { height: 34px; width: 34px; border-radius: 8px; display: block; flex-shrink: 0; }
.logo-text {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  background: var(--gradient-kotlin);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Full lockup (icon + TGBAGUPTA + tagline) — real exported PNGs, each with
   its own baked background. Screen/multiply blend neutralizes that flat
   background against the surrounding surface instead of showing a box. */
.footer-logo-full { height: 64px; width: auto; display: block; margin-bottom: 14px; }
.footer-logo-full.for-dark { display: none; mix-blend-mode: screen; }
.footer-logo-full.for-light { display: block; mix-blend-mode: multiply; }
:root[data-theme="dark"] .footer-logo-full.for-dark { display: block; }
:root[data-theme="dark"] .footer-logo-full.for-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .footer-logo-full.for-dark { display: block; }
  :root:not([data-theme="light"]) .footer-logo-full.for-light { display: none; }
}

/* Icon strip has the same near-black baked background as the badge/lockup —
   screen blend against a fixed dark card neutralizes it regardless of the
   page's own light/dark theme. */
.icon-strip-band {
  background: #0f0d16;
  border-radius: var(--radius);
  padding: 32px 20px;
  overflow: hidden;
}
.icon-strip-band img { display: block; width: 100%; height: auto; mix-blend-mode: screen; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 0.94rem;
}
.nav-links a { color: var(--text-dim); transition: color 0.15s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 20px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- [ATOM] theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.25s ease;
}
.theme-toggle:hover { border-color: var(--border-hover); color: var(--text); }
.theme-toggle svg { display: block; }

/* ---------- [ATOM] header playground link ---------- */
.playground-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.playground-link:hover { border-color: var(--accent); color: var(--accent); }
.playground-link svg { display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
: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; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-cta .btn-ghost { display: none; }
  body.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 24px;
    gap: 20px;
  }
}

/* ---------- [ATOM] signature gradient blob ----------
   The Kotlin Sunrise motif: a soft violet→magenta mesh blob, echoing
   JetBrains' own Kotlin brand gradient. Reused across hero, section
   dividers, and footer as the site's one recurring "wow" element —
   pure CSS, no images or libraries. */
.gradient-blob {
  position: absolute;
  border-radius: 50%;
  background: var(--gradient-kotlin);
  filter: blur(90px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}
:root[data-theme="dark"] .gradient-blob { opacity: 0.5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gradient-blob { opacity: 0.5; }
}

/* ---------- [ATOM] grain overlay ----------
   Applied to specific decorative surfaces only (hero, cta bands, blob
   fields) — never as a page-wide veil over running text, so body copy
   contrast is never touched by it. */
.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  pointer-events: none;
  border-radius: inherit;
  z-index: 1;
}

/* ---------- [ORGANISM] hero ---------- */
.hero { padding: 110px 0 72px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; position: relative; z-index: 2; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: 20px; }
.hero h1 .accent {
  background: var(--gradient-kotlin);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-blob {
  top: -140px;
  right: -120px;
  width: 580px;
  height: 580px;
}
@media (max-width: 900px) {
  .hero-blob { width: 380px; height: 380px; top: -80px; right: -140px; }
}

.hero-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  font-family: var(--mono);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}
.hero-panel .dots { display: flex; gap: 6px; margin-bottom: 18px; }
.hero-panel .dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-hover); }
.hero-panel pre { white-space: pre-wrap; color: var(--text-dim); line-height: 1.7; }
.hero-panel .kw { color: var(--code-kw); }
.hero-panel .fn { color: var(--code-fn); }
.hero-panel .str { color: var(--code-str); }
.hero-panel .com { color: var(--code-com); }

/* ---------- [ORGANISM] stats bar ---------- */
.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
@media (max-width: 720px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-num {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--accent-2);
}
.stat-label { color: var(--text-dim); font-size: 0.85rem; margin-top: 6px; }

/* ---------- [MOLECULE] cards / grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 960px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-2);
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--text-dim); font-size: 0.94rem; flex-grow: 1; }
.card .card-link,
.project-card .card-link {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- [ATOM modifier] pillar color-coding ----------
   The palette carries information: coral = mobile, cobalt = the general
   full-stack/web work, violet-magenta = the AI/ML specialty. Applied as a
   small eyebrow tag + a tinted icon chip on each service card. */
.pillar-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.pillar-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pillar-tag.pillar-mobile { color: var(--accent-2); }
.pillar-tag.pillar-mobile::before { background: var(--accent-2); }
.pillar-tag.pillar-web { color: var(--accent); }
.pillar-tag.pillar-web::before { background: var(--accent); }
.pillar-tag.pillar-ai {
  background: var(--gradient-kotlin);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pillar-tag.pillar-ai::before { background: var(--gradient-kotlin); }

.card-icon.pillar-mobile { background: var(--coral-soft); color: var(--accent-2); }
.card-icon.pillar-web { background: var(--accent-soft); color: var(--accent); }
.card-icon.pillar-ai { background: var(--violet-soft); color: var(--violet); }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  margin: 0 6px 6px 0;
}

/* ---------- [MOLECULE] portfolio project-card ---------- */
.project-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.project-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.project-card.is-matched {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.project-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.project-head h3 { font-size: 1.35rem; }
.status-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-live { background: var(--status-live-bg); color: var(--status-live-color); border: 1px solid var(--status-live-border); }
.status-dev { background: var(--status-dev-bg); color: var(--status-dev-color); border: 1px solid var(--status-dev-border); }
.project-card p.desc { color: var(--text-dim); margin-bottom: 16px; }
.project-metrics { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.project-metrics div { font-family: var(--mono); font-size: 0.85rem; color: var(--accent-2); }
.project-metrics span { display: block; color: var(--text-faint); font-size: 0.72rem; margin-top: 2px; }

/* ---------- [ORGANISM] process list ---------- */
.process-list { counter-reset: step; display: grid; gap: 4px; }
.process-item {
  counter-increment: step;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.process-item:last-child { border-bottom: 1px solid var(--border); }
.process-item::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  color: var(--text-faint);
  font-size: 1.1rem;
  grid-column: 1;
  grid-row: 1 / 3;
  transition: color 0.2s ease;
}
.process-item:hover::before { color: var(--accent-2); }
.process-item h4 { grid-column: 2; grid-row: 1; margin-bottom: 6px; }
.process-item p { grid-column: 2; grid-row: 2; color: var(--text-dim); font-size: 0.94rem; }

/* ---------- [MOLECULE] CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px;
  text-align: center;
}
.cta-band h2 { margin-bottom: 14px; }
.cta-band p { color: var(--text-dim); max-width: 520px; margin: 0 auto; }
.cta-band .btn-row { justify-content: center; }
@media (max-width: 620px) { .cta-band { padding: 36px 24px; } }

/* ---------- [MOLECULE] app platform row (Web/Android/iOS/Desktop) ----------
   Reuses .status-badge for the "Coming this week" chips so it stays
   visually consistent with the in-dev badges used on project cards. */
.app-platform-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  margin-top: 32px;
}
.app-platform-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}
.app-platform-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- [ORGANISM] contact section ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-methods { display: grid; gap: 16px; margin-top: 28px; }
.contact-method {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: border-color 0.15s ease;
}
.contact-method:hover { border-color: var(--border-hover); }
.contact-method .icon { color: var(--accent-2); flex-shrink: 0; }
.contact-method .label { font-size: 0.78rem; color: var(--text-faint); font-family: var(--mono); }
.contact-method .value { font-weight: 600; }

form.contact-form { display: grid; gap: 16px; }
.contact-form label { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 6px; display: block; }
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form textarea { resize: vertical; min-height: 130px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.form-note { font-size: 0.8rem; color: var(--text-faint); margin-top: 4px; }

/* ---------- [ORGANISM] footer ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: auto;
}
.footer-blob {
  bottom: -180px;
  left: -140px;
  width: 420px;
  height: 420px;
  opacity: 0.22;
}
:root[data-theme="dark"] .footer-blob { opacity: 0.28; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .footer-blob { opacity: 0.28; }
}
.site-footer .container { position: relative; z-index: 2; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-grid ul { list-style: none; display: grid; gap: 10px; }
.footer-grid a { color: var(--text-dim); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--text); }
.newsletter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.newsletter-row h4 { font-size: 1rem; margin: 0; }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  min-width: 220px;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.newsletter-form input[type="email"]:focus { outline: none; border-color: var(--accent); }
.newsletter-status { width: 100%; margin: 0; font-size: 0.85rem; color: var(--status-live-color); }
.newsletter-status.is-error { color: var(--code-str); }
@media (max-width: 640px) {
  .newsletter-row { flex-direction: column; align-items: flex-start; }
  .newsletter-form { width: 100%; }
  .newsletter-form input[type="email"] { flex: 1; min-width: 0; }
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-faint);
  font-size: 0.82rem;
}
.footer-socials { display: flex; gap: 16px; }

/* ---------- [MOLECULE] breadcrumb + [ORGANISM] page hero ---------- */
.page-hero { position: relative; overflow: hidden; padding: 56px 0 40px; border-bottom: 1px solid var(--border); }
.page-hero .container { position: relative; z-index: 2; }
.page-hero-blob { top: -160px; right: -160px; width: 460px; height: 460px; opacity: 0.3; }
:root[data-theme="dark"] .page-hero-blob { opacity: 0.4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-hero-blob { opacity: 0.4; }
}
.breadcrumb { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent-2); }

/* eyebrow pillar coloring, for service-page heroes */
.eyebrow.pillar-mobile { color: var(--accent-2); }
.eyebrow.pillar-mobile::before { background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }
.eyebrow.pillar-web { color: var(--accent); }
.eyebrow.pillar-web::before { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.eyebrow.pillar-ai {
  background: var(--gradient-kotlin);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.eyebrow.pillar-ai::before { background: var(--gradient-kotlin); }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 96px;
}
.sidebar-card h4 { margin-bottom: 14px; font-size: 0.95rem; }
.sidebar-card ul { list-style: none; display: grid; gap: 10px; margin-bottom: 20px; }
.sidebar-card li { font-size: 0.9rem; color: var(--text-dim); padding-left: 18px; position: relative; }
.sidebar-card li::before { content: "→"; position: absolute; left: 0; color: var(--accent-2); }

.check-list { list-style: none; display: grid; gap: 14px; margin: 24px 0; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-dim); }
.check-list li::before {
  content: "✓";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.related-services { display: grid; gap: 10px; }
.related-services a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-dim);
}
.related-services a:hover { border-color: var(--border-hover); color: var(--text); }

/* ---------- [ORGANISM] FAQ (built from [MOLECULE] faq-item) ---------- */
.faq-list { display: grid; gap: 12px; max-width: 780px; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.faq-item:hover { border-color: var(--border-hover); }
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 22px 20px; color: var(--text-dim); font-size: 0.94rem; }

/* ---------- [UTILITY] scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- [ORGANISM] requirements wizard ---------- */
.wizard-progress { height: 4px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 36px; }
.wizard-progress-bar { height: 100%; width: 20%; background: var(--gradient-kotlin); transition: width 0.3s ease; }
.wizard-step-counter { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); margin-bottom: 10px; }
.wizard-step { display: none; }
.wizard-step.is-active { display: block; animation: wizard-fade 0.35s ease; }
@keyframes wizard-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wizard-step h3 { margin-bottom: 8px; }
.wizard-step .step-hint { color: var(--text-dim); margin-bottom: 24px; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 8px; }
.option-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-card label {
  display: block;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  font-size: 0.92rem;
  background: var(--bg-card);
}
.option-card label:hover { border-color: var(--border-hover); }
.option-card input:checked + label {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}
.option-card input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; }
.wizard-review dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin-top: 16px; }
.wizard-review dt { color: var(--text-faint); font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
.wizard-review dd {
  color: var(--text);
  font-size: 0.95rem;
  /* A long description with no natural spaces (or a pasted URL) would
     otherwise overflow this grid cell and push/squeeze the rest of the
     page's layout instead of wrapping. */
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.wizard-error { color: var(--code-str); font-size: 0.85rem; margin-top: 8px; display: none; }
.wizard-error.is-visible { display: block; }

/* ---------- [UTILITY] cursor-follow glow + magnetic buttons ----------
   The site's one restrained micro-interaction beyond scroll-reveal — no
   animation library, ~20 lines of vanilla JS (see js/main.js). Both
   degrade to a plain static hover on touch devices and under
   prefers-reduced-motion, never just "slower." */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--violet-soft), transparent 72%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: transform;
}
.cursor-glow.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce), (hover: none) {
  .cursor-glow { display: none; }
}

.magnetic { transition: transform 0.2s ease; }
@media (prefers-reduced-motion: reduce), (hover: none) {
  .magnetic { transition: none !important; transform: none !important; }
}

/* ---------- [UTILITY] image fallback placeholder ----------
   Swapped in by js/islands/image-fallback for any <img> whose file
   doesn't exist yet at /assets/images/... — drop the real file in later
   and it just loads normally, nothing else to change. */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-faint);
  min-height: 120px;
}

.project-thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 18px; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-thumb .img-placeholder { width: 100%; height: 100%; min-height: 0; border: none; background: var(--bg-elevated); }

.developer-photo { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; margin-bottom: 16px; }
.developer-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.developer-photo .img-placeholder { width: 100%; height: 100%; min-height: 0; border: none; background: var(--bg-elevated); border-radius: 50%; }

/* ---------- [PAGE] design playground ----------
   Live HTML/CSS/JS editor + iframe preview, click-to-tweak visual
   editing (inline-style patching, no fake execution for compiled
   stacks), and read-only reference snippets for Compose/ASP.NET/XML
   since those need a real compiler, not a browser. */
.playground-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 560px;
}
@media (max-width: 860px) {
  .playground-shell { grid-template-columns: 1fr; height: auto; }
  .playground-pane { height: 420px; }
}
.playground-pane { background: var(--bg-card); display: flex; flex-direction: column; height: 100%; min-height: 0; }
.playground-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-wrap: wrap;
}
.pg-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pg-tab {
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pg-tab:hover { color: var(--text); }
.pg-tab.is-active { background: var(--bg-card); border-color: var(--border); color: var(--accent); }
.pg-tab.is-ref::after { content: " (ref)"; opacity: 0.6; font-size: 0.68rem; }
.playground-editor {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  resize: none;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 14px;
  tab-size: 2;
}
.playground-editor:focus { outline: none; background: var(--bg-elevated); }
.playground-preview-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  background: #fff;
}
.pg-ref-note {
  font-size: 0.78rem;
  color: var(--text-faint);
  padding: 10px 14px;
  border-bottom: 1px dashed var(--border);
  background: var(--bg-elevated);
}
.pg-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.pg-btn {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pg-btn:hover { border-color: var(--border-hover); }
.pg-btn.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pg-select {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}
.pg-editpanel {
  position: fixed;
  z-index: 60;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  padding: 14px;
  width: 220px;
  display: none;
  font-size: 0.8rem;
}
.pg-editpanel.is-open { display: block; }
.pg-editpanel label { display: block; color: var(--text-faint); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 10px 0 4px; }
.pg-editpanel input[type="color"] { width: 100%; height: 30px; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.pg-editpanel input[type="range"] { width: 100%; }
.pg-editpanel-close { position: absolute; top: 8px; right: 10px; cursor: pointer; color: var(--text-faint); background: none; border: none; font-size: 1rem; }

/* ---------- [COMPONENT] device showcase ----------
   Animated device-mockup switcher: laptop lid opening, mobile power-on,
   desktop boot flicker, tablet slide-in. Switching devices swaps a
   fade + per-device entrance animation, never a hard cut. */
.device-tabs { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.device-tab {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.device-tab:hover { border-color: var(--border-hover); color: var(--text); }
.device-tab.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.device-stage {
  position: relative;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
  /* The mobile breakpoint below shrinks this stage with transform:scale,
     which changes paint only, not layout — without this, the laptop
     mockup's real (un-scaled) ~560-620px width still reserves that much
     horizontal space and overflows a narrow viewport, showing as extra
     blank space on the right and letting the page scroll sideways. */
  overflow: hidden;
}
.device-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.device-frame.is-active { opacity: 1; pointer-events: auto; }

.dm-screen-content {
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dm-screen-nav { height: 22px; background: var(--bg-elevated); display: flex; align-items: center; gap: 4px; padding: 0 10px; flex-shrink: 0; }
.dm-screen-nav span { width: 6px; height: 6px; border-radius: 50%; background: var(--border-hover); }
.dm-screen-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; }
.dm-screen-eyebrow { font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; color: var(--accent-2); text-transform: uppercase; }
.dm-screen-title { font-family: var(--display); font-weight: 600; color: var(--text); line-height: 1.15; }
.dm-screen-sub { color: var(--text-faint); font-size: 8px; max-width: 80%; line-height: 1.4; }
.dm-screen-btn { background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: 8px; font-weight: 600; padding: 6px 14px; margin-top: 4px; }

/* laptop */
.device-frame.laptop { width: 560px; }
.laptop-lid {
  width: 560px;
  height: 340px;
  background: #1b1710;
  border-radius: 12px 12px 4px 4px;
  padding: 10px;
  box-sizing: border-box;
  transform-origin: bottom center;
  box-shadow: var(--shadow);
}
.laptop-lid .dm-screen-content { border-radius: 4px; }
.laptop-base {
  width: 620px;
  height: 16px;
  background: #2a2420;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 0 0 10px 10px;
  clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
}
.dm-screen-title.laptop-title { font-size: 22px; }
@keyframes laptopOpen { from { transform: rotateX(-95deg); } to { transform: rotateX(0deg); } }
.device-frame.laptop.is-entering .laptop-lid { animation: laptopOpen 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* desktop */
.device-frame.desktop { width: 520px; }
.desktop-monitor {
  width: 520px;
  height: 320px;
  background: #1b1710;
  border-radius: 10px;
  padding: 12px;
  box-sizing: border-box;
  box-shadow: var(--shadow);
}
.desktop-monitor .dm-screen-content { border-radius: 3px; }
.desktop-stand { width: 70px; height: 36px; background: #2a2420; margin: 0 auto; clip-path: polygon(35% 0, 65% 0, 85% 100%, 15% 100%); }
.desktop-base { width: 160px; height: 8px; background: #332c22; margin: 0 auto; border-radius: 4px; }
.dm-screen-title.desktop-title { font-size: 20px; }
@keyframes desktopBoot { 0% { opacity: 0; } 12% { opacity: 1; } 22% { opacity: 0.1; } 34% { opacity: 1; } 44% { opacity: 0.15; } 60% { opacity: 1; } 100% { opacity: 1; } }
.device-frame.desktop.is-entering .desktop-monitor .dm-screen-content { animation: desktopBoot 0.9s steps(1, end); }

/* mobile */
.device-frame.mobile { width: 200px; }
.mobile-shell {
  width: 200px;
  height: 420px;
  background: #1b1710;
  border-radius: 30px;
  padding: 10px 8px;
  box-sizing: border-box;
  box-shadow: var(--shadow);
  position: relative;
}
.mobile-shell::before { content: ""; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 50px; height: 5px; border-radius: 3px; background: #332c22; z-index: 2; }
.mobile-shell .dm-screen-content { border-radius: 20px; }
.dm-screen-title.mobile-title { font-size: 15px; }
@keyframes mobilePower { 0% { opacity: 0; transform: scale(0.9); } 35% { opacity: 0.4; } 50% { opacity: 0; } 68% { opacity: 1; transform: scale(1.03); } 100% { opacity: 1; transform: scale(1); } }
.device-frame.mobile.is-entering .mobile-shell .dm-screen-content { animation: mobilePower 0.8s ease; }

/* tablet */
.device-frame.tablet { width: 340px; }
.tablet-shell {
  width: 340px;
  height: 440px;
  background: #1b1710;
  border-radius: 22px;
  padding: 16px 12px;
  box-sizing: border-box;
  box-shadow: var(--shadow);
}
.tablet-shell .dm-screen-content { border-radius: 8px; }
.dm-screen-title.tablet-title { font-size: 18px; }
@keyframes tabletSlide { from { transform: translateY(46px) rotate(-3deg); opacity: 0; } to { transform: translateY(0) rotate(0deg); opacity: 1; } }
.device-frame.tablet.is-entering .tablet-shell { animation: tabletSlide 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }

@media (max-width: 640px) {
  .device-stage { height: 380px; transform: scale(0.72); }
}

/* device chrome polish — camera dot + a soft highlight on the base bars,
   shared by the homepage showcase and the playground device shell */
.laptop-lid, .desktop-monitor, .pg-device-shell.laptop, .pg-device-shell.desktop {
  position: relative;
}
.laptop-lid::before, .pg-device-shell.laptop::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4a4236;
  z-index: 3;
}
.laptop-base, .desktop-base {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent);
}
.tablet-shell::after, .pg-device-shell.tablet::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: #4a4236;
  z-index: 3;
}

/* ---------- [COMPONENT] playground device stage ----------
   Reuses the exact same laptop/desktop/mobile/tablet chrome as the
   homepage device showcase — full device shapes, not a resized box.
   Only ONE live iframe exists (#pg-frame); it's never reparented
   (which would reload it), it's absolutely positioned over whichever
   device's screen cutout is active, with its coordinates recomputed
   and CSS-transitioned on every switch — so the code you're editing
   just visually moves into the new frame instead of reloading. */
.pg-device-tabs { justify-content: flex-start; gap: 6px; margin: 0; padding: 8px 14px 0; }
.pg-device-tabs .device-tab { padding: 5px 12px; font-size: 0.72rem; }
.pg-preview-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}
.pg-stage { position: relative; width: 100%; height: 100%; }
.pg-live-frame {
  position: absolute;
  border: none;
  background: #fff;
  z-index: 2;
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), top 0.5s cubic-bezier(0.4, 0, 0.2, 1), width 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.35s ease;
}
.pg-screen-slot { width: 100%; height: 100%; }
.laptop-lid .pg-screen-slot { border-radius: 4px; }
.desktop-monitor .pg-screen-slot { border-radius: 3px; }
.mobile-shell .pg-screen-slot { border-radius: 20px; }
.tablet-shell .pg-screen-slot { border-radius: 8px; }

/* scaled-down chrome sizes for the narrower playground preview pane —
   same shapes/keyframes as the homepage showcase, smaller footprint */
.pg-stage .device-frame.laptop { width: 340px; }
.pg-stage .laptop-lid { width: 340px; height: 210px; padding: 6px; }
.pg-stage .laptop-base { width: 372px; height: 10px; }
.pg-stage .device-frame.desktop { width: 320px; }
.pg-stage .desktop-monitor { width: 320px; height: 200px; padding: 8px; }
.pg-stage .desktop-stand { width: 44px; height: 22px; }
.pg-stage .desktop-base { width: 100px; height: 6px; }
.pg-stage .device-frame.mobile { width: 130px; }
.pg-stage .mobile-shell { width: 130px; height: 270px; padding: 7px 5px; border-radius: 20px; }
.pg-stage .device-frame.tablet { width: 220px; }
.pg-stage .tablet-shell { width: 220px; height: 290px; padding: 10px 7px; border-radius: 14px; }
.pg-stage .mobile-shell::before { width: 34px; height: 4px; top: 6px; }
.pg-stage .tablet-shell::after { width: 18px; height: 2px; bottom: 4px; }
.pg-stage .laptop-lid::before { top: 2px; width: 3px; height: 3px; }

/* ---------- [COMPONENT] blog post body ----------
   Rendered by the blog view's markdown-lite parser (headings, lists,
   tables, bold/italic) — see js/islands/blog/view.js. */
.blog-body { max-width: 760px; color: var(--text-dim); font-size: 1rem; line-height: 1.7; }
.blog-body p { margin-bottom: 20px; }
.blog-body h2 { color: var(--text); font-size: 1.5rem; margin: 40px 0 16px; }
.blog-body h3 { color: var(--text); font-size: 1.2rem; margin: 32px 0 12px; }
.blog-body h4 { color: var(--text); font-size: 1rem; margin: 24px 0 10px; text-transform: uppercase; letter-spacing: 0.03em; font-family: var(--mono); font-size: 0.82rem; }
.blog-body ul, .blog-body ol { margin: 0 0 20px; padding-left: 22px; display: grid; gap: 8px; }
.blog-body li { line-height: 1.6; }
.blog-body strong { color: var(--text); }
.blog-table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.blog-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.blog-table th, .blog-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.blog-table th { font-family: var(--mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); background: var(--bg-elevated); }
.blog-table tr:last-child td { border-bottom: none; }

.blog-byline { color: var(--text-faint); font-size: 0.88rem; margin-top: 10px; }
.blog-byline a { color: var(--text-dim); }
.blog-byline a:hover { color: var(--accent); }

.blog-author-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  max-width: 720px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.blog-author-card h4 { margin-bottom: 4px; }
.blog-author-card p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 10px; }
.blog-author-avatar { flex-shrink: 0; margin-bottom: 0; }
.blog-author-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.blog-author-links { display: flex; flex-wrap: wrap; gap: 16px; }
.blog-author-links a { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
@media (max-width: 480px) {
  .blog-author-card { flex-direction: column; align-items: center; text-align: center; }
}

/* ---------- [COMPONENT] blog comments ---------- */
.blog-comments { max-width: 720px; }
.blog-comments h3 { margin-bottom: 20px; }
.blog-comment-form { display: grid; gap: 12px; margin-bottom: 32px; }
.blog-comment-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.blog-comment-form input, .blog-comment-form textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.92rem;
  box-sizing: border-box;
}
.blog-comment-form input:focus, .blog-comment-form textarea:focus { outline: none; border-color: var(--accent); }
.blog-comment-status { font-size: 0.85rem; color: var(--status-live-color); }
.blog-comment-status.is-error { color: var(--code-str); }
.blog-comment-status.is-pending { color: var(--status-dev-color); }
.blog-comment-list { display: grid; gap: 16px; }
.blog-comment-item { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); }
.blog-comment-item .blog-comment-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.blog-comment-item .blog-comment-name { font-weight: 600; font-size: 0.9rem; }
.blog-comment-item .blog-comment-date { color: var(--text-faint); font-size: 0.78rem; font-family: var(--mono); }
.blog-comment-item p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.55; }
.blog-comment-empty { color: var(--text-faint); font-size: 0.9rem; }

/* ---------- [COMPONENT] site-wide review widget ---------- */
.review-summary { display: flex; align-items: baseline; gap: 10px; margin-bottom: 24px; }
.review-summary-standalone { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.review-summary-standalone .review-summary { margin-bottom: 0; justify-content: center; }
.review-summary-standalone .review-summary-score { font-size: 3.2rem; }
.review-summary-score { font-family: var(--display); font-size: 2.4rem; font-weight: 600; color: var(--text); }
.review-summary-score span { font-size: 1.1rem; color: var(--text-faint); font-family: var(--sans); font-weight: 400; }
.review-summary-count { color: var(--text-dim); font-size: 0.9rem; }
.review-form { display: grid; gap: 12px; margin-bottom: 32px; max-width: 560px; }
.review-form .form-row { display: grid; }
.review-form label { font-size: 0.85rem; color: var(--text-dim); }
.review-form input, .review-form textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.92rem;
  box-sizing: border-box;
}
.review-form input:focus, .review-form textarea:focus { outline: none; border-color: var(--accent); }
.review-scale { display: flex; gap: 6px; flex-wrap: wrap; }
.review-scale-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.review-scale-btn:hover { border-color: var(--border-hover); }
.review-scale-btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.review-status { font-size: 0.85rem; color: var(--status-live-color); }
.review-status.is-error { color: var(--code-str); }
.review-status.is-pending { color: var(--status-dev-color); }
.review-list { display: grid; gap: 14px; max-width: 700px; }
.review-item { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); }
.review-item-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.review-score { font-family: var(--mono); font-weight: 700; color: var(--accent); font-size: 0.95rem; }
.review-score span { color: var(--text-faint); font-weight: 400; }
.review-name { font-weight: 600; font-size: 0.9rem; }
.review-date { color: var(--text-faint); font-size: 0.78rem; font-family: var(--mono); margin-left: auto; }
.review-item p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.55; }
.review-empty { color: var(--text-faint); font-size: 0.9rem; }

/* ---------- [MOLECULE] learning videos ----------
   Video cards (YouTube-hosted, we only index metadata — see
   TGB_learning_videos.sql) + a lightbox modal player. Reuses .card-grid's
   spacing rhythm but needs its own thumbnail/play-badge/duration chrome. */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 960px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .video-grid { grid-template-columns: 1fr; } }

.video-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.video-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-play-badge {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.video-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.video-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.video-episode-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.video-title { font-weight: 600; font-size: 0.98rem; color: var(--text); line-height: 1.35; }
.video-desc { color: var(--text-dim); font-size: 0.86rem; line-height: 1.5; }

.learning-topic-group { margin-bottom: 40px; }
.learning-topic-group:last-child { margin-bottom: 0; }
.learning-topic-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.learning-topic-count { font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); font-weight: 400; }

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.video-modal.is-open { display: flex; }
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 6, 0.72);
}
.video-modal-body {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.video-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.video-modal-frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.video-modal-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-modal-title { margin-top: 14px; font-size: 1rem; color: var(--text); }

/* utility */
.mt-lg { margin-top: 48px; }
.text-center { text-align: center; }
