/* Fonts load via <link> in HTML (preconnect + stylesheet) for better performance */

/* ========================================
   Tokens
   ======================================== */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg: #151515;
  --surface: #191919;
  --text: #e8e8e8;
  --text-light: #999;
  --text-muted: #555;
  --accent: #fff;
  --accent-hover: #ccc;
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.04);
  --border-hover: rgba(255,255,255,0.16);
  --highlight: #fff;
  --glow: rgba(255,255,255,0.05);
  --max-width: 1100px;
  --radius: 8px;
}

/* ========================================
   Reset & Base
   ======================================== */

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

::selection { background: #e06b1f; color: #fff; }
::-moz-selection { background: #e06b1f; color: #fff; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s;
}

/* Underlines only on content links (inside main/footer), not nav */
main a, .site-footer a {
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.25);
  text-decoration-style: solid;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s, text-decoration-style 0.2s,
              text-decoration-thickness 0.2s, text-underline-offset 0.2s;
}

main a:hover, .site-footer a:hover {
  text-decoration-color: #fff;
}

/* Wavy squiggle for inline text links on hover */
main p a:hover,
main li a:hover,
.site-footer a:hover {
  text-decoration-style: wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

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

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

h1 { font-size: 2.8rem; letter-spacing: -0.03em; }
h2 { font-size: 1.8rem; margin-bottom: 1rem; letter-spacing: -0.025em; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

/* ========================================
   Navigation — Stained Glass
   ======================================== */

.site-nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 0.9rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: background 0.5s, border-color 0.5s, box-shadow 0.5s;

  background: rgba(21, 21, 21, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.site-nav::before { display: none; }

.site-nav.scrolled {
  background: rgba(21, 21, 21, 0.95);
}

.nav-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: baseline;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-name:hover { text-decoration: none; }

.nav-name .brace {
  color: rgba(255,255,255,0.25);
  font-weight: 300;
  transition: color 0.3s;
}

.nav-name:hover .brace { color: rgba(255,255,255,0.45); }

.nav-name .ni { display: inline; }

.nav-name .nx {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: pre;
  vertical-align: baseline;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
}

.nav-name:hover .nx { opacity: 1; }
.nav-name:hover .nx1 { max-width: 2em;  transition-delay: 0s; }
.nav-name:hover .nx2 { max-width: 0.4em; transition-delay: 0.03s; }
.nav-name:hover .nx3 { max-width: 0.5em; transition-delay: 0.05s; }
.nav-name:hover .nx4 { max-width: 0.4em; transition-delay: 0.07s; }
.nav-name:hover .nx5 { max-width: 0.6em; transition-delay: 0.09s; }
.nav-name:hover .nx6 { max-width: 2.5em; transition-delay: 0.1s; }

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

.nav-links a {
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--text-light);
  transition: color 0.2s, background 0.3s;
  position: relative;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
}

.nav-links a:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.05);
}

.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  -webkit-tap-highlight-color: transparent;
  width: 44px;
  height: 44px;
  position: relative;
}

.nav-hamburger span {
  display: block;
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger span:nth-child(1) { top: 14px; }
.nav-hamburger span:nth-child(2) { top: 21px; }
.nav-hamburger span:nth-child(3) { top: 28px; }

.nav-hamburger.open span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

/* ========================================
   Hero — Full-bleed painting + floating card
   ======================================== */

.hero {
  position: relative;
  width: calc(100% - 2rem);
  max-width: calc(100% - 2rem);
  margin: 0 auto;
  height: 100vh;
  overflow: hidden;
  border-radius: 12px;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  opacity: 0;
  animation: imgReveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@keyframes imgReveal {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

/* Darken edges so the card reads well */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(17,17,17,0.85) 0%, rgba(17,17,17,0.15) 45%, transparent 65%),
    linear-gradient(to left, rgba(17,17,17,0.5) 0%, transparent 50%);
  pointer-events: none;
}

/* Floating card */
.hero-card {
  position: absolute;
  bottom: 4.5rem;
  right: 3.5rem;
  max-width: 420px;
  z-index: 3;
  opacity: 0;
  animation: cardIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.hero-card h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  color: #fff;
  margin-bottom: 1.2rem;
}

.hero-card p {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.hero-card p a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: border-color 0.2s;
}

.hero-card p a:hover {
  border-bottom-color: #fff;
}

.hero-cite {
  display: block;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.01em;
}

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

/* ========================================
   About Page
   ======================================== */

.about-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 3rem;
}

