/* ============================================================
   RESET & VARIABLES
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f5f3ee;
  --bg-card:      #ffffff;
  --bg-surface:   #eceae4;
  --bg-surface2:  #e3e1da;
  --text-1:       #111110;
  --text-2:       #46443f;
  --text-3:       #7f7c74;
  --border:       rgba(17,17,16,0.08);
  --border-md:    rgba(17,17,16,0.13);
  --border-str:   rgba(17,17,16,0.21);
  --accent:       #2f7a52;
  --accent-dim:   #246040;
  --accent-light: #e6f3ec;
  --accent-mid:   #a8d4ba;
  --accent-info:  #1d4ed8;
  --accent-info-light: #eff6ff;
  --font-display: 'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --nav-h:        64px;
  --max-w:        1280px;
  --radius:       14px;
  --radius-sm:    8px;
  --radius-xs:    5px;
  --space-1:      0.5rem;
  --space-2:      0.75rem;
  --space-3:      1rem;
  --space-4:      1.5rem;
  --space-5:      2rem;
  --t:            0.22s ease;
  --ease-out:     cubic-bezier(0.16,1,0.3,1);
  --ease-press:   cubic-bezier(0.34,1.56,0.64,1);
  --photo-filter: saturate(0.88) contrast(0.97) brightness(1.03) sepia(0.06);
  --photo-overlay: linear-gradient(180deg, rgba(245,243,238,0.08), rgba(245,243,238,0.18));
}

[data-theme="dark"] {
  --bg:           #0f1110;
  --bg-card:      #171a18;
  --bg-surface:   #1e211f;
  --bg-surface2:  #252826;
  --text-1:       #edeae3;
  --text-2:       #a39f96;
  --text-3:       #6b6963;
  --border:       rgba(237,234,227,0.06);
  --border-md:    rgba(237,234,227,0.10);
  --border-str:   rgba(237,234,227,0.16);
  --accent:       #4ab87a;
  --accent-dim:   #3a9460;
  --accent-light: #13231a;
  --accent-mid:   #1f3e2c;
  --accent-info:  #93c5fd;
  --accent-info-light: #0a1628;
  --photo-filter: saturate(0.82) contrast(0.92) brightness(0.78) sepia(0.04);
  --photo-overlay: linear-gradient(180deg, rgba(15,17,16,0.16), rgba(15,17,16,0.30));
}

/* ============================================================
   BASE
============================================================ */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

body.page-is-transitioning > :not(.nav):not(.theme-wipe):not(.boot-intro) {
  transition:
    opacity 0.22s ease,
    transform 0.34s var(--ease-out);
}

body.page-is-leaving > :not(.nav):not(.theme-wipe):not(.boot-intro) {
  opacity: 0;
  transform: translateX(calc(-26px * var(--page-dir, 0))) translateY(8px);
}

body.page-is-entering > :not(.nav):not(.theme-wipe):not(.boot-intro) {
  animation: pageEnter 0.34s var(--ease-out) both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateX(calc(26px * var(--page-dir, 0))) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}


a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-mid); color: var(--text-1); }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 62%, transparent);
  outline-offset: 4px;
}

/* ============================================================
   FIRST LOAD INTRO
============================================================ */
.boot-intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
  --boot-content-opacity: 1;
  --boot-content-y: 0px;
  background: transparent;
  color: var(--text-1);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.95s cubic-bezier(0.16,1,0.3,1),
    transform 0.95s cubic-bezier(0.16,1,0.3,1),
    visibility 0.95s cubic-bezier(0.16,1,0.3,1);
}

.boot-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, color-mix(in srgb, var(--text-2) 10%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--text-2) 10%, transparent) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
}

.boot-intro.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.boot-intro.is-skipped {
  display: none;
}

.boot-intro.is-exiting {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}


