/* ========================================
   OVERTHOUGHT LABS — THE THINKER'S WORKSHOP
   Design Tokens, Typography, Layout & Animation
   ======================================== */


/* ─── Design Tokens ─── */

:root {
  /* Palette */
  --canvas:     #FAF7F2;
  --ink:        #1A1A1A;
  --amber:      #D97706;
  --amber-hover:#B45309;
  --sage:       #6B7F6B;
  --parchment:  #F0EBE3;
  --warmgray:   #8B8178;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --content-width: 720px;
  --wide-width:    1080px;
  --nav-height:    56px;
  --section-gap:   160px;
  --gutter:        28px;

  /* Animation */
  --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth:    cubic-bezier(0.16, 1, 0.3, 1);
  --duration-draw:  1.4s;
  --duration-fade:  0.8s;
}


/* ─── Smooth Scroll ─── */

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}


/* ─── Reset ─── */

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

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

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


/* ─── Focus Styles ─── */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
  border-radius: 2px;
}


/* ═══════════════════════════════════════
   STICKY NAVIGATION
   ═══════════════════════════════════════ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(250, 247, 242, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(26, 26, 26, 0.05);
  transition: box-shadow 0.3s ease;
}

.nav.scrolled {
  box-shadow: 0 1px 12px rgba(26, 26, 26, 0.05);
}

.nav-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Text logo */
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 48;
  transition: opacity 0.2s ease;
}

.nav-logo:hover {
  opacity: 0.7;
}

.nav-logo-accent {
  font-weight: 900;
  color: var(--amber);
}

/* Nav links */
.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warmgray);
  transition: color 0.2s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--amber);
  transition: width 0.3s var(--ease-out);
}

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

.nav-link:hover::after {
  width: 100%;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 20px;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 7px;
  padding: 0;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
  transform: translateY(4.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
  transform: translateY(-4.5px) rotate(-45deg);
}


/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + 48px) var(--gutter) 80px;
}

.hero-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
}

/* Hero headline */
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(36px, 6.5vw, 58px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variation-settings: 'opsz' 144;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(20px);
  animation: hero-reveal 0.8s var(--ease-out) 0.15s forwards;
}

@keyframes hero-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* The ink-accent word */
.ink-word {
  position: relative;
  display: inline;
  white-space: nowrap;
}

.ink-accent {
  position: absolute;
  bottom: 0px;
  left: -4px;
  width: calc(100% + 8px);
  height: 16px;
  overflow: visible;
  pointer-events: none;
}

.ink-stroke {
  stroke: var(--amber);
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  transition: none;
}

.ink-stroke.animate {
  animation: draw-stroke var(--duration-draw) var(--ease-out) forwards;
}

@keyframes draw-stroke {
  to {
    stroke-dashoffset: 0;
  }
}

/* Hero subtitle */
.hero-sub {
  font-size: 18px;
  line-height: 1.65;
  color: var(--warmgray);
  max-width: 480px;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(14px);
  animation: hero-reveal 0.7s var(--ease-out) 0.45s forwards;
}

/* Hero CTA link */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--amber);
  transition: color 0.2s ease;
  opacity: 0;
  animation: hero-reveal 0.6s var(--ease-out) 0.7s forwards;
}

.hero-cta:hover {
  color: var(--amber-hover);
}

.cta-arrow {
  transition: transform 0.3s var(--ease-out);
}

.hero-cta:hover .cta-arrow {
  transform: translateY(3px);
}


/* ═══════════════════════════════════════
   SECTIONS (shared)
   ═══════════════════════════════════════ */

.section {
  padding: var(--section-gap) var(--gutter);
}

.section-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.section-inner--wide {
  max-width: var(--wide-width);
}

/* Eyebrow label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  display: block;
  margin-bottom: 20px;
}

/* Section title */
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-variation-settings: 'opsz' 72;
  margin-bottom: 8px;
}


/* ═══════════════════════════════════════
   MANIFESTO
   ═══════════════════════════════════════ */

.manifesto-body {
  margin-top: 28px;
  color: var(--warmgray);
  max-width: 540px;
  font-size: 17px;
}

.manifesto-body p + p {
  margin-top: 20px;
}

.manifesto-body em {
  color: var(--ink);
  font-style: italic;
}

.manifesto-kicker {
  color: var(--ink) !important;
  font-weight: 500;
  font-style: italic;
  font-family: var(--font-display);
  font-size: 19px;
  font-variation-settings: 'opsz' 48;
}


