/* ==========================================================================
   RECUR LLC — Design System & Layout
   Architectural Warm Paper & Deep Ink with Vermilion Recursive Spine
   ========================================================================== */

:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --surface-subtle: #f1efe9;
  --ink: #141413;
  --ink-secondary: #4a4843;
  --ink-muted: #706d66;
  --border: rgba(20, 20, 19, 0.1);
  --border-strong: rgba(20, 20, 19, 0.2);
  --accent: #c84b31;
  --accent-soft: rgba(200, 75, 49, 0.09);
  --band-bg: rgba(20, 20, 19, 0.028);
  --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.04), 0 4px 16px rgba(20, 20, 19, 0.03);
  --shadow-md: 0 4px 12px rgba(20, 20, 19, 0.06), 0 16px 36px rgba(20, 20, 19, 0.06);

  --font-sans: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --row-h: 52px;
  --container: 1120px;
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #121211;
  --surface: #1a1a18;
  --surface-subtle: #22221f;
  --ink: #f4f2ec;
  --ink-secondary: #c8c5bc;
  --ink-muted: #938f86;
  --border: rgba(244, 242, 236, 0.1);
  --border-strong: rgba(244, 242, 236, 0.22);
  --accent: #e06346;
  --accent-soft: rgba(224, 99, 70, 0.14);
  --band-bg: rgba(244, 242, 236, 0.035);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35), 0 20px 44px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 280ms ease, color 280ms ease;
  position: relative;
}

/* Tactile paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.brand-mark .brand-r {
  color: var(--accent);
}

.brand-mark .brand-llc {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.nav-group {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 28px);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 28px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: color 180ms ease;
}

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

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

/* ==========================================================================
   Hero Section & Animated Acronym Stage
   ========================================================================== */

