/* ==========================================================================
   Design System & Tokens
   ========================================================================== */
:root {
  /* Editorial Warm Palette */
  --bg: #FAF9F5;            /* Premium warm ivory */
  --bg-alt: #F2EFE9;        /* Warm secondary cream */
  --surface: #FFFFFF;       /* Pure white surface */
  --ink: #111622;           /* Deep ink navy-black (strict high contrast) */
  --ink-soft: #3D4454;      /* Highly readable body text navy-gray */
  --ink-faint: #727986;     /* Caption & metadata slate */
  --line: #E2DDD5;          /* Sophisticated, visible warm boundaries */
  --line-light: #ECE8E0;    /* Soft inner divider line */
  
  /* Precision Accent Colors */
  --blue: #1A3EB2;          /* True cobalt blue */
  --blue-hover: #122B85;    /* Deep navy-blue for hover states */
  --blue-light: #E9EDFC;    /* Soft blue tint */
  --violet: #6E4AE0;        /* Secondary technical violet */
  
  /* Status Colors */
  --success: #0F7E41;       /* Technical active green */
  --success-bg: #E3F5EC;    /* Soft green background */

  /* Typography */
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Layout Boundaries */
  --container: 1180px;
  --radius: 8px;
  --radius-sm: 4px;
  --nav-h: 72px;
  
  /* Transitions */
  --timing: 0.2s;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 1.2rem;
  border-radius: 50%;
  transition: background-color var(--timing);
}
.theme-toggle:hover {
  background-color: var(--bg-alt);
}
.theme-toggle .icon-moon { display: none; }
.dark-mode .theme-toggle .icon-sun { display: none; }
.dark-mode .theme-toggle .icon-moon { display: block; }

/* Dark Mode Variables */
body.dark-mode {
  --bg: #0A0C10;            /* Deeper charcoal background */
  --bg-alt: #11141C;        /* Slightly lighter alt background */
  --surface: #171B26;       /* Elevated surface color */
  --ink: #EDF0F5;           /* Off-white text */
  --ink-soft: #B0B8C7;      /* Muted secondary text */
  --ink-faint: #6B768B;     /* Subdued caption text */
  --line: #252D3D;          /* Subtle border color */
  --line-light: #252D3D;    /* Same for inner lines */
  --blue: #5880FF;          /* Keep accent, adjust for dark background contrast */
  --blue-hover: #7A9BFF;    /* Brighter hover */
}

/* Dark Mode Overrides */
body.dark-mode .btn-outline {
  border-color: var(--line);
}
body.dark-mode .btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Header transition */
.site-header {
  transition: background-color var(--timing) var(--ease), border-color var(--timing) var(--ease);
}
body.dark-mode .site-header {
  background-color: rgba(10, 12, 16, 0.85);
}

/* Fix for Diagram/Schematics in Dark Mode */
body.dark-mode .diagram-node {
  fill: var(--bg-alt);
  stroke: var(--line);
}
body.dark-mode .diagram-node-active {
  fill: var(--bg-alt);
  stroke: var(--blue);
}
body.dark-mode .diagram-node-text {
  fill: var(--ink);
}
body.dark-mode .diagram-label {
  fill: var(--ink-faint);
}
body.dark-mode .diagram-line {
  stroke: var(--line);
}
body.dark-mode .about-diagram .diagram-node-active {
  fill: var(--bg-alt);
}
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography & Hierarchy
   ========================================================================== */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  font-weight: 800;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

p {
  margin: 0 0 1.25em;
  color: var(--ink-soft);
  max-width: 65ch;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--timing) var(--ease), border-color var(--timing) var(--ease);
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

/* Monospace Micro-labels */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* Global Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--surface);
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  border-radius: var(--radius);
  outline: 2px solid var(--blue);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* Grid & Spacing Container */
.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 120px 0;
}
.section-alt {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 680px;
  margin-bottom: 64px;
}
.section-head p {
  margin-top: 16px;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Interactive Elements / Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--timing) var(--ease),
              border-color var(--timing) var(--ease),
              color var(--timing) var(--ease),
              transform var(--timing) var(--ease);
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background-color: var(--ink);
  color: var(--surface);
}
.btn-primary:hover {
  background-color: var(--blue);
}
.btn-outline {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover {
  border-color: var(--ink);
  background-color: rgba(17, 22, 34, 0.02);
}
.btn-text {
  background: none;
  border: none;
  color: var(--blue);
  padding: 10px 4px;
  font-weight: 600;
}
.btn-text:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}
.btn-small {
  padding: 10px 18px;
  font-size: 0.88rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(250, 249, 245, 0.88);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
  height: var(--nav-h);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  margin-right: auto;
  letter-spacing: -0.03em;
}
.logo-dot {
  color: var(--blue);
}