/* ═══════════════════════════════════════
   PEN-STROKE DIVIDERS
   ═══════════════════════════════════════ */

.stroke-divider {
  max-width: 240px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.stroke-divider svg {
  width: 100%;
  height: 8px;
}

.divider-stroke {
  stroke: var(--sage);
  opacity: 0.35;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
}

.divider-stroke.animate {
  animation: draw-divider 1.8s var(--ease-out) forwards;
}

@keyframes draw-divider {
  to {
    stroke-dashoffset: 0;
  }
}


/* ═══════════════════════════════════════
   PROCESS — OVERTHINK → BUILD → SHIP
   ═══════════════════════════════════════ */

.process-flow {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin-top: 52px;
}

/* Process cards */
.process-card {
  flex: 1;
  max-width: 280px;
  padding: 36px 28px 32px;
  background: var(--parchment);
  border-radius: 10px;
  border: 1px solid rgba(26, 26, 26, 0.05);
  transition: box-shadow 0.4s ease,
              opacity var(--duration-fade) var(--ease-smooth);
  /* Scroll animation initial state */
  opacity: 0;
  transform: translateY(28px);
  will-change: transform, opacity;
}

.process-card.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: box-shadow 0.4s ease, opacity var(--duration-fade) var(--ease-smooth);
}

.process-card.visible:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(26, 26, 26, 0.06);
}

.process-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--ink);
  font-variation-settings: 'opsz' 48;
}

/* Amber accent on the "Overthink" card title */
.process-card[data-step="overthink"] .process-card-title {
  color: var(--amber);
}

.process-card-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--warmgray);
}

/* Hand-drawn arrows between cards */
.process-arrow {
  width: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 4px;
}

.process-arrow svg {
  width: 100%;
  height: 40px;
}

.arrow-stroke,
.arrow-head {
  stroke: var(--amber);
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
}

.arrow-stroke.animate {
  animation: draw-arrow 0.7s var(--ease-out) forwards;
}

.arrow-head.animate {
  animation: draw-arrow 0.4s var(--ease-out) 0.35s forwards;
}

@keyframes draw-arrow {
  to {
    stroke-dashoffset: 0;
  }
}


/* ═══════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════ */

.section--contact .section-inner {
  text-align: center;
  padding: 20px 0;
}

.section--contact .section-title {
  margin-bottom: 28px;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--amber);
  letter-spacing: 0.01em;
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s var(--ease-out), color 0.2s ease;
}

.contact-email:hover {
  border-color: var(--amber);
  color: var(--amber-hover);
}


/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */

.footer {
  padding: 36px var(--gutter);
  border-top: 1px solid rgba(26, 26, 26, 0.06);
}

.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy,
.footer-loc {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--warmgray);
  letter-spacing: 0.02em;
}


/* ═══════════════════════════════════════
   SCROLL DRAW-IN ANIMATIONS
   ═══════════════════════════════════════ */

.draw-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--duration-fade) var(--ease-smooth),
              transform var(--duration-fade) var(--ease-smooth);
  will-change: transform, opacity;
}

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


/* ═══════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-title,
  .hero-sub,
  .hero-cta,
  .draw-in,
  .process-card {
    opacity: 1 !important;
    transform: none !important;
  }

  .ink-stroke,
  .divider-stroke,
  .arrow-stroke,
  .arrow-head {
    stroke-dashoffset: 0 !important;
  }
}


/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --section-gap: 80px;
    --gutter: 20px;
  }

  /* Mobile nav */
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(250, 247, 242, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 28px var(--gutter);
    gap: 22px;
    border-bottom: 1px solid rgba(26, 26, 26, 0.06);
  }

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

  .nav-toggle {
    display: flex;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 56px);
    padding-bottom: 56px;
  }

  .hero-title br {
    display: none;
  }

  .hero-sub {
    font-size: 16px;
  }

  /* Section titles */
  .section-title br {
    display: none;
  }

  /* Process: vertical stack */
  .process-flow {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .process-card {
    max-width: 100%;
    width: 100%;
  }

  .process-arrow {
    transform: rotate(90deg);
    width: 44px;
    margin: 6px 0;
  }

  /* Contact */
  .contact-email {
    font-size: 15px;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}


/* ═══════════════════════════════════════
   SMALL MOBILE (≤480px)
   ═══════════════════════════════════════ */

@media (max-width: 480px) {
  .hero-title {
    font-size: 32px;
  }

  .process-card {
    padding: 28px 22px 24px;
  }
}
