/* ==========================================================================
   CV & Portfolio Stylesheet - Md. Rayhan Sheikh Raj
   Architecture: Hydra Stratified Midnight Obsidian + Non-Neon Precision
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Typographic Hierarchy */
  --font-display: "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* Precision Radii & Transitions */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Stratified Midnight Obsidian Defaults (Fallback for pre-light-dark engines) */
  --bg-void: #030712;
  --bg-deep: #060d1e;
  --bg-surface: #070e1c;
  --bg-panel: #0a1426;
  --bg-card: #0c1830;
  --bg-card-hover: #122244;
  --bg-hover: rgba(0, 240, 255, 0.05);

  --border-subtle: #1a2942;
  --border: #1a2942;
  --border-md: rgba(0, 240, 255, 0.25);
  --border-active: #00f0ff;

  --cyan: #00f0ff;
  --cyan-dim: rgba(0, 240, 255, 0.12);
  --cyan-glow: transparent;
  --blue-primary: #3b82f6;
  --ice: #38bdf8;
  --ice-dim: rgba(56, 189, 248, 0.14);
  --purple: #818cf8;
  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.14);

  --white: #ffffff;
  --body-text: #f1f5f9;
  --dim: #cbd5e1;
  --muted: #94a3b8;
  --text-inverse: #030712;
  --grid-line: rgba(148, 163, 184, 0.05);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);

  /* Scrollbar Tokens (>= 3:1 contrast) */
  --scrollbar-thumb: #334e7a;
  --scrollbar-track: #030712;

  /* Map legacy aliases cleanly */
  --bg: var(--bg-void);
  --bg-subtle: var(--bg-surface);
  --border-highlight: var(--border-md);
  --text: var(--body-text);
  --text-muted: var(--muted);
  --primary: var(--ice);
  --accent: var(--purple);
  --accent-gradient: linear-gradient(135deg, var(--cyan) 0%, var(--ice) 50%, var(--purple) 100%);
  --badge-bg: var(--cyan-dim);
  --badge-border: var(--border-md);
  --tag-bg: var(--bg-surface);

  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  accent-color: var(--ice);
}

/* Reflect meta[name="color-scheme"] override in CSS (dark-mode-toggle guidance) */
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

