/* ==========================================================================
   Daniel Galindo Aranda — Portfolio & Technical Profile
   Institutional, Minimalist & Engineering Design System
   ========================================================================== */

/* Self-hosted variable fonts (latin subset, SIL Open Font License) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
}

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme: Dark (Default) — Deep Slate & Obsidian */
  --bg-primary: #090c10;
  --bg-secondary: #0d1117;
  --bg-alt: #0b0f14;
  --bg-card: rgba(18, 24, 32, 0.88);
  --bg-card-hover: rgba(22, 30, 40, 0.94);
  --bg-alt-glass: rgba(11, 15, 20, 0.55);
  --bg-footer-glass: rgba(13, 17, 23, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.16);

  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #7d8590;

  --accent-primary: #2f81f7;
  --accent-hover: #1f6feb;
  /* Solid fills under white text and accent text on tinted chips (AA contrast) */
  --accent-solid: #1f6feb;
  --accent-solid-hover: #1a5fd0;
  --accent-on-soft: #2f81f7;
  --accent-soft: rgba(56, 139, 253, 0.12);
  --accent-secondary: #3fb950;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.45);
  --card-spotlight: rgba(47, 129, 247, 0.08);
}

[data-theme="light"] {
  --bg-primary: #f6f8fa;
  --bg-secondary: #ffffff;
  --bg-alt: #f0f2f5;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(252, 253, 253, 0.95);
  --bg-alt-glass: rgba(240, 242, 245, 0.6);
  --bg-footer-glass: rgba(255, 255, 255, 0.78);
  --border-color: #d0d7de;
  --border-color-hover: #afb8c1;

  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-muted: #636c76;

  --accent-primary: #0969da;
  --accent-hover: #0860ca;
  --accent-solid: #0969da;
  --accent-solid-hover: #0860ca;
  --accent-on-soft: #0550ae;
  --accent-soft: rgba(9, 105, 218, 0.08);
  --accent-secondary: #1a7f37;
  --card-spotlight: rgba(9, 105, 218, 0.04);

  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Ambient Interactive Canvas (Network & Particles)
   ========================================================================== */
.ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s ease;
}