.boot-terminal-window {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  overflow: hidden;
  border: 1px solid var(--border-str);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-card) 86%, transparent);
  box-shadow: 0 24px 80px rgba(17,17,16,0.13);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  animation: bootPanelIn 0.65s cubic-bezier(0.16,1,0.3,1) forwards;
  transition: opacity 0.75s cubic-bezier(0.16,1,0.3,1),
              transform 0.75s cubic-bezier(0.16,1,0.3,1);
}

.boot-intro.is-exiting .boot-terminal-window {
  animation: none;
  opacity: 0;
  transform: translateY(-18px) scale(0.97);
}

[data-theme="dark"] .boot-terminal-window {
  box-shadow: 0 24px 80px rgba(0,0,0,0.34);
}

.boot-terminal-top {
  height: 38px;
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
}

.boot-window-controls {
  display: inline-flex;
  gap: 0.42rem;
  flex-shrink: 0;
}

.boot-window-controls span {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  border: 1px solid var(--border-md);
  background: var(--bg-card);
}

.boot-window-controls span:nth-child(1) { background: #d96b5f; }
.boot-window-controls span:nth-child(2) { background: #d8b957; }
.boot-window-controls span:nth-child(3) { background: var(--accent); }

.boot-terminal-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
}

.boot-terminal-body {
  min-height: 360px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 2.25vw, 0.78rem);
  line-height: 1.65;
  overflow: hidden;
}

.boot-row {
  min-height: 1.65em;
  opacity: 0;
  transform: translateY(4px);
  animation: bootLineIn 0.18s ease forwards;
}

.boot-command-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
  color: var(--text-2);
}

.boot-prompt {
  color: var(--accent);
  white-space: nowrap;
}

.boot-typed {
  display: inline-block;
  overflow: hidden;
  width: 0;
  max-width: max-content;
  white-space: nowrap;
  border-right: 1px solid transparent;
  padding-right: 0.12em;
  animation: bootType var(--type-time, 0.5s) steps(18) forwards;
  animation-delay: inherit;
}

.boot-typed-final {
  border-right-color: var(--accent);
  animation:
    bootType var(--type-time, 0.5s) steps(18) forwards,
    bootCursor 0.8s steps(1) infinite;
  animation-delay: inherit;
}

.boot-output {
  color: var(--text-3);
  padding-left: 1rem;
}

.boot-grid-output {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, max-content));
  gap: 0.35rem 1.1rem;
}

.boot-found {
  color: var(--accent);
}

.boot-found::before {
  content: './';
  color: var(--text-3);
}

.boot-launch-card {
  margin-top: 0.7rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-str);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent-light) 56%, transparent);
  opacity: 0;
  transform: translateY(6px);
  animation: bootLineIn 0.32s ease forwards;
  display: grid;
  gap: 0.18rem;
  color: var(--text-2);
}

.boot-launch-card strong {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.8vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--text-1);
}

.boot-launch-card span {
  font-size: 0.68rem;
  color: var(--accent);
}

.boot-launch-card .boot-launch-label {
  color: var(--text-3);
}

.boot-launch-card span:last-child {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Tightened timeline — full sequence lands at ~3.7s so the launch
   card is actually seen before the hand-off (exit fires at 4.9s) */
.d0 { animation-delay: 0.2s; }
.d0 .boot-typed { animation-delay: 0.32s, 0.32s; }
.d1 { animation-delay: 0.55s; }
.d2 { animation-delay: 0.72s; }
.d2 .boot-typed { animation-delay: 0.84s, 0.84s; }
.d3 { animation-delay: 1.32s; }
.d4 { animation-delay: 1.5s; }
.d4 .boot-typed { animation-delay: 1.62s, 1.62s; }
.d5 { animation-delay: 2.28s; }
.d5 .boot-typed { animation-delay: 2.4s, 2.4s; }
.d6 { animation-delay: 2.75s; }
.d7 { animation-delay: 3.0s; }
.d7 .boot-typed { animation-delay: 3.12s, 3.12s; }
.d8 { animation-delay: 3.72s; }

body.boot-lock {
  overflow: hidden;
}

.boot-skip {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2;
  padding: 7px 11px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--bg-card) 78%, transparent);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background var(--t), transform var(--t);
}

