/* ===== TOKENS ===== */
:root {
  --white: #ffffff;
  --ink: #111111;
  --ink-muted: #888888;
  --blue: #0EA5E9;
  --orange: #F97316;
  --bg: #fdfcfb;
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ===== DOODLE LAYER ===== */
.doodles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Each doodle absolutely positioned */
.doodle { position: absolute; }

.doodle-spiral {
  width: 120px;
  top: 8%;
  right: 6%;
  animation: float 6s ease-in-out infinite;
}

.doodle-stars-tl {
  width: 90px;
  top: 12%;
  left: 5%;
  animation: float 7s ease-in-out 0.5s infinite;
}

.doodle-wave {
  width: 200px;
  bottom: 22%;
  left: 3%;
  animation: float 8s ease-in-out 1s infinite;
}

.doodle-dots {
  width: 70px;
  top: 35%;
  right: 3%;
  animation: float 5s ease-in-out 0.3s infinite;
}

.doodle-arrow {
  width: 80px;
  bottom: 34%;
  left: 18%;
  animation: float 6.5s ease-in-out 0.8s infinite;
}

.doodle-loops {
  width: 110px;
  top: 60%;
  left: 8%;
  animation: float 9s ease-in-out 0.2s infinite;
}

.doodle-squiggle {
  width: 130px;
  bottom: 12%;
  right: 5%;
  animation: float 7.5s ease-in-out 0.6s infinite;
}

/* Draw-in animation for paths */
.draw {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawIn 2.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}
.draw-2 {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawIn 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}
.draw-3 {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawIn 1s cubic-bezier(0.4, 0, 0.2, 1) 1.5s forwards;
}

/* Pop-in animation for circles */
.pop {
  opacity: 0;
  transform: scale(0);
  transform-origin: center;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
}
.pop-2 { animation-delay: 0.6s; }
.pop-3 { animation-delay: 0.8s; }
.pop-4 { animation-delay: 1.0s; }
.pop-5 { animation-delay: 1.2s; }
.pop-6 { animation-delay: 1.4s; }
.pop-7 { animation-delay: 1.6s; }

/* Circle draw-in */
.draw-circle {
  animation: drawCircle 1.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
}
.draw-c2 {
  animation: drawCircle 1.4s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards;
}

/* Doodle underline path */
.draw-ul {
  stroke-dasharray: 250;
  stroke-dashoffset: 250;
  animation: drawIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .draw, .draw-2, .draw-3, .pop, .pop-2, .pop-3, .pop-4, .pop-5, .pop-6, .pop-7,
  .draw-circle, .draw-c2, .draw-ul, .doodle {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
    transform: none;
  }
}

@keyframes drawIn {
  to { stroke-dashoffset: 0; }
}
@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}
@keyframes popIn {
  to { opacity: 1; transform: scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-6px) rotate(1deg); }
  66% { transform: translateY(4px) rotate(-1deg); }
}

/* ===== NAV ===== */
.nav {
  position: relative;
  z-index: 10;
  padding: 28px 40px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px 80px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  gap: 0;
  animation: heroFadeUp 0.7s ease both;
}

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

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
  animation: tagPulse 2.5s ease-in-out infinite;
}

@keyframes tagPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(56px, 12vw, 108px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 24px;
}

/* Doodle underline on "builders" */
.underline-doodle {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.underline-svg {
  position: absolute;
  bottom: -6px;
  left: -4px;
  width: calc(100% + 8px);
  height: 14px;
  overflow: visible;
}

.hero-sub {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-muted);
  font-weight: 400;
  margin-bottom: 36px;
  max-width: 400px;
}

/* ===== FORM ===== */
.form {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 420px;
  margin-bottom: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
}

.form-input {
  flex: 1;
  padding: 15px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  border: 2px solid transparent;
  border-right: none;
  border-radius: 16px 0 0 16px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input::placeholder { color: #bbb; }

.form-input:focus {
  border-color: var(--blue);
}

.form-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 15px 22px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 0 16px 16px 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease;
}

.form-btn:hover {
  background: #333;
  transform: translateY(-1px);
}
.form-btn:active { transform: translateY(0); }

/* ===== PILLS ===== */
.pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  justify-content: center;
}

.pill {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
}

.pill-dot {
  font-size: 13px;
  color: #ccc;
}

/* ===== FOOTER ===== */
.footer {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-muted);
  border-top: 1px solid #f0f0f0;
}

.footer a {
  transition: color 0.2s ease;
  cursor: pointer;
}
.footer a:hover { color: var(--blue); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .nav { padding: 20px 20px; }
  .hero { padding: 40px 20px 60px; }
  .footer { padding: 16px 20px; }

  .form {
    flex-direction: column;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: visible;
  }

  .form-input {
    border-right: 2px solid transparent;
    border-radius: 14px 14px 0 0;
    border-bottom: none;
  }
  .form-input:focus { border-color: var(--blue); }

  .form-btn {
    justify-content: center;
    border-radius: 0 0 14px 14px;
    padding: 14px;
  }

  .doodle-dots, .doodle-spiral { right: 1%; }
  .doodle-loops { left: 1%; }
  .doodle-stars-tl { left: 1%; }
  .doodle-wave { left: 0; }
  .doodle-arrow { left: 8%; }
}

@media (max-width: 400px) {
  .hero-headline { font-size: clamp(44px, 14vw, 72px); }
}
