/* =====================================================================
   PORTFOLIO — UNIFIED STYLESHEET (style.css)
   Shared styling for index.html and sql-project.html
   Theme: Dark, refined slate base with an electric-blue accent.
   Layout: CSS Grid + Flexbox, fully responsive.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   Change colors, fonts, and spacing here once to update both pages.
   --------------------------------------------------------------------- */
:root {
  /* Surfaces & background */
  --bg:            #0a0e16;   /* page background (deep slate) */
  --bg-soft:       #0f1623;   /* slightly raised background  */
  --surface:       #131c2b;   /* cards / panels              */
  --surface-2:     #18233650; /* translucent inner surface   */
  --border:        #25324a;   /* hairline borders            */
  --border-strong: #33425f;   /* hover / focus borders       */

  /* Typography colors */
  --text:          #e8eef7;   /* primary text                */
  --text-muted:    #93a1b8;   /* secondary text              */
  --text-faint:    #5d6b82;   /* captions, labels            */

  /* Accents */
  --accent:        #5b8def;   /* primary blue                */
  --accent-bright: #79a6ff;   /* lighter blue (hover)        */
  --accent-cyan:   #38d6c8;   /* secondary cyan              */
  --accent-glow:   rgba(91, 141, 239, 0.35);

  /* Syntax-highlight palette (SQL code blocks) */
  --code-keyword:  #79a6ff;
  --code-function: #38d6c8;
  --code-string:   #e0a98a;
  --code-number:   #c6a0f6;
  --code-comment:  #5d6b82;
  --code-punct:    #93a1b8;

  /* Typography */
  --font-display: "Sora", system-ui, sans-serif;
  --font-body:    "IBM Plex Sans", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* Shape & motion */
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --shadow:    0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 28px 60px -20px rgba(0, 0, 0, 0.8);
  --ease:      cubic-bezier(0.22, 1, 0.36, 1); /* smooth ease-out */

  /* Layout */
  --maxw: 1200px;
}

/* ---------------------------------------------------------------------
   2. RESET & BASE
   --------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;

  /* Atmospheric background: layered radial glows + a faint grid texture.
     This gives the dark theme depth instead of a flat solid color.      */
  background-image:
    radial-gradient(60% 50% at 15% 0%, rgba(91, 141, 239, 0.14), transparent 70%),
    radial-gradient(50% 45% at 90% 10%, rgba(56, 214, 200, 0.10), transparent 70%),
    linear-gradient(transparent 0, transparent 31px, rgba(255, 255, 255, 0.025) 32px),
    linear-gradient(90deg, transparent 0, transparent 31px, rgba(255, 255, 255, 0.025) 32px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  background-attachment: fixed;
}

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

/* Shared content wrapper to constrain line length and center the page. */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------------------------------------------------------------------
   3. TYPOGRAPHY HELPERS
   --------------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

/* =====================================================================
   4. HOME / LANDING PAGE (index.html)
   ===================================================================== */

/* Center the hero vertically in the viewport. */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 80px;
}

.hero__intro {
  max-width: 640px;
  /* Staggered entrance animation on page load. */
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s var(--ease) forwards;
}

.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  margin: 18px 0 16px;
}

.hero__title .accent,
.project__title .accent {
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 52ch;
}

/* ---- Navigation button grid (the centerpiece) ---------------------- */
.nav-grid {
  margin-top: 56px;
  display: grid;
  /* Auto-fit lets the grid grow gracefully as you add more buttons. */
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* Each navigation button is a full card-style link. */
.nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.45s var(--ease),
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease);

  /* Staggered load-in (delays set inline per card below). */
  opacity: 0;
  transform: translateY(24px);
  animation: rise 0.8s var(--ease) forwards;
}

/* Animated accent wash that fades in on hover. */
.nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 0% 0%, var(--accent-glow), transparent 55%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  z-index: -1;
}

.nav-btn:hover,
.nav-btn:focus-visible {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
  outline: none;
}

.nav-btn:hover::before,
.nav-btn:focus-visible::before {
  opacity: 1;
}

/* Top row of the button: index number + arrow. */
.nav-btn__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-btn__index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

.nav-btn__arrow {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--accent-bright);
  transition: transform 0.45s var(--ease), background 0.45s var(--ease), border-color 0.45s var(--ease);
}

.nav-btn:hover .nav-btn__arrow {
  transform: translate(4px, -4px);
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nav-btn__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.nav-btn__desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Small status tag inside a button (e.g. "SQL", "Soon"). */
.tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-2);
}

.tag--accent {
  color: var(--accent-bright);
  border-color: rgba(91, 141, 239, 0.4);
  background: rgba(91, 141, 239, 0.08);
}