/* --- Hero: name left, photo right --- */

.about-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: end;
  padding: 10rem 0 0;
}

.about-hero-text {
  padding-bottom: 2rem;
}

.about-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.about-name {
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.about-hero-photo {
  position: relative;
}

.about-hero-photo::before {
  content: '';
  position: absolute;
  inset: 12px -12px -12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  pointer-events: none;
}

.about-hero-photo img {
  width: 100%;
  border-radius: 10px;
  display: block;
  position: relative;
  z-index: 1;
}

/* --- Body (bio blocks) --- */

.about-body {
  max-width: 38rem;
  padding: 3.5rem 0 2rem;
}

.about-body > p {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.8;
  margin: 0 0 1.25rem;
}

.about-body .about-lead {
  font-size: 1.12rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.65;
  margin: 0 0 1.35rem;
}

.about-body .about-resume-link {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 1.5rem 0 0;
}

.about-body > p:last-child {
  margin-bottom: 0;
}

.about-resume-link a {
  color: var(--text-light);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
}

.about-resume-link a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.about-contact {
  padding: 0 0 1rem;
}

.about-contact h2 {
  margin-bottom: 1.35rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.about-racecalls {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-bottom: 4rem;
}

/* ========================================
   Page Layout — Subpages
   ======================================== */

.page-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10rem 3rem 5rem;
}

.page-header h1 {
  margin-bottom: 0.6rem;
  font-size: 3rem;
  letter-spacing: -0.04em;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
}

/* Page hero — title left, photo right */
.page-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: end;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10rem 3rem 4rem;
}

.page-hero-text h1 {
  margin-bottom: 0.6rem;
  font-size: 3rem;
  letter-spacing: -0.04em;
}

.page-hero-text p {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
}

.page-hero-photo {
  position: relative;
}

.page-hero-photo::before {
  content: '';
  position: absolute;
  inset: 12px -12px -12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  pointer-events: none;
}

.page-hero-photo img {
  width: 100%;
  border-radius: 10px;
  display: block;
  position: relative;
  z-index: 1;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 3rem 2.5rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  margin-bottom: 0.35rem;
}

.footer-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-meta a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-meta a:hover {
  color: var(--text);
}

.footer-links {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.5;
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
}

@media (max-width: 560px) {
  .footer-inner {
    flex-direction: column;
    gap: 1.5rem;
  }
  .footer-links {
    justify-content: flex-start;
    gap: 1.25rem;
  }
}

/* ========================================
   Animations
   ======================================== */

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

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

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

.animate-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.06s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.12s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.18s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.24s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.36s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.42s; }
.stagger-children.visible > *:nth-child(9) { transition-delay: 0.48s; }
.stagger-children.visible > *:nth-child(10) { transition-delay: 0.54s; }
.stagger-children.visible > *:nth-child(11) { transition-delay: 0.6s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Experience — Timeline
   ======================================== */

.timeline-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 3rem 8rem;
  position: relative;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  transform: translateX(-50%);
  opacity: 0.2;
}

.timeline-entry {
  display: flex;
  align-items: flex-start;
  margin-bottom: 3.5rem;
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-entry:nth-child(odd) {
  flex-direction: row;
  padding-right: calc(50% + 2.5rem);
  text-align: right;
}

.timeline-entry:nth-child(even) {
  flex-direction: row-reverse;
  padding-left: calc(50% + 2.5rem);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
  z-index: 2;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px rgba(99,102,241,0.3);
}

.timeline-entry:hover .timeline-dot {
  transform: translateX(-50%) scale(1.3);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--accent), 0 0 12px var(--glow);
}

.timeline-card {
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  width: 100%;
}

.timeline-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 20px var(--glow);
  transform: translateY(-2px);
}

.timeline-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.timeline-card time {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}

.timeline-card .org {
  font-style: italic;
  color: var(--text-light);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.5rem;
}

.timeline-card .detail {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.7;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease;
  opacity: 0;
}

.timeline-card.expanded .detail {
  max-height: 800px;
  opacity: 1;
}