/* Progressive light/dark color tokens using light-dark() when supported */
@supports (color: light-dark(white, black)) {
  :root {
    --bg-void: light-dark(#f8fafc, #030712);
    --bg-deep: light-dark(#f1f5f9, #060d1e);
    --bg-surface: light-dark(#eef2f7, #070e1c);
    --bg-panel: light-dark(#ffffff, #0a1426);
    --bg-card: light-dark(#ffffff, #0c1830);
    --bg-card-hover: light-dark(#f8fafc, #122244);
    --bg-hover: light-dark(rgba(2, 132, 199, 0.06), rgba(0, 240, 255, 0.05));

    --border-subtle: light-dark(#dbe3ee, #1a2942);
    --border: light-dark(#dbe3ee, #1a2942);
    --border-md: light-dark(rgba(2, 132, 199, 0.35), rgba(0, 240, 255, 0.25));
    --border-active: light-dark(#0284c7, #00f0ff);

    --cyan: light-dark(#0284c7, #00f0ff);
    --cyan-dim: light-dark(rgba(2, 132, 199, 0.1), rgba(0, 240, 255, 0.12));
    --ice: light-dark(#0369a1, #38bdf8);
    --ice-dim: light-dark(rgba(3, 105, 161, 0.1), rgba(56, 189, 248, 0.14));
    --purple: light-dark(#4f46e5, #818cf8);
    --emerald: light-dark(#059669, #10b981);
    --emerald-dim: light-dark(rgba(5, 150, 105, 0.1), rgba(16, 185, 129, 0.14));

    --white: light-dark(#0f172a, #ffffff);
    --body-text: light-dark(#0f172a, #f1f5f9);
    --dim: light-dark(#334155, #cbd5e1);
    --muted: light-dark(#475569, #94a3b8);
    --text-inverse: light-dark(#ffffff, #030712);
    --grid-line: light-dark(rgba(15, 23, 42, 0.04), rgba(148, 163, 184, 0.05));
    --shadow: light-dark(0 8px 22px rgba(15, 23, 42, 0.06), 0 12px 28px rgba(0, 0, 0, 0.38));

    --scrollbar-thumb: light-dark(#64748b, #334e7a);
    --scrollbar-track: light-dark(#e2e8f0, #030712);
  }
}

/* Fallback light scheme for older browsers without light-dark() */
@supports not (color: light-dark(white, black)) {
  @media (prefers-color-scheme: light) {
    :root:not(:has(> head > meta[name="color-scheme"][content="dark"])) {
      --bg-void: #f8fafc;
      --bg-deep: #f1f5f9;
      --bg-surface: #eef2f7;
      --bg-panel: #ffffff;
      --bg-card: #ffffff;
      --bg-card-hover: #f8fafc;
      --border-subtle: #dbe3ee;
      --border: #dbe3ee;
      --border-md: rgba(2, 132, 199, 0.35);
      --border-active: #0284c7;
      --cyan: #0284c7;
      --cyan-dim: rgba(2, 132, 199, 0.1);
      --ice: #0369a1;
      --purple: #4f46e5;
      --white: #0f172a;
      --body-text: #0f172a;
      --dim: #334155;
      --muted: #475569;
      --text-inverse: #ffffff;
      --shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
      --scrollbar-thumb: #64748b;
      --scrollbar-track: #e2e8f0;
    }
  }
}

/* Legacy scrollbar fallback only where standard scrollbar-color is unsupported */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 9999px;
  }
}

/* ==========================================================================
   Base Reset & Accessibility Utilities
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-void);
  color: var(--body-text);
  line-height: 1.6;
  padding: 1.35rem 1.75rem 3rem;
  min-height: 100vh;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1200;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  border: 1px solid var(--border-active);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
}

/* Accessible High-Contrast Focus Indicator */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--border-active);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
}

/* ==========================================================================
   Utility Bar (No Navbar, Actions Only)
   ========================================================================== */
.utility-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease), box-shadow 0.18s var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--cyan);
  color: var(--text-inverse);
  border-color: var(--cyan);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.btn-primary:hover {
  background: var(--ice);
  border-color: var(--ice);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--body-text);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-md);
}

.icon-btn {
  min-width: 40px;
  min-height: 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--body-text);
  cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease);
}

.icon-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-md);
}

.icon-btn:active {
  transform: scale(0.96);
}

/* Pure CSS Theme Toggle Icon Branching (dark-mode-toggle pattern) */
.theme-opt {
  display: none;
  align-items: center;
  justify-content: center;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-opt-light {
  display: inline-flex;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-opt-dark {
  display: inline-flex;
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-opt-light {
    display: inline-flex;
  }
}

@media (prefers-color-scheme: light) {
  :root:not(:has(> head > meta[name="color-scheme"][content="dark"])) .theme-opt-dark {
    display: inline-flex;
  }
}

/* ==========================================================================
   Header Profile Card (Stratified Obsidian Panel)
   ========================================================================== */
.profile-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
}

.profile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.4rem;
}

.profile-info h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 0.45rem;
}

.headline {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ice);
}

.telemetry-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: var(--emerald);
  padding: 0.32rem 0.85rem;
  border-radius: 9999px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--emerald);
}

@media (prefers-reduced-motion: no-preference) {
  .status-dot {
    animation: statusPulse 2.4s ease-in-out infinite;
  }
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.profile-bio {
  color: var(--dim);
  font-size: 1rem;
  max-width: 72ch;
  margin-bottom: 1.4rem;
  line-height: 1.7;
}

.focus-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--cyan);
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.94rem;
  color: var(--dim);
}

.focus-box strong {
  color: var(--white);
  font-weight: 700;
}

.contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--muted);
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.18s var(--ease);
}

a.contact-item:hover {
  color: var(--cyan);
}

.contact-item svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  color: var(--ice);
  flex-shrink: 0;
}

/* ==========================================================================
   Section Headers & Telemetry Metrics
   ========================================================================== */
.section {
  margin-bottom: 3.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--white);
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-subtle);
  margin-left: 0.5rem;
}

.section-title svg {
  color: var(--cyan);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Integrated Architectural Ledger Strip */
.metrics-ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-subtle);
  gap: 0.75rem 1.5rem;
}

.ledger-item {
  padding-left: 1rem;
  border-left: 1px solid var(--border-subtle);
}

.ledger-item:first-child {
  padding-left: 0;
  border-left: none;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--cyan);
  line-height: 1.2;
}

.metric-label {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.2rem;
}

@media (max-width: 768px) {
  .metrics-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ledger-item:nth-child(odd) {
    padding-left: 0;
    border-left: none;
  }
}

/* ==========================================================================
   Featured Projects: Asymmetrical Bento Grid
   ========================================================================== */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  min-height: 36px;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.825rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease);
}