.boot-skip:hover {
  color: var(--text-1);
  border-color: var(--accent-mid);
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* ============================================================
   ANIMATION SYSTEM
============================================================ */
@keyframes bootPanelIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bootCursor {
  0%, 46% { border-right-color: var(--accent); }
  47%, 100% { border-right-color: transparent; }
}

@keyframes bootFileIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bootLineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bootType {
  from { width: 0; }
  to { width: var(--type-width); }
}

@keyframes bootMetaIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bootSessionIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.75); }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes scrollFill {
  0%   { transform: scaleY(0); transform-origin: top; }
  48%  { transform: scaleY(1); transform-origin: top; }
  52%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Ambient noise drift — used on all pages via .page-ambient */
@keyframes noiseDrift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-12px, 8px); }
  66%  { transform: translate(6px, -10px); }
  100% { transform: translate(0, 0); }
}

@keyframes themeWipe {
  0% {
    width: 0;
    height: 0;
    opacity: 0.22;
  }
  70% {
    opacity: 0.12;
  }
  100% {
    width: var(--wipe-size);
    height: var(--wipe-size);
    opacity: 0;
  }
}

@keyframes labelCursor {
  0%, 44% { opacity: 1; }
  45%, 100% { opacity: 0; }
}

.theme-wipe {
  position: fixed;
  z-index: 3000;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 34%, var(--bg-card));
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: themeWipe 0.68s cubic-bezier(0.16,1,0.3,1) forwards;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .theme-wipe {
  mix-blend-mode: screen;
}

/* Reveal */
.reveal {
  opacity: 1;
  transform: translateY(0);
  /* JS will add transition for animation if loaded */
}
.reveal.animating {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease-out),
              transform 0.75s var(--ease-out);
}
.reveal.animating.visible { opacity: 1; transform: translateY(0); }

.section-label.reveal.animating {
  transform: translateY(10px);
}

:where(.photo-frame, .about-photo-frame, .proj-media).reveal.animating {
  transform: translateY(18px) scale(0.985);
}

:where(.photo-frame, .about-photo-frame, .proj-media).reveal.animating.visible {
  transform: translateY(0) scale(1);
}

/* Directional reveal variants */
.reveal-left.animating { transform: translateX(-34px); }
.reveal-right.animating { transform: translateX(34px); }
.reveal-left.animating.visible,
.reveal-right.animating.visible { transform: translateX(0); }

/* Terminal-style typing cursor on section labels */
.section-label.is-typing::after,
.section-label.typed-done::after {
  content: '_';
  display: inline-block;
  margin-left: 0.22em;
  color: var(--accent);
}

.section-label.is-typing::after {
  animation: blink 0.72s steps(1) infinite;
}

.section-label.typed-done::after {
  animation: labelCursor 0.82s steps(1) 3 forwards;
}

/* Split-word headings — per-word rise (no overflow masks, so
   tight letter-spacing and descenders never get clipped) */
.split-words .sw {
  display: inline-block;
}

.split-words .sw > span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.45em);
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.7s var(--ease-out);
  transition-delay: calc(var(--wi, 0) * 60ms);
}

.split-words.is-split-in .sw > span {
  opacity: 1;
  transform: translateY(0);
}

.d1 { transition-delay: 0.07s; }
.d2 { transition-delay: 0.15s; }
.d3 { transition-delay: 0.23s; }
.d4 { transition-delay: 0.32s; }
.d5 { transition-delay: 0.42s; }

