/* ====================================
   CHATREE KENGPIPAT — Portfolio v4
   Modern Grid · Blue/White · Inter
   ==================================== */

:root {
  /* Light mode - Blue/White */
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --text: #0f172a;
  --text-strong: #020617;
  --text-muted: #586379;
  --text-subtle: #5e6b7e; /* WCAG AA: ≥4.9:1 on all light surfaces (was #94a3b8) */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #3b82f6;
  --accent-light: #dbeafe;
  --accent-bg: #eff6ff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --success: #059669;
  --success-light: #d1fae5;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #1e2b3f;
  --surface-3: #334155;
  --text: #f1f5f9;
  --text-strong: #ffffff;
  --text-muted: #94a3b8;
  --text-subtle: #8b98ac; /* WCAG AA: ≥4.8:1 on all dark surfaces (was #64748b) */
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: #3b82f6;
  --accent-light: #1e3a8a;
  --accent-bg: #1e293b;
  --border: #334155;
  --border-strong: #475569;
  --success: #34d399;
  --success-light: #064e3b;
  --danger: #f87171;
  --warning: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============= TYPOGRAPHY ============= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  line-height: 1.2;
}

em {
  font-style: normal;
  color: var(--accent);
  font-weight: 700;
}

code, pre {
  font-family: 'JetBrains Mono', monospace;
}

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

/* ============= NAV ============= */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px) saturate(180%);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}

.nav-logo-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
  transform: rotate(45deg);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links a:hover { color: var(--accent); background: var(--accent-bg); }
.nav-links a.active { color: var(--accent); background: var(--accent-bg); }

/* Contact is the conversion quick-jump: a persistent CTA in the fixed nav. */
.nav-links a.nav-cta {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.nav-links a.nav-cta:hover,
.nav-links a.nav-cta.active { background: var(--accent-hover); color: #fff; }

/* ===== Projects dropdown (branched project menu, all pages) ===== */
.nav-dd { position: relative; }
.nav-dd-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}
.nav-dd:hover .nav-dd-btn,
.nav-dd:focus-within .nav-dd-btn { color: var(--accent); background: var(--accent-bg); }
.nav-dd-caret { font-size: 0.6em; transition: transform 0.25s var(--ease-smooth); }
.nav-dd:hover .nav-dd-caret,
.nav-dd:focus-within .nav-dd-caret { transform: rotate(180deg); }
.nav-dd-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 340px;
  max-width: 90vw;
  /* Cap to the viewport and scroll inside — the menu now has enough
     groups to run past the bottom of the screen. */
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s var(--ease-smooth), transform 0.2s var(--ease-smooth), visibility 0.2s;
  z-index: 210;
}
/* Thin, unobtrusive scrollbar for the dropdown */
.nav-dd-panel::-webkit-scrollbar { width: 8px; }
.nav-dd-panel::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.nav-dd-panel { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.nav-dd:hover .nav-dd-panel,
.nav-dd:focus-within .nav-dd-panel { opacity: 1; visibility: visible; transform: none; }
.nav-dd-group { padding: 0.25rem 0; }
.nav-dd-group + .nav-dd-group { border-top: 1px solid var(--border); margin-top: 0.2rem; padding-top: 0.45rem; }
.nav-dd-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 0.15rem 0.7rem 0.3rem;
}
.nav-dd-panel a {
  display: block;
  padding: 0.42rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
}
.nav-dd-panel a:hover { background: var(--accent-bg); color: var(--accent); }
@media (max-width: 768px) {
  .nav-dd { width: 100%; }
  .nav-dd-btn { width: 100%; justify-content: space-between; font-size: 0.98rem; padding: 0.8rem 0.85rem; }
  .nav-dd-panel {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; box-shadow: none; border: 0; background: transparent;
    padding: 0.1rem 0 0.3rem 0.6rem; transition: none;
    max-height: none; overflow: visible;  /* the mobile drawer scrolls, not this panel */
  }
  .nav-dd-panel a { font-size: 0.92rem; padding: 0.55rem 0.7rem; }
}

/* Hamburger is a real <button>, desktop-hidden; drawer chrome only exists on mobile. */
.nav-hamburger { display: none; }
.nav-drawer-head { display: none; }
.nav-overlay { display: none; }

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s;
  margin-left: 0.5rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

/* ============= HERO ============= */
.hero {
  min-height: 100vh;
  padding: 7rem 2.5rem 4rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
}

.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-bg) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.hero-tag::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
  line-height: 1.05;
}