/* Cyan tag variant */
.tag--cyan {
  color: var(--accent-cyan);
  border-color: rgba(56, 214, 200, 0.4);
  background: rgba(56, 214, 200, 0.07);
}

/* ---- Hero two-column layout (intro + profile card) ---------------- */
.hero__top {
  display: grid;
  grid-template-columns: 1fr 270px;
  align-items: center;
  gap: 40px;
}

/* Profile card — sits to the right of the headline */
.profile-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 32px 24px 26px;
  background: var(--surface);
  border: 1px solid rgba(56, 214, 200, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  animation:
    profile-card-in    0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both,
    profile-card-pulse 1.6s ease-in-out 1.5s 2;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease),
              box-shadow 0.45s var(--ease);
}

@keyframes profile-card-in {
  0%   { opacity: 0; transform: translateY(36px) scale(0.93); filter: blur(6px); }
  65%  { opacity: 1; transform: translateY(-4px) scale(1.015); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes profile-card-pulse {
  0%, 100% { border-color: rgba(56, 214, 200, 0.3); box-shadow: var(--shadow); }
  50%       { border-color: var(--accent-cyan); box-shadow: var(--shadow-lift), 0 0 40px rgba(56, 214, 200, 0.22); }
}

.profile-card:hover,
.profile-card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-lift), 0 0 0 1px rgba(56, 214, 200, 0.15);
  outline: none;
}

/* Animated background glow on hover */
.profile-card__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 130% at 50% 0%, rgba(56, 214, 200, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  z-index: -1;
}

.profile-card:hover .profile-card__glow {
  opacity: 1;
}

/* Round photo */
.profile-card__photo {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(56, 214, 200, 0.55);
  background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
  box-shadow: 0 0 0 4px rgba(56, 214, 200, 0.08);
  flex-shrink: 0;
}

.profile-card__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card__initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  z-index: 0;
}

.profile-card__photo img:not([style*="display:none"]) + .profile-card__initials {
  opacity: 0;
}

/* Card body text */
.profile-card__body { width: 100%; }

.profile-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.profile-card__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-card__role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.profile-card__tagline {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(110deg, var(--accent-bright), var(--accent-cyan));
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0a0e16;
  white-space: nowrap;
  max-width: 100%;
}

/* "View Resume" call-to-action row */
.profile-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  width: 100%;
  justify-content: center;
  transition: color 0.35s var(--ease);
}

.profile-card:hover .profile-card__cta {
  color: var(--accent-cyan);
}

/* Responsive: stack on smaller screens */
@media (max-width: 820px) {
  .hero__top {
    grid-template-columns: 1fr;
  }

  .profile-card {
    flex-direction: row;
    text-align: left;
    gap: 20px;
    padding: 22px 24px;
  }

  .profile-card__body { flex: 1; }

  .profile-card__cta {
    justify-content: flex-start;
    padding-top: 12px;
  }
}

@media (max-width: 480px) {
  .profile-card {
    flex-direction: column;
    text-align: center;
  }

  .profile-card__cta { justify-content: center; }
}

/* Disabled / "coming soon" buttons: visible but non-interactive. */
.nav-btn--soon {
  pointer-events: none;
  opacity: 0.55;
}

.nav-btn--soon .nav-btn__arrow {
  color: var(--text-faint);
}

/* =====================================================================
   5. RESUME PAGE (resume.html)
   ===================================================================== */

.resume-page { padding-block: 56px 96px; }

/* ---- Page header banner ------------------------------------------- */
.resume-banner {
  margin-top: 28px;
  padding: 36px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 32px;
  position: relative;
  overflow: hidden;
}

.resume-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(56, 214, 200, 0.1), transparent 60%),
    radial-gradient(40% 60% at 0% 100%, rgba(91, 141, 239, 0.08), transparent 60%);
  pointer-events: none;
}

/* Round photo in banner */
.resume-banner__photo {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(56, 214, 200, 0.5);
  background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
  box-shadow: 0 0 0 6px rgba(56, 214, 200, 0.08);
  flex-shrink: 0;
  z-index: 1;
}

.resume-banner__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resume-banner__initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.resume-banner__photo img:not([style*="display:none"]) + .resume-banner__initials {
  opacity: 0;
}

.resume-banner__info { z-index: 1; }

.resume-banner__name {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.1;
}