.timeline-card .expand-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  transition: opacity 0.2s;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-section-label {
  text-align: center;
  margin: 3rem 0 2rem;
  position: relative;
  z-index: 2;
}

.timeline-section-label span {
  background: var(--bg);
  padding: 0 1.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 500;
}

/* Education */
.education-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 3rem 8rem;
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.edu-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 20px var(--glow);
}

.edu-card h3 { margin-bottom: 0.5rem; }
.edu-card p { color: var(--text-light); font-size: 0.92rem; }

/* ========================================
   Writing Page
   ======================================== */

.writing-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 3rem;
}

.writing-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.filter-tabs {
  display: flex;
  gap: 1.5rem;
  margin-bottom: -1px;
}

.filter-selects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.tag-filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.tag-filter-select {
  font-family: var(--font-main);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  min-width: 8rem;
}

.filter-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 0;
  font-family: var(--font-main);
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: -1px;
}

.filter-tab:hover {
  color: var(--text-light);
}

.filter-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 500;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 10px;
  margin-bottom: 8rem;
}

.writing-card-outline {
  position: relative;
  display: flex;
  flex-direction: column;
}

.writing-card-outline::before {
  content: '';
  position: absolute;
  inset: 10px -10px -10px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  pointer-events: none;
  transition: border-color 0.5s, inset 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s;
}

.writing-card-outline:hover::before {
  border-color: rgba(255,255,255,0.15);
  inset: 6px -6px -6px 6px;
  box-shadow: 0 0 30px rgba(255,255,255,0.03);
}

.writing-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.writing-card-outline:hover .writing-card {
  border-color: var(--border-hover);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  transform: translateY(-2px);
}

.writing-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.writing-card .excerpt {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 0.85rem;
}

.writing-card .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
}

.writing-card.press-card .excerpt {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Article expanded view */
.article-view {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem;
}

.article-view .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 2.5rem;
  font-size: 0.88rem;
  color: var(--text-light);
  transition: color 0.2s;
}

.article-view .back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.article-view h1 {
  font-size: 2.4rem;
  margin-bottom: 0.6rem;
}

.article-view .article-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-view .article-body {
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.9;
}

.article-view .article-body p {
  margin-bottom: 1.5rem;
}