.hero h1 .accent-text {
  color: var(--accent);
  font-weight: 800;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-desc strong { color: var(--text); font-weight: 600; }

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.75rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ===== WCAG AA contrast remediation (page audited in dark theme) =====
   White text on the lighter dark-mode accent (#60a5fa) is only 2.54:1, so
   filled primary buttons use the deeper accent (#2563eb → 5.2:1) in dark mode.
   Light mode already passes (its --accent is #2563eb). */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .sapcta-btn,
[data-theme="dark"] .edu-badge { background: #2563eb; }
[data-theme="dark"] .nav-links a.nav-cta { background: #2563eb; }
[data-theme="dark"] .nav-links a.nav-cta:hover,
[data-theme="dark"] .nav-links a.nav-cta.active { background: #1d4ed8; }
[data-theme="dark"] .btn-primary:hover { background: #1d4ed8; }
/* Priority chips: red/muted text on their tinted chips measured 4.25–4.4:1 — nudge lighter. */
[data-theme="dark"] .priority-p1 { color: #fca5a5; }
[data-theme="dark"] .priority-p3 { color: #aeb9c9; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* Hero Bento Cards */
.hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  position: relative;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all 0.2s;
  position: relative;
}

.hero-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-card.span-2 { grid-column: span 2; }

.hero-card-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.3rem;
  letter-spacing: -0.04em;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.hero-card-num small {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hero-card-label {
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.hero-card-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-card-detail .trend {
  color: var(--success);
  font-weight: 600;
}

/* ============= SECTIONS ============= */
section {
  padding: 5rem 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.section-header {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-bg);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  align-self: flex-start;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
  font-weight: 500;
}

/* ============= IMPACT STRIP (Bento) ============= */
.impact-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.impact-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.impact-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.impact-cell:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.impact-cell:hover::before { transform: scaleX(1); }

.impact-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.impact-num small {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 700;
}

.impact-label {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.impact-cell p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ============= ABOUT ============= */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
  font-size: 0.98rem;
}

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

.about-quote {
  background: var(--accent-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  border-radius: var(--radius-md);
}

.skills-grid {
  display: grid;
  gap: 0.5rem;
}

.skill-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.skill-row:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.skill-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  min-width: 50px;
  text-align: center;
}

.skill-name {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

/* ============= METHODOLOGY ============= */
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Flat surface cards (design-system card): solid surface, hairline border, even padding all round.
   No glassmorphism, no side dividers — depth comes from the hover lift + accent glow. */
.method-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.75rem;
  transition: transform 0.4s var(--ease-smooth),
              border-color 0.3s var(--ease-smooth),
              box-shadow 0.4s var(--ease-smooth);
}

.method-card:hover .method-card-title { color: var(--accent); }

.method-card:hover .method-card-icon {
  background: var(--accent);
  color: #fff;
}

.method-card-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 1rem;
}

.method-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.method-card-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}

.method-card-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* ============= DOCUMENTATION HIERARCHY ============= */
.doc-hierarchy {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.doc-level {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.2s;
}

.doc-level:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.doc-level-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  min-width: 56px;
  text-align: center;
}

.doc-level-content { display: flex; flex-direction: column; gap: 0.2rem; }
.doc-level-name { font-size: 0.98rem; font-weight: 600; color: var(--text); }
.doc-level-desc { font-size: 0.82rem; color: var(--text-muted); }
.doc-level-audience {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.doc-arrow {
  text-align: center;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.2rem;
}

/* ============= KANBAN BOARD ============= */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.kanban-col {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  min-height: 280px;
}

.kanban-col-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-col-count {
  font-family: 'JetBrains Mono', monospace;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-weight: 700;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.kanban-card-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.kanban-card-title {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.priority {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.priority-p1 { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.priority-p2 { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.priority-p3 { background: color-mix(in srgb, var(--text-muted) 15%, transparent); color: var(--text-muted); }

.kanban-avatar {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ============= PROCESS FLOW ============= */
.process-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.process-step {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: relative;
  transition: all 0.2s;
}

.process-step:hover {
  background: var(--bg);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.process-num {
  width: 36px;
  height: 36px;
  background: var(--accent-bg);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.process-name {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.process-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============= FOCUS CARDS ============= */
/* Featured-lead layout: P2P (Implementation Lead) is a full-width lead card; the other two sit below as a pair. */
.focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.focus-grid .focus-card:first-child {
  grid-column: 1 / -1;
  background: var(--accent-bg);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.focus-grid .focus-card:first-child .focus-card-title {
  font-size: 1.45rem;
}

.focus-grid .focus-card:first-child .focus-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 2rem;
}

.focus-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all 0.2s;
}

.focus-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.focus-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.focus-card-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.focus-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.focus-list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.focus-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* ============= PROJECT CARDS (Grid) ============= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '→';
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 1.25rem;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.3s;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.project-card:hover::after { transform: translate(4px, -4px); }

.project-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-bg);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  width: fit-content;
  letter-spacing: 0.05em;
}

.project-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.project-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.project-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.project-metric { text-align: left; }
.project-metric-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--success);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.project-metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* ============= AWARD FEATURE ============= */
.award-feature {
  background: linear-gradient(135deg, var(--accent-bg) 0%, var(--surface) 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
}

.award-feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.award-icon {
  width: 64px;
  height: 64px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: var(--shadow-md);
}

.award-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.award-feature h3 {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: -0.025em;
}

.award-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.award-desc strong { color: var(--text); font-weight: 600; }

.award-arrow {
  font-size: 1.75rem;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.3s;
}

.award-feature:hover .award-arrow { transform: translateX(6px); }

/* ============= ACADEMIC FEATURE ============= */
.academic-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.academic-feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.academic-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.academic-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.academic-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.academic-desc strong { color: var(--text); font-weight: 600; }

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tech-pill.primary {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  font-weight: 600;
}

.academic-metrics {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.academic-metric { display: flex; flex-direction: column; }

.academic-metric-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.025em;
}

.academic-metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

.academic-arrow {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.3s;
}

.academic-feature:hover .academic-arrow { transform: translateX(6px); }

/* ============= SKILL MATRIX ============= */
.skill-matrix {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.25rem;
}

.skill-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.25rem;
}

.skill-cat {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.skill-cat-title {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  letter-spacing: -0.01em;
}

.skill-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.skill-bar-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.skill-bar-name {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.skill-bar-track {
  background: var(--surface-2);
  height: 6px;
  border-radius: 100px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 100px;
}

.skill-bar-level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: right;
  min-width: 75px;
}

/* ============= TOOLS GRID ============= */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.tool-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all 0.2s;
}

.tool-group:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tool-group h3 {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tool-item {
  font-size: 0.83rem;
  color: var(--text-muted);
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-item::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* ============= EDUCATION ============= */
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.edu-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.edu-school {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.edu-degree {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.edu-detail {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.edu-badge {
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  line-height: 1.4;
}

/* ============= CONTACT ============= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.contact-text h2 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.contact-text p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 480px;
  font-size: 0.95rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  transform: translateX(2px);
}

.contact-link-icon {
  color: var(--accent);
  font-size: 1rem;
  width: 20px;
}

/* ============= FOOTER ============= */
footer {
  padding: 2rem 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

footer p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============= PROJECT DETAIL PAGES ============= */
.project-hero {
  padding: 6rem 2.5rem 3rem;
  border-bottom: 1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.breadcrumb a { color: var(--text-muted); transition: color 0.2s; text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-subtle); }

.project-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: end;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  padding: 0.45rem 1rem;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.platform-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.project-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1rem;
}

.project-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.project-hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 600px;
}

.project-hero-desc strong { color: var(--text); font-weight: 600; }

.project-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
}

.project-info-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.project-info-row:last-child { border-bottom: none; }
.project-info-row:first-child { padding-top: 0; }

.project-info-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.project-info-val { color: var(--text); font-weight: 500; text-align: right; }

/* Results Banner */
.results-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 0 0 3rem;
}

.result-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  text-align: left;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.result-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--success);
}

.result-cell:hover {
  border-color: var(--success);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.result-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--success);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

.result-label {
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.result-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============= POWER BI DASHBOARD EMBED ============= */
.dashboard-section {
  margin: 3rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dashboard-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--surface-2);
}

.dashboard-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dashboard-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.dashboard-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dashboard-source {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dashboard-source::before {
  content: '◧';
  color: var(--accent);
}

.dashboard-image {
  width: 100%;
  height: auto;
  display: block;
}

.dashboard-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  background: var(--surface-2);
}

.dashboard-footer strong { color: var(--text); font-weight: 600; }

/* ============= CONTENT SECTIONS ============= */
.content-section {
  max-width: 900px;
  margin: 0 auto;
}

.content-h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 3rem 0 1.25rem;
  letter-spacing: -0.025em;
  color: var(--text);
}

.content-h3:first-child { margin-top: 0; }
.content-h3 em { color: var(--accent); font-style: normal; }

.content-p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

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

/* ============= TABLES ============= */
.process-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 0.85rem;
}

.process-table th {
  background: var(--surface-2);
  padding: 0.85rem 1rem;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.process-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.process-table tr:last-child td { border-bottom: none; }
.process-table tr:hover td { background: var(--surface-2); color: var(--text); }

.process-table code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* ============= CALLOUT ============= */
.callout {
  background: var(--accent-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
}

.callout-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.callout p {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.callout p:last-child { margin-bottom: 0; }

/* ============= CODE BLOCK ============= */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.7;
  overflow-x: auto;
  margin: 1.25rem 0;
  white-space: pre-wrap;
}

.code-block .comment { color: var(--text-muted); font-style: italic; }
.code-block .keyword { color: var(--accent); font-weight: 600; }

.code-block-num {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  overflow: hidden;
}

.code-block-header {
  background: var(--surface-2);
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text);
  font-weight: 500;
}

.code-block-lang { color: var(--accent); font-weight: 700; }

.code-block-body {
  padding: 1.25rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

.code-block-body .comment { color: var(--text-muted); font-style: italic; }
.code-block-body .keyword { color: var(--accent); font-weight: 600; }
.code-block-body .string { color: var(--success); }
.code-block-body .number { color: var(--warning); }

/* ============= DISCLAIMER ============= */
.disclaimer {
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.disclaimer-icon {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

.disclaimer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.disclaimer-text strong { color: var(--text); }

/* ============= MAPPING TABLE ============= */
.mapping-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin: 1.5rem 0;
}

.mapping-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mapping-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mapping-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.mapping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.mapping-table th {
  background: var(--surface-2);
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.mapping-table th.sap-col { color: var(--accent); }

.mapping-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.mapping-table tr:last-child td { border-bottom: none; }

.mapping-table .xeer-action { color: var(--text); font-weight: 500; }

.mapping-table .sap-tcode {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-size: 0.78rem;
  background: var(--accent-bg);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  font-weight: 500;
}

/* ============= DIAGRAM CONTAINER ============= */
.diagram-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.diagram-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.diagram-svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-svg .node-box { fill: var(--bg); stroke: var(--border); stroke-width: 1.5; transition: all 0.3s; }
.diagram-svg .node-box:hover { fill: var(--accent-bg); stroke: var(--accent); }
.diagram-svg .node-start { fill: color-mix(in srgb, var(--success) 15%, var(--surface)); stroke: var(--success); }
.diagram-svg .node-end { fill: var(--accent-bg); stroke: var(--accent); }
.diagram-svg .node-decision { fill: var(--accent-bg); stroke: var(--accent); stroke-width: 1.5; }
.diagram-svg .node-defect { fill: color-mix(in srgb, var(--danger) 15%, var(--surface)); stroke: var(--danger); }
.diagram-svg .arrow { stroke: var(--text-muted); stroke-width: 1.5; fill: none; }
.diagram-svg .label { font-family: 'Inter', sans-serif; font-size: 12px; fill: var(--text); font-weight: 600; }
.diagram-svg .label-small { font-family: 'JetBrains Mono', monospace; font-size: 9px; fill: var(--text-muted); }
.diagram-svg .label-accent { font-family: 'JetBrains Mono', monospace; font-size: 10px; fill: var(--accent); font-weight: 700; }
.diagram-svg .lane-bg { fill: var(--surface-2); stroke: var(--border); stroke-width: 1; stroke-dasharray: 3,3; }

/* ============= MODULE TAGS ============= */
.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 1.5rem;
}

.module-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  font-weight: 500;
}

/* ============= PROJECT NAV ============= */
.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 3rem;
}

.project-nav-link {
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.project-nav-link:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-nav-link.next { text-align: right; }

.project-nav-direction {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.project-nav-link:hover .project-nav-direction { color: var(--accent); }

.project-nav-title {
  font-size: 1rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.project-nav-link:hover .project-nav-title { color: var(--accent); }

/* ============= PHOTO GRID (Mitsubishi) ============= */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.photo-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}

.photo-item:hover img { transform: scale(1.04); }

.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
  color: white;
  padding: 1.5rem 1rem 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
}

/* ============= IDEAS GRID (Mitsubishi) ============= */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 1.5rem 0;
}

.idea-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.idea-card.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.idea-card.selected::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.idea-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.idea-name {
  font-size: 0.72rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.idea-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.idea-card.selected .idea-score {
  color: var(--accent);
  font-weight: 700;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ============= COST BREAKDOWN ============= */
.cost-breakdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin: 1.5rem 0;
}

.cost-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.cost-row:last-child {
  border-bottom: none;
  font-weight: 700;
  font-size: 1.05rem;
  padding-top: 1.1rem;
  border-top: 2px solid var(--accent);
  margin-top: 0.5rem;
}

.cost-row.total .cost-value { color: var(--accent); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.cost-label { color: var(--text-muted); }
.cost-row.total .cost-label { color: var(--text); font-weight: 700; }
.cost-value { font-family: 'JetBrains Mono', monospace; color: var(--text); font-weight: 500; }

/* ============= COACHES + SUBJECTS GRID ============= */
.coaches-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 1.25rem 0;
}

.coach-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: all 0.2s;
}

.coach-card:hover { border-color: var(--accent); }

.coach-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
}

.coach-name { font-size: 0.78rem; color: var(--text); font-weight: 600; margin-bottom: 0.2rem; }
.coach-role { font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; color: var(--text-muted); font-weight: 500; }

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin: 1.5rem 0;
}

.subject-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  text-align: center;
  transition: all 0.2s;
}

.subject-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.subject-pct {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
  letter-spacing: -0.03em;
}

.subject-name { font-size: 0.72rem; color: var(--text); font-weight: 600; line-height: 1.3; }

/* ============= SENIOR PROJECT COMPONENTS ============= */
.algo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin: 1rem 0;
  transition: all 0.2s;
}

.algo-card:hover { border-color: var(--accent); }

.algo-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.algo-card-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }

.algo-card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.algo-card-desc { color: var(--text-muted); font-size: 0.88rem; line-height: 1.7; margin-bottom: 1rem; }
.algo-card-desc strong { color: var(--text); }

.formula-block {
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.formula-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

.state-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 0.85rem;
}

.state-table th {
  background: var(--surface-2);
  padding: 0.75rem 0.9rem;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.state-table td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
.state-table tr:last-child td { border-bottom: none; }
.state-table .state-num { font-family: 'JetBrains Mono', monospace; color: var(--accent); font-weight: 700; width: 30px; }
.state-table .state-name { font-family: 'JetBrains Mono', monospace; color: var(--text); font-weight: 600; font-size: 0.78rem; }
.state-table .state-range { font-family: 'JetBrains Mono', monospace; color: var(--accent); font-size: 0.75rem; white-space: nowrap; font-weight: 500; }

.task-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  margin: 2rem 0;
}

.task-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--accent);
}

.task-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
}

.task-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.3rem; letter-spacing: -0.025em; }

.task-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.task-result { text-align: right; }

.task-result-val {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--success);
  line-height: 1;
  letter-spacing: -0.025em;
}

.task-result-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.3rem;
}

.hyperparam-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1.25rem 0;
}

.hyperparam {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem;
}

.hyperparam-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.hyperparam-value {
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.hyperparam-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

.network-layers {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
  justify-content: center;
}

.layer {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  text-align: center;
  min-width: 90px;
  transition: all 0.2s;
}

.layer:hover { border-color: var(--accent); background: var(--bg); }
.layer-name { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--text); font-weight: 700; margin-bottom: 0.2rem; }
.layer-size { font-size: 1.1rem; color: var(--accent); font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.layer-activation { font-family: 'JetBrains Mono', monospace; font-size: 0.55rem; color: var(--text-muted); margin-top: 0.25rem; font-weight: 500; }
.layer-arrow { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 1rem; font-weight: 700; }
.layer.input { border-color: var(--success); background: var(--success-light); }
.layer.output { border-color: var(--accent); background: var(--accent-bg); }

/* ============= SCROLL HINT ============= */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.scroll-line {
  width: 1px;
  height: 2.5rem;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ============= RESPONSIVE ============= */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .impact-strip { grid-template-columns: repeat(2, 1fr); }
  .methodology-grid { grid-template-columns: 1fr; }
  .method-card { padding: 1.4rem 1.5rem; }
  .focus-grid { grid-template-columns: 1fr; }
  .focus-grid .focus-card:first-child .focus-list { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .process-flow { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .skill-cat-grid { grid-template-columns: 1fr; }
  .ideas-grid { grid-template-columns: repeat(2, 1fr); }
  .coaches-grid { grid-template-columns: repeat(2, 1fr); }
  .subjects-grid { grid-template-columns: repeat(2, 1fr); }
  .hyperparam-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: 1fr; }
  .award-feature { grid-template-columns: 1fr; text-align: center; }
  .academic-feature { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .project-hero-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Raise nav's stacking context above the body-level .nav-overlay (z-index 150).
     The drawer (#primary-nav, z-index 200) lives INSIDE <nav>, so its z-index only
     counts within nav's context — without this, the semi-transparent scrim painted
     over the whole drawer and ate every tap (links felt unclickable). */
  nav { padding: 0.85rem 1rem; justify-content: flex-start; gap: 0.7rem; z-index: 200; }
  .nav-logo { font-size: 0.8rem; margin-right: auto; }

  /* ===== Left off-canvas drawer (Google-Sites style) ===== */
  /* Hamburger: real <button>, pulled to the far left of the bar. */
  .nav-hamburger {
    order: -1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, background 0.2s;
  }
  .nav-hamburger:hover { border-color: var(--accent); background: var(--accent-bg); }
  .nav-hamburger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.28s var(--ease-smooth), opacity 0.2s;
  }
  /* hamburger bars → X when the drawer is open (driven by aria-expanded on the button) */
  .nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  /* The link list becomes the sliding panel. */
  .nav-links {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 1rem 1rem 1.5rem;
    background: var(--bg);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.34s var(--ease-smooth);
    z-index: 200;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav-links.open { transform: translateX(0); }

  /* Drawer header: title + close (✕). */
  .nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.15rem 0.1rem 0.85rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-drawer-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .nav-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
  }
  .nav-drawer-close:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
  .nav-drawer-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .nav-links a { font-size: 0.98rem; padding: 0.8rem 0.85rem; width: 100%; border-radius: var(--radius-sm); }
  .nav-links a.nav-cta { text-align: center; margin-top: 0.5rem; }
  .nav-links li:last-child {
    display: flex;
    justify-content: flex-start;
    margin-top: 0.5rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border);
  }

  /* Dark scrim behind the drawer (intentionally dark in both light & dark themes). */
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease-smooth), visibility 0.3s;
    z-index: 150;
  }
  .nav-overlay.open { opacity: 1; visibility: visible; }

  /* Gentle staggered entrance for the items once the panel is open. */
  .nav-links.open li { animation: navItemIn 0.42s var(--ease-smooth) backwards; }
  .nav-links.open li.nav-drawer-head { animation: none; }
  .nav-links.open li:nth-child(2) { animation-delay: 0.04s; }
  .nav-links.open li:nth-child(3) { animation-delay: 0.09s; }
  .nav-links.open li:nth-child(4) { animation-delay: 0.14s; }
  .nav-links.open li:nth-child(5) { animation-delay: 0.19s; }
  .nav-links.open li:nth-child(6) { animation-delay: 0.24s; }
  .nav-links.open li:nth-child(7) { animation-delay: 0.29s; }
  .nav-links.open li:nth-child(8) { animation-delay: 0.34s; }

  @keyframes navItemIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: none; }
  }

  /* Reduced motion: drawer + scrim snap, no slide or stagger. */
  @media (prefers-reduced-motion: reduce) {
    .nav-links, .nav-overlay { transition: none !important; }
    .nav-hamburger span { transition: none !important; }
    .nav-links.open li { animation: none !important; }
  }
  .hero { padding: 6rem 1.25rem 3rem; }
  .hero-visual { grid-template-columns: 1fr; }
  .hero-card.span-2 { grid-column: span 1; }
  section { padding: 3.5rem 1.25rem; }
  .section-title { font-size: 1.65rem; }
  .impact-strip { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .process-flow { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .ideas-grid { grid-template-columns: 1fr; }
  .coaches-grid { grid-template-columns: 1fr; }
  .subjects-grid { grid-template-columns: 1fr; }
  .hyperparam-grid { grid-template-columns: 1fr; }
  .contact-text h2 { font-size: 2rem; }
  .edu-card { grid-template-columns: 1fr; }
  .project-hero { padding: 6rem 1.25rem 2.5rem; }
  .project-nav { grid-template-columns: 1fr; }
  .dashboard-header { flex-direction: column; align-items: flex-start; }
  footer { flex-direction: column; gap: 0.5rem; text-align: center; padding: 1.5rem 1.25rem; }
}

/* ============= PROFILE CARD ============= */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
}

.profile-photo-wrapper {
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
}

.profile-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  background: var(--surface-2);
  margin: 0 auto;
  display: block;
  box-shadow: var(--shadow-md);
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.profile-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.profile-meta-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-meta-icon {
  color: var(--accent);
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
}

/* Small profile (for contact section) */
.profile-mini {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.profile-mini-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.profile-mini-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profile-mini-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-strong);
}