.resume-banner__role {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.resume-banner__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- KPI strip ---------------------------------------------------- */
.resume-kpi {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 14px;
  margin-top: 20px;
  align-items: stretch;
}

.resume-kpi__card {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.resume-kpi__card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.resume-kpi__value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.resume-kpi__label {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Dual-focus card: multi-line value */
.resume-kpi__card--focus {
  border-color: rgba(91, 141, 239, 0.25);
}

.resume-kpi__focus-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.resume-kpi__focus-line {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.4;
  text-align: center;
}

.resume-kpi__focus-plus {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  letter-spacing: 0.2em;
  padding: 5px 0;
  text-align: center;
}

/* ---- Banner info layout ------------------------------------------- */
.resume-banner__name {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.1;
}

.resume-banner__role {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
  margin: 0;
}

/* Thin separator between name block and meta row */
.resume-banner__divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Bottom row: location left, tagline right */
.resume-banner__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.resume-banner__loc {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.resume-banner__loc svg { color: var(--accent-cyan); flex-shrink: 0; }

/* Gradient capsule tagline */
.resume-banner__tagline {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 18px;
  border-radius: 999px;
  background: linear-gradient(110deg, var(--accent-bright), var(--accent-cyan));
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0a0e16;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .resume-kpi {
    grid-template-columns: 1fr 1fr;
  }
  .resume-kpi__card--focus {
    grid-column: 1 / -1;
  }
}

/* ---- Generic resume section --------------------------------------- */
.resume-section { margin-top: 48px; }

.resume-section__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.resume-section__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.resume-section__rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Summary card ------------------------------------------------- */
.summary-card {
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  width: 100%;
}

/* ---- Skill group cards -------------------------------------------- */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.skill-group-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.skill-group-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.skill-group-card__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-2);
}

.skill-tag--primary {
  color: var(--accent-bright);
  border-color: rgba(91, 141, 239, 0.4);
  background: rgba(91, 141, 239, 0.07);
}

.skill-tag--cyan {
  color: var(--accent-cyan);
  border-color: rgba(56, 214, 200, 0.35);
  background: rgba(56, 214, 200, 0.06);
}

/* ---- Experience: stacked cards with gap connectors ---------------- */

/* Plain flex column — no side line */
.exp-stack {
  display: flex;
  flex-direction: column;
}

/* Bridge element sits IN the gap between two cards */
.exp-bridge {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  padding-left: 22px; /* aligns node with card's left-border accent */
}

/* Vertical line above the node */
.exp-bridge::before {
  content: '';
  position: absolute;
  left: 25px;          /* node center: 22px + 4px (half of 8px node) - 0.75px */
  top: 0;
  height: calc(50% - 5px);
  width: 1.5px;
  background: linear-gradient(to bottom, transparent, var(--border));
}

/* Vertical line below the node */
.exp-bridge::after {
  content: '';
  position: absolute;
  left: 25px;
  bottom: 0;
  height: calc(50% - 5px);
  width: 1.5px;
  background: linear-gradient(to top, transparent, var(--border));
}

/* The connector node in the middle of the bridge */
.exp-bridge__node {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

/* Coloured nodes for different transitions */
.exp-bridge--cyan .exp-bridge__node {
  border-color: rgba(56, 214, 200, 0.55);
  background: rgba(56, 214, 200, 0.08);
  box-shadow: 0 0 8px rgba(56, 214, 200, 0.2);
}

.exp-bridge--blue .exp-bridge__node {
  border-color: rgba(91, 141, 239, 0.55);
  background: rgba(91, 141, 239, 0.08);
  box-shadow: 0 0 8px rgba(91, 141, 239, 0.2);
}

/* The flippable card */
.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  perspective: 1200px;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

/* Always-visible coloured left accent — subtle at rest, vivid on hover */
.exp-card--current {
  border-left: 3px solid rgba(56, 214, 200, 0.45);
}
.exp-card--data {
  border-left: 3px solid rgba(91, 141, 239, 0.45);
}
.exp-card--other {
  border-left: 3px solid rgba(51, 66, 95, 0.8);
}

/* Hover: brighten border + coloured side glow */
.exp-card--current:hover {
  border-left-color: var(--accent-cyan);
  box-shadow: var(--shadow-lift),
              -6px 0 32px rgba(56, 214, 200, 0.18),
              inset 0 0 40px rgba(56, 214, 200, 0.04);
}
.exp-card--data:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-lift),
              -6px 0 32px rgba(91, 141, 239, 0.18),
              inset 0 0 40px rgba(91, 141, 239, 0.04);
}
.exp-card--other:hover {
  border-left-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
}

/* Inner wrapper that actually rotates */
.exp-card__inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: var(--radius-lg);
}

.exp-card.is-flipped .exp-card__inner {
  transform: rotateY(180deg);
}

/* Both faces */
.exp-card__front,
.exp-card__back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: calc(var(--radius-lg) - 1px);
}

/* Front face — normal flow, sets the card height */
.exp-card__front {
  padding: 26px 28px;
}

/* Back face — absolute overlay, rotated 180° */
.exp-card__back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header inside each face */
.exp-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 4px;
}