/* ========================================
   Contact Section (used in About)
   ======================================== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  margin-bottom: 0;
  max-width: 42rem;
}

.contact-item {
  display: block;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 20px var(--glow);
  transform: translateY(-3px);
  text-decoration: none;
}

.contact-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.contact-value {
  font-size: 1.05rem;
  font-weight: 500;
  color: #fff;
}

.copied-toast {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  margin-left: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.copied-toast.show { opacity: 1; }

/* Contact cards: brand primary colour washes in on hover */
.contact-item--twitter,
.contact-item--linkedin,
.contact-item--manifold {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.contact-item--twitter {
  --contact-brand: #1da1f2;
}

.contact-item--linkedin {
  --contact-brand: #0a66c2;
}

/* Manifold card wash (brand purple) */
.contact-item--manifold {
  --contact-brand: #7032e2;
}

.contact-item--twitter::before,
.contact-item--linkedin::before,
.contact-item--manifold::before {
  content: '';
  position: absolute;
  top: -5%;
  left: -25%;
  width: 150%;
  height: 110%;
  background: var(--contact-brand);
  transform: translate3d(-100%, 0, 0) skewX(-14deg);
  transform-origin: 0 50%;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
  pointer-events: none;
}

.contact-item--twitter .contact-label,
.contact-item--twitter .contact-value,
.contact-item--linkedin .contact-label,
.contact-item--linkedin .contact-value,
.contact-item--manifold .contact-label,
.contact-item--manifold .contact-value {
  position: relative;
  z-index: 1;
  transition: color 0.35s ease 0.12s;
}

.contact-item--twitter:hover,
.contact-item--twitter:focus-visible,
.contact-item--linkedin:hover,
.contact-item--linkedin:focus-visible,
.contact-item--manifold:hover,
.contact-item--manifold:focus-visible {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
  text-decoration: none;
}

.contact-item--twitter:hover::before,
.contact-item--twitter:focus-visible::before,
.contact-item--linkedin:hover::before,
.contact-item--linkedin:focus-visible::before,
.contact-item--manifold:hover::before,
.contact-item--manifold:focus-visible::before {
  transform: translate3d(0, 0, 0) skewX(-14deg);
}

.contact-item--twitter:hover .contact-label,
.contact-item--twitter:focus-visible .contact-label,
.contact-item--linkedin:hover .contact-label,
.contact-item--linkedin:focus-visible .contact-label,
.contact-item--manifold:hover .contact-label,
.contact-item--manifold:focus-visible .contact-label {
  color: rgba(255, 255, 255, 0.85);
}

.contact-item--twitter:hover .contact-value,
.contact-item--twitter:focus-visible .contact-value,
.contact-item--linkedin:hover .contact-value,
.contact-item--linkedin:focus-visible .contact-value,
.contact-item--manifold:hover .contact-value,
.contact-item--manifold:focus-visible .contact-value {
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .contact-item--twitter::before,
  .contact-item--linkedin::before,
  .contact-item--manifold::before {
    transition: none;
    transform: translate3d(-100%, 0, 0) skewX(-14deg);
  }

  .contact-item--twitter:hover::before,
  .contact-item--twitter:focus-visible::before,
  .contact-item--linkedin:hover::before,
  .contact-item--linkedin:focus-visible::before,
  .contact-item--manifold:hover::before,
  .contact-item--manifold:focus-visible::before {
    transform: translate3d(0, 0, 0) skewX(-14deg);
  }

  .contact-item--twitter .contact-label,
  .contact-item--twitter .contact-value,
  .contact-item--linkedin .contact-label,
  .contact-item--linkedin .contact-value,
  .contact-item--manifold .contact-label,
  .contact-item--manifold .contact-value {
    transition: none;
  }
}

/* ========================================
   404 Page
   ======================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 2rem;
}

.not-found h1 {
  font-size: 10rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  letter-spacing: -0.05em;
  opacity: 0.3;
}

.not-found p {
  color: var(--text-light);
  margin: 1.5rem 0 3rem;
  font-size: 1.15rem;
}

.not-found a {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s ease;
}

.not-found a:hover {
  background: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,255,255,0.1);
}

/* Bayes-themed 404 */
.not-found.bayes-404-page {
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6.5rem 1.5rem 4rem;
  min-height: min-content;
}

.bayes-404-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.bayes-404-code {
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  letter-spacing: -0.05em;
  opacity: 0.35;
  margin: 0 0 0.5rem;
}

.not-found.bayes-404-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--text);
  opacity: 1;
  margin: 0;
}

.bayes-404-lead {
  color: var(--text-light);
  margin: 1rem auto 0;
  max-width: 36rem;
  font-size: 1.05rem;
}

.bayes-404 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem 2rem;
}

.bayes-404 h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.bayes-404-copy {
  color: var(--text-light);
  font-size: 0.98rem;
  margin: 0 0 1rem;
  line-height: 1.65;
}

.bayes-formula {
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
  line-height: 1.6;
}

.bayes-formula-main {
  display: inline-block;
  margin-bottom: 0.35rem;
}

.bayes-formula-sub {
  color: var(--text-light);
  font-size: 0.9rem;
}

.bayes-sliders {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin: 1.5rem 0;
}

.bayes-field label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.bayes-field input[type="range"] {
  width: 100%;
  max-width: 100%;
  height: 0.5rem;
  accent-color: #e06b1f;
  cursor: pointer;
}

.bayes-field input[type="range"]:focus-visible {
  outline: 2px solid #e06b1f;
  outline-offset: 3px;
}

.bayes-results {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.bayes-result-line {
  margin: 0.35rem 0;
  font-size: 1rem;
  color: var(--text);
}

.bayes-result-line:first-child {
  margin-top: 0;
}

.bayes-404-cta {
  text-align: center;
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
}

.not-found.bayes-404-page .bayes-404-cta a {
  display: inline;
  padding: 0;
  background: none;
  border-radius: 0;
  color: #fff;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s ease;
}

.not-found.bayes-404-page .bayes-404-cta a:hover {
  background: none;
  text-decoration-color: #fff;
  transform: none;
  box-shadow: none;
}

/* ========================================
   Premium Effects
   ======================================== */

main, .site-nav, .site-footer { position: relative; z-index: 2; }

.char-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(-60deg);
  animation: charReveal 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-style: preserve-3d;
}

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

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vtOut 0.15s cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: vtIn 0.2s cubic-bezier(0, 0, 0.2, 1) 0.08s both;
}