.profile-mini-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 500;
}

/* =====================================================
   PREMIUM ANIMATIONS & LUXURY EFFECTS — v5
   ===================================================== */

/* Custom easing curves */
:root {
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-snappy: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms var(--ease-smooth);
  --transition-slow: 600ms var(--ease-smooth);
  --glow-color: color-mix(in srgb, var(--accent) 35%, transparent);
  --glow-strong: color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ========== KEYFRAMES ========== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px var(--glow-color), 0 0 40px transparent;
  }
  50% {
    box-shadow: 0 0 30px var(--glow-strong), 0 0 60px var(--glow-color);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes accentPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes textShine {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes borderGlow {
  0%, 100% {
    border-color: var(--border);
    box-shadow: 0 0 0 0 transparent;
  }
  50% {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--glow-color);
  }
}

/* ========== SCROLL REVEAL CLASSES ========== */
/* Scroll-reveal — VISIBLE BY DEFAULT.
   The resting state is opacity:1 so content can never be trapped invisible if
   the IntersectionObserver never fires (e.g. a section taller than ~12× the
   viewport never reaches the old 0.08 threshold → never got `.visible`). The
   entrance is now a self-contained on-load CSS animation: it plays when the
   class is present and ALWAYS settles at opacity:1, and if animations/JS are
   unavailable the element simply renders fully visible. */
.reveal       { animation: revealUp    0.8s var(--ease-smooth) both; }
.reveal-scale { animation: revealScale 0.8s var(--ease-smooth) both; }
.reveal-left  { animation: revealLeft  0.8s var(--ease-smooth) both; }
.reveal-right { animation: revealRight 0.8s var(--ease-smooth) both; }

/* `.visible` (added by the observer) is now a harmless no-op that just pins the
   settled state, kept so any other CSS keyed off it still resolves. */
.reveal.visible,
.reveal-scale.visible,
.reveal-left.visible,
.reveal-right.visible { opacity: 1; transform: none; }

@keyframes revealUp    { from { opacity: 0; transform: translateY(30px); }  to { opacity: 1; transform: none; } }
@keyframes revealScale { from { opacity: 0; transform: scale(0.95); }       to { opacity: 1; transform: none; } }
@keyframes revealLeft  { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes revealRight { from { opacity: 0; transform: translateX(40px); }  to { opacity: 1; transform: none; } }

/* Stagger children — same visible-by-default guarantee, with a cascade delay. */
.stagger > * { animation: revealUp 0.6s var(--ease-smooth) both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.12s; }
.stagger > *:nth-child(3) { animation-delay: 0.19s; }
.stagger > *:nth-child(4) { animation-delay: 0.26s; }
.stagger > *:nth-child(5) { animation-delay: 0.33s; }
.stagger > *:nth-child(6) { animation-delay: 0.40s; }
.stagger > *:nth-child(7) { animation-delay: 0.47s; }
.stagger > *:nth-child(8) { animation-delay: 0.54s; }

/* ============================================================
   SMART SCROLL REVEAL  ·  v10  — pure CSS scroll-driven animation
   BULLETPROOF BY CONSTRUCTION. The only thing that ever hides an
   element is a scroll-timeline animation guarded by BOTH @supports
   and (prefers-reduced-motion: no-preference). No browser support,
   reduced motion, or JS that never runs → the element renders fully
   visible. A view() timeline is evaluated from the element's scroll
   POSITION at paint time, so it can never get "stuck" invisible the
   way a JS/observer reveal can (the bug that ate this page twice).
   JS only tags WHICH blocks animate (animation.js → initScrollReveal).
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    [data-reveal] {
      animation-name: revealRise;
      animation-fill-mode: both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
    [data-reveal="media"] { animation-name: revealRiseMedia; }

    /* Grid items cascade — stagger each child's entry range. */
    [data-reveal="grid"]:nth-child(1)  { animation-range: entry 0%  entry 55%; }
    [data-reveal="grid"]:nth-child(2)  { animation-range: entry 6%  entry 61%; }
    [data-reveal="grid"]:nth-child(3)  { animation-range: entry 12% entry 67%; }
    [data-reveal="grid"]:nth-child(4)  { animation-range: entry 18% entry 73%; }
    [data-reveal="grid"]:nth-child(5)  { animation-range: entry 24% entry 79%; }
    [data-reveal="grid"]:nth-child(6)  { animation-range: entry 30% entry 85%; }
    [data-reveal="grid"]:nth-child(n+7){ animation-range: entry 36% entry 91%; }

    @keyframes revealRise {
      from { opacity: 0; transform: translateY(28px); }
      to   { opacity: 1; transform: none; }
    }
    @keyframes revealRiseMedia {
      from { opacity: 0; transform: translateY(28px) scale(0.985); }
      to   { opacity: 1; transform: none; }
    }
  }
}

/* Mobile fix — the view() reveal is scroll-LINKED, so it is reversible: scrolling
   back up moves a stacked card down into its `entry` range and animates its
   opacity back toward 0. On short touch viewports with tall, full-width cards
   that transparent band covers much of the screen, so cards appear to "disappear"
   while scrubbing up and down. On mobile we therefore drop the scroll-driven
   reveal entirely and render every block statically visible (content first).
   Desktop keeps the entrance. This preserves the "never trapped invisible"
   guarantee — here it is simply always visible. */
@media (max-width: 768px) {
  [data-reveal] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ========== HERO ENTRANCE ========== */
.hero-left > * {
  animation: fadeUp 0.9s var(--ease-smooth) backwards;
}
.hero-left > *:nth-child(1) { animation-delay: 0.1s; }
.hero-left > *:nth-child(2) { animation-delay: 0.2s; }
.hero-left > *:nth-child(3) { animation-delay: 0.35s; }
.hero-left > *:nth-child(4) { animation-delay: 0.5s; }

.hero-visual > * {
  animation: fadeUp 0.9s var(--ease-smooth) backwards;
}
.hero-visual > *:nth-child(1) { animation-delay: 0.4s; }
.hero-visual > *:nth-child(2) { animation-delay: 0.5s; }
.hero-visual > *:nth-child(3) { animation-delay: 0.6s; }
.hero-visual > *:nth-child(4) { animation-delay: 0.7s; }

/* Floating hero background orb */
.hero::before {
  animation: float 8s var(--ease-smooth) infinite, gradientShift 12s linear infinite;
  background-size: 200% 200%;
}

/* Pulse dot in hero-tag */
.hero-tag::before {
  animation: accentPulse 2s var(--ease-smooth) infinite;
}

/* ========== ENHANCED HOVER · BENTO CARDS ========== */
.hero-card {
  transition: all 0.4s var(--ease-smooth);
  cursor: pointer;
  position: relative;
}

.hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent, var(--accent-soft));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
  pointer-events: none;
}

.hero-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 30px var(--glow-color),
    var(--shadow-lg);
}

.hero-card:hover::after { opacity: 1; }

.hero-card:hover .hero-card-num {
  transform: scale(1.05);
  text-shadow: 0 0 20px var(--glow-color);
}

.hero-card-num {
  transition: all 0.3s var(--ease-smooth);
}

/* ========== ENHANCED HOVER · IMPACT CELLS ========== */
.impact-cell {
  transition: all 0.4s var(--ease-smooth);
  cursor: default;
}

.impact-cell:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 25px var(--glow-color),
    var(--shadow-lg);
  border-color: var(--accent);
}

.impact-cell:hover::before { transform: scaleX(1); height: 4px; }

.impact-cell:hover .impact-num {
  transform: scale(1.08);
  text-shadow: 0 0 25px var(--glow-color);
}

.impact-num { transition: all 0.4s var(--ease-bounce); }

/* ========== ENHANCED HOVER · PROJECT CARDS ========== */
.project-card {
  transition: all 0.5s var(--ease-smooth);
  cursor: pointer;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, var(--accent-bg) 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
  pointer-events: none;
  border-radius: var(--radius-md);
}

.project-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 30px 60px -15px var(--glow-color),
    0 0 40px var(--glow-color),
    var(--shadow-xl);
  border-color: var(--accent);
}

.project-card:hover::before { opacity: 0.5; }
.project-card:hover::after { transform: translate(8px, -8px); color: var(--accent); }

.project-card:hover .project-title { color: var(--accent); }

.project-card .project-title { transition: color 0.3s var(--ease-smooth); }

.project-card:hover .project-metric-val {
  transform: scale(1.05);
  text-shadow: 0 0 15px color-mix(in srgb, var(--success) 50%, transparent);
}

.project-metric-val { transition: all 0.3s var(--ease-bounce); }

/* ========== ENHANCED HOVER · METHOD CARDS ========== */
.method-card { transition: all 0.4s var(--ease-smooth); cursor: default; }

.method-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow:
    0 18px 38px -20px var(--glow-strong),
    0 0 22px -4px var(--glow-color);
}

.method-card:hover .method-card-icon {
  transform: rotate(-8deg) scale(1.1);
  box-shadow: 0 0 25px var(--glow-color);
}

.method-card-icon {
  transition: all 0.4s var(--ease-bounce);
}

/* ========== ENHANCED HOVER · FOCUS CARDS ========== */
.focus-card { transition: all 0.4s var(--ease-smooth); }

.focus-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 25px var(--glow-color),
    var(--shadow-lg);
  border-color: var(--accent);
}

.focus-card:hover .focus-card-title { color: var(--accent); }
.focus-card .focus-card-title { transition: color 0.3s var(--ease-smooth); }

/* ========== ENHANCED HOVER · PROCESS STEPS ========== */
.process-step { transition: all 0.4s var(--ease-smooth); cursor: default; }

.process-step:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 15px 30px -8px var(--glow-color),
    0 0 20px var(--glow-color),
    var(--shadow-md);
  border-color: var(--accent);
  background: var(--bg);
}

.process-step:hover .process-num {
  transform: scale(1.15) rotate(-5deg);
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--glow-color);
}