.exp-card__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.exp-card__badge--current {
  color: var(--accent-cyan);
  background: rgba(56, 214, 200, 0.1);
  border: 1px solid rgba(56, 214, 200, 0.3);
}

.exp-card__badge--data {
  color: var(--accent-bright);
  background: rgba(91, 141, 239, 0.08);
  border: 1px solid rgba(91, 141, 239, 0.25);
}

.exp-card__badge--other {
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.exp-card__role {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.exp-card__company { font-size: 0.88rem; color: var(--accent-bright); }

.exp-card__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding-top: 2px;
}

.exp-card__bullets {
  list-style: none;
  padding: 16px 0 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.exp-card__bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 0.91rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.exp-card__bullets li::before {
  content: "›";
  position: absolute;
  left: 2px;
  top: -1px;
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

/* "View Achievements" trigger button */
.flip-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: rgba(91, 141, 239, 0.07);
  border: 1px solid rgba(91, 141, 239, 0.25);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.flip-trigger:hover {
  background: rgba(91, 141, 239, 0.15);
  border-color: var(--accent);
  color: #fff;
}

.flip-trigger--back {
  color: var(--text-faint);
  background: var(--surface-2);
  border-color: var(--border);
}

.flip-trigger--back:hover {
  background: var(--bg-soft);
  border-color: var(--border-strong);
  color: var(--text);
}

/* Back face content */
.exp-card__back-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.exp-card__back-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* Achievement bullets */
.achievements {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.achievements li {
  position: relative;
  padding-left: 22px;
  font-size: 0.91rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.achievements li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 3px;
  font-size: 0.6rem;
  color: var(--accent-cyan);
}

/* ---- Education cards ---------------------------------------------- */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edu-item {
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.edu-item:hover { border-color: var(--border-strong); transform: translateX(4px); }

.edu-item__title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.edu-item__sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.55;
}

.edu-item__link {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- CTA strip ---------------------------------------------------- */
.resume-cta {
  margin-top: 52px;
  padding: 32px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.resume-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 100% at 100% 50%, rgba(91, 141, 239, 0.1), transparent 60%);
  pointer-events: none;
}

.resume-cta__text h3 { font-size: 1.2rem; margin-bottom: 6px; }
.resume-cta__text p  { font-size: 0.92rem; color: var(--text-muted); }

.resume-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 500;
  color: #0a0e16;
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-cyan));
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 26px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), filter 0.35s var(--ease);
}

.cta-btn:hover, .cta-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -12px var(--accent-glow);
  filter: brightness(1.08);
  outline: none;
}

.cta-btn--ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}

.cta-btn--ghost:hover, .cta-btn--ghost:focus-visible {
  border-color: var(--border-strong);
  background: var(--bg-soft);
  filter: none;
  box-shadow: var(--shadow);
}

/* ---- Responsive: resume page -------------------------------------- */
@media (max-width: 640px) {
  .resume-banner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 28px 24px;
  }

  .resume-banner__photo { margin: 0 auto; width: 88px; height: 88px; }
  .resume-banner__tags  { justify-content: center; }

  .resume-cta { flex-direction: column; padding: 24px 20px; }
  .resume-cta__actions { width: 100%; flex-direction: column; }
  .cta-btn { justify-content: center; }
}

/* =====================================================================
   5b. CONTACT PAGE (contact.html)
   ===================================================================== */

.contact-page {
  padding-block: 56px 96px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(100% 100% at 0% 0%, var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: -1;
}

.contact-card:hover,
.contact-card:focus-within {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
}

.contact-card:hover::before { opacity: 1; }

.contact-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(91, 141, 239, 0.1);
  border: 1px solid rgba(91, 141, 239, 0.25);
  display: grid;
  place-items: center;
  color: var(--accent-bright);
}

.contact-card__icon--cyan {
  background: rgba(56, 214, 200, 0.08);
  border-color: rgba(56, 214, 200, 0.25);
  color: var(--accent-cyan);
}

.contact-card__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.contact-card__value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.contact-card__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-note {
  margin-top: 40px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(91, 141, 239, 0.04);
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 60ch;
}

/* =====================================================================
   5c. SQL PROJECT PAGE (sql-project.html)
   ===================================================================== */

.project {
  padding-block: 56px 96px;
}