.filter-btn:hover {
  color: var(--white);
  border-color: var(--border-md);
  background: var(--bg-hover);
}

.filter-btn:active {
  transform: scale(0.97);
}

.filter-btn.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: var(--border-md);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.15rem;
}

.bento-wide {
  grid-column: span 7;
}

.bento-compact {
  grid-column: span 5;
}

.bento-half {
  grid-column: span 6;
}

/* Uniform balanced grid when filtered to a subset */
.bento-grid.is-filtered .project-card {
  grid-column: span 6;
}

@media (max-width: 960px) {
  .bento-wide,
  .bento-compact,
  .bento-half,
  .bento-grid.is-filtered .project-card {
    grid-column: span 12;
  }
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.22s var(--ease), background-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.project-card:hover {
  border-color: var(--border-md);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.project-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.project-category-tag {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid var(--border-md);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  display: inline-block;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.project-desc {
  color: var(--dim);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1.1rem;
}

.project-highlights {
  list-style: none;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-highlights li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.4rem;
}

/* Crisp CSS geometric bullet (zero raw glyph dependency) */
.project-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  border-right: 1.5px solid var(--cyan);
  border-top: 1.5px solid var(--cyan);
  transform: rotate(45deg);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.35rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.24rem 0.55rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--dim);
}

.project-links {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.95rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--cyan);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease);
}

.project-link:hover {
  background: var(--bg-hover);
  border-color: var(--border-md);
}

.project-link:active {
  transform: scale(0.97);
}

/* ==========================================================================
   Interactive Skills & Technologies (Reference: skills-section.tsx)
   ========================================================================== */
.skills-showcase {
  position: relative;
  overflow-x: clip;
  padding: 2rem 1.5rem 2.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* Crisp Architectural Grid Backdrop (Zero Neon Slop / Zero Blurry Blobs) */
.skills-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
}

.skills-header {
  position: relative;
  z-index: 5;
  text-align: center;
  margin-bottom: 2rem;
}

.skills-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.9rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--body-text);
  margin-bottom: 0.85rem;
}

.skills-badge svg {
  width: 14px;
  height: 14px;
  color: var(--cyan);
}

.skills-heading {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--white);
  line-height: 1.2;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.skills-subtitle {
  margin: 0.65rem auto 0;
  max-width: 38rem;
  font-size: 0.98rem;
  color: var(--muted);
}

/* Controls Row (Single Horizontal Line on Desktop) */
.skills-controls {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.skills-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.26rem;
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.skills-tab {
  min-height: 34px;
  padding: 0.36rem 0.72rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.79rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.14s var(--ease);
}

.skills-tab:hover {
  color: var(--white);
  background: var(--bg-hover);
}

.skills-tab:active {
  transform: scale(0.97);
}

.skills-tab.active {
  background: var(--bg-card);
  color: var(--cyan);
  border-color: var(--border-md);
}

.skills-actions-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.skills-search-wrap {
  position: relative;
  width: clamp(180px, 16vw, 240px);
}

@media (min-width: 1120px) {
  .skills-controls {
    flex-wrap: nowrap;
  }
  .skills-tabs {
    flex-wrap: nowrap;
  }
  .skills-actions-right {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
}

.skills-search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.skills-search-input {
  width: 100%;
  min-height: 38px;
  padding: 0.45rem 0.85rem 0.45rem 2.35rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--body-text);
  font-size: 0.85rem;
  font-family: var(--font-ui);
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.skills-search-input::placeholder {
  color: var(--muted);
}

.skills-search-input:focus {
  border-color: var(--border-active);
  background: var(--bg-card);
}

.skills-view-toggle {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  gap: 0.2rem;
}

.view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.32rem 0.7rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.14s var(--ease);
}

.view-mode-btn svg {
  width: 14px;
  height: 14px;
}

.view-mode-btn:hover {
  color: var(--white);
}

.view-mode-btn:active {
  transform: scale(0.96);
}

.view-mode-btn.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: var(--border-md);
}

.motion-toggle-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.14s var(--ease);
}

.motion-toggle-btn svg {
  width: 15px;
  height: 15px;
}

.motion-toggle-btn:hover {
  color: var(--cyan);
  border-color: var(--border-md);
}

.motion-toggle-btn:active {
  transform: scale(0.96);
}

.motion-toggle-btn .motion-icon-play {
  display: none;
}

.skills-showcase.motion-paused .motion-toggle-btn .motion-icon-pause {
  display: none;
}

.skills-showcase.motion-paused .motion-toggle-btn .motion-icon-play {
  display: block;
  color: var(--cyan);
}