.main-nav {
  display: flex;
  gap: 24px;
}
.main-nav a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  position: relative;
  padding: 8px 0;
}
.main-nav a:hover {
  color: var(--ink);
}
.main-nav a.active {
  color: var(--ink);
}
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background-color: var(--blue);
  border-radius: 1px;
}

.nav-cta {
  display: inline-flex;
}

/* Mobile Menu Trigger */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0;
  z-index: 1100;
  border-radius: var(--radius);
  transition: background-color var(--timing) var(--ease);
}
.menu-toggle:hover {
  background-color: var(--bg-alt);
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--ink);
  border-radius: 1px;
  transition: transform var(--timing) var(--ease), opacity var(--timing) var(--ease);
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  flex-direction: column;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg);
  padding: 24px 32px;
  gap: 8px;
  border-top: 1px solid var(--line);
  z-index: 999;
  overflow-y: auto;
}
.mobile-nav.open {
  display: flex;
}
.mobile-nav a {
  padding: 14px 0;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-light);
}
.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--ink);
}
.mobile-nav .btn {
  margin-top: 16px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 100px 0;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 64px;
  align-items: center;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.hero-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  background-color: var(--blue);
  border-radius: 50%;
}
.hero-heading {
  font-size: clamp(2.4rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}
.reveal-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  animation: revealWord 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.reveal-word:nth-child(2) { animation-delay: 0.04s; }
.reveal-word:nth-child(3) { animation-delay: 0.08s; }
.reveal-word:nth-child(4) { animation-delay: 0.12s; }
.reveal-word:nth-child(5) { animation-delay: 0.16s; }
.reveal-word:nth-child(6) { animation-delay: 0.20s; }
.reveal-word:nth-child(7) { animation-delay: 0.24s; }
.reveal-word:nth-child(8) { animation-delay: 0.28s; }

.hero-heading .accent {
  color: var(--blue);
}
@keyframes revealWord {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-sub {
  font-size: 1.12rem;
  line-height: 1.6;
  max-width: 48ch;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.hero-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-links a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hero-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Sidebar Dashboard Panel */
.hero-panel {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 4px 20px -10px rgba(17, 22, 34, 0.04);
}
.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-head {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-light);
  margin-bottom: 18px;
}
.panel-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  text-transform: none;
  font-weight: 600;
  color: var(--success);
  font-size: 0.85rem;
  background-color: var(--success-bg);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0;
}
.panel-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
  display: inline-block;
  animation: pulseGreen 2s infinite;
}
@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(15, 126, 65, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(15, 126, 65, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(15, 126, 65, 0); }
}

.panel-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.panel-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  gap: 12px;
}
.panel-list li span {
  color: var(--ink-faint);
}
.panel-list li strong {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}
.panel-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--line-light);
  font-size: 0.88rem;
}
.panel-foot span {
  color: var(--ink-faint);
}
.panel-foot a {
  font-weight: 700;
  color: var(--blue);
}
.panel-foot a:hover {
  color: var(--blue-hover);
}

/* Hero Diagram Card */
.hero-diagram-card {
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background-color: var(--surface);
  box-shadow: 0 4px 20px -10px rgba(17, 22, 34, 0.04);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 64px;
  align-items: start;
}
.about-photo {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 28px;
  box-shadow: 0 8px 30px -16px rgba(17, 22, 34, 0.15);
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.about-copy {
  display: flex;
  flex-direction: column;
}
.about-copy p {
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

/* Layered Architecture Diagram */
.about-diagram {
  margin-top: 40px;
  max-width: 480px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: var(--radius);
}

/* ==========================================================================
   What I Build Capabilities Grid
   ========================================================================== */
.build-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 32px;
}
.build-card {
  padding: 40px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-color: var(--surface);
  transition: background-color var(--timing) var(--ease);
}
.build-card:hover {
  background-color: rgba(26, 62, 178, 0.015);
}
.build-card h3 {
  margin-bottom: 18px;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
}
.build-card p {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-list li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  background-color: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}
.section-alt .tag-list li {
  background-color: var(--surface);
}

/* ==========================================================================
   Selected Work & Editorial Specs Layout
   ========================================================================== */
.project-feature {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 64px;
  align-items: start;
  padding-bottom: 56px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line);
}
.project-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 12px;
}
.project-feature h3 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 18px;
  letter-spacing: -0.025em;
}
.project-desc {
  font-size: 1.08rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

.project-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
  padding: 24px 0;
}
.project-facts dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.project-facts dd {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink);
  font-weight: 500;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}