/* Sticky-feeling top bar holding the "Back to Home" button. */
.topbar {
  padding-block: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---- Back to Home button ------------------------------------------- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition:
    transform 0.4s var(--ease),
    border-color 0.4s var(--ease),
    background 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.back-btn:hover,
.back-btn:focus-visible {
  transform: translateX(-4px);
  border-color: var(--border-strong);
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  outline: none;
}

.back-btn svg {
  transition: transform 0.4s var(--ease);
}

.back-btn:hover svg {
  transform: translateX(-3px);
}

/* Action variant — lifts up instead of sliding left, used for toolbar buttons */
.back-btn--action,
.back-btn--action:hover,
.back-btn--action:focus-visible {
  transform: translateY(-2px);
}

.back-btn--action:hover svg,
.back-btn--action:focus-visible svg {
  transform: none;
}

/* Primary accent pill (Run query) */
.back-btn--primary {
  color: var(--accent-bright);
  border-color: rgba(91, 141, 239, 0.45);
  background: rgba(91, 141, 239, 0.1);
}

.back-btn--primary:hover:not(:disabled),
.back-btn--primary:focus-visible:not(:disabled) {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.back-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* ---- Project header ------------------------------------------------ */
.project__header {
  margin-top: 18px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.project__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 16px 0 18px;
  max-width: 18ch;
}

/* Meta chips row (stack, role, date, etc.) */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.meta__item {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

/* ---- Generic content section -------------------------------------- */
.section {
  margin-top: 56px;
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.section__title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin-bottom: 18px;
}

.section p {
  color: var(--text-muted);
  max-width: 70ch;
  margin-bottom: 14px;
}

.section p strong {
  color: var(--text);
  font-weight: 600;
}

/* ---- SQL code block ------------------------------------------------ */
.code-block {
  margin-top: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Faux window header with traffic-light dots + a filename. */
.code-block__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.code-block__dots {
  display: flex;
  gap: 7px;
}

.code-block__dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
}

.code-block__dots span:nth-child(1) { background: #e06c75; }
.code-block__dots span:nth-child(2) { background: #e5c07b; }
.code-block__dots span:nth-child(3) { background: #98c379; }

.code-block__name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* Scrollable code area; keeps long lines readable on mobile. */
.code-block pre {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
  tab-size: 2;
}

.code-block code { font-family: inherit; }

/* Syntax-highlight token classes (applied via <span> in the HTML). */
.tok-kw   { color: var(--code-keyword); font-weight: 500; }
.tok-fn   { color: var(--code-function); }
.tok-str  { color: var(--code-string); }
.tok-num  { color: var(--code-number); }
.tok-com  { color: var(--code-comment); font-style: italic; }
.tok-punc { color: var(--code-punct); }

/* ---- Key insights grid -------------------------------------------- */
.insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.insight-card {
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

.insight-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.insight-card__stat {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.insight-card__text {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Bulleted takeaways list. */
.takeaways {
  list-style: none;
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.takeaways li {
  position: relative;
  padding-left: 30px;
  color: var(--text-muted);
  max-width: 70ch;
}

.takeaways li::before {
  content: "›";
  position: absolute;
  left: 6px;
  top: -1px;
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* =====================================================================
   6. FOOTER (shared)
   ===================================================================== */
.footer {
  margin-top: 80px;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* =====================================================================
   7. ANIMATIONS
   ===================================================================== */
@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero__intro,
  .nav-btn {
    opacity: 1;
    transform: none;
  }
}

/* =====================================================================
   8. RESPONSIVE TWEAKS
   ===================================================================== */
@media (max-width: 600px) {
  .container { padding-inline: 18px; }

  .nav-grid { margin-top: 40px; }

  .nav-btn { padding: 24px 22px; }

  .topbar { padding-block: 22px; }

  .code-block pre { font-size: 0.8rem; padding: 18px; }
}

/* =====================================================================
   9. INTERACTIVE SQL LAB (sql-project.html)
   Styling for the live, in-browser SQL query runner (SQL.js + Chinook).
   ===================================================================== */

.lab {
  margin-top: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Lab header bar (mirrors the code-block window style for consistency). */
.lab__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.lab__bar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}

.lab__bar-title .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.lab__body {
  padding: 22px 20px;
}

/* ---- Preset query buttons ----------------------------------------- */
.preset-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.preset-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  transition:
    transform 0.35s var(--ease),
    border-color 0.35s var(--ease),
    background 0.35s var(--ease),
    color 0.35s var(--ease);
}

.preset-btn:hover,
.preset-btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-soft);
  outline: none;
}

.preset-btn.is-active {
  border-color: rgba(91, 141, 239, 0.5);
  color: var(--accent-bright);
  background: rgba(91, 141, 239, 0.1);
  box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.15);
}

/* Question categories (sidebar) */
.q-category + .q-category {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.q-category__title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
  font-weight: 500;
}

.q-category__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q-category .preset-btn {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  line-height: 1.35;
}

/* Standardized SQL action buttons (matches back-btn / site pills) */
.sql-lab__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.sql-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition:
    transform 0.35s var(--ease),
    border-color 0.35s var(--ease),
    background 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    color 0.35s var(--ease);
}

.sql-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sql-btn:hover:not(:disabled),
.sql-btn:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  outline: none;
}

.sql-btn--primary {
  color: var(--accent-bright);
  border-color: rgba(91, 141, 239, 0.45);
  background: rgba(91, 141, 239, 0.1);
}

.sql-btn--primary:hover:not(:disabled),
.sql-btn--primary:focus-visible:not(:disabled) {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.sql-btn--compact {
  padding: 9px 16px;
  font-size: 0.78rem;
}

.sql-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---- Query editor -------------------------------------------------- */
.editor {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  tab-size: 2;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.editor:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.18);
}

.editor--large {
  flex: 1;
  min-height: 320px;
  width: 100%;
  resize: vertical;
  font-size: 0.92rem;
  line-height: 1.65;
  border-radius: var(--radius);
}

/* ---- Action row ---------------------------------------------------- */
.lab-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}

.run-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  color: #0a0e16;
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-cyan));
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), filter 0.35s var(--ease);
}