.process-num { transition: all 0.4s var(--ease-bounce); }

/* ========== ENHANCED HOVER · AWARD FEATURE ========== */
.award-feature {
  transition: all 0.5s var(--ease-smooth);
  background: linear-gradient(
    135deg,
    var(--accent-bg) 0%,
    var(--surface) 50%,
    var(--accent-bg) 100%
  );
  background-size: 200% 200%;
  animation: gradientShift 8s var(--ease-smooth) infinite;
}

.award-feature:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 40px 80px -20px var(--glow-strong),
    0 0 60px var(--glow-color),
    var(--shadow-xl);
}

.award-icon {
  transition: all 0.5s var(--ease-bounce);
  animation: float 4s var(--ease-smooth) infinite;
}

.award-feature:hover .award-icon {
  transform: rotate(-12deg) scale(1.15);
  box-shadow: 0 0 40px var(--glow-strong);
}

/* ========== ENHANCED HOVER · ACADEMIC FEATURE ========== */
.academic-feature { transition: all 0.5s var(--ease-smooth); }

.academic-feature:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 30px 60px -15px var(--glow-color),
    0 0 40px var(--glow-color),
    var(--shadow-xl);
  border-color: var(--accent);
}

.academic-feature:hover .academic-title { color: var(--accent); }
.academic-feature .academic-title { transition: color 0.3s var(--ease-smooth); }

.academic-feature:hover .academic-metric-val {
  text-shadow: 0 0 20px var(--glow-color);
  transform: scale(1.05);
}

.academic-metric-val { transition: all 0.3s var(--ease-bounce); }

/* ========== ENHANCED HOVER · PROFILE CARD ========== */
.profile-card {
  transition: all 0.5s var(--ease-smooth);
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 30px var(--glow-color),
    var(--shadow-lg);
  border-color: var(--accent);
}

.profile-photo {
  transition: all 0.5s var(--ease-bounce);
  cursor: pointer;
}

.profile-card:hover .profile-photo {
  transform: scale(1.08) rotate(-3deg);
  box-shadow:
    0 0 30px var(--glow-strong),
    0 15px 30px -10px var(--glow-color);
  border-color: var(--accent);
}

/* ========== ENHANCED HOVER · TOOL GROUPS ========== */
.tool-group { transition: all 0.4s var(--ease-smooth); }

.tool-group:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 15px 30px -8px var(--glow-color),
    0 0 20px var(--glow-color),
    var(--shadow-md);
  border-color: var(--accent);
}

.tool-group:hover h4 { color: var(--accent); }

/* ========== ENHANCED HOVER · EDUCATION CARDS ========== */
.edu-card { transition: all 0.4s var(--ease-smooth); }

.edu-card:hover {
  transform: translateY(-4px) translateX(4px);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 30px var(--glow-color),
    var(--shadow-lg);
  border-color: var(--accent);
}

.edu-card:hover .edu-badge {
  transform: scale(1.05) rotate(-2deg);
  box-shadow: 0 0 20px var(--glow-color);
}

.edu-badge { transition: all 0.4s var(--ease-bounce); }

/* ========== ENHANCED HOVER · CONTACT LINKS ========== */
.contact-link { transition: all 0.3s var(--ease-smooth); }

.contact-link:hover {
  transform: translateX(8px) scale(1.02);
  box-shadow:
    0 10px 25px -5px var(--glow-color),
    0 0 20px var(--glow-color);
}

/* ========== ENHANCED HOVER · BUTTONS ========== */
.btn { transition: all 0.3s var(--ease-smooth); position: relative; overflow: hidden; }

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s var(--ease-smooth), height 0.6s var(--ease-smooth);
  z-index: 0;
}

.btn:hover::before { width: 300px; height: 300px; }
.btn > * { position: relative; z-index: 1; }

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 15px 30px -8px var(--glow-strong),
    0 0 25px var(--glow-color);
}

.btn-outline:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px -5px var(--glow-color);
}

/* ========== PRESS FEEDBACK (was missing) ========== */
/* Sub-100ms tactile press: the button dips back to rest and compresses
   slightly. Gives the click a physical acknowledgement on every device. */
.btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 90ms;
}

.project-card:active,
.award-feature:active,
.academic-feature:active,
.edu-card:active,
.contact-link:active,
.project-nav-link:active {
  transform: translateY(-2px) scale(0.995);
  transition-duration: 90ms;
}

/* ========== KEYBOARD FOCUS (a11y · was missing) ========== */
/* Visible focus ring for keyboard users only — never removed without a
   replacement. Mouse clicks stay clean via :focus-visible. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.project-card:focus-visible,
.award-feature:focus-visible,
.academic-feature:focus-visible,
.edu-card:focus-visible,
.contact-link:focus-visible,
.project-nav-link:focus-visible,
.hero-v7-meta-pill:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Cards already carry their own radius — keep the ring hugging it. */
.project-card:focus-visible,
.award-feature:focus-visible,
.academic-feature:focus-visible,
.edu-card:focus-visible,
.project-nav-link:focus-visible {
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

/* ========== ENHANCED HOVER · KANBAN CARDS ========== */
.kanban-card { transition: all 0.3s var(--ease-smooth); }

.kanban-card:hover {
  transform: translateX(3px) scale(1.02);
  box-shadow: 0 8px 20px -5px var(--glow-color);
  border-color: var(--accent);
}

/* ========== ENHANCED HOVER · DOC LEVELS ========== */
.doc-level { transition: all 0.3s var(--ease-smooth); }

.doc-level:hover {
  transform: translateX(8px) scale(1.01);
  box-shadow: 0 8px 20px -5px var(--glow-color);
  border-color: var(--accent);
}

/* ========== ENHANCED HOVER · SKILL ROWS ========== */
.skill-row { transition: all 0.3s var(--ease-smooth); }

.skill-row:hover {
  transform: translateX(6px);
  box-shadow: 0 5px 15px -3px var(--glow-color);
  border-color: var(--accent);
}

.skill-row:hover .skill-tag {
  transform: scale(1.1);
  background: var(--accent);
  color: white;
}

.skill-tag { transition: all 0.3s var(--ease-bounce); }

/* ========== ENHANCED HOVER · DASHBOARD ========== */
.dashboard-section {
  transition: all 0.5s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.dashboard-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, var(--glow-color) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-smooth);
  pointer-events: none;
  z-index: 1;
}

.dashboard-section:hover {
  transform: translateY(-4px);
  box-shadow:
    0 30px 60px -15px var(--glow-color),
    0 0 40px var(--glow-color),
    var(--shadow-xl);
  border-color: var(--accent);
}

.dashboard-section:hover::before { opacity: 0.05; }

.dashboard-image {
  transition: transform 0.6s var(--ease-smooth);
}

.dashboard-section:hover .dashboard-image {
  transform: scale(1.01);
}

/* ========== PROJECT INFO CARD HOVER ========== */
.project-info-card {
  transition: all 0.4s var(--ease-smooth);
}

.project-info-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 25px var(--glow-color),
    var(--shadow-lg);
  border-color: var(--accent);
}

/* ========== RESULT CELL HOVER ========== */
.result-cell { transition: all 0.4s var(--ease-smooth); }

.result-cell:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 15px 30px -8px color-mix(in srgb, var(--success) 30%, transparent),
    0 0 25px color-mix(in srgb, var(--success) 25%, transparent),
    var(--shadow-md);
}

.result-cell:hover .result-val {
  transform: scale(1.05);
  text-shadow: 0 0 20px color-mix(in srgb, var(--success) 40%, transparent);
}

.result-val { transition: all 0.3s var(--ease-bounce); }

/* ========== PHOTO ITEM HOVER (Mitsubishi) ========== */
.photo-item { transition: all 0.4s var(--ease-smooth); }

.photo-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 30px var(--glow-color),
    var(--shadow-xl);
  border-color: var(--accent);
}

.photo-item:hover img { transform: scale(1.08); }

/* ========== IDEA CARDS HOVER ========== */
.idea-card { transition: all 0.4s var(--ease-smooth); }

.idea-card:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow:
    0 15px 30px -8px var(--glow-color),
    0 0 20px var(--glow-color),
    var(--shadow-md);
  border-color: var(--accent);
}

.idea-card.selected:hover {
  box-shadow:
    0 20px 40px -10px var(--glow-strong),
    0 0 30px var(--glow-strong),
    var(--shadow-lg);
}

/* ========== COACH/SUBJECT CARDS HOVER ========== */
.coach-card, .subject-card { transition: all 0.4s var(--ease-smooth); }

.coach-card:hover, .subject-card:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow:
    0 12px 25px -8px var(--glow-color),
    0 0 15px var(--glow-color),
    var(--shadow-md);
  border-color: var(--accent);
}

.coach-card:hover .coach-avatar,
.subject-card:hover .subject-pct {
  transform: scale(1.15);
  text-shadow: 0 0 15px var(--glow-color);
}

.coach-avatar, .subject-pct { transition: all 0.4s var(--ease-bounce); }

/* ========== PROJECT NAV LINK HOVER ========== */
.project-nav-link { transition: all 0.4s var(--ease-smooth); }

.project-nav-link:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 25px var(--glow-color),
    var(--shadow-lg);
}

/* Section-title emphasis: solid Implementation Blue. Emphasis comes from the
   accent + weight, not gradient text (a documented brand ban). The previous
   gradient-clip + perpetual shimmer was both the ban and ambient motion noise. */
.section-title em {
  color: var(--accent);
  font-weight: 800;
}

/* ========== NAV LINK UNDERLINE ========== */
.nav-links a { position: relative; }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: all 0.3s var(--ease-smooth);
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-links a:hover::after { width: 60%; }

/* ========== THEME TOGGLE GLOW ========== */
.theme-toggle { transition: all 0.3s var(--ease-bounce); }

.theme-toggle:hover {
  transform: rotate(15deg) scale(1.1);
  box-shadow: 0 0 20px var(--glow-color);
}

/* ========== NAV LOGO MARK ========== */
/* The diamond is the smallest brand atom — let it answer to the logo hover
   with a quarter-turn and a faint signal glow. */
.nav-logo-mark {
  transition: transform 0.45s var(--ease-bounce), box-shadow 0.3s var(--ease-smooth);
}

.nav-logo:hover .nav-logo-mark {
  transform: rotate(135deg) scale(1.18);
  box-shadow: 0 0 14px var(--glow-color);
}

/* ========== PLATFORM BADGE PULSE ========== */
.platform-badge::before {
  animation: accentPulse 2s var(--ease-smooth) infinite;
}

/* ========== TECH PILL GLOW ========== */
.tech-pill { transition: all 0.3s var(--ease-smooth); }

.tech-pill:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px -3px var(--glow-color);
  border-color: var(--accent);
  color: var(--accent);
}

.tech-pill.primary:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 5px 20px -3px var(--glow-strong);
}

/* ========== MODULE TAG GLOW ========== */
.module-tag { transition: all 0.3s var(--ease-smooth); cursor: default; }

.module-tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px -3px var(--glow-color);
  background: var(--accent);
  color: white;
}

/* ========== TAG GLOW (project tags) ========== */
.tag { transition: all 0.3s var(--ease-smooth); }
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ========== SECTION NUM GLOW ========== */
.section-num {
  transition: all 0.3s var(--ease-smooth);
  position: relative;
}

section:hover .section-num {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--glow-color);
}

/* ========== ALGO CARD HOVER (Senior Project) ========== */
.algo-card { transition: all 0.4s var(--ease-smooth); }

.algo-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 25px var(--glow-color),
    var(--shadow-lg);
  border-color: var(--accent);
}

.algo-card:hover .algo-card-title { color: var(--accent); }
.algo-card .algo-card-title { transition: color 0.3s var(--ease-smooth); }

/* ========== TASK SECTION HOVER ========== */
.task-section { transition: all 0.4s var(--ease-smooth); }

.task-section:hover {
  transform: translateY(-2px);
  box-shadow:
    0 25px 50px -15px var(--glow-color),
    0 0 35px var(--glow-color),
    var(--shadow-xl);
  border-color: var(--accent);
}