.project-social {
  display: flex;
  gap: 18px;
}
.project-social a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-faint);
}
.project-social a:hover {
  color: var(--blue);
}

.project-editorial {
  width: 100%;
}

/* Authentic editorial project specifications card */
.project-specs-card {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 4px 20px -10px rgba(17, 22, 34, 0.04);
}
.project-specs-card h4 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 20px;
  border-bottom: 1.5px solid var(--line-light);
  padding-bottom: 12px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.specs-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.specs-list li {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.specs-list li strong {
  color: var(--ink);
  font-weight: 700;
}

/* Progressive Disclosure Story Styles */
.practora-story {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
}
.practora-story.open {
  max-height: 2500px;
  opacity: 1;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
  padding: 40px 0 48px;
}
.story-block h4 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  color: var(--ink);
}
.story-block p {
  font-size: 0.94rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   Algorithms Code Container
   ========================================================================== */
.project-card {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  overflow: hidden;
  box-shadow: 0 4px 20px -10px rgba(17, 22, 34, 0.04);
}
.project-card-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-alt);
}
.project-card-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.project-card-header h3 {
  font-size: 1.4rem;
  margin: 0;
}
.project-card-body {
  padding: 32px;
}
.project-card-body p {
  font-size: 1.02rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Code Container Block */
.code-container {
  background-color: #0E121A;
  border: 1px solid #1C2331;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.4);
}
.code-block-header {
  background-color: #121824;
  padding: 10px 18px;
  border-bottom: 1px solid #1C2331;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #8C99B3;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.code-container pre {
  margin: 0;
  padding: 18px 22px;
  overflow-x: auto;
  background-color: transparent;
  border: none;
  border-radius: 0;
}
.code-container code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #CDD6E5;
  line-height: 1.6;
  display: block;
}