.run-btn:hover:not(:disabled),
.run-btn:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -12px var(--accent-glow);
  filter: brightness(1.06);
  outline: none;
}

.run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Secondary ghost button (e.g. Reset). */
.ghost-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease);
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  border-color: var(--border-strong);
  color: var(--text);
  outline: none;
}

/* ---- Status / loading text ---------------------------------------- */
.lab-status {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-left: auto;
}

.lab-status.is-busy { color: var(--accent-bright); }

/* Small spinner shown while the engine/db load. */
.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 7px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Manual file-picker fallback (if auto-load is blocked) --------- */
.picker {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.picker input { margin-top: 10px; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8rem; }

/* ---- Results area -------------------------------------------------- */
.result-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin: 22px 0 10px;
}

.result-wrap {
  overflow: auto;
  max-height: min(480px, 55vh);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.result-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: var(--bg-soft);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.result-table td {
  padding: 11px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

/* Right-align and mono-format numeric cells (added via JS). */
.result-table td.num {
  font-family: var(--font-mono);
  text-align: right;
  color: var(--text-muted);
}

.result-table tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
.result-table tr:hover td { background: rgba(91, 141, 239, 0.06); }

/* ---- Error message ------------------------------------------------- */
.lab-error {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(224, 108, 117, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(224, 108, 117, 0.08);
  color: #f0a8ad;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  white-space: pre-wrap;
}

/* Schema reference chips (helps visitors know what to query). */
.schema {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schema__chip {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 11px;
}

.schema__chip b { color: var(--text); font-weight: 600; }

/* ---- Responsive tweaks for the lab -------------------------------- */
@media (max-width: 600px) {
  .lab__body { padding: 18px 14px; }
  .lab-status { margin-left: 0; width: 100%; }
  .editor { font-size: 0.82rem; }
  .result-table th,
  .result-table td { padding: 9px 12px; }
}

/* =====================================================================
   10. SQL WORKBENCH v2 (sql-project.html)
   KPI strip, two-column workbench, schema browser, sortable grid,
   table/chart toggle.
   ===================================================================== */

/* ---- KPI summary strip --------------------------------------------- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.kpi-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}

.kpi-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }

.kpi-card__value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kpi-card__value.is-loading {
  background: none;
  color: var(--text-faint);
  font-size: 1.1rem;
}

.kpi-card__label {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---- SQL lab layout (stacked: workspace → schema → results) -------- */
.section--lab .section__lead {
  color: var(--text-muted);
  max-width: 65ch;
  margin-bottom: 8px;
}

.kbd-hint {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  vertical-align: middle;
}

.sql-lab {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 28px;
}

.sql-lab__workspace {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: 420px;
}

.sql-lab__questions,
.sql-lab__editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sql-lab__editor .panel__body--editor {
  flex: 1;
}

.panel__body--scroll {
  max-height: min(520px, 70vh);
  overflow-y: auto;
  padding-right: 12px;
}

.panel__body--editor {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 380px;
  gap: 16px;
}

.panel__body--results {
  min-height: 280px;
}

/* Legacy two-column (unused) */
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  margin-top: 24px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.panel__bar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
}

.panel__bar-title .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.panel__body { padding: 18px; }

/* ---- Small icon buttons (copy / download) -------------------------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.icon-btn:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn svg { width: 13px; height: 13px; }

/* ---- Segmented Table / Chart toggle -------------------------------- */
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.seg button {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.seg button.active { background: var(--accent); color: #0a0e16; font-weight: 500; }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Per-query insight panel --------------------------------------- */
.insight {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(91, 141, 239, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.insight__q {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 6px;
}

.insight__text { font-size: 0.92rem; color: var(--text); line-height: 1.6; }

/* ---- Schema explorer (grouped chips) ------------------------------- */
.panel__bar-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin: 0;
}

.schema-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px 24px;
}

.schema-group__title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.schema-group__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schema-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 108px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.35s var(--ease),
    border-color 0.35s var(--ease),
    background 0.35s var(--ease),
    color 0.35s var(--ease);
}

.schema-chip:hover,
.schema-chip:focus-visible {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  color: var(--accent-bright);
  background: rgba(91, 141, 239, 0.06);
  outline: none;
}

.schema-chip__name { font-weight: 500; }
.schema-chip__meta {
  font-size: 0.68rem;
  color: var(--text-faint);
}

/* ---- Results panel bar --------------------------------------------- */
.panel__bar--results {
  flex-wrap: wrap;
  gap: 12px 16px;
}

.panel__bar-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}

.panel__bar-tools .result-meta {
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.results-view {
  margin-top: 4px;
}

/* ---- Excel-like additions to the results table --------------------- */
.result-table th,
.result-table td { border-right: 1px solid var(--border); }
.result-table th:last-child,
.result-table td:last-child { border-right: none; }

.result-table th { cursor: pointer; user-select: none; }
.result-table th .arrow { opacity: 0.55; margin-left: 5px; font-size: 0.7rem; }

.result-table th.rownum,
.result-table td.rownum {
  width: 48px;
  text-align: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  background: var(--bg-soft);
  position: sticky;
  left: 0;
  cursor: default;
}

/* ---- Chart view ---------------------------------------------------- */
.chart-wrap {
  position: relative;
  height: min(400px, 45vh);
  min-height: 280px;
  padding: 16px 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.empty-note {
  padding: 44px 16px;
  text-align: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

/* ---- Dataset attribution ------------------------------------------- */
.attribution {
  margin-top: 16px;
  font-size: 0.86rem;
  color: var(--text-faint);
}

.attribution a { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; }

  .sql-lab__workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .panel__body--scroll {
    max-height: none;
  }

  .panel__body--editor {
    min-height: 280px;
  }

  .editor--large {
    min-height: 220px;
  }

  .panel__bar-tools {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .schema-groups {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    height: 300px;
    min-height: 240px;
  }
}

/* =====================================================================
   11. SQL PROJECT WORKBENCH (sql-project.html)
   Uses global :root tokens, nav-btn / back-btn / code-block patterns.
   ===================================================================== */

.project__header--compact {
  padding-bottom: 32px;
}

.project__header--compact .project__title {
  max-width: 22ch;
}

.project__deck {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 12px 0 24px;
  line-height: 1.65;
}

.project__header--compact .attribution {
  margin-top: 24px;
  margin-bottom: 0;
}

.section--tight {
  margin-top: 48px;
}

.sql-demo {
  --sql-ui-transition: all 0.2s ease;
}

.sql-demo .section__lead {
  color: var(--text-muted);
  max-width: 58ch;
  margin-bottom: 32px;
}

/* ---- Question tiles (full nav-btn tile style, 3-up grid) ----------- */
.sql-q-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

/* Re-uses nav-btn visuals exactly; .sql-q adds the active-state layer */
.sql-q {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 26px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.45s var(--ease),
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}

.sql-q::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 0% 0%, var(--accent-glow), transparent 55%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  z-index: -1;
}

.sql-q:hover,
.sql-q:focus-visible {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
  outline: none;
}

.sql-q:hover::before,
.sql-q:focus-visible::before {
  opacity: 1;
}

.sql-q:hover .sql-q__arrow,
.sql-q:focus-visible .sql-q__arrow {
  transform: translate(4px, -4px);
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sql-q.is-active {
  border-color: rgba(91, 141, 239, 0.5);
  box-shadow: var(--shadow-lift), 0 0 0 1px rgba(91, 141, 239, 0.2);
}

.sql-q.is-active .sql-q__arrow {
  transform: translate(4px, -4px);
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sql-q__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sql-q__arrow {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--accent-bright);
  flex-shrink: 0;
  transition: transform 0.45s var(--ease), background 0.45s var(--ease), border-color 0.45s var(--ease);
}

/* Card title and index must stay light on the dark surface */
.sql-q .nav-btn__title {
  color: var(--text);
  font-size: 1.15rem;
}

.sql-q .nav-btn__index {
  color: var(--text-faint);
}

/* ---- Workbench layout ----------------------------------------------- */
.sql-workbench {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sql-ide {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.sql-ide__bar {
  flex-wrap: wrap;
}

.sql-ide__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}

.sql-ide__meta .lab-status {
  margin: 0;
}

.sql-ide__hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.sql-ide__hint kbd {
  display: inline-block;
  margin: 0 2px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.sql-ide__editor {
  display: flex;
  width: 100%;
  background: var(--bg);
  box-shadow: inset 0 2px 16px rgba(0, 0, 0, 0.35);
}

.sql-ide__textarea {
  flex: 1;
  display: block;
  width: 100%;
  min-height: 600px;
  resize: vertical;
  margin: 0;
  padding: 22px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
  tab-size: 2;
  transition: var(--sql-ui-transition);
}

.sql-ide__textarea::selection {
  background: rgba(91, 141, 239, 0.35);
  color: var(--text);
}

.sql-ide__textarea:focus {
  outline: none;
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 0 3px rgba(91, 141, 239, 0.2),
    inset 0 0 28px rgba(91, 141, 239, 0.06);
}

/* Toolbar: site back-btn + SQL modifiers */
.sql-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.sql-demo .sql-action:hover,
.sql-demo .sql-action:focus-visible {
  transform: translateY(-2px);
}

.sql-demo .sql-action:hover svg,
.sql-demo .sql-action:focus-visible svg {
  transform: none;
}

.sql-action--primary {
  color: var(--accent-bright);
  border-color: rgba(91, 141, 239, 0.45);
  background: rgba(91, 141, 239, 0.1);
}

.sql-action--primary:hover:not(:disabled),
.sql-action--primary:focus-visible:not(:disabled) {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.sql-action--muted {
  color: var(--text-muted);
}

.sql-action--compact {
  padding: 10px 16px;
  font-size: 0.8rem;
}

.sql-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.sql-picker {
  margin-top: 0;
}

.sql-picker input[type="file"] {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Results (surface card, BI table) ------------------------------- */
.sql-results {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.sql-results__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.sql-results__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--text);
}

.sql-results__tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sql-results__tools .result-meta {
  margin: 0;
}

.sql-results .insight {
  margin-bottom: 24px;
}

.sql-table-wrap {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}

.sql-table-scroll {
  width: 100%;
  max-height: min(460px, 52vh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.sql-table {
  width: 100%;
  margin: 0 auto;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.875rem;
}

.sql-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Header: gradient background, centered, mono caps */
.sql-table th {
  padding: 13px 18px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--accent-bright);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border-bottom: 2px solid rgba(91, 141, 239, 0.25);
  white-space: normal;
  word-break: break-word;
  min-width: 80px;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.sql-table th:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(91, 141, 239, 0.12) 0%, var(--bg-soft) 100%);
}

/* All data cells: center by default */
.sql-table td {
  padding: 12px 18px;
  color: var(--text);
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  transition: background 0.15s ease;
}

/* Numeric cells: mono + tabular nums */
.sql-table td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--accent-bright);
}

.sql-table th.col-num {
  color: var(--accent-cyan);
}

/* Zebra striping */
.sql-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.018);
}

/* Row hover — full-row accent wash */
.sql-table tbody tr:hover td {
  background: rgba(91, 141, 239, 0.08);
  color: var(--text);
}

.sql-table tbody tr:hover td.num {
  color: var(--accent-cyan);
}

/* Row number column */
.sql-table th.rownum,
.sql-table td.rownum {
  width: 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  background: var(--bg);
  position: sticky;
  left: 0;
  z-index: 1;
  cursor: default;
}

.sql-table th .arrow {
  opacity: 0.55;
  margin-left: 4px;
  font-size: 0.65rem;
}

.sql-empty {
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
}

.sql-empty p {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
}

.sql-chart {
  min-height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

/* Schema reference (matches code-block / surface cards) */
.sql-schema {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--sql-ui-transition);
}

.sql-schema[open] {
  border-color: var(--border-strong);
}

.sql-schema__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 22px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  background: var(--bg-soft);
  transition: var(--sql-ui-transition);
}

.sql-schema__summary::-webkit-details-marker { display: none; }

.sql-schema__summary::after {
  content: "▾";
  color: var(--accent-bright);
  transition: transform 0.2s ease;
}

.sql-schema[open] .sql-schema__summary::after {
  transform: rotate(180deg);
}

.sql-schema__summary:hover {
  background: rgba(91, 141, 239, 0.06);
}

.sql-schema__hint {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.sql-schema__body {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
  .sql-q {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 14px;
    padding: 18px;
  }

  .sql-q__arrow {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .sql-q:hover,
  .sql-q:focus-visible {
    transform: translateY(-2px);
  }

  .sql-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .sql-action--primary {
    grid-column: 1 / -1;
  }

  .sql-ide__textarea {
    min-height: 260px;
    height: 260px;
    max-height: 260px;
    padding: 16px;
    font-size: 0.82rem;
  }

  .sql-results {
    padding: 18px;
  }

  .sql-results__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .sql-results__tools {
    width: 100%;
  }
}