/* ========== HYPERPARAM HOVER ========== */
.hyperparam { transition: all 0.3s var(--ease-smooth); }

.hyperparam:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 20px -5px var(--glow-color);
  border-color: var(--accent);
  background: var(--bg);
}

.hyperparam:hover .hyperparam-value {
  color: var(--accent);
  text-shadow: 0 0 15px var(--glow-color);
}

.hyperparam-value { transition: all 0.3s var(--ease-smooth); }

/* ========== LAYER HOVER (Neural network viz) ========== */
.layer { transition: all 0.3s var(--ease-bounce); }

.layer:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 25px -5px var(--glow-color);
  z-index: 2;
}

/* ========== TABLE ROW SHIMMER ========== */
.process-table tr td,
.mapping-table tr td,
.state-table tr td {
  transition: all 0.3s var(--ease-smooth);
}

.process-table tr:hover td,
.mapping-table tr:hover td,
.state-table tr:hover td {
  background: var(--accent-bg);
  color: var(--text);
}

/* ========== CALLOUT HOVER ========== */
.callout { transition: all 0.4s var(--ease-smooth); }

.callout:hover {
  border-color: var(--accent);
  box-shadow:
    0 10px 25px -5px var(--glow-color),
    0 0 20px var(--glow-color);
}

/* ========== DISCLAIMER HOVER ========== */
.disclaimer { transition: all 0.4s var(--ease-smooth); }

.disclaimer:hover {
  box-shadow: 0 10px 25px -5px var(--glow-color);
  border-style: solid;
}

/* ========== DIAGRAM CONTAINER HOVER ========== */
.diagram-container { transition: all 0.4s var(--ease-smooth); }

.diagram-container:hover {
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 30px var(--glow-color);
  border-color: var(--accent);
}

.diagram-svg .node-box,
.diagram-svg .node-start,
.diagram-svg .node-end,
.diagram-svg .node-decision,
.diagram-svg .node-defect {
  transition: all 0.3s var(--ease-smooth);
}

.diagram-svg g:hover .node-box,
.diagram-svg .node-box:hover {
  filter: drop-shadow(0 0 8px var(--glow-color));
}

/* ========== COST BREAKDOWN HOVER ========== */
.cost-breakdown { transition: all 0.4s var(--ease-smooth); }

.cost-breakdown:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -10px var(--glow-color);
  border-color: var(--accent);
}

.cost-row { transition: all 0.3s var(--ease-smooth); }

.cost-row:hover {
  background: var(--accent-bg);
  padding-left: 0.5rem;
  border-radius: var(--radius-sm);
}

/* ========== SKILL BAR FILL ANIMATION ========== */
.skill-bar-fill {
  transition: width 1.5s var(--ease-smooth);
  background-size: 200% 100%;
  animation: gradientShift 4s linear infinite;
}

.skill-bar:hover .skill-bar-fill {
  filter: brightness(1.2);
  box-shadow: 0 0 15px var(--glow-color);
}

/* ========== FOCUS LIST ITEMS HOVER ========== */
.focus-list li {
  transition: all 0.3s var(--ease-smooth);
  cursor: default;
}

.focus-list li:hover {
  padding-left: 1.3rem;
  color: var(--text);
}

.focus-list li::before { transition: all 0.3s var(--ease-bounce); }
.focus-list li:hover::before { transform: scale(1.5); box-shadow: 0 0 10px var(--glow-color); }

/* ========== GLOBAL SMOOTH SCROLL ========== */
html { scroll-padding-top: 5rem; }

/* ========== NAV BACKDROP ENHANCEMENT ========== */
nav { transition: all 0.3s var(--ease-smooth); }

nav.scrolled {
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  box-shadow: var(--shadow-md);
}

/* ========== TOUCH DEVICES — Reduce animations ========== */
@media (hover: none) {
  .hero-card:hover,
  .impact-cell:hover,
  .project-card:hover,
  .method-card:hover,
  .focus-card:hover,
  .award-feature:hover,
  .academic-feature:hover,
  .profile-card:hover,
  .tool-group:hover,
  .edu-card:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }
}

/* ========== REDUCE MOTION ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-scale, .reveal-left, .reveal-right, .stagger > * {
    opacity: 1;
    transform: none;
  }
}

/* =====================================================
   v6 — HERO PROFILE CARD + KEY ACHIEVEMENTS
   ===================================================== */

/* HERO PROFILE CARD (spans 2 cols of bento grid) */
.hero-profile-card {
  grid-column: span 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-smooth);
  margin-bottom: 0;
}

.hero-profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
}

.hero-profile-wrapper {
  position: relative;
  z-index: 1;
  margin-bottom: 0.85rem;
}

.hero-profile-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid var(--surface);
  object-fit: cover;
  display: block;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
  background: var(--surface-2);
  transition: all 0.4s var(--ease-bounce);
}

.hero-profile-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-strong);
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.hero-profile-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.85rem;
  letter-spacing: 0.02em;
}

.hero-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.hero-profile-meta-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-profile-meta-item .icon {
  color: var(--accent);
  font-size: 0.75rem;
  width: 14px;
  text-align: center;
}

.hero-profile-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px -10px var(--glow-color),
    0 0 30px var(--glow-color),
    var(--shadow-lg);
  border-color: var(--accent);
}

.hero-profile-card:hover .hero-profile-photo {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: 0 0 25px var(--glow-strong);
}

/* =========== KEY ACHIEVEMENTS LIST =========== */
.achievements-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 2rem;
  transition: all 0.4s var(--ease-smooth);
}

.achievements-wrapper:hover {
  box-shadow: 0 20px 40px -10px var(--glow-color);
  border-color: var(--border-strong);
}

.achievement-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1.5rem;
  align-items: flex-start;
  transition: all 0.3s var(--ease-smooth);
  position: relative;
}

.achievement-item:last-child { border-bottom: none; }

.achievement-item:hover {
  padding-left: 0.5rem;
}

.achievement-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-bg);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  flex-shrink: 0;
  transition: all 0.3s var(--ease-bounce);
}

.achievement-item:hover .achievement-num {
  background: var(--accent);
  color: white;
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 0 20px var(--glow-color);
}

.achievement-content { flex: 1; }

.achievement-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.achievement-title .achievement-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.achievement-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.achievement-desc strong { color: var(--text); font-weight: 600; }

.achievement-metrics {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.achievement-metric {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--success);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.achievement-metric::before {
  content: '▲';
  font-size: 0.7rem;
}

/* About section: single column simplified */
.about-simple {
  max-width: 900px;
  margin: 0 auto;
}

.about-simple .focus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.about-simple .focus-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.4rem 0.8rem;
  border-radius: 100px;
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  transition: all 0.3s var(--ease-smooth);
}

.about-simple .focus-tag:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px -3px var(--glow-color);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-profile-card { grid-column: span 1; }
}

/* =====================================================
   v7 — HERO REDESIGN + NEWTON SECTION + DYNAMIC BG
   ===================================================== */

/* ANIMATED TECH BACKGROUND (whole page) */
.tech-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.tech-bg::before,
.tech-bg::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: floatOrb 25s ease-in-out infinite;
}

.tech-bg::before {
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -200px;
  left: -200px;
  opacity: 0.15;
}

.tech-bg::after {
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  bottom: -200px;
  right: -200px;
  opacity: 0.12;
  animation-delay: -10s;
  animation-direction: reverse;
}

[data-theme="dark"] .tech-bg::before { opacity: 0.25; }
[data-theme="dark"] .tech-bg::after { opacity: 0.2; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(150px, -100px) scale(1.1); }
  66% { transform: translate(-100px, 100px) scale(0.95); }
}

/* Grid pattern overlay */
.tech-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, transparent 70%);
}

[data-theme="dark"] .tech-grid {
  background-image: 
    linear-gradient(rgba(96, 165, 250, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.05) 1px, transparent 1px);
}

/* Floating particles (SVG-based) */
.tech-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

[data-theme="dark"] .tech-particles { opacity: 0.6; }

@keyframes floatParticle {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  25% { transform: translateY(-30px) translateX(20px); opacity: 0.8; }
  50% { transform: translateY(-60px) translateX(-15px); opacity: 0.5; }
  75% { transform: translateY(-30px) translateX(-25px); opacity: 0.7; }
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: floatParticle 8s ease-in-out infinite;
}

/* =========== HERO REDESIGN v7 =========== */
.hero-v7 {
  min-height: 100vh;
  padding: 8rem 2.5rem 4rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-v7-left {
  position: relative;
  z-index: 2;
}

.hero-v7-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0 0 1.9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  backdrop-filter: blur(10px);
}

.hero-v7-tag::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: accentPulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px var(--accent);
}

.hero-v7 h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  margin-bottom: 1rem;
  line-height: 0.95;
  background: linear-gradient(180deg, var(--text-strong) 0%, var(--text) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-v7 h1 .accent-line {
  display: block;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 50%, var(--accent) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textShine 6s linear infinite;
}

.hero-v7-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 1.9rem;
  line-height: 1.7;
}
/* ====================================
   TEXT BALANCING & JUSTIFICATION
   ==================================== */

.balanced-text {
  /* ชิดซ้าย + text-wrap: pretty ให้ขอบขวาเรียงสวยและลด orphan
     อ่านลื่นกว่าการ justify ที่ทำให้ช่องว่างระหว่างคำห่างไม่เท่ากัน */
  text-align: left;
  text-wrap: pretty;
  max-width: 540px; /* คุมความยาวบรรทัดให้อ่านสบาย (~60–65ch) */
  width: 100%;
}

/* ====================================
   HERO SECTION v7 (Center Balanced Layout)
   ==================================== */

.hero-v7 {
  min-height: 100vh;
  padding: 8rem 2.5rem 4rem;
  
  /* 1. เปลี่ยนมาใช้ Flexbox เพื่อให้ควบคุมการจัดกลุ่มตรงกลางได้เด็ดขาดกว่า Grid ในกรณีนี้ */
  display: flex;
  flex-direction: row;
  justify-content: center; /* ดึงบล็อกซ้ายและขวามากระจุกรวมกันตรงกลางหน้าจอ */
  align-items: center;
  
  /* 2. กำหนดระยะห่างระหว่างข้อความกับรูปภาพ (ลดเหลือ 3.5rem เพื่อให้ชิดกันมากขึ้น) */
  gap: 3.5rem; 
  
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

/* ล็อกความกว้างของบล็อกฝั่งซ้าย (ข้อความ) ไม่ให้ยืดออกไปหาขอบจอ */
.hero-v7-left {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 580px; /* ล็อกความกว้างไว้เท่านี้ */
  /* จัดเรียงทุก element ในแนวตั้งให้ชิดซ้ายและคุมจังหวะระยะห่างได้แน่นอน */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* ล็อกความกว้างของบล็อกฝั่งขวา (รูปภาพ) */
.hero-v7-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  width: 100%;
  max-width: 450px; /* ล็อกความกว้างรูปภาพ */
}

/* 3. ตรวจสอบให้แน่ใจว่ามีส่วน Responsive สำหรับหน้าจอเล็ก/มือถือ (ห้ามลืมใส่ส่วนนี้) */
@media (max-width: 1024px) {
  .hero-v7 { 
    flex-direction: column; /* เปลี่ยนเป็นเรียงบนลงล่างในจอเล็ก */
    gap: 2.5rem; 
    padding: 7rem 1.5rem 3rem; 
  }
  .hero-v7-left, .hero-v7-right {
    max-width: 100%;
  }
  /* จอเล็ก: ชื่อถูกจัดกึ่งกลางอยู่แล้ว จึงจัดทั้งบล็อกซ้ายให้กึ่งกลางตามให้เรียงสวยเป็นแกนเดียวกัน */
  .hero-v7-left {
    align-items: center;
    text-align: center;
  }
  /* ย่อหน้ายังชิดซ้ายเพื่อให้อ่านลื่น แต่จัดบล็อกให้อยู่กึ่งกลาง */
  .hero-v7-left .balanced-text {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-v7-right {
    order: -1; /* เอารูปขึ้นก่อนข้อความในมือถือ */
    max-width: 380px; /* ย่อรูปลงนิดหน่อยไม่ให้ล้นมือถือ */
  }
}

/* ปรับขนาดฟอนต์ของ h1 ลงเล็กน้อย ป้องกันการล้นจอในบางอุปกรณ์ */
.hero-v7 h1 {
  font-size: clamp(2.2rem, 5vw, 4.5rem); 
  /* ลดจาก 2.5rem/6vw/5rem ลงมานิดนึงเพื่อให้พอดีกับกรอบ */
}

.hero-v7-desc strong { color: var(--text); font-weight: 600; }

.hero-v7-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-v7-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: 100px;
  backdrop-filter: blur(10px);
  transition: all 0.3s var(--ease-smooth);
}

.hero-v7-meta-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px -3px var(--glow-color);
}

