/* ============================================================
   DESIGN TOKENS — Dark + Green
   ============================================================ */

:root {
  --bg: #0a0f0d;
  --bg-alt: #111916;
  --surface: #161e1a;
  --surface-hover: #1c2621;
  --text: #e4e2dd;
  --text-secondary: #8a8a82;
  --text-tertiary: #5a5a54;
  --accent: #22c55e;
  --accent-dim: rgba(34, 197, 94, 0.12);
  --accent-glow: rgba(34, 197, 94, 0.06);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.3s var(--ease-out);
}


/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Background texture — cross-browser SVG dot pattern */
.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' fill='%23ffffff' fill-opacity='0.07'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }

::selection {
  background: var(--accent);
  color: var(--bg);
}


/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) { .container { padding: 0 48px; } }
@media (min-width: 1200px) { .container { padding: 0 24px; } }


/* ============================================================
   INTRO OVERLAY — green bg, white text, curtain split
   ============================================================ */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.intro-curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: #15803d;
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
}

.intro-curtain-left  { left: 0; }
.intro-curtain-right { right: 0; }

.intro-overlay.is-splitting .intro-curtain-left {
  transform: translateX(-100%);
}

.intro-overlay.is-splitting .intro-curtain-right {
  transform: translateX(100%);
}

.intro-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: opacity 0.35s ease;
}

.intro-word-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: clamp(4.4rem, 13.2vw, 9.9rem);
  font-family: var(--font-serif);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
}

.intro-word {
  display: block;
  position: absolute;
  inset: 0;
  text-align: center;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.4s ease, transform 0.5s var(--ease-out);
  color: #fff;
}

.intro-word.is-active {
  opacity: 1;
  transform: translateY(0);
}

.intro-word.is-exiting {
  opacity: 0;
  transform: translateY(-100%);
}

.intro-skip {
  position: absolute;
  bottom: 48px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 13, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

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

@media (min-width: 768px) { .nav-links { display: flex; } }

/* Mobile toggle */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-right: -8px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (min-width: 768px) { .menu-toggle { display: none; } }

.menu-toggle.is-open span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle.is-open span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  top: 56px;
  background: var(--bg);
  z-index: 99;
  display: flex;
  flex-direction: column;
  padding: 48px 24px;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu.is-open { opacity: 1; pointer-events: auto; }

.mobile-menu a {
  font-family: var(--font-serif);
  font-size: 32px;
}

.mobile-menu a:hover { color: var(--accent); }

.mobile-menu .mobile-meta {
  margin-top: auto;
  display: flex;
  gap: 24px;
}

.mobile-menu .mobile-meta a {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
}


/* ============================================================
   SCROLL REVEAL
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Slide from right (for alternate project cards) */
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up (for images) */
.reveal-scale {
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-scale.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}


/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 80px 0 64px;
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
}

@media (min-width: 768px) { .hero { padding: 100px 0 80px; } }

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

@media (min-width: 768px) {
  .hero-content {
    flex-direction: row;
    align-items: flex-start;
    gap: 64px;
  }
}

.hero-text { flex: 1; }

.hero-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  font-weight: 400;
}

/* Animated hero headline — text reveal */
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.0;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero-name .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}

.hero-name .char.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-intro {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 440px;
  line-height: 1.7;
  margin-bottom: 32px;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover {
  background: #1aab4e;
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  transition: border-color var(--transition), transform var(--transition);
}

.btn-ghost:hover {
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}

.hero-photo {
  flex-shrink: 0;
  width: 220px;
}

.hero-photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  object-fit: cover;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--border);
}

@media (max-width: 767px) {
  .hero-photo { width: 160px; order: -1; }
}

.hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.social-row a {
  color: var(--text-tertiary);
  transition: color var(--transition);
  display: flex;
}

.social-row a:hover { color: var(--text); }
.social-row svg { width: 18px; height: 18px; }