.code-keyword { color: #8FBCBB; }
.code-type { color: #88C0D0; }
.code-method { color: #81A1C1; }
.code-string { color: #A3BE8C; }
.code-comment { color: #5E81AC; }

/* ==========================================================================
   Technical Skills Section
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.skill-group {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 4px 16px -8px rgba(17, 22, 34, 0.04);
}
.skill-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-light);
}

/* ==========================================================================
   Beyond the Application (Infrastructure & Certificates)
   ========================================================================== */
.beyond-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 64px;
}
.beyond-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
}
.beyond-item {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.beyond-item:first-child,
.beyond-item:nth-child(2) {
  border-top: none;
}
.beyond-item h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.beyond-item p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.beyond-item a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.beyond-item a:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

/* ==========================================================================
   My Learning Journey Timeline
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 36px;
  margin: 0 0 48px;
  border-left: 1.5px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 0 0 32px 24px;
}
.timeline li:last-child {
  padding-bottom: 0;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -44px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--bg-alt);
  border: 1.5px solid var(--blue);
}
.timeline li.active::before {
  background-color: var(--blue);
}
.timeline h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.timeline p {
  font-size: 0.96rem;
  margin: 0;
}

.algo-case {
  border-top: 1px solid var(--line);
  padding-top: 40px;
  margin-top: 40px;
  max-width: 720px;
}
.algo-case h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.algo-case p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ==========================================================================
   Certificates Grid
   ========================================================================== */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cert-card {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 16px -8px rgba(17, 22, 34, 0.04);
}
.cert-card h3 {
  font-size: 1.1rem;
  line-height: 1.35;
}
.cert-card a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cert-card a:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

/* ==========================================================================
   Proof Of Work Matrix
   ========================================================================== */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.proof-item {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--timing) var(--ease),
              transform var(--timing) var(--ease),
              box-shadow var(--timing) var(--ease);
  box-shadow: 0 4px 16px -8px rgba(17, 22, 34, 0.04);
}
a.proof-item:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(17, 22, 34, 0.08);
}
.proof-item h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.proof-item p {
  font-size: 0.92rem;
  margin: 0;
  color: var(--ink-soft);
}
.proof-item-cta {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 4px;
}
a.proof-item:hover .proof-item-cta {
  color: var(--blue-hover);
}

/* ==========================================================================
   Call To Action (GitHub Banner)
   ========================================================================== */
.github-cta {
  background-color: var(--ink);
  color: var(--surface);
  padding: 80px 0;
  border-top: 1px solid #1c2230;
}
.github-cta h2 {
  color: var(--surface);
  margin-bottom: 12px;
}
.github-cta p {
  color: rgba(255, 255, 255, 0.76);
  margin: 0;
  font-size: 1.05rem;
}
.github-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.github-cta .btn-primary {
  background-color: var(--surface);
  color: var(--ink);
}
.github-cta .btn-primary:hover {
  background-color: var(--bg-alt);
}

/* ==========================================================================
   Contact Cards & Grid
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color var(--timing) var(--ease),
              transform var(--timing) var(--ease),
              box-shadow var(--timing) var(--ease);
  box-shadow: 0 4px 16px -8px rgba(17, 22, 34, 0.04);
}
.contact-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(17, 22, 34, 0.08);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.contact-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.contact-cta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.contact-card:hover .contact-cta {
  color: var(--blue-hover);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 32px;
  background-color: var(--surface);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.footer-title, 
.footer-loc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-faint);
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.footer-links a:hover {
  color: var(--blue);
}
.footer-copy {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin: 48px 0 0;
}

/* ==========================================================================
   Diagram Elements & Blueprint SVGs
   ========================================================================== */
.diagram-container {
  width: 100%;
}
.diagram-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Restrained and elegant schematic elements */
.diagram-node {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 1px;
}
.diagram-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  fill: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.diagram-node-text {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  fill: var(--ink);
}
.diagram-line {
  stroke: var(--line);
  stroke-width: 1.5px;
  fill: none;
}
.diagram-accent {
  fill: var(--blue);
}

/* About Diagram specific schematic adjustments */
.about-diagram .diagram-node {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 1px;
}
.about-diagram .diagram-node-active {
  fill: #FAF9F5;
  stroke: var(--blue);
  stroke-width: 1.5px;
}
.about-diagram .diagram-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}
.about-diagram .diagram-node-text {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* 1280px - Large laptops */
@media (max-width: 1280px) {
  :root {
    --container: 1040px;
  }
}

/* 1024px - Tablets / Small laptops */
@media (max-width: 1024px) {
  :root {
    --container: 920px;
  }
  .hero-inner {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
  }
  .about-grid, 
  .beyond-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .build-grid {
    grid-template-columns: 1fr;
  }
  .project-feature {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .cert-grid,
  .proof-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* 768px - Tablet portrait */
@media (max-width: 768px) {
  .main-nav,
  .nav-cta {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero-panel {
    order: -1;
  }
  .beyond-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* 480px - Mobile optimization overhaul */
@media (max-width: 480px) {
  :root {
    --nav-h: 60px;
  }
  body {
    font-size: 15px;
    line-height: 1.5;
  }
  
  /* Sections - tighter spacing */
  .section {
    padding: 60px 0;
  }
  .section-inner {
    padding: 0 16px;
  }
  .section-head {
    margin-bottom: 40px;
  }

  /* Navigation */
  .header-inner {
    padding: 0 16px;
  }
  .mobile-nav {
    padding: 24px 16px;
  }
  .mobile-nav a {
    font-size: 1.2rem;
    padding: 16px 0;
  }

  /* Hero Section */
  .hero {
    padding: 60px 0;
  }
  .hero-heading {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
    margin-bottom: 20px;
  }
  .hero-sub {
    font-size: 1rem;
    margin-bottom: 24px;
  }
  .hero-actions {
    gap: 12px;
  }
  .hero-actions .btn {
    width: 100%;
    padding: 12px 16px;
  }
  .hero-links {
    gap: 16px;
  }

  /* Cards & Grids */
  .build-card, .cert-card, .proof-item, .contact-card {
    padding: 20px;
  }
  
  .project-feature h3 {
    font-size: 1.5rem;
  }
  .project-facts {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .story-grid {
    gap: 20px;
    padding: 20px 0;
  }

  .skills-grid, .cert-grid, .proof-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Footer */
  .site-footer {
    padding: 40px 0 20px;
  }
  .footer-copy {
    margin: 32px 0 0;
  }
}