.hero-v7-meta-pill .icon { color: var(--accent); }

.hero-v7-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* HERO PHOTO (Right side - large) */
.hero-v7-right {
  position: relative;
  display: flex;
  align-items: center;
  /* 2. เปลี่ยนจาก center เป็น flex-start เพื่อให้กรอบรูปชิดขอบซ้าย (เข้าหาข้อความ) */
  justify-content: flex-start; 
  z-index: 2;
  width: 100%; /* บังคับให้โครงเต็มคอลัมน์ เพื่อให้คำสั่ง flex-start ทำงานได้ 100% */
}

.hero-photo-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 4/5;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-bg) 0%, var(--surface) 100%);
  box-shadow: 
    0 30px 80px -15px var(--glow-strong),
    0 0 60px var(--glow-color),
    var(--shadow-xl);
  border: 1px solid var(--border);
  transition: all 0.5s var(--ease-smooth);
}

.hero-photo-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, var(--accent-bg) 100%);
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
}

.hero-photo-frame::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), transparent 30%, transparent 70%, var(--accent-soft));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s var(--ease-smooth);
}

.hero-photo-frame:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 40px 100px -20px var(--glow-strong),
    0 0 80px var(--glow-color),
    var(--shadow-xl);
}

.hero-photo-frame:hover::after { opacity: 1; }

.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.6s var(--ease-smooth);
}

.hero-photo-frame:hover img { transform: scale(1.04); }

/* Floating decorative elements around photo */
.hero-deco {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.hero-deco-1 {
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: var(--accent);
  border-radius: 16px;
  opacity: 0.15;
  animation: float 6s ease-in-out infinite;
}

.hero-deco-2 {
  bottom: -30px;
  left: -30px;
  width: 100px;
  height: 100px;
  background: var(--accent-soft);
  border-radius: 50%;
  opacity: 0.12;
  animation: float 8s ease-in-out infinite reverse;
}

.hero-deco-3 {
  top: 40%;
  right: -50px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent);
  animation: floatParticle 5s ease-in-out infinite;
}

.hero-deco-4 {
  bottom: 25%;
  left: -40px;
  width: 8px;
  height: 8px;
  background: var(--accent-soft);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--accent-soft);
  animation: floatParticle 7s ease-in-out infinite reverse;
}

/* Floating badge over photo */
.hero-photo-badge {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  transition: all 0.3s var(--ease-smooth);
}

[data-theme="light"] .hero-photo-badge {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--accent-bg);
  box-shadow: 0 10px 30px -10px var(--glow-color);
}

.hero-photo-frame:hover .hero-photo-badge {
  transform: translateY(-2px);
}

.hero-photo-badge-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

[data-theme="dark"] .hero-photo-badge-name { color: white; }

.hero-photo-badge-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.1rem;
}

.hero-photo-badge-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 0 15px var(--glow-color);
}

/* ====================================
   WORKPLACE SECTION - PERFECT CENTERING
   ==================================== */

.workplace-section {
  /* เพิ่มคำสั่งนี้เพื่อบังคับให้เนื้อหาทั้งหมดถูกดันมาอยู่กึ่งกลางหน้าจออย่างเด็ดขาด */
  display: flex;
  justify-content: center; 
  padding: 6rem 2.5rem;
}

.workplace-grid {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 5rem; /* เพิ่มระยะห่างระหว่างตัวหนังสือกับรูปให้หายใจสะดวกขึ้น */
  
  /* หัวใจสำคัญ: ล็อกความกว้างรวมของเนื้อหาไว้ที่ 1100px แล้วจัดกึ่งกลาง */
  /* จะแก้ปัญหาข้อมูลเทไปกองฝั่งซ้ายได้อย่างสมบูรณ์ */
  width: 100%;
  max-width: 1100px; 
  margin: 0 auto;
}

.workplace-content {
  width: 100%;
  max-width: 520px; /* ล็อกความกว้างของบล็อกตัวหนังสือ */
}

/* ====================================
   บังคับขอบขวาตรงเป๊ะ (Magazaine Style)
   ==================================== */
/* ใช้ !important เพื่อการันตีว่าจะไม่มีโค้ดบรรทัดอื่นมาแหกกฎนี้ได้ */
.workplace-content p {
  text-align: justify !important;
  text-justify: inter-word !important;
  hyphens: auto !important;
  -webkit-hyphens: auto !important;
  word-spacing: -0.04em !important; 
  line-height: 1.85 !important;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

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

/* Responsive สำหรับแท็บเล็ตและมือถือ */
@media (max-width: 1024px) {
  .workplace-grid {
    flex-direction: column;
    gap: 3.5rem;
  }
  .workplace-content {
    max-width: 100%;
  }
}
/* 2. จัดขอบขวาของตัวหนังสือให้ตรงเป๊ะเป็นเส้นไม้บรรทัด (Block Text) */
.balanced-paragraph {
  text-align: justify;
  text-justify: inter-word; /* กระจายช่องว่างระหว่างคำให้สวยงาม */
  hyphens: auto;            /* ให้เบราว์เซอร์ช่วยตัดคำยาวๆ ลงมาบรรทัดใหม่ */
  -webkit-hyphens: auto;
  word-spacing: -0.04em;    /* บีบช่องว่างระหว่างคำนิดหน่อย ป้องกันรูโหว่ใหญ่ๆ */
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.balanced-paragraph strong { 
  color: var(--text); 
  font-weight: 600; 
}

.workplace-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.4rem 0.85rem;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.workplace-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: accentPulse 2s ease-in-out infinite;
}

.workplace-content h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.workplace-content h2 em {
  color: var(--accent);
  font-style: normal;
}

.workplace-content p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

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

.workplace-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.workplace-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: all 0.3s var(--ease-smooth);
}

.workplace-stat:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px var(--glow-color);
}

.workplace-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.workplace-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Photo Gallery with offset layout */
.workplace-photos {
  position: relative;
  height: 540px;
}

.workplace-photo {
  position: absolute;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  transition: all 0.5s var(--ease-smooth);
}

.workplace-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-smooth);
}

.workplace-photo:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 30px 60px -15px var(--glow-strong),
    0 0 40px var(--glow-color);
  border-color: var(--accent);
  z-index: 3;
}

.workplace-photo:hover img { transform: scale(1.05); }

.workplace-photo-1 {
  top: 0;
  left: 0;
  width: 60%;
  height: 70%;
  z-index: 1;
}

.workplace-photo-2 {
  bottom: 0;
  right: 0;
  width: 55%;
  height: 65%;
  z-index: 2;
}

.workplace-photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
  color: white;
  padding: 2rem 1.25rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.workplace-photo-overlay-tag {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.62rem;
  margin-bottom: 0.4rem;
}

/* Decorative elements behind workplace photos */
.workplace-photos::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.1;
  filter: blur(40px);
  z-index: 0;
  animation: float 10s ease-in-out infinite;
}

.workplace-photos::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 100px;
  height: 100px;
  background: var(--accent-soft);
  border-radius: 16px;
  opacity: 0.08;
  z-index: 0;
  animation: float 8s ease-in-out infinite reverse;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-v7 { grid-template-columns: 1fr; gap: 2.5rem; padding: 7rem 1.5rem 3rem; }
  .hero-v7-right { order: -1; max-width: 360px; margin: 0 auto; }
  .workplace-grid { grid-template-columns: 1fr; }
  .workplace-photos { height: 480px; max-width: 500px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .hero-photo-frame { max-width: 300px; }
  .workplace-section { padding: 3rem 1.25rem; }
  .workplace-photos { height: 380px; }
  .workplace-stats { grid-template-columns: 1fr; }
  .hero-v7-meta { gap: 0.4rem; }
  .hero-v7-meta-pill { font-size: 0.68rem; padding: 0.35rem 0.65rem; }
}

/* =====================================================
   v8 — NEURAL NETWORK BG + ABOUT V7 + WORKPLACE SINGLE
   ===================================================== */

/* NEURAL NETWORK CANVAS BACKGROUND */
#neuralBg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
}

/* Enhanced gradient mesh background */
.gradient-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(at 15% 20%, rgba(37, 99, 235, 0.12) 0%, transparent 45%),
    radial-gradient(at 85% 30%, rgba(96, 165, 250, 0.10) 0%, transparent 45%),
    radial-gradient(at 30% 80%, rgba(59, 130, 246, 0.10) 0%, transparent 45%),
    radial-gradient(at 75% 90%, rgba(37, 99, 235, 0.08) 0%, transparent 45%);
  animation: meshFloat 30s ease-in-out infinite;
}

[data-theme="dark"] .gradient-mesh {
  background:
    radial-gradient(at 15% 20%, rgba(96, 165, 250, 0.15) 0%, transparent 45%),
    radial-gradient(at 85% 30%, rgba(37, 99, 235, 0.15) 0%, transparent 45%),
    radial-gradient(at 30% 80%, rgba(59, 130, 246, 0.12) 0%, transparent 45%),
    radial-gradient(at 75% 90%, rgba(96, 165, 250, 0.10) 0%, transparent 45%);
}

@keyframes meshFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(1.1); }
  75% { transform: translate(20px, 20px) scale(1.05); }
}

/* Remove old particles (replaced by canvas) */
.tech-particles { display: none !important; }

/* Stronger grid */
.tech-grid {
  background-size: 80px 80px;
  background-image: 
    linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
  animation: gridDrift 60s linear infinite;
}

[data-theme="dark"] .tech-grid {
  background-image: 
    linear-gradient(rgba(96, 165, 250, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.07) 1px, transparent 1px);
}

@keyframes gridDrift {
  0% { background-position: 0 0; }
  100% { background-position: 80px 80px; }
}

/* Make orbs more visible */
.tech-bg::before {
  width: 700px;
  height: 700px;
  opacity: 0.18;
}

.tech-bg::after {
  width: 700px;
  height: 700px;
  opacity: 0.15;
}

[data-theme="dark"] .tech-bg::before { opacity: 0.3; }
[data-theme="dark"] .tech-bg::after { opacity: 0.25; }

/* =========== ABOUT V7 — Two Column with Photo =========== */
.about-grid-v7 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 4rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.about-text-v7 p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
  text-align: justify;
  hyphens: auto;
}

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

.about-text-v7 .about-quote-v7 {
  background: linear-gradient(135deg, var(--accent-bg) 0%, var(--surface) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 1.5rem 1.6rem;
  margin: 2rem 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
  border-radius: var(--radius-md);
  font-style: normal;
  position: relative;
  transition: all 0.3s var(--ease-smooth);
}

.about-text-v7 .about-quote-v7:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -8px var(--glow-color);
  border-color: var(--accent);
}

.about-text-v7 .about-quote-v7::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 12px;
  font-size: 3.5rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  opacity: 0.25;
  font-weight: 700;
  line-height: 1;
}

.about-text-v7 .focus-tags-v7 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.about-text-v7 .focus-tag-v7 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.45rem 0.85rem;
  border-radius: 100px;
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  transition: all 0.3s var(--ease-smooth);
  cursor: default;
}

.about-text-v7 .focus-tag-v7:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -3px var(--glow-color);
}

.about-photo-wrap {
  position: sticky;
  top: 6rem;
}

.about-photo-card {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow:
    0 25px 50px -10px var(--glow-color),
    0 0 40px var(--glow-color),
    var(--shadow-xl);
  background: var(--surface);
  transition: all 0.5s var(--ease-smooth);
}