/* ============================================================
   NAV
============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(245,243,238,0.88);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  transition: height 0.35s var(--ease-out), background 0.4s ease, box-shadow var(--t);
}

[data-theme="dark"] .nav { background: rgba(15,17,16,0.9); }

.nav.scrolled {
  box-shadow: 0 1px 0 var(--border-md), 0 8px 40px rgba(0,0,0,0.06);
}

.nav.nav-compact {
  height: 56px;
  background: rgba(245,243,238,0.94);
  box-shadow: 0 1px 0 var(--border-md), 0 12px 34px rgba(0,0,0,0.07);
}

[data-theme="dark"] .nav.nav-compact {
  background: rgba(15,17,16,0.96);
}

.nav.nav-compact .nav-links {
  gap: 1.35rem;
}

.nav.nav-compact .nav-logo {
  transform: scale(0.94);
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  transition: opacity var(--t), transform 0.35s var(--ease-out);
  flex-shrink: 0;
}
.nav-logo:hover { opacity: 0.72; transform: translateY(-1px); }
.logo-dot { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  align-items: center;
  position: relative;
  --nav-indicator-x: 0px;
  --nav-indicator-w: 0px;
  transition: gap 0.35s var(--ease-out);
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-2);
  letter-spacing: 0.04em;
  transition: color var(--t), transform 0.24s var(--ease-out), opacity var(--t);
  position: relative;
  padding-bottom: 3px;
  display: inline-block;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-1); }
.nav-links a:hover { transform: translateY(-1px); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-links.nav-indicator-ready a.active::after {
  opacity: 0;
  transform: scaleX(0);
}

.nav-indicator {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: var(--nav-indicator-w);
  height: 1px;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  transform: translateX(var(--nav-indicator-x));
  transform-origin: left;
  transition:
    transform 0.34s var(--ease-out),
    width 0.34s var(--ease-out),
    opacity 0.18s ease;
}

.nav-links.nav-indicator-ready .nav-indicator {
  opacity: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-status {
  display: none;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: statusPulse 3s ease-in-out infinite;
}

.theme-toggle {
  width: 40px; height: 22px;
  background: var(--bg-surface2);
  border: 1px solid var(--border-md);
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  transition: background var(--t), border-color var(--t), transform 0.18s var(--ease-press);
  flex-shrink: 0;
}

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

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.35s var(--ease-press), background var(--t);
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(18px);
  background: var(--accent);
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  --magnet-x: 0px;
  --magnet-y: 0px;
  --pointer-x: 50%;
  --pointer-y: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transform: translate(var(--magnet-x), var(--magnet-y));
  transition: background var(--t), color var(--t), border-color var(--t), transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out);
  white-space: nowrap;
  isolation: isolate;
}

.btn::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.24) 46%, transparent 58%);
  transform: translateX(-120%);
  transition: transform 0.62s var(--ease-out);
  pointer-events: none;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), color-mix(in srgb, var(--accent) 22%, transparent), transparent 46%);
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.btn:hover::before {
  transform: translateX(120%);
}

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

.btn svg {
  flex-shrink: 0;
  transition: transform 0.28s var(--ease-out);
}

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

.btn-primary {
  background: var(--text-1);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: #fff;
  transform: translate(var(--magnet-x), calc(var(--magnet-y) - 1px));
  box-shadow: 0 8px 22px rgba(47,122,82,0.22);
}
.btn-primary:active { transform: translate(var(--magnet-x), var(--magnet-y)) scale(0.98); box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-str);
}
.btn-ghost:hover { color: var(--text-1); border-color: var(--text-1); transform: translate(var(--magnet-x), calc(var(--magnet-y) - 1px)); }
.btn-ghost:active { transform: translate(var(--magnet-x), var(--magnet-y)) scale(0.98); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--accent-dim);
  transform: translate(var(--magnet-x), calc(var(--magnet-y) - 1px));
  box-shadow: 0 8px 22px rgba(47,122,82,0.28);
}
.btn-accent:active {
  transform: translate(var(--magnet-x), var(--magnet-y)) scale(0.98);
  box-shadow: none;
}

/* ============================================================
   SHARED SECTION ELEMENTS
============================================================ */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