.hero-section,
.section,
.footer {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(9, 12, 16, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

[data-theme="light"] .navbar {
  background: rgba(246, 248, 250, 0.88);
}

.nav-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.brand-code {
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

.brand-name {
  color: var(--text-primary);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-links a {
  position: relative;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 1px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.nav-links a.active:not(.btn)::after {
  transform: scaleX(1);
}

.nav-links a.btn.active {
  border-color: var(--accent-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  transition: border-color var(--transition-fast);
}

.lang-toggle:hover {
  border-color: var(--border-color-hover);
}

.lang-option {
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

html[lang="es"] .lang-option[data-lang-option="es"],
html[lang="en"] .lang-option[data-lang-option="en"] {
  background: var(--accent-soft);
  color: var(--accent-on-soft);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform var(--transition-normal), opacity var(--transition-fast);
}

.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

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

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 7.5rem 1.5rem 4.5rem;
  background: radial-gradient(circle at 70% 35%, rgba(47, 129, 247, 0.07), transparent 60%);
}

.hero-inner {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-content {
  min-width: 0;
}

/* Interactive arm panel */
.hero-visual {
  position: relative;
  height: 440px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(var(--border-color) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--border-color) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg-alt-glass);
  overflow: hidden;
}

/* Without the script (class set in <head>) the panel and the toggles would be inert */
html:not(.js) .hero-visual,
html:not(.js) .lang-toggle,
html:not(.js) .theme-toggle {
  display: none;
}

html:not(.js) .hero-inner {
  grid-template-columns: 1fr;
}

.arm-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.telemetry {
  position: absolute;
  left: 1rem;
  right: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
}

.telemetry-top {
  top: 0.85rem;
  gap: 0.5rem;
}

.telemetry-bottom {
  bottom: 0.75rem;
  justify-content: space-between;
}

.telemetry b {
  font-weight: 500;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

.telemetry-sep {
  opacity: 0.5;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-secondary);
  animation: status-pulse 2.4s ease-out infinite;
}

@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.55); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(63, 185, 80, 0); }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.kicker-line {
  display: inline-block;
  width: 16px;
  height: 1px;
  background-color: var(--accent-primary);
}

.hero-title {
  font-size: clamp(2.5rem, 5.4vw, 4.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  color: var(--text-primary);
  background: linear-gradient(115deg, var(--text-primary) 35%, var(--accent-primary) 115%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.25rem;
  max-width: 620px;
}

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

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-icon {
  flex-shrink: 0;
}

/* Icon-only button (same height as text buttons) */
.btn-square {
  padding: 0;
  width: var(--btn-height, 2.9rem);
  height: var(--btn-height, 2.9rem);
}

.hero-actions-sep {
  width: 1px;
  height: 1.75rem;
  margin: 0 0.25rem;
  background: var(--border-color);
}

.btn-primary {
  background: var(--accent-solid);
  color: #ffffff;
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-color-hover);
}

.btn-outline-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.btn-outline-sm:hover {
  background: var(--accent-solid);
  color: #ffffff;
  border-color: var(--accent-solid);
}

/* ==========================================================================
   Section Components
   ========================================================================== */
main {
  counter-reset: section;
}

main:focus {
  outline: none;
}

.section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--border-color);
  counter-increment: section;
}

.bg-alt {
  background-color: var(--bg-alt-glass);
}

.section-header {
  text-align: center;
  margin-bottom: 3.25rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.section-tag::before {
  content: counter(section, decimal-leading-zero) " / ";
  color: var(--text-muted);
}

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

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0.6rem auto 0;
}

/* ==========================================================================
   About Grid
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.quote-box {
  border-left: 2px solid var(--accent-primary);
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}

.quote-text {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.about-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

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

/* Bento tiles */
.stats-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  counter-reset: stat;
}

.stat-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  transition: border-color var(--transition-fast);
  counter-increment: stat;
}

.stat-item::after {
  content: counter(stat, decimal-leading-zero);
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.stat-item:hover {
  border-color: var(--border-color-hover);
}

.stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Grids & Cards
   ========================================================================== */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

/* Specialty cards also list their tools, so they get two wide columns */
.areas-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.area-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.area-card .tags {
  margin-top: auto;
}

@media (max-width: 720px) {
  .areas-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Card Spotlight & Modern Hover Effect
   ========================================================================== */
.card, .stat-item, .about-card {
  position: relative;
  overflow: hidden;
}

.card::before, .stat-item::before, .about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 760px;
  height: 760px;
  /* Fixed gradient moved with transform: following the cursor needs no repaint */
  background: radial-gradient(circle closest-side, var(--card-spotlight), transparent 70%);
  transform: translate(calc(var(--mouse-x, -600px) - 380px), calc(var(--mouse-y, -600px) - 380px));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.card:hover::before, .stat-item:hover::before, .about-card:hover::before {
  opacity: 1;
  will-change: transform;
}

.card > *, .stat-item > *, .about-card > * {
  position: relative;
  z-index: 2;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
}

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

.card-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-primary);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

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

.tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Project Card
   ========================================================================== */
.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

.project-card:hover {
  transform: none;
}

.project-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.project-title {
  font-size: 1.45rem;
}

.project-card .cert-header {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-card .project-list {
  margin: 0 0 1.25rem;
}

.project-actions {
  margin-top: 1.5rem;
}

/* ==========================================================================
   Timeline
   ========================================================================== */
.timeline {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.25rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-primary);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.timeline-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ==========================================================================
   Certifications & Languages
   ========================================================================== */
.cert-card {
  display: flex;
  flex-direction: column;
}

.cert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cert-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.cert-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.cert-list li {
  position: relative;
  padding-left: 1rem;
}

.cert-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: bold;
}

.cert-list li strong {
  color: var(--text-primary);
}

.lang-box {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.lang-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

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

.lang-level {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--bg-footer-glass);
  border-top: 1px solid var(--border-color);
  padding: 4.5rem 0 2.5rem;
}

.footer-content {
  text-align: center;
}

.footer-cta {
  max-width: 580px;
  margin: 0 auto 3rem;
}

.footer-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.footer-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

.footer-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-subtext {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.print-only {
  display: none;
}

/* ==========================================================================
   Scroll Reveal (class added by JS only, so content is visible without it)
   `translate` is used so the hover `transform` lift keeps working.
   ========================================================================== */
.reveal {
  opacity: 0;
  translate: 0 16px;
  transition:
    opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    translate 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform var(--transition-normal),
    background-color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal);
}

.reveal.visible {
  opacity: 1;
  translate: 0 0;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.5rem 1rem;
  background: var(--accent-solid);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.5rem 1.25rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: none;
  }

  .nav-open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links a:not(.btn)::after {
    display: none;
  }

  .nav-links a.active {
    color: var(--accent-primary);
  }

  .nav-links .btn-outline-sm {
    margin-top: 0.9rem;
    padding: 0.6rem 0.8rem;
    text-align: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    width: 100%;
    max-width: 520px;
    height: 280px;
    margin: 0 auto;
  }

  .brand,
  .lang-toggle,
  .theme-toggle,
  .nav-toggle {
    min-height: 44px;
  }

  .theme-toggle,
  .nav-toggle {
    min-width: 44px;
  }

  .lang-option {
    padding: 0.45rem 0.55rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 650px) {
  .kicker-line {
    display: none;
  }

  /* The separator becomes a line break so both icon buttons share the second row */
  .hero-actions-sep {
    flex-basis: 100%;
    width: auto;
    height: 0;
    margin: 0;
    background: none;
  }

  .kicker-text {
    letter-spacing: 0.06em;
  }

  .stats-card {
    grid-template-columns: 1fr;
  }

  .stat-item {
    min-height: 0;
  }

  .hero-tagline {
    font-size: 1.1rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .card {
    padding: 1.35rem;
  }
}

@media (max-width: 400px) {
  .brand-name {
    display: none;
  }

  /* Keeps the three hero buttons on one row on the narrowest phones */
  .hero-actions .btn:not(.btn-square) {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ==========================================================================
   Print / Save as PDF: light palette, everything visible, no interactive chrome
   ========================================================================== */
@media print {
  :root,
  [data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-alt: #ffffff;
    --bg-card: #ffffff;
    --bg-alt-glass: #ffffff;
    --bg-footer-glass: #ffffff;
    --border-color: #d0d7de;
    --text-primary: #1f2328;
    --text-secondary: #424a53;
    --text-muted: #57606a;
    --accent-primary: #0969da;
    --accent-on-soft: #0550ae;
    --accent-soft: rgba(9, 105, 218, 0.08);
    --accent-secondary: #1a7f37;
    --shadow-subtle: none;
    --shadow-card: none;
    --shadow-hover: none;
  }

  .ambient-canvas,
  .navbar,
  .skip-link,
  .hero-visual,
  .hero-actions,
  .footer-buttons,
  .project-actions {
    display: none !important;
  }

  .reveal {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .hero-section {
    min-height: 0;
    padding: 0 1.5rem 2rem;
    background: none;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-title {
    background: none;
    -webkit-text-fill-color: currentColor;
  }

  .section {
    padding: 2rem 0;
  }

  .footer {
    padding: 2rem 0 0;
  }

  .card,
  .stat-item,
  .about-card,
  .timeline-item {
    break-inside: avoid;
  }

  .section-header {
    break-after: avoid;
  }

  .print-only {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
  }
}