/* Desktop Radial Hub Container */
.skills-hub-wrapper {
  display: none;
  position: relative;
  z-index: 10;
  width: 100%;
}

@media (min-width: 1024px) {
  .skills-showcase:not(.mode-grid) .skills-hub-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .skills-showcase:not(.mode-grid) .skills-cards-grid {
    display: none;
  }
}

@media (max-width: 1023px) {
  .skills-view-toggle,
  .motion-toggle-btn {
    display: none;
  }
}

.skills-showcase.mode-grid .motion-toggle-btn {
  display: none;
}

.skills-hub-stage {
  position: relative;
  width: 100%;
  min-height: 740px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: min-height 0.7s var(--ease), height 0.7s var(--ease);
}

.skills-hub-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.28s var(--ease);
}

/* Central Interactive Core Hub (Non-Neon Hairline Precision) */
.skills-central-hub {
  position: relative;
  z-index: 30;
  width: 128px;
  height: 128px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease), opacity 0.3s ease;
}

.skills-central-hub:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.skills-central-hub:active {
  transform: scale(0.95);
}

.skills-central-hub.not-armed {
  transform: scale(0.8);
  opacity: 0;
}

.skills-central-hub.collapse-pulse {
  animation: hubCollapsePulse 0.7s ease-in-out;
}

.hub-energy-svg {
  position: absolute;
  inset: -6px;
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
  pointer-events: none;
  z-index: 5;
}

.hub-energy-track {
  fill: none;
  stroke: transparent;
  stroke-width: 2.5;
}

.hub-energy-arc {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0;
  transition: stroke-dashoffset 0.2s ease-out, opacity 0.25s ease;
}

.hub-inner-core {
  position: absolute;
  inset: 8px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-hexagon-icon {
  width: 32px;
  height: 32px;
  color: var(--cyan);
  animation: spinShrinkExpand 8s ease-in-out infinite;
}

.hub-orbit-ring {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
}

.hub-orbit-ring-1 {
  inset: -24px;
  border: 1px solid var(--border-subtle);
  animation: hubSpin 12s linear infinite;
}

.hub-orbit-ring-2 {
  inset: -48px;
  border: 1px solid var(--border-md);
  animation: hubSpin 20s linear infinite reverse;
}

.skills-central-hub.ring-rush .hub-orbit-ring-1 {
  animation-duration: 4s;
}

.skills-central-hub.ring-rush .hub-orbit-ring-2 {
  animation-duration: 8s;
}

.skills-showcase.motion-paused .hub-hexagon-icon,
.skills-showcase.motion-paused .hub-orbit-ring-1,
.skills-showcase.motion-paused .hub-orbit-ring-2 {
  animation-play-state: paused;
}

/* Connection Lines Layer (Compositor-Only scaleY + translateY) */
.skills-lines-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.skill-line-anchor {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.skill-line-beam {
  width: 1px;
  height: var(--line-len, 220px);
  transform-origin: top;
  transform: scaleY(0);
  background: linear-gradient(to bottom, var(--cyan), var(--ice-dim), transparent);
  position: relative;
  overflow: visible;
  opacity: 0;
}

.skill-line-pulse {
  position: absolute;
  top: 0;
  width: 4px;
  height: 32px;
  left: -1.5px;
  background: var(--cyan);
  opacity: 0;
  animation: beamPulse 2s linear infinite;
}

.skills-showcase.motion-paused .skill-line-pulse {
  animation-play-state: paused;
}

/* Radial Skill Cards */
.skills-radial-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

.radial-skill-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--card-w, 228px);
  pointer-events: auto;
  will-change: transform, opacity;
}

.radial-skill-card .skill-card {
  padding: 0.85rem 0.9rem;
}

.radial-skill-card .skill-name {
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

/* Shared Skill Card Appearance (Radial & Grid) */
.skill-card {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  padding: 0.95rem 1rem;
  transition: border-color 0.22s var(--ease), background-color 0.22s var(--ease), transform 0.2s var(--ease);
}

.skill-card:hover {
  border-color: var(--border-md);
  background: var(--bg-card-hover);
}

.skill-card.featured {
  border-color: var(--border-md);
  background: linear-gradient(145deg, var(--cyan-dim) 0%, var(--bg-card) 60%);
}

.skill-card.featured:hover {
  border-color: var(--border-active);
}

.skill-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.72rem;
}

.skill-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.skill-icon-box {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--muted);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.skill-icon-box svg {
  width: 17px;
  height: 17px;
}