.hero-section {
  padding: clamp(32px, 5vh, 64px) 0 clamp(44px, 7vh, 80px);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.hero-top-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: clamp(16px, 3vh, 32px);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage {
  position: relative;
  height: calc(var(--row-h) * 7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  margin: 0 calc(-1 * clamp(10px, 2vw, 20px));
}

.center-band {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: calc(var(--row-h) + 12px);
  transform: translateY(-50%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--band-bg);
  opacity: 0;
  transition: opacity 750ms ease;
  pointer-events: none;
}

.stage.phase-reels .center-band {
  opacity: 1;
}

.hero-heading-wrap {
  margin: 0;
  font-weight: inherit;
  width: 100%;
  display: flex;
  justify-content: center;
}

.phrase-grid {
  position: relative;
  display: grid;
  grid-template-columns: max-content max-content 1.12fr 1.08fr 0.94fr;
  column-gap: clamp(12px, 2.2vw, 30px);
  align-items: center;
  width: 100%;
  max-width: 1080px;
  padding: 0 clamp(12px, 2vw, 24px);
  font-size: clamp(16px, 2.55vw, 34px);
  line-height: var(--row-h);
  letter-spacing: -0.02em;
}

.col-wrap {
  position: relative;
  transform-origin: left center;
  will-change: transform;
}

.col-wrap.is-animating {
  transition: transform 980ms cubic-bezier(0.22, 1, 0.36, 1);
}

.static-word {
  display: flex;
  align-items: center;
  white-space: nowrap;
  height: var(--row-h);
}

.init-letter {
  display: inline-block;
  font-weight: 800;
  color: var(--ink);
  transition: color 580ms ease;
}

.stage.phase-expanded .init-letter.anchor,
.stage.phase-reels .init-letter.anchor {
  color: var(--accent);
}

.suffix {
  display: inline-block;
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 580ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 580ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.stage.phase-expanded .suffix,
.stage.phase-reels .suffix {
  opacity: 1;
  transform: translateX(0);
}

.llc-badge {
  position: absolute;
  top: 50%;
  left: 0;
  font-size: clamp(16px, 2.55vw, 34px);
  line-height: var(--row-h);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  transform-origin: left center;
  pointer-events: none;
  transition: opacity 420ms ease, transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.llc-badge.hidden-llc {
  opacity: 0;
}

/* Vertical Reel Columns */
.reel-viewport {
  position: relative;
  height: calc(var(--row-h) * 7);
  display: flex;
  align-items: center;
  cursor: pointer;
}

.stage.phase-reels .reel-viewport {
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.16) 16%,
    rgba(0, 0, 0, 0.52) 35%,
    #000 45%,
    #000 55%,
    rgba(0, 0, 0, 0.52) 65%,
    rgba(0, 0, 0, 0.16) 84%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.16) 16%,
    rgba(0, 0, 0, 0.52) 35%,
    #000 45%,
    #000 55%,
    rgba(0, 0, 0, 0.52) 65%,
    rgba(0, 0, 0, 0.16) 84%,
    transparent 100%
  );
}

.reel-track {
  position: relative;
  width: 100%;
  height: calc(var(--row-h) * 9);
  transform: translateY(0);
  will-change: transform;
}

.reel-track.sliding {
  transition: transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reel-item {
  height: var(--row-h);
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: opacity 550ms ease, color 420ms ease;
}

.reel-item.neighbor {
  opacity: 0;
  color: var(--ink-muted);
  font-weight: 400;
  pointer-events: none;
}

.stage.phase-reels .reel-item.dist-1 {
  opacity: 0.56;
}
.stage.phase-reels .reel-item.dist-2 {
  opacity: 0.28;
}
.stage.phase-reels .reel-item.dist-3 {
  opacity: 0.12;
}
.stage.phase-reels .reel-item.dist-4 {
  opacity: 0;
}

.reel-item.active-row {
  opacity: 1;
}

.reel-item.neighbor .init-letter {
  font-weight: 600;
  color: var(--ink-muted);
}

.reel-item.active-row .init-letter {
  font-weight: 800;
}

.reel-item.active-row .word-rest {
  font-weight: 600;
  color: var(--ink);
}

.reel-item.neighbor .word-rest {
  font-weight: 400;
  color: var(--ink-muted);
}

/* Hero Controls & Subtitle */
.hero-footer {
  margin-top: clamp(20px, 3vh, 36px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.hero-lead {
  max-width: 520px;
  margin: 0;
  font-size: 16px;
  color: var(--ink-secondary);
}

.hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 140ms ease;
}

.ctrl-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.ctrl-btn:active {
  transform: translateY(1px);
}

.ctrl-btn.is-accent {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.ctrl-btn.is-accent:hover {
  opacity: 0.9;
  background: var(--ink);
}

.cheeky-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
}

.cheeky-label input {
  accent-color: var(--accent);
  cursor: pointer;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.section-block {
  padding: clamp(64px, 9vw, 112px) 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(32px, 4vw, 52px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px 0;
  font-weight: 600;
}

.section-title {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.section-subtitle {
  margin: 0;
  max-width: 440px;
  font-size: 15px;
  color: var(--ink-secondary);
}

/* ==========================================================================
   Portfolio Grid (Intentional 2-over-3 Architectural Grid for 5 Ventures)
   ========================================================================== */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.venture-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 240ms ease,
    border-color 240ms ease;
  position: relative;
}

.venture-card.featured {
  grid-column: span 3;
}

.venture-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.venture-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.venture-index {
  color: var(--accent);
  font-weight: 600;
}

.venture-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.venture-name {
  margin: 0;
  font-size: clamp(21px, 2.2vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.venture-name a:hover {
  color: var(--accent);
}

.visit-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  flex-shrink: 0;
  transition: transform 200ms ease, border-color 200ms ease, color 200ms ease, background-color 200ms ease;
}

.venture-card:hover .visit-arrow {
  transform: translate(2px, -2px);
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.venture-domain {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.venture-desc {
  margin: 0 0 24px 0;
  font-size: 15px;
  color: var(--ink-secondary);
  line-height: 1.62;
}

.venture-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.venture-stat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.motto-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.motto-trigger:hover {
  border-color: var(--border-strong);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ==========================================================================
   Philosophy / About Section
   ========================================================================== */

.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.philosophy-copy p {
  font-size: 16px;
  color: var(--ink-secondary);
  margin: 18px 0 0 0;
  line-height: 1.7;
}

.pillars-list {
  display: flex;
  flex-direction: column;
}

.pillar-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.pillar-row:last-child {
  border-bottom: 1px solid var(--border);
}

.pillar-letter {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
}

.pillar-row h3 {
  margin: 0 0 6px 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pillar-row p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Contact & Footer
   ========================================================================== */

.contact-band {
  padding: clamp(56px, 8vw, 96px) 0;
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--shadow-sm);
}

.contact-card h2 {
  margin: 0 0 8px 0;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.contact-card p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 15px;
  max-width: 480px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
  font-size: 13px;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.footer-live-phrase {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-secondary);
}

.footer-live-phrase strong {
  color: var(--accent);
  font-weight: 600;
}

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

@media (max-width: 960px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .venture-card,
  .venture-card.featured {
    grid-column: span 1;
  }
  .venture-card:last-child {
    grid-column: span 2;
  }
  .philosophy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  :root {
    --row-h: 42px;
  }

  .nav-links {
    display: none;
  }

  .stage {
    height: auto;
    min-height: 300px;
    padding: 28px 0;
  }

  .center-band {
    display: none;
  }

  .phrase-grid {
    grid-template-columns: 1fr;
    row-gap: 4px;
    font-size: 26px;
    max-width: 340px;
  }

  .reel-viewport {
    height: calc(var(--row-h) * 3);
  }

  .stage.phase-reels .reel-viewport {
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      rgba(0, 0, 0, 0.35) 22%,
      #000 42%,
      #000 58%,
      rgba(0, 0, 0, 0.35) 78%,
      transparent 100%
    );
    mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      rgba(0, 0, 0, 0.35) 22%,
      #000 42%,
      #000 58%,
      rgba(0, 0, 0, 0.35) 78%,
      transparent 100%
    );
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .venture-card,
  .venture-card.featured,
  .venture-card:last-child {
    grid-column: span 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .col-wrap.is-animating,
  .suffix,
  .reel-track.sliding,
  .llc-badge {
    transition-duration: 10ms !important;
  }
}