@keyframes vtOut {
  to { opacity: 0; }
}

@keyframes vtIn {
  from { opacity: 0; }
}

/* JS fallback transition classes */
.page-exit main,
.page-exit .site-footer {
  transition: opacity 0.15s ease, transform 0.15s ease;
  opacity: 0;
  transform: translateY(-4px);
}

.page-enter main,
.page-enter .site-footer {
  animation: pageEnter 0.25s cubic-bezier(0, 0, 0.2, 1) both;
}

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

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

  .page-exit main,
  .page-exit .site-footer,
  .page-enter main,
  .page-enter .site-footer {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }

  .animate-in,
  .animate-in.visible,
  .stagger-children > *,
  .stagger-children.visible > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ========================================
   Command Palette (Cmd+K)
   ======================================== */

.cmdk-body-lock { overflow: hidden; }

.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding-top: min(18vh, 140px);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.cmdk-overlay.cmdk-open {
  opacity: 1;
  visibility: visible;
}

.cmdk-dialog {
  width: 100%;
  max-width: 680px;
  max-height: min(62vh, 500px);
  background: rgba(30, 30, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.7), 0 0 0 0.5px rgba(255,255,255,0.04);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmdk-open .cmdk-dialog {
  transform: scale(1) translateY(0);
}

.cmdk-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cmdk-search-icon {
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.cmdk-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 400;
  color: #fff;
  caret-color: #fff;
  letter-spacing: -0.01em;
}

.cmdk-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.cmdk-kbd {
  font-family: var(--font-main);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 0.15rem 0.5rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.cmdk-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem;
}

.cmdk-results::-webkit-scrollbar {
  width: 4px;
}

.cmdk-results::-webkit-scrollbar-track {
  background: transparent;
}

.cmdk-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.cmdk-group {
  margin-bottom: 0.35rem;
}

.cmdk-group-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.28);
  font-weight: 600;
  padding: 0.65rem 0.8rem 0.3rem;
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
}

.cmdk-item:hover,
.cmdk-item.cmdk-active {
  background: rgba(255, 255, 255, 0.09);
  text-decoration: none;
}

.cmdk-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cmdk-item-title {
  font-size: 0.93rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmdk-item-desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmdk-item-arrow {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.cmdk-item.cmdk-active .cmdk-item-arrow,
.cmdk-item:hover .cmdk-item-arrow {
  opacity: 1;
}

.cmdk-match {
  color: #fff;
  font-weight: 700;
}

.cmdk-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.88rem;
}

.cmdk-footer {
  display: none;
}

/* --- Cmd+K Hint (inside nav bar) --- */

.cmdk-hint {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.9rem;
  font-family: var(--font-main);
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease, background 0.2s;
  white-space: nowrap;
  margin-left: 0.25rem;
}

.cmdk-hint.cmdk-hint-visible {
  opacity: 1;
}

.cmdk-hint:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.cmdk-hint kbd {
  font-family: var(--font-main);
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.08rem 0.3rem;
  margin: 0 0.1rem;
}

/* ========================================
   Reading Progress Bar
   ======================================== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, rgba(255,255,255,0.6), #fff);
  z-index: 200;
  pointer-events: none;
  transition: width 80ms linear;
}

.reading-progress::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 80px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
}

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

@media (max-width: 768px) {
  .about-page {
    padding: 0 1.25rem;
  }

  .site-nav {
    padding: 0.75rem 1.25rem;
  }

  .site-nav {
    overflow: visible;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(26, 26, 29, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
  }

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

  h1 { font-size: 2rem; }

  .hero {
    height: 100svh;
    width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
  }

  .hero-img {
    object-position: 60% center;
  }

  .hero-card {
    bottom: 3rem;
    right: 1.25rem;
    left: 1.25rem;
    max-width: none;
  }

  .hero-card h1 { font-size: 2.2rem; }
  .hero-card p { font-size: 0.82rem; }

  .about-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 6rem 0 0;
  }

  .about-hero-text {
    padding-bottom: 0;
  }

  .about-name {
    font-size: 3rem;
  }

  .about-hero-photo::before {
    inset: 8px -8px -8px 8px;
  }

  .about-body {
    padding: 2.25rem 0 1.5rem;
  }

  .about-racecalls {
    margin-top: 2rem;
    padding-top: 2rem;
    padding-bottom: 3rem;
  }

  .about-contact {
    padding-bottom: 0;
  }

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

  .page-header {
    padding: 7rem 1.5rem 3rem;
  }

  .page-header h1 { font-size: 2.4rem; }

  .page-hero {
    grid-template-columns: 1fr;
    padding: 7rem 1.5rem 2rem;
  }

  .page-hero-text h1 { font-size: 2.4rem; }

  .page-hero-photo::before {
    inset: 8px -8px -8px 8px;
  }

  /* Timeline mobile */
  .timeline-line { left: 1.25rem; }

  .timeline-entry,
  .timeline-entry:nth-child(odd),
  .timeline-entry:nth-child(even) {
    flex-direction: row;
    padding-left: 3rem;
    padding-right: 0;
    text-align: left;
  }

  .timeline-dot,
  .timeline-entry:nth-child(odd) .timeline-dot,
  .timeline-entry:nth-child(even) .timeline-dot {
    left: 1.25rem;
  }

  .filter-tabs { gap: 1rem; overflow-x: auto; }
  .filter-selects {
    width: 100%;
    margin-left: 0;
  }

  .cmdk-hint { display: none; }
}