.about-photo-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 35px 70px -15px var(--glow-strong),
    0 0 60px var(--glow-color),
    var(--shadow-xl);
  border-color: var(--accent);
}

.about-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transition: transform 0.6s var(--ease-smooth);
  display: block;
}

.about-photo-card:hover img { transform: scale(1.04); }

.about-photo-badge-v7 {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  color: white;
  z-index: 2;
}

[data-theme="light"] .about-photo-badge-v7 {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--accent-bg);
  box-shadow: 0 10px 30px -10px var(--glow-color);
}

.about-photo-badge-v7 .name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.about-photo-badge-v7 .role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
}

/* Floating decorations around about photo */
.about-photo-deco {
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.about-photo-deco-1 {
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: var(--accent);
  border-radius: 16px;
  opacity: 0.12;
  animation: float 6s ease-in-out infinite;
}

.about-photo-deco-2 {
  bottom: -25px;
  left: -25px;
  width: 100px;
  height: 100px;
  background: var(--accent-soft);
  border-radius: 50%;
  opacity: 0.1;
  filter: blur(20px);
  animation: float 8s ease-in-out infinite reverse;
}

/* =========== WORKPLACE V8 — Single Photo Showcase =========== */
.workplace-photos-v8 {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.workplace-photo-single {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow:
    0 30px 60px -15px var(--glow-strong),
    0 0 50px var(--glow-color),
    var(--shadow-xl);
  background: var(--surface);
  transition: all 0.5s var(--ease-smooth);
}

.workplace-photo-single::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), transparent 30%, transparent 70%, var(--accent-soft));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s var(--ease-smooth);
}

.workplace-photo-single:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent);
  box-shadow:
    0 40px 80px -20px var(--glow-strong),
    0 0 70px var(--glow-color),
    var(--shadow-xl);
}

.workplace-photo-single:hover::after { opacity: 1; }

.workplace-photo-single img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 5%;
  transition: transform 0.6s var(--ease-smooth);
  display: block;
}

.workplace-photo-single:hover img { transform: scale(1.04); }

.workplace-photo-overlay-v8 {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  color: white;
  z-index: 2;
  transition: all 0.3s var(--ease-smooth);
}

[data-theme="light"] .workplace-photo-overlay-v8 {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--accent-bg);
  box-shadow: 0 10px 30px -10px var(--glow-color);
}

.workplace-photo-overlay-v8 .tag {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.workplace-photo-overlay-v8 .label {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Decorations around workplace single photo */
.workplace-photos-v8::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.12;
  filter: blur(40px);
  z-index: 0;
  animation: float 10s ease-in-out infinite;
}

.workplace-photos-v8::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 120px;
  height: 120px;
  background: var(--accent-soft);
  border-radius: 16px;
  opacity: 0.1;
  z-index: 0;
  animation: float 8s ease-in-out infinite reverse;
}

/* Responsive */
@media (max-width: 1024px) {
  .about-grid-v7 { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-photo-wrap { position: static; max-width: 400px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .about-grid-v7 { gap: 2rem; }
  .workplace-photos-v8 { max-width: 320px; }
}
/* ====================================
   WORLD-CLASS TECH BACKGROUND & GLASS
   ==================================== */

#techCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -999;
  /* Token-driven so it tracks the theme automatically (deep slate in dark,
     soft slate-white in light) with no hard-coded values and no flash. */
  background: radial-gradient(circle at center, var(--bg) 0%, var(--surface-3) 100%);
  transition: background 0.5s ease;
}

/* Cards stay FLAT by default (design-system rule). Depth is built from the
   slate tonal ramp + the hover lift/glow defined in the animation layer above,
   not from a resting glass blur. The previous global glassmorphism override
   (hard-coded rgba + !important) was removed: it broke The Flat-By-Default Rule
   and The One Accent Rule, and fought every token-driven surface. Surfaces now
   resolve to var(--surface)/var(--border) in both themes. */
.balanced-text {
  text-align: left;
  
  /* ฟีเจอร์ระดับพรีเมียม: บังคับให้ความยาวของทุกบรรทัดเฉลี่ยออกมาเท่าๆ กัน ไม่ให้มีบรรทัดไหนสั้นหรือยาวโดด */
  text-wrap: balance; 
  
  /* ปรับระยะห่างระหว่างบรรทัดให้โปร่งขึ้น อ่านสบายตา */
  line-height: 1.8; 
  
  /* บีบช่องว่างระหว่างตัวอักษรนิดนึงให้ดู Modern */
  letter-spacing: -0.01em; 
  
  /* ล็อกความกว้างสูงสุดไว้ ไม่ให้บรรทัดยาวเกินไปจนกวาดสายตายาก */
  max-width: 580px; 
  width: 100%;
}
/* ====================================
   FORCE CENTER - WORKPLACE SECTION
   (แก้ปัญหาโดนขังฝั่งซ้ายจาก Grid เก่า)
   ==================================== */

.workplace-section {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
}

.workplace-grid {
  /* เปลี่ยนจาก grid เป็น flex เพื่อทลายคอลัมน์ฝั่งขวาที่ว่างเปล่าทิ้ง */
  display: flex !important;
  justify-content: center !important; /* ดึงทุกอย่างมาไว้ตรงกลางจอ */
  align-items: center !important;
  width: 100% !important;
  max-width: 1100px !important;
  margin: 0 auto !important;
  gap: 4rem !important;
}

.workplace-content {
  width: 100% !important;
  max-width: 580px !important; /* ล็อกความกว้างข้อความให้สวยงาม */
}
/* ====================================
   POWERFUL HERO v8 (Typography & Dimensions)
   ==================================== */

.powerful-hero {
  min-height: 110vh; /* เพิ่มความสูงอีกนิด */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2.5rem;
}

.hero-v7-inner {
  max-width: 1500px;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  position: relative;
}

/* 1. MEGA TYPOGRAPHY (The Main Event) */
.hero-v7-content {
  flex: 1;
  z-index: 5;
}

.mega-title {
  font-size: clamp(3.5rem, 8vw, 8rem); /* ใหญ่ยักษ์ */
  line-height: 0.85;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

/* 2. Text Masking Technique */
.mask-text {
  color: transparent;
  -webkit-text-stroke: 1px rgba(96, 165, 250, 0.5); /* เส้นขอบบางๆ */
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4) 0%, rgba(96, 165, 250, 0.4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  position: relative;
  display: inline-block;
  opacity: 0; /* เริ่มต้นซ่อนไว้สำหรับ Animation */
}

/* Accent line เดิมแต่ปรับสัดส่วน */
.accent-line::after {
  content: '';
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100px;
  height: clamp(8px, 1.5vw, 15px);
  background: var(--accent);
  border-radius: 2px;
}

.hero-v7-tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 2rem;
}

/* 3. PHOTO INTEGRATION (Larger & Complex) */
.hero-v7-photo-container {
  flex: 0 0 45%;
  height: 90vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* แสงหลังรูปเพิ่มพลัง */
.hero-v7-right-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
  z-index: -1;
  filter: blur(50px);
}

.hero-v7-photo-card {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 20px;
  transform: perspective(1000px) rotateY(-10deg); /* เพิ่มมิติ 3D นิดๆ */
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-v7-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

@media (max-width: 1024px) {
  .hero-v7-inner { flex-direction: column; text-align: center; }
  .mega-title { font-size: 4rem; }
  .hero-v7-photo-container { height: 50vh; width: 100%; order: -1; }
  .hero-v7-photo-card { transform: rotateY(0deg); }
}
/* =====================================================
   CHATREE KENGPIPAT — Premium Reveal + Gloss FX
   ===================================================== */

.ck-headline {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.04em;
  perspective: 1000px;
  transform-style: preserve-3d;
  cursor: default;
}

.ck-line {
  position: relative;
  display: block;
  width: fit-content;
  font-size: clamp(4rem, 9vw, 9rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.065em;
  text-transform: uppercase;
  color: var(--text-strong);
  transform-origin: left center;
  transform:
    translateY(0)
    rotateX(var(--ck-rx, 0deg))
    rotateY(var(--ck-ry, 0deg));
  animation: ckReveal 1.05s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition:
    transform 450ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 450ms cubic-bezier(0.16, 1, 0.3, 1),
    text-shadow 450ms cubic-bezier(0.16, 1, 0.3, 1);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28),
    0 16px 36px rgba(37, 99, 235, 0.08);
  overflow: hidden;
}

.ck-line-blue {
  color: var(--accent);
  animation-delay: 0.16s;
}

/* แสงสะท้อน ไม่ย้อมสีตัวอักษร */
.ck-line::after {
  content: attr(class);
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: transparent;
  background:
    linear-gradient(
      105deg,
      transparent 0%,
      transparent 39%,
      rgba(255, 255, 255, 0.08) 44%,
      rgba(255, 255, 255, 0.92) 49%,
      rgba(219, 234, 254, 0.22) 54%,
      transparent 61%,
      transparent 100%
    );
  background-size: 250% 100%;
  background-position: -180% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  mix-blend-mode: screen;
  opacity: 0;
  animation: ckGlossSweep 1.65s ease-in-out infinite;
  animation-delay: 1.05s;
}

.ck-line-dark::after { content: "CHATREE"; }
.ck-line-blue::after { content: "KENGPIPAT"; animation-delay: 1.22s; }

.ck-headline:hover .ck-line {
  transform:
    translateY(-0.035em)
    rotateX(var(--ck-rx, 0deg))
    rotateY(var(--ck-ry, 0deg))
    scale(1.018);
  filter: drop-shadow(0 18px 34px rgba(37, 99, 235, 0.16));
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.36),
    0 24px 56px rgba(37, 99, 235, 0.16);
}

.ck-headline:hover .ck-line::after {
  animation-duration: 0.95s;
}

@keyframes ckReveal {
  from {
    opacity: 0;
    transform: translateY(0.42em) rotateX(26deg) scale(0.96);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
    filter: blur(0);
  }
}

@keyframes ckGlossSweep {
  0%, 18% {
    opacity: 0;
    background-position: -180% 50%;
  }
  36% {
    opacity: 0.92;
  }
  56%, 100% {
    opacity: 0;
    background-position: 180% 50%;
  }
}

[data-theme="dark"] .ck-line {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14),
    0 18px 42px rgba(96, 165, 250, 0.16);
}

@media (max-width: 768px) {
  .ck-line {
    font-size: clamp(3.1rem, 16vw, 5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ck-line,
  .ck-line::after {
    animation: none !important;
    transform: none !important;
  }
}
/* =====================================================
   CHATREE KENGPIPAT — Signature Light Sculpture FX
   Premium reveal · reflective glint · 3D hover
   ===================================================== */

/* กันแท่งน้ำเงินเก่ากลับมา */
.accent-line::before,
.accent-line::after,
.hero-v7 h1::before,
.hero-v7 h1::after,
.mega-title::before,
.mega-title::after {
  content: none !important;
  display: none !important;
}

.ck-signature {
  --ck-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ck-ink: var(--text-strong);
  --ck-blue: var(--accent);
  --ck-glow: color-mix(in srgb, var(--accent) 24%, transparent);
  --ck-glow-strong: color-mix(in srgb, var(--accent) 48%, transparent);

  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.02em;
  width: fit-content;
  isolation: isolate;
  perspective: 1100px;
  transform-style: preserve-3d;
  cursor: default;
}

/* ambient glow behind headline */
.ck-signature::before {
  content: '';
  position: absolute;
  inset: -0.12em -0.08em;
  z-index: -2;
  border-radius: 0.18em;
  background:
    radial-gradient(circle at 18% 18%, var(--ck-glow-strong), transparent 34%),
    radial-gradient(circle at 78% 78%, var(--ck-glow), transparent 42%);
  filter: blur(34px);
  opacity: 0.22;
  transform: translateZ(-80px);
  animation: ckAuraBreath 4.8s ease-in-out infinite;
}

/* small travelling edge light */
.ck-signature::after {
  content: '';
  position: absolute;
  left: -8%;
  top: 45%;
  width: 34%;
  height: 0.075em;
  z-index: 5;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.85), transparent);
  box-shadow: 0 0 22px rgba(96, 165, 250, 0.35);
  opacity: 0;
  transform: translateX(-60%) rotate(-8deg);
  animation: ckEdgeComet 3.2s ease-in-out infinite;
  pointer-events: none;
}