/* ============================================================
   TICKER
============================================================ */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--border-md);
  border-bottom: 1px solid var(--border-md);
  padding: 12px 0;
  background: var(--bg-surface);
  transition: background 0.4s ease;
  position: relative;
  z-index: 1;
}

.ticker-inner {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.ticker:hover .ticker-inner { animation-play-state: paused; }

.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.ticker-item {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
}

.ticker-icon {
  width: 1rem;
  height: 1rem;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
  opacity: 0.82;
}

.ticker-icon-aws {
  width: 1.38rem;
  fill: currentColor;
  stroke: none;
}

.ticker-sep { color: var(--accent); font-size: 0.42rem; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .boot-intro {
    display: none;
  }

  body.boot-lock {
    overflow: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .ticker-inner {
    animation: none !important;
    transform: none !important;
  }

  .reveal.animating,
  .reveal.animating.visible {
    opacity: 1;
    transform: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .btn,
  .btn:hover,
  .btn-primary:hover,
  .btn-ghost:hover,
  .btn-accent:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(0.98);
  }

  .nav-links a:hover,
  .nav-logo:hover {
    transform: none;
  }
}

/* ============================================================
   PAGE CONTAINER
============================================================ */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ============================================================
   NEXT CHAPTER — full-width story navigation before the footer
============================================================ */
.next-chapter {
  border-top: 1px solid var(--border);
  margin-top: 6rem;
  position: relative;
  z-index: 1;
  background: var(--bg);
  transition: background 0.45s ease;
}

.next-chapter:hover {
  background: var(--bg-surface);
}

.next-chapter + footer {
  margin-top: 0;
}

.next-link {
  display: block;
  padding: 4.2rem 0 4.6rem;
}

.next-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.next-title {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: clamp(2.6rem, 9vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text-1);
  transition: transform 0.5s var(--ease-out);
}

.next-arrow {
  display: inline-block;
  color: var(--accent);
  transition: transform 0.5s var(--ease-out);
}

.next-link:hover .next-title {
  transform: translateX(12px);
}

.next-link:hover .next-arrow {
  transform: translateX(16px);
}

.next-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
  margin-top: 0.95rem;
  transition: color var(--t);
}

.next-link:hover .next-sub {
  color: var(--text-2);
}

/* ============================================================
   FOOTER
============================================================ */
footer {
  border-top: 1px solid var(--border);
  margin-top: 6rem;
  background: var(--bg-card);
  transition: background 0.4s ease;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.footer-brand .f-logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  line-height: 1.9;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.9rem;
}

.footer-col a {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 0.45rem;
  transition: color var(--t);
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-start;
}

.footer-bottom span {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-3);
}


/* ============================================================
   GITHUB NAV LINK
============================================================ */
.nav-gh {
  display: inline-flex;
  align-items: center;
  color: var(--text-3);
  transition: color var(--t);
  flex-shrink: 0;
}
.nav-gh:hover { color: var(--text-1); }
.nav-gh svg { display: block; }

/* Make nav-status work as <a> without breaking its appearance */
a.nav-status {
  text-decoration: none;
  transition: color var(--t);
}
a.nav-status:hover { color: var(--text-2); }

/* ============================================================
   RESPONSIVE — PROGRESSIVE ENHANCEMENT
============================================================ */

/* Tablet and up */
@media (min-width: 600px) {
  .nav { padding: 0 2rem; }
  .page { padding: 0 2rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (min-width: 768px) {
  .nav-status { display: flex; }
  .footer-inner { grid-template-columns: 1fr 1fr 1fr; }
}

@media (min-width: 900px) {
  .nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (min-width: 1024px) {
  .nav { padding: 0 2.5rem; }
  .page { padding: 0 2.5rem; }
}