/* ========================================
   Print
   ======================================== */

@media print {
  .site-nav, .site-footer,
  .writing-filters, .cmdk-overlay, .cmdk-hint { display: none; }

  main { padding-top: 0; }
  body { font-size: 11pt; background: #fff; color: #000; }
  .hero { height: auto; position: static; }
  .hero-img { position: static; height: auto; }
  .hero-card { position: static; max-width: none; opacity: 1; }
  .hero::after { display: none; }
  .timeline-entry { opacity: 1 !important; transform: none !important; }
  a { color: #333; }
  a::after { content: ' (' attr(href) ')'; font-size: 0.8em; color: #666; }
}

/* ========================================
   Now Page
   ======================================== */

.now-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 3rem;
}

.now-header {
  padding: 10rem 0 4rem;
  position: relative;
}

.now-title {
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin-bottom: 1.5rem;
}

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

.now-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.now-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.now-status-text {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #4ade80;
  font-weight: 500;
}

.now-updated {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 400;
}

.now-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 5rem;
}

.now-card-outline {
  position: relative;
  height: 100%;
}

.now-card-outline::before {
  content: '';
  position: absolute;
  inset: 10px -10px -10px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  pointer-events: none;
  transition: border-color 0.5s, inset 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s;
}

.now-card-outline:hover::before {
  border-color: rgba(255,255,255,0.15);
  inset: 6px -6px -6px 6px;
  box-shadow: 0 0 30px rgba(255,255,255,0.03);
}

/* Stagger card entrance */
.now-grid .now-card-outline:nth-child(1) { animation-delay: 0s; }
.now-grid .now-card-outline:nth-child(2) { animation-delay: 0.08s; }
.now-grid .now-card-outline:nth-child(3) { animation-delay: 0.16s; }
.now-grid .now-card-outline:nth-child(4) { animation-delay: 0.24s; }
.now-grid .now-card-outline:nth-child(5) { animation-delay: 0.32s; }
.now-grid .now-card-outline:nth-child(6) { animation-delay: 0.4125s; }

.now-card-outline {
  opacity: 0;
  animation: nowCardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.now-card-inner {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.now-card-outline:hover .now-card-inner {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 20px var(--glow);
  transform: translateY(-2px);
}

.now-card-inner h3 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.now-card-inner p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.75;
}

.now-footer-note {
  text-align: center;
}

.now-footer-note p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ========================================
   Tweet Cards (now page)
   ======================================== */

.now-tweets {
  margin-bottom: 4rem;
}

.tweet-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tweet-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tweet-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  transform: translateY(-1px);
  text-decoration: none;
  background-image: none;
}

.tweet-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.tweet-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tweet-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tweet-see-all {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.tweet-see-all:hover {
  color: var(--text);
  text-decoration: none;
  background-image: none;
}

.tweet-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tweet-skeleton {
  height: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .now-header {
    padding: 7rem 0 3rem;
  }

  .now-title {
    font-size: 3rem;
  }

  .now-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .cmdk-dialog {
    max-width: calc(100% - 2rem);
    max-height: 70vh;
  }
}

/* ========================================
   Race Calls Page
   ======================================== */

.racecalls-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 3rem 6rem;
}

.racecalls-header {
  padding: 10rem 0 3rem;
}

.racecalls-title {
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin-bottom: 1.5rem;
}

.racecalls-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 420px;
}