.skill-card.featured .skill-icon-box,
.skill-card:hover .skill-icon-box {
  background: var(--cyan-dim);
  border-color: var(--border-md);
  color: var(--cyan);
}

.skill-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-years {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.skill-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}

.skill-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.08rem 0.45rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  background: var(--cyan);
  color: var(--text-inverse);
}

.skill-top-badge svg {
  width: 9px;
  height: 9px;
}

.skill-level-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan);
}

.skill-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.skill-progress-fill {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: var(--accent-gradient);
  transform-origin: left;
  transform: scaleX(0);
  will-change: transform;
}

.skill-desc {
  margin-top: 0.62rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skill-cat-pill {
  display: inline-block;
  margin-top: 0.65rem;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  color: var(--dim);
  background: var(--bg-surface);
}

/* Mobile / Grid Layout */
.skills-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1rem;
  position: relative;
  z-index: 15;
}

.grid-skill-card {
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition: opacity 0.4s ease, transform 0.4s var(--ease);
}

.grid-skill-card.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.grid-skill-card:hover .skill-card {
  transform: translateY(-2px);
}

.skills-empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  position: relative;
  z-index: 15;
}

/* Hub Keyframe Animations */
@keyframes hubSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spinShrinkExpand {
  0% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(720deg) scale(0.7); }
  40% { transform: rotate(720deg) scale(1.2); }
  70% { transform: rotate(720deg) scale(1); }
  100% { transform: rotate(720deg) scale(1); }
}

@keyframes hubCollapsePulse {
  0% { transform: scale(1); }
  28% { transform: scale(1.07); }
  65% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@keyframes beamPulse {
  0% { transform: translateY(36px); opacity: 0; }
  30% { opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translateY(calc(var(--line-len, 220px) - 32px)); opacity: 0; }
}

/* ==========================================================================
   Experience & Education Split
   ========================================================================== */
.split-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-item,
.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.65rem;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.timeline-item:hover,
.edu-card:hover {
  border-color: var(--border-md);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.role-title,
.edu-degree {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
}

.company-name,
.edu-institution {
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.94rem;
  margin-bottom: 0.45rem;
}

.time-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--dim);
  padding: 0.24rem 0.65rem;
  border-radius: 6px;
}

.timeline-desc {
  color: var(--dim);
  font-size: 0.92rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.edu-highlights {
  font-size: 0.9rem;
  color: var(--dim);
  margin-top: 0.85rem;
  line-height: 1.6;
}

.edu-highlights p {
  margin-bottom: 0.85rem;
}

.responsibilities-list {
  list-style: none;
  font-size: 0.875rem;
  color: var(--muted);
}

.responsibilities-list li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.45rem;
}

/* Pure CSS Vector Checkmark (Zero raw emoji glyph) */
.responsibilities-list li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.42em;
  width: 5px;
  height: 9px;
  border-right: 2px solid var(--emerald);
  border-bottom: 2px solid var(--emerald);
  transform: rotate(45deg);
}

/* ==========================================================================
   Native Accessible Project Architecture Dialog
   ========================================================================== */
.hydra-dialog {
  margin: auto;
  max-width: 680px;
  width: calc(100% - 2rem);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  color: var(--body-text);
  padding: 0;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
}

.hydra-dialog::backdrop {
  background: rgba(3, 7, 18, 0.78);
}

@media (prefers-reduced-motion: no-preference) {
  .hydra-dialog[open] {
    animation: dialogReveal 0.22s var(--ease) both;
  }
}

@keyframes dialogReveal {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-panel {
  padding: 1.75rem 2rem;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-top: 0.5rem;
}

.dialog-summary {
  color: var(--dim);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.dialog-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.87rem;
  color: var(--dim);
  line-height: 1.55;
}

.dialog-block-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cyan);
  margin-bottom: 0.45rem;
}

.dialog-section {
  margin-bottom: 1.15rem;
}