.status-text {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ask-tobi-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 100px;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.ask-tobi-btn kbd {
  color: var(--text);
}

.ask-tobi-btn:hover {
  background: rgba(34, 197, 94, 0.18);
  border-color: var(--accent);
}

.ask-tobi-btn kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

@media (max-width: 767px) {
  .ask-tobi-btn kbd { display: none; }
}


/* ============================================================
   SECTIONS
   ============================================================ */

.section { padding: 96px 0; }

@media (min-width: 768px) { .section { padding: 128px 0; } }

.section-header {
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
}


/* ============================================================
   PROJECT CARDS — image determines card size, NO cropping
   ============================================================ */

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

/* Featured card spans full width */
.project-card.featured {
  grid-column: 1 / -1;
}

/* Image wrapper — NO fixed height, image flows naturally */
.project-media {
  overflow: hidden;
}

.project-media a {
  display: block;
}

.project-media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease-out;
}

.project-card:hover .project-media img {
  transform: scale(1.03);
}

/* Text info BELOW the image */
.project-info {
  padding: 20px;
}

.project-info h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-info h3 svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color 0.3s ease, transform 0.3s ease;
}

.project-card:hover .project-info h3 svg {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.project-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  font-weight: 300;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tags span {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}

/* More projects (text-only links) */
.more-projects {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.more-project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left var(--transition);
}

.more-project-link:hover { padding-left: 8px; }

.more-project-link .mp-name {
  font-family: var(--font-serif);
  font-size: 18px;
}

.more-project-link .mp-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-left: 12px;
  display: none;
}

@media (min-width: 768px) { .more-project-link .mp-desc { display: inline; } }

.more-project-link svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: color var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.more-project-link:hover svg {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* Big CTA link (like Abraham's "See all my projects") */
.big-cta {
  display: block;
  margin-top: 48px;
}

.big-cta-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 32px 0;
}

.big-cta-inner h3 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
}

.big-cta-inner svg {
  width: 28px;
  height: 28px;
  color: var(--text-tertiary);
  transition: color 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
  margin-bottom: 4px;
}

.big-cta:hover svg {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* Animated underline */
.cta-line {
  position: relative;
  height: 1.5px;
  background: var(--border);
  overflow: hidden;
}

.cta-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}

.big-cta:hover .cta-line::after {
  transform: scaleX(1);
  transform-origin: left;
  transition-duration: 0.3s;
}


/* ============================================================
   EXPERIENCE
   ============================================================ */

.log-entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .log-entry {
    grid-template-columns: 180px 1fr;
    gap: 32px;
  }
}

.log-date {
  font-size: 13px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.log-body h3 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
}

.log-body .log-company { color: var(--text-secondary); font-weight: 400; }

.log-body p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.6;
  font-weight: 300;
}


/* ============================================================
   ABOUT
   ============================================================ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
}

@media (min-width: 768px) {
  .about-grid { grid-template-columns: 1fr 340px; gap: 80px; }
}

.about-text h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 24px;
}

.about-text p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
  font-weight: 300;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.about-card h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  font-weight: 500;
}

.about-card .card-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.about-card .card-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 2px; }
.about-card .card-mono { font-size: 12px; color: var(--text-tertiary); }

.about-card hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.about-card .coursework {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.stack-inline {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.stack-inline strong {
  font-weight: 500;
  color: var(--accent);
  display: block;
  margin-top: 12px;
  margin-bottom: 2px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stack-inline strong:first-child { margin-top: 0; }


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer { padding: 96px 0 48px; }

@media (min-width: 768px) { .site-footer { padding: 128px 0 48px; } }

.footer-cta {
  margin-bottom: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border);
}

.footer-cta h2 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 400;
  margin-bottom: 16px;
}

.footer-cta p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 480px;
  font-weight: 300;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  transition: color var(--transition);
}

.email-link:hover { color: var(--accent); }

.email-link svg { width: 16px; height: 16px; transition: transform var(--transition); }
.email-link:hover svg { transform: translate(2px, -2px); }

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy { font-size: 13px; color: var(--text-tertiary); }

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-tertiary);
  transition: color var(--transition);
  display: flex;
}

.footer-links a:hover { color: var(--text); }
.footer-links svg { width: 18px; height: 18px; }


/* ============================================================
   COMMAND PALETTE — "Ask Tobi"
   ============================================================ */

.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cmd-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cmd-palette {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 560px;
  max-width: 92vw;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.25s var(--ease-out);
}

.cmd-overlay.is-open .cmd-palette {
  transform: translateY(0) scale(1);
}