/* Hero stats */
.rc-hero-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.rc-ring-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.rc-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.rc-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 6;
}

.rc-ring-fill {
  fill: none;
  stroke: #4ade80;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 213.6;
  stroke-dashoffset: 213.6;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.rc-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.rc-stat-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-right: 0.5rem;
}

.rc-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.rc-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 500;
}

.rc-stat-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.rc-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rc-stat-item-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.rc-stat-item-value.rc-stat-correct {
  color: #4ade80;
}

.rc-stat-item-value.rc-stat-pending {
  color: var(--text-muted);
}

.rc-stat-item-value.rc-stat-first {
  color: #eab308;
}

.rc-stat-item-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.rc-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

/* Merged filter row */
.rc-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.rc-filter-divider {
  width: 1px;
  height: 20px;
  background: var(--border-hover);
  flex-shrink: 0;
  margin: 0 0.25rem;
}

.rc-filters {
  display: flex;
  gap: 0.35rem;
}

.rc-type-filters {
  /* no extra overrides needed */
}

.rc-filter-btn {
  background: none;
  border: none;
  font-family: var(--font-main);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  font-weight: 400;
}

.rc-filter-btn:hover {
  color: var(--text-light);
  background: rgba(255,255,255,0.04);
}

.rc-filter-btn.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  font-weight: 500;
}