.dialog-section:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Toast Notification (Hydra Pattern §3.2)
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--cyan);
  color: var(--body-text);
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.75rem;
  margin-top: 3.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-meta {
  margin-top: 0.45rem;
  font-size: 0.84rem;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

.footer-links a:hover {
  color: var(--cyan);
}

/* Coarse Pointer Touch Target Bump (WCAG 2.5.8) */
@media (pointer: coarse) {
  .btn,
  .icon-btn,
  .filter-btn,
  .skills-tab,
  .project-link,
  .motion-toggle-btn {
    min-height: 44px;
  }
}

/* ==========================================================================
   Print Stylesheet (For PDF & Physical CV Export)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #111827 !important;
    padding: 0 !important;
    font-size: 10.5pt !important;
  }

  .utility-bar,
  .filter-tabs,
  .toast,
  .project-links,
  footer,
  .icon-btn,
  .skills-controls,
  .skills-hub-wrapper,
  .skills-ambient,
  .skip-link,
  .hydra-dialog {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    width: 100% !important;
  }

  .profile-card,
  .project-card,
  .skill-card,
  .timeline-item,
  .edu-card,
  .skills-showcase {
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .metrics-ledger,
  .ledger-item {
    border-color: #cbd5e1 !important;
  }

  .metric-value {
    color: #0f172a !important;
  }

  .metric-label {
    color: #334155 !important;
  }

  .profile-card::before {
    display: none;
  }

  .profile-info h1,
  .gradient-text,
  .skills-heading {
    -webkit-text-fill-color: #0f172a !important;
    color: #0f172a !important;
  }

  .profile-info h1 {
    font-size: 22pt !important;
  }

  .skills-header {
    text-align: left !important;
    margin-bottom: 0.75rem !important;
  }

  .skills-heading {
    font-size: 13pt !important;
  }

  .skills-subtitle,
  .skills-badge {
    display: none !important;
  }

  .skills-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.6rem !important;
  }

  .grid-skill-card {
    opacity: 1 !important;
    transform: none !important;
    page-break-inside: avoid;
  }

  .skill-card {
    padding: 0.65rem !important;
    margin-bottom: 0 !important;
  }

  .skill-name,
  .skill-level-pct,
  .project-title,
  .role-title,
  .edu-degree {
    color: #0f172a !important;
  }

  .skill-years,
  .skill-desc,
  .profile-bio,
  .project-desc,
  .timeline-desc,
  .responsibilities-list,
  .contact-strip,
  .focus-box {
    color: #334155 !important;
  }

  .skill-progress-track {
    background: #e2e8f0 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .skill-progress-fill {
    transform: scaleX(var(--skill-scale, 0.85)) !important;
    background: #0284c7 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .section-title {
    color: #0f172a !important;
    font-size: 13pt !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.7rem !important;
    page-break-after: avoid;
  }

  .section-title::after {
    background-color: #cbd5e1 !important;
  }

  .tag,
  .skill-cat-pill,
  .skill-top-badge,
  .time-badge,
  .status-badge,
  .project-category-tag {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
  }

  .bento-grid,
  .split-layout {
    display: block !important;
  }

  .project-card {
    margin-bottom: 0.85rem !important;
  }
}

@media (max-width: 768px) {
  body {
    padding: 1.25rem 0.75rem 2.5rem;
  }

  .profile-card {
    padding: 1.5rem;
  }

  .telemetry-cluster {
    align-items: flex-start;
  }

  .contact-strip {
    flex-direction: column;
    gap: 0.75rem;
  }

  .skills-showcase {
    padding: 1.5rem 1rem;
  }

  .skills-actions-right,
  .skills-search-wrap {
    width: 100%;
  }

  .dialog-panel {
    padding: 1.25rem;
  }
}

/* Education cards are rendered from cv.json; space them when there is more than one. */
.edu-list {
  display: grid;
  gap: 1.25rem;
}

/* ============================================================================
   BACKGROUND ART (fixed behind the page, washed for legibility).
   Dark theme: media/bg.webp under a dark wash. Light theme: media/bg-light.webp
   under a pale wash.
   ============================================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--bg-art-wash-top, rgba(3, 7, 18, 0.55)) 0%, var(--bg-art-wash-bottom, rgba(3, 7, 18, 0.78)) 100%),
    var(--bg-art-image, url('media/bg.webp')) center / cover no-repeat;
  opacity: var(--bg-art-opacity, 1);
  transition: opacity 0.3s ease;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  --bg-art-image: url('media/bg-light.webp');
  --bg-art-wash-top: rgba(248, 250, 252, 0.5);
  --bg-art-wash-bottom: rgba(248, 250, 252, 0.72);
}

@media (prefers-color-scheme: light) {
  :root:not(:has(> head > meta[name="color-scheme"][content="dark"])) {
    --bg-art-image: url('media/bg-light.webp');
    --bg-art-wash-top: rgba(248, 250, 252, 0.5);
    --bg-art-wash-bottom: rgba(248, 250, 252, 0.72);
  }
}

@media print {
  body::before {
    display: none;
  }
}

/* ============================================================================
   GLASS CARDS (let the background art show through in both themes).
   Light theme uses a higher alpha: dark text needs more backing than light text.
   ============================================================================ */
:root {
  --glass-alpha: 54%;
  --glass-blur: 14px;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  --glass-alpha: 66%;
  --glass-blur: 14px;
}

@media (prefers-color-scheme: light) {
  :root:not(:has(> head > meta[name="color-scheme"][content="dark"])) {
    --glass-alpha: 66%;
    --glass-blur: 14px;
  }
}

.profile-card,
.skills-showcase {
  background: color-mix(in srgb, var(--bg-panel) var(--glass-alpha), transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
}

.project-card,
.timeline-item,
.edu-card {
  background: color-mix(in srgb, var(--bg-card) var(--glass-alpha), transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
}

.project-card:hover {
  background: color-mix(in srgb, var(--bg-card-hover) calc(var(--glass-alpha) + 14%), transparent);
}

.btn-secondary,
.icon-btn,
.filter-btn {
  background: color-mix(in srgb, var(--bg-card) calc(var(--glass-alpha) + 10%), transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}

/* ============================================================================
   OBSCURA JOURNEY (journey.js)
   A fixed canvas draws the Obsidian to Crystal sequence behind the page.
   journey.js adds .journey-on to <body> once a frame is on screen and keeps
   --journey between 0 (Obsidian, dark) and 1 (Crystal, bright).
   Without .journey-on the static theme image above stays in place.
   ============================================================================ */
.journey-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: -2;
  display: none;
  pointer-events: none;
}

body.journey-on .journey-canvas {
  display: block;
}

/* The canvas replaces the static image; body::before keeps only the wash.
   The wash takes the theme colour and grows stronger where the frame fights
   the theme: bright frames under the dark theme, dark frames under the light. */
body.journey-on {
  --journey: 0;
  --bg-art-image: none;
  --bg-art-wash-top: rgb(3 7 18 / calc(0.5 + 0.2 * var(--journey)));
  --bg-art-wash-bottom: rgb(3 7 18 / calc(0.72 + 0.1 * var(--journey)));
  --glass-alpha: calc(54% + 22% * var(--journey));
}

:root:has(> head > meta[name="color-scheme"][content="light"]) body.journey-on {
  --bg-art-wash-top: rgb(248 250 252 / calc(0.84 - 0.36 * var(--journey)));
  --bg-art-wash-bottom: rgb(248 250 252 / calc(0.9 - 0.2 * var(--journey)));
  --glass-alpha: calc(80% - 14% * var(--journey));
}

@media (prefers-color-scheme: light) {
  :root:not(:has(> head > meta[name="color-scheme"][content="dark"])) body.journey-on {
    --bg-art-wash-top: rgb(248 250 252 / calc(0.84 - 0.36 * var(--journey)));
    --bg-art-wash-bottom: rgb(248 250 252 / calc(0.9 - 0.2 * var(--journey)));
    --glass-alpha: calc(80% - 14% * var(--journey));
  }
}

@media print {
  .journey-canvas {
    display: none !important;
  }
}

/* ============================================================================
   SITE ADDITIONS: navigation bar, About, Contact, project status, back to top
   ============================================================================ */
[hidden] {
  display: none !important;
}

/* Anchored sections stop below the sticky navigation bar. */
section[id] {
  scroll-margin-top: 6.25rem;
}

/* ---- Navigation bar: sticky glass pill ---- */
.site-nav {
  position: sticky;
  top: 0.85rem;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.6rem 0.5rem 0.85rem;
  margin-bottom: 1.75rem;
  border-radius: 9999px;
  border: 1px solid color-mix(in srgb, var(--white) 14%, transparent);
  background: color-mix(in srgb, var(--bg-panel) 46%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--white) 16%, transparent),
    0 10px 30px rgba(0, 0, 0, 0.18);
  transition: background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-nav.is-scrolled {
  background: color-mix(in srgb, var(--bg-panel) 66%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--white) 16%, transparent),
    0 14px 38px rgba(0, 0, 0, 0.28);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0 auto;
}

.nav-link {
  padding: 0.45rem 0.8rem;
  border-radius: 9999px;
  color: var(--dim);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.nav-link:hover {
  color: var(--white);
  background: var(--bg-hover);
}

.nav-link[aria-current='true'] {
  color: var(--cyan);
  background: var(--cyan-dim);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.nav-links + .nav-actions {
  margin-left: 0;
}

.site-nav .btn,
.site-nav .icon-btn {
  border-radius: 9999px;
}

.nav-menu-btn {
  display: none;
}

@media (max-width: 1080px) {
  .site-nav {
    border-radius: 26px;
    flex-wrap: wrap;
  }

  .nav-menu-btn {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    margin: 0;
    padding: 0.4rem 0 0.25rem;
    border-top: 1px solid var(--border-subtle);
  }

  .site-nav.menu-open .nav-links {
    display: flex;
  }

  .nav-link {
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-sm);
  }

  .nav-links + .nav-actions {
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .nav-brand span,
  .nav-cta span {
    display: none;
  }

  .nav-cta {
    width: 40px;
    padding: 0;
  }
}

/* ---- About ---- */
.about-card,
.contact-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.9rem 2.1rem;
  background: color-mix(in srgb, var(--bg-panel) var(--glass-alpha), transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
}

.about-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.5rem 2.25rem;
  align-items: start;
}

.about-avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
}

.about-body p {
  color: var(--dim);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 68ch;
}

.about-body p + p {
  margin-top: 0.9rem;
}

.about-facts {
  margin: 0;
}

.about-facts > div {
  padding: 0.6rem 0;
  border-top: 1px solid var(--border-subtle);
}

.about-facts > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.about-facts dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.about-facts dd {
  margin: 0.1rem 0 0;
  color: var(--body-text);
  font-size: 0.94rem;
  font-weight: 600;
}

@media (max-width: 960px) {
  .about-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Project status and links ---- */
.project-status {
  flex-shrink: 0;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.project-status-live,
.project-status-open-source {
  color: var(--emerald);
  background: var(--emerald-dim);
  border-color: rgba(16, 185, 129, 0.32);
}

.project-status-development {
  color: var(--ice);
  background: var(--ice-dim);
  border-color: color-mix(in srgb, var(--ice) 35%, transparent);
}

.project-links {
  flex-wrap: wrap;
  gap: 0.6rem;
}

.project-link-external {
  text-decoration: none;
  color: var(--text-inverse);
  background: var(--cyan);
  border-color: var(--cyan);
}

.project-link-external:hover {
  background: var(--ice);
  border-color: var(--ice);
}

/* ---- Contact ---- */
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 2rem 2.75rem;
}

.contact-text {
  color: var(--dim);
  line-height: 1.7;
  max-width: 46ch;
}

.contact-email {
  display: inline-block;
  margin-top: 1rem;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-email:hover {
  color: var(--cyan);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.contact-actions .btn {
  color: var(--body-text);
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-label {
  color: var(--dim);
  font-size: 0.84rem;
  font-weight: 600;
}

.form-input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
  color: var(--body-text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.form-input:hover {
  border-color: var(--border-md);
}

.form-input:focus-visible {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}

.form-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.form-footer .btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.form-status {
  flex: 1 1 16rem;
  color: var(--dim);
  font-size: 0.9rem;
}

.form-status[data-kind='ok'] {
  color: var(--emerald);
}

.form-status[data-kind='error'] {
  color: #f87171;
}

@media (max-width: 960px) {
  .contact-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-card,
  .contact-card {
    padding: 1.4rem 1.25rem;
  }
}

/* ---- Footer links, back to top, toast position ---- */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.4rem;
}

.back-to-top {
  position: fixed;
  right: 1.75rem;
  bottom: 1.75rem;
  z-index: 950;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

.toast {
  bottom: 5.5rem;
}

/* ---- No-JavaScript fallback ---- */
.noscript-fallback {
  max-width: 46rem;
  margin: 2rem auto;
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--body-text);
  line-height: 1.7;
}

.noscript-fallback h1 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
}

.noscript-fallback ul {
  margin: 0.75rem 0 0 1.2rem;
}

.noscript-fallback a {
  color: var(--cyan);
}

@media print {
  .site-nav,
  .back-to-top,
  .contact-form {
    display: none !important;
  }
}

/* ---- Experience / Education: equal-height columns, aligned card headers ---- */
.split-layout {
  align-items: stretch;
  margin-bottom: 3.25rem;
}

.split-layout > .section {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.timeline,
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

/* The last card in each column grows, so both columns end on the same line. */
.timeline > .timeline-item:last-child,
.edu-list > .edu-card:last-child {
  flex: 1;
}

.timeline-meta > div {
  min-width: 0;
  flex: 1 1 14rem;
}

.timeline-meta .time-badge {
  flex-shrink: 0;
  white-space: nowrap;
}

.edu-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.edu-highlights {
  margin-top: 0;
}

@media print {
  .split-layout > .section {
    display: block;
  }
}