.cmd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.cmd-header svg {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
}

.cmd-input::placeholder { color: var(--text-tertiary); }

.cmd-esc {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.cmd-body {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
}

.cmd-answer {
  padding: 16px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.cmd-answer .cmd-label {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  font-style: italic;
}

.cmd-suggestion {
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cmd-suggestion:hover {
  background: var(--accent-dim);
  color: var(--text);
}

.cmd-suggestion.is-selected {
  background: var(--accent-dim);
  color: var(--text);
}

.cmd-suggestion .cmd-enter {
  font-size: 11px;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cmd-suggestion:hover .cmd-enter,
.cmd-suggestion.is-selected .cmd-enter {
  opacity: 1;
}

.cmd-nav {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
}

.cmd-nav span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cmd-nav kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
}


/* ============================================================
   HERO CHARACTER ANIMATION
   ============================================================ */

.hero-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}

.hero-char.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   ROTATING WORD — cycles in hero headline
   ============================================================ */

.rotating-wrapper {
  display: inline-block;
  position: relative;
  overflow: hidden;
  vertical-align: bottom;
  min-width: 160px;
}

.rotating-word {
  display: inline-block;
  color: var(--accent);
  font-style: italic;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.rotating-word.is-exiting {
  opacity: 0;
  transform: translateY(-100%);
}

.rotating-word.is-entering {
  animation: rotateIn 0.4s var(--ease-out) forwards;
}

@keyframes rotateIn {
  0% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   SECTION SUBTITLE
   ============================================================ */

.section-sub {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 300;
}


/* ============================================================
   READS — Book grid
   ============================================================ */

.reads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 24px;
}

@media (min-width: 768px) {
  .reads-grid { grid-template-columns: repeat(5, 1fr); }
}

.book-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
}

.book-cover {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 2 / 3;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.book-card:hover .book-cover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.book-info h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

.book-info span {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 300;
}


/* ============================================================
   HERO CHARACTER ANIMATION
   ============================================================ */

.hero-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}

.hero-char.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   ROTATING WORD — animates IN with hero text, then cycles
   ============================================================ */

.rotating-wrapper {
  display: inline-block;
  position: relative;
  vertical-align: bottom;
  overflow: hidden;
  /* Starts hidden like hero-char, revealed together */
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.4s ease 0.5s, transform 0.6s var(--ease-out) 0.5s;
}

.rotating-wrapper.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rotating-word {
  display: inline-block;
  color: var(--accent);
  font-style: italic;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.rotating-word.is-exiting {
  opacity: 0;
  transform: translateY(-100%);
}

.rotating-word.is-entering {
  animation: rotateWordIn 0.4s ease-out forwards;
}

@keyframes rotateWordIn {
  0% { opacity: 0; transform: translateY(60%); }
  100% { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   SECTION SUBTITLE
   ============================================================ */

.section-sub, .page-sub {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 300;
  margin-top: 4px;
}


/* ============================================================
   PAGE HEADER — sub-pages (work, reads, about)
   ============================================================ */

.page-section {
  padding-top: 140px;
}

.page-header {
  margin-bottom: 56px;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--accent);
}


/* ============================================================
   ACTIVE NAV LINK
   ============================================================ */

.nav-links a.is-active,
.mobile-menu a.is-active {
  color: var(--accent);
}


/* ============================================================
   EXPLORE CARDS — homepage navigation
   ============================================================ */

.explore-section {
  padding-top: 0;
}

.explore-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .explore-grid { grid-template-columns: repeat(3, 1fr); }
}

.explore-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color 0.3s ease, transform 0.3s ease;
  position: relative;
}

.explore-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.explore-icon {
  color: var(--accent);
  opacity: 0.7;
}

.explore-card h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  font-style: italic;
}

.explore-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 300;
}

.explore-arrow {
  font-size: 18px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.explore-card:hover .explore-arrow {
  opacity: 1;
  transform: translateX(0);
}


/* ============================================================
   BACK TO TOP
   ============================================================ */

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 50;
}

.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); border-color: var(--accent); }
.back-to-top svg { width: 18px; height: 18px; }


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 999;
}

.skip-link:focus { top: 16px; }