.ck-signature__line {
  position: relative;
  display: block;
  width: fit-content;
  color: var(--ck-ink);
  font-size: clamp(4.1rem, 9vw, 9rem);
  font-weight: 950;
  line-height: 0.82;
  letter-spacing: -0.07em;
  text-transform: uppercase;
  transform-style: preserve-3d;
  transform:
    rotateX(var(--ck-rx, 0deg))
    rotateY(var(--ck-ry, 0deg))
    translateZ(0);
  transition:
    transform 520ms var(--ck-ease),
    filter 520ms var(--ck-ease),
    text-shadow 520ms var(--ck-ease);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.34),
    0 18px 36px rgba(37,99,235,0.08);
}

.ck-signature__line--blue {
  color: var(--ck-blue);
}

/* depth layer */
.ck-signature__line::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: currentColor;
  opacity: 0.12;
  transform: translate3d(0.035em, 0.045em, -12px);
  filter: blur(0.4px);
  pointer-events: none;
}

/* glossy reflection only */
.ck-signature__line::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: 3;
  color: transparent;
  pointer-events: none;
  background:
    linear-gradient(
      108deg,
      transparent 0%,
      transparent 37%,
      rgba(255,255,255,0.08) 43%,
      rgba(255,255,255,0.96) 49%,
      rgba(219,234,254,0.18) 54%,
      transparent 62%,
      transparent 100%
    );
  background-size: 260% 100%;
  background-position: -170% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  mix-blend-mode: screen;
  opacity: 0;
  animation: ckGlassSweep 2.65s ease-in-out infinite;
}

.ck-signature__line--blue::after {
  animation-delay: 0.16s;
}

.ck-signature__char {
  display: inline-block;
  position: relative;
  transform-origin: 50% 82%;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(0.48em) rotateX(34deg) scale(0.96);
  animation: ckCharReveal 900ms var(--ck-ease) forwards;
  animation-delay: calc(var(--ck-i) * 52ms + var(--ck-line-delay, 0ms));
  will-change: transform, opacity, filter;
}

.ck-signature__space {
  display: inline-block;
  width: 0.22em;
}

.ck-signature:hover .ck-signature__line {
  transform:
    rotateX(var(--ck-rx, 0deg))
    rotateY(var(--ck-ry, 0deg))
    translateY(-0.035em)
    translateZ(28px)
    scale(1.012);
  filter: drop-shadow(0 18px 30px var(--ck-glow));
  text-shadow:
    0 1px 0 rgba(255,255,255,0.42),
    0 26px 58px rgba(37,99,235,0.16);
}

.ck-signature:hover .ck-signature__char {
  animation-play-state: running;
}

.ck-signature:hover .ck-signature__line::after {
  animation-duration: 1.05s;
}

/* subtle individual letter lift on hover */
.ck-signature__char:hover {
  transform: translateY(-0.08em) translateZ(42px) rotateX(-8deg) scale(1.04);
  transition: transform 260ms var(--ck-ease);
}

[data-theme="dark"] .ck-signature {
  --ck-glow: color-mix(in srgb, var(--accent) 32%, transparent);
  --ck-glow-strong: color-mix(in srgb, var(--accent) 62%, transparent);
}

[data-theme="dark"] .ck-signature__line {
  text-shadow:
    0 1px 0 rgba(255,255,255,0.16),
    0 20px 44px rgba(96,165,250,0.18);
}

@keyframes ckCharReveal {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(0.48em) rotateX(34deg) scale(0.96);
  }
  62% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-0.045em) rotateX(-5deg) scale(1.012);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) rotateX(0) scale(1);
  }
}

@keyframes ckGlassSweep {
  0%, 18% {
    opacity: 0;
    background-position: -170% 50%;
  }
  34% {
    opacity: 0.88;
  }
  52%, 100% {
    opacity: 0;
    background-position: 170% 50%;
  }
}

@keyframes ckAuraBreath {
  0%, 100% {
    opacity: 0.18;
    transform: translateZ(-80px) scale(0.98);
  }
  50% {
    opacity: 0.34;
    transform: translateZ(-80px) scale(1.04);
  }
}

@keyframes ckEdgeComet {
  0%, 18% {
    opacity: 0;
    transform: translateX(-70%) rotate(-8deg);
  }
  34% {
    opacity: 0.75;
  }
  55%, 100% {
    opacity: 0;
    transform: translateX(270%) rotate(-8deg);
  }
}

@media (max-width: 768px) {
  .ck-signature__line {
    font-size: clamp(3.15rem, 16vw, 5.1rem);
    letter-spacing: -0.06em;
  }

  .ck-signature::after {
    height: 0.09em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ck-signature,
  .ck-signature::before,
  .ck-signature::after,
  .ck-signature__line,
  .ck-signature__line::after,
  .ck-signature__char {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}
/* =====================================================
   CK HEADLINE SIZE FIX
   ลดขนาดไม่ให้ชน/อยู่หลังรูป
   ===================================================== */

.ck-signature {
  max-width: min(100%, 680px);
  overflow: visible;
}

.ck-signature__line {
  font-size: clamp(3.1rem, 6.2vw, 6.4rem) !important;
  line-height: 0.86;
  letter-spacing: -0.058em;
}

/* ถ้ายังใหญ่ไป ลด KENGPIPAT นิดหนึ่งเพราะยาวกว่า */
.ck-signature__line--blue {
  font-size: clamp(3rem, 5.9vw, 6.1rem) !important;
}

/* กัน hero ฝั่งซ้ายกินพื้นที่รูป */
.hero-v7-left,
.hero-v7-content {
  max-width: 620px !important;
  min-width: 0;
  z-index: 5;
}

.hero-v7-right,
.hero-v7-photo-container {
  z-index: 4;
}

/* Desktop กว้างมาก */
@media (min-width: 1440px) {
  .ck-signature__line {
    font-size: clamp(2.65rem, 5.3vw, 5.5rem) !important;
  }

  .ck-signature__line--blue {
    font-size: clamp(2.65rem, 5.3vw, 5.5rem) !important;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .ck-signature {
    max-width: 100%;
    align-items: center;
  }

  .ck-signature__line {
    font-size: clamp(3rem, 10vw, 5.4rem) !important;
    text-align: center;
  }

  .ck-signature__line--blue {
    font-size: clamp(2.8rem, 9.4vw, 5rem) !important;
  }
}

/* Mobile — size the headline so the longest word ("KENGPIPAT", 9 ultra-black
   caps) always fits the viewport. The old 14vw/12.5vw preferred value scaled up
   too fast: at 360px it resolved to ~50px, overflowing the screen and dragging
   the whole hero column (and the desc paragraph) off the right edge. */
@media (max-width: 768px) {
  /* Keep the headline and its column from ever exceeding the viewport, so a
     wide word can't blow out the flex column and clip the paragraph. */
  .ck-signature { max-width: 100%; }
  .hero-v7-left { width: 100%; max-width: 100% !important; min-width: 0; }

  .ck-signature__line {
    font-size: clamp(2.1rem, 11vw, 3.5rem) !important;
    letter-spacing: -0.05em;
    max-width: 100%;
  }

  /* "KENGPIPAT" is two chars longer than "CHATREE" — size it a touch smaller so
     both lines clear the right edge together. */
  .ck-signature__line--blue {
    font-size: clamp(1.85rem, 9.4vw, 3.1rem) !important;
  }
}

/* Small phones (≤380px): tighten once more so 320–375px devices never clip. */
@media (max-width: 380px) {
  .ck-signature__line { font-size: clamp(1.95rem, 10.2vw, 2.9rem) !important; }
  .ck-signature__line--blue { font-size: clamp(1.7rem, 8.7vw, 2.6rem) !important; }
}

/* =====================================================
   COOL FX LAYER · v11
   Cursor spotlight · 3D tilt · hero entrance ·
   scroll progress · section-title underline draw.
   Every effect is opt-in via pointer or
   (prefers-reduced-motion: no-preference); the page is
   fully visible and usable with none of it running.
   ===================================================== */

/* ---- 1. Cursor spotlight on cards ----
   JS injects a .fx-glow child and tracks --mx/--my. The glow sits at z-index -1
   inside an isolated stacking context, so it paints over the card surface but
   behind the card's own content and ::before/::after — no clobbering. */
.fx-spot { position: relative; isolation: isolate; }
.fx-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
  background: radial-gradient(
    460px circle at var(--mx, 50%) var(--my, 50%),
    var(--glow-color), transparent 60%
  );
}
.fx-spot:hover .fx-glow { opacity: 1; }

/* ---- 2. 3D tilt on big feature cards (transform set inline by JS) ---- */
.fx-tilt {
  transform-style: preserve-3d;
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth);
}
.fx-tilt:hover { transition-duration: 0.1s; } /* track the pointer crisply */

/* ---- 3. Hero v7 choreographed entrance (page load) ----
   The signature (.ck-signature) keeps its own per-letter reveal; everything
   else rises in sequence. Load animation only (immediate, never scroll-gated),
   so content is never trapped invisible. */
@media (prefers-reduced-motion: no-preference) {
  .hero-v7-left > *:not(.ck-signature) {
    animation: heroRise 0.85s var(--ease-smooth) backwards;
  }
  .hero-v7-left > .hero-v7-tag  { animation-delay: 0.15s; }
  .hero-v7-left > .hero-v7-desc { animation-delay: 0.30s; }
  .hero-v7-left > .hero-v7-meta { animation-delay: 0.45s; }
  .hero-v7-left > .hero-v7-cta  { animation-delay: 0.60s; }
  .hero-v7-right {
    animation: heroPhotoIn 1.05s var(--ease-smooth) 0.2s backwards;
  }
  @keyframes heroRise {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes heroPhotoIn {
    from { opacity: 0; transform: translateY(26px) scale(0.97); }
    to   { opacity: 1; transform: none; }
  }
}

/* ---- 3d. Skip-to-content link (first focusable; a11y) ---- */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 2000;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip:focus { left: 0; }

/* ---- 4. Slim scroll-progress bar (index; JS adds #ck-progress) ---- */
#ck-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 1000;                 /* above the fixed nav (z-index 100) */
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  box-shadow: 0 0 14px var(--glow-color);
  will-change: transform;
  transition: transform 0.1s linear;
  pointer-events: none;
}

/* ---- 4b. Back-to-top pill (JS adds #ck-top; shows past ~620px) ---- */
#ck-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 26px -8px var(--glow-color), 0 2px 6px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth), filter 0.2s;
}
#ck-top.show { opacity: 1; transform: none; pointer-events: auto; }
#ck-top:hover { filter: brightness(1.08); transform: translateY(-2px); }
#ck-top:active { transform: translateY(0) scale(0.95); }
@media print { #ck-top { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  #ck-top { transition: opacity 0.2s; }
  #ck-top:hover { transform: none; }
}

/* ---- 5. Section-title emphasis: underline draws as it scrolls in ----
   Scroll-driven (view timeline). No support / reduced motion → no underline,
   heading still perfect. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .section-title em { position: relative; }
    .section-title em::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: -0.12em;
      height: 2px;
      border-radius: 2px;
      background: linear-gradient(90deg, var(--accent), transparent);
      transform: scaleX(0);
      transform-origin: left;
      animation: emUnderline linear both;
      animation-timeline: view();
      animation-range: entry 12% entry 55%;
    }
    @keyframes emUnderline { to { transform: scaleX(1); } }
  }
}

/* ---- Reduced motion: hard-off for all of the above ---- */
@media (prefers-reduced-motion: reduce) {
  .fx-glow { display: none; }
  .fx-tilt { transform: none !important; }
  #ck-progress { display: none; }
}
/* ---- Justified body text (distributed evenly across each line) — site-wide ---- */
.content-p,
.hero-v7-desc,
.balanced-text,
.balanced-paragraph,
.project-desc,
.project-hero-desc,
.method-card-desc,
.sapcta-desc,
.award-desc,
.academic-desc,
.algo-card-desc,
.about-text-v7 p,
.workplace-content p {
  text-align: justify;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}