/* Type breakdown (compact inline text) */
.rc-type-summary {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Call cards */
.rc-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rc-call-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  opacity: 0;
  animation: rcCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.rc-call-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

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

.rc-call-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.rc-call-info {
  display: flex;
  align-items: center;
  min-width: 0;
}

.rc-call-race {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.15rem;
}

.rc-call-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rc-call-meta strong {
  color: var(--text-light);
}

.rc-call-result {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}

.rc-result-correct {
  color: #4ade80;
  background: rgba(74,222,128,0.1);
}

.rc-result-incorrect {
  color: #f87171;
  background: rgba(248,113,113,0.1);
}

.rc-result-pending {
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
}

.rc-call-card {
  cursor: pointer;
}

.rc-call-card--compact {
  cursor: default;
}

.rc-call-details {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.rc-call-card.expanded .rc-call-details {
  display: block;
}

.rc-detail-row {
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 0.2rem 0;
}

.rc-detail-row strong {
  color: #fff;
}

.rc-detail-label {
  display: inline-block;
  width: 100px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 500;
}

.rc-source-link {
  color: var(--text-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rc-source-link:hover {
  color: #fff;
}

.rc-empty {
  text-align: center;
  padding: 3rem 0;
}

.rc-empty p {
  color: var(--text-muted);
  font-size: 0.9rem;
}


/* Date group headers */
.rc-date-group {
  margin-bottom: 1.5rem;
}

.rc-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.rc-date-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.rc-date-count {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}

.rc-date-group .rc-call-card {
  margin-bottom: 0.75rem;
}

/* First call badge */
.rc-first-call-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #92400e;
  background: #fbbf24;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Race type / state pills on cards (inline with race name) */
.rc-pill {
  display: inline-block;
  font-size: 0.62rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  font-weight: 500;
  vertical-align: middle;
  margin-left: 0.15rem;
}

/* Margin display */
.rc-margin {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Footnote */
.rc-footnote {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.rc-footnote p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Race Call Preview Widget (About & Now pages) */
.rc-preview {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: var(--text);
}

.rc-preview:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 20px var(--glow);
  transform: translateY(-2px);
  text-decoration: none;
}

.rc-preview-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.rc-preview-record {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  display: block;
  margin-bottom: 0.25rem;
}

.rc-preview-pct {
  font-size: 0.85rem;
  color: #4ade80;
  font-weight: 500;
}

.rc-preview-link {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  transition: color 0.2s;
}

.rc-preview:hover .rc-preview-link {
  color: var(--text-light);
}

@media (max-width: 768px) {
  .racecalls-page {
    padding: 0 1.5rem 4rem;
  }

  .racecalls-header {
    padding: 7rem 0 2rem;
  }

  .racecalls-title {
    font-size: 3rem;
  }

  .rc-hero-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .rc-stat-strip {
    margin-left: 0;
    width: 100%;
    justify-content: space-around;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }

  .rc-filter-row {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .rc-filter-divider {
    display: none;
  }

  .rc-filters {
    overflow-x: auto;
  }
}

/* ========================================
   Resume page (matches site chrome + print)
   ======================================== */

.resume-main {
  padding: 5.75rem 1.5rem 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.resume-page-header {
  margin-bottom: 2rem;
}

.resume-page-header-inner {
  max-width: 42rem;
}

.resume-page-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.resume-page-sub {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.resume-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.resume-toolbar-btn {
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-hover);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.resume-toolbar-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.resume-toolbar-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
}

.resume-toolbar-link:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.resume-shell {
  margin-top: 0.5rem;
}

.resume-paper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.resume-inner {
  padding: 2rem 2.25rem;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.92rem;
  line-height: 1.55;
}

.resume-inner .resume-header {
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(224, 107, 31, 0.65);
}

.resume-inner .resume-name {
  font-family: 'DM Sans', var(--font-main);
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

.resume-inner .resume-tagline {
  color: var(--text-light);
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
}

.resume-inner .resume-contact-line {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.65;
}

.resume-inner .resume-contact-line a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 2px;
}

.resume-inner .resume-contact-line a:hover {
  text-decoration-color: #fff;
}

.resume-inner .resume-section {
  margin-bottom: 1.15rem;
}

.resume-inner .resume-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
  margin: 0 0 0.65rem;
}

.resume-inner .resume-item {
  margin-bottom: 0.85rem;
}

.resume-inner .resume-item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.resume-inner .resume-item-title {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}

.resume-inner .resume-item-date {
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
  white-space: nowrap;
}

.resume-inner .resume-item-org {
  font-size: 0.88rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 0.15rem;
}

.resume-inner .resume-item ul,
.resume-inner .edu-details,
.resume-inner .activities-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-light);
  font-size: 0.88rem;
}

.resume-inner .resume-item li,
.resume-inner .edu-details li,
.resume-inner .activities-list li {
  margin-bottom: 0.2rem;
}

.resume-inner .resume-skills {
  display: grid;
  grid-template-columns: minmax(5rem, 7rem) 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.88rem;
  margin: 0;
}

.resume-inner .resume-skills dt {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.resume-inner .resume-skills dd {
  margin: 0;
  color: var(--text-light);
}

@media (max-width: 640px) {
  .resume-inner {
    padding: 1.35rem 1.15rem;
  }

  .resume-inner .resume-skills {
    grid-template-columns: 1fr;
  }

  .resume-inner .resume-skills dt {
    margin-top: 0.5rem;
  }

  .resume-inner .resume-skills dt:first-child {
    margin-top: 0;
  }
}

/* Marker for resume API (server.js); no visual */
.flag-footer {
  display: none;
}

@media print {
  .site-nav,
  .site-footer,
  .resume-page-header,
  .flag-footer {
    display: none !important;
  }

  .resume-main {
    padding: 0;
    max-width: none;
  }

  body {
    background: #fff !important;
  }

  .resume-paper {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: #fff;
  }

  .resume-inner,
  .resume-inner .resume-contact-line,
  .resume-inner .resume-item ul,
  .resume-inner .edu-details,
  .resume-inner .activities-list,
  .resume-inner .resume-skills dd {
    color: #222 !important;
  }

  .resume-inner .resume-name,
  .resume-inner .resume-item-title {
    color: #111 !important;
  }

  .resume-inner .resume-section-title {
    color: #333 !important;
    border-bottom-color: #ccc !important;
  }

  .resume-inner .resume-header {
    border-bottom-color: #e06b1f !important;
  }

  .resume-inner a {
    color: #111 !important;
    text-decoration: none !important;
  }
}
