/* ============================================
   Good Twigs — Stylesheet
   Earthy, modern, warm editorial aesthetic
   ============================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Palette — earthy & natural */
  --bg: #FAF7F2;
  --bg-warm: #F3EDE3;
  --bg-deep: #2C2A26;
  --cream: #FFFCF7;
  --ink: #2A2722;
  --ink-soft: #5C564E;
  --ink-light: #8A8278;
  --moss: #5B6B4D;
  --moss-dark: #44523A;
  --moss-light: #8A9A7B;
  --clay: #B07A56;
  --clay-light: #D4A584;
  --terracotta: #C17B5C;
  --sage: #C5CFB8;
  --line: #E5DDD1;
  --line-soft: #EDE7DC;
  --white: #FFFFFF;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --max-width: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Radius */
  --radius: 18px;
  --radius-sm: 10px;
  --radius-lg: 28px;

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.2s var(--ease);
  --t-med: 0.4s var(--ease);
}

/* ---------- Reset ---------- */
*, *::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-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button { font-family: inherit; cursor: pointer; border: none; background: none; }

ul { list-style: none; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 999;
  background: var(--moss);
  color: var(--cream);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 1rem; }

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

:focus-visible {
  outline: 3px solid var(--moss);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Background shapes ---------- */
.bg-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.shape {
  position: absolute;
  width: clamp(300px, 50vw, 600px);
  height: auto;
  opacity: 0.045;
}
.shape-1 {
  top: -8%;
  right: -10%;
  fill: var(--moss);
}
.shape-2 {
  bottom: -5%;
  left: -12%;
  width: clamp(350px, 55vw, 700px);
  fill: var(--clay);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

main { position: relative; z-index: 1; }

/* ---------- Typography helpers ---------- */
.section-eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 1rem;
}
.section-eyebrow.light { color: var(--sage); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-intro {
  margin-top: 1.2rem;
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.85rem 2rem;
  border-radius: 100px;
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  text-align: center;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--moss);
  color: var(--cream);
  box-shadow: 0 4px 14px rgba(91, 107, 77, 0.25);
}
.btn-primary:hover {
  background: var(--moss-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91, 107, 77, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--line);
}
.btn-secondary:hover {
  border-color: var(--moss);
  color: var(--moss);
  transform: translateY(-2px);
}

.btn-submit {
  white-space: nowrap;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med), background var(--t-med);
}
.site-header.scrolled {
  border-bottom-color: var(--line-soft);
}

.nav {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.logo-mark {
  display: inline-flex;
  color: var(--moss);
  transition: color var(--t-fast);
}
.logo:hover .logo-mark { color: var(--clay); }
.logo-text { line-height: 1; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-menu a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 0.3rem 0;
  transition: color var(--t-fast);
}
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--moss);
  transition: width var(--t-fast);
  border-radius: 2px;
}
.nav-menu a:hover { color: var(--moss); }
.nav-menu a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  z-index: 101;
}
.nav-toggle-bar {
  width: 26px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem var(--gutter) 4rem;
  position: relative;
}

.hero-inner {
  max-width: 760px;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.1s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.2s forwards;
}

.hero-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 400;
  color: var(--moss);
  margin-bottom: 1.8rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.35s forwards;
}

.hero-copy {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.5s forwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.65s forwards;
}

.hero-scroll {
  margin-top: 4rem;
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1.2s forwards;
}
.scroll-line {
  width: 2px;
  height: 50px;
  background: linear-gradient(to bottom, transparent, var(--moss-light), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ---------- Categories ---------- */
.categories {
  padding: clamp(4rem, 10vw, 7rem) 0;
  background: var(--bg-warm);
  position: relative;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
}
.section-head .section-eyebrow { text-align: center; }
.section-head .section-title { text-align: center; }
.section-head .section-intro { margin-inline: auto; text-align: center; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.category-card {
  background: var(--cream);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 2.2rem 2rem;
  text-align: center;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(44, 42, 38, 0.08);
  border-color: var(--sage);
}

.category-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sage);
  border-radius: 50%;
  color: var(--moss-dark);
  transition: transform var(--t-med), background var(--t-med);
}
.category-card:hover .category-icon {
  transform: scale(1.08) rotate(-3deg);
  background: var(--moss-light);
}

.category-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.category-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ---------- Philosophy ---------- */
.philosophy {
  padding: clamp(4rem, 10vw, 7rem) 0;
}

.philosophy-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.philosophy-statement {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}
.philosophy-statement em {
  font-style: italic;
  color: var(--moss);
  font-weight: 500;
}

.philosophy-body p {
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
}
.philosophy-body p:last-child { margin-bottom: 0; }

.philosophy-values {
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.value-item {
  position: relative;
  padding-left: 2.5rem;
}
.value-dot {
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 5px rgba(91, 107, 77, 0.15);
}
.value-item:nth-child(2) .value-dot { background: var(--clay); box-shadow: 0 0 0 5px rgba(176, 122, 86, 0.15); }
.value-item:nth-child(3) .value-dot { background: var(--moss-light); box-shadow: 0 0 0 5px rgba(138, 154, 123, 0.2); }
.value-item:nth-child(4) .value-dot { background: var(--terracotta); box-shadow: 0 0 0 5px rgba(193, 123, 92, 0.15); }
.value-item:nth-child(5) .value-dot { background: var(--moss-dark); box-shadow: 0 0 0 5px rgba(68, 82, 58, 0.15); }

.value-item h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.value-item p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ---------- Brand statement ---------- */
.brand-statement {
  padding: clamp(4rem, 10vw, 7rem) 0;
  background: var(--moss-dark);
  color: var(--cream);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.brand-statement::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(138, 154, 123, 0.15), transparent 60%);
  pointer-events: none;
}

.brand-statement .container { z-index: 2; }

.nest-illustration {
  margin: 0 auto 1.5rem;
  color: var(--sage);
  opacity: 0.85;
}

.brand-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1rem;
}

.brand-headline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 1.1rem;
  color: rgba(255, 252, 247, 0.75);
  max-width: 48ch;
  margin-inline: auto;
  line-height: 1.7;
}

/* ---------- Signup ---------- */
.signup {
  padding: clamp(4rem, 10vw, 7rem) 0;
  background: var(--bg-warm);
}

.signup-inner {
  max-width: 580px;
  text-align: center;
}

.signup-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.signup-copy {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-bottom: 2.2rem;
}

.signup-form {
  margin-bottom: 1rem;
}

.form-field {
  display: flex;
  gap: 0.6rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.4rem 0.4rem 0.4rem 1.5rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-field:focus-within {
  border-color: var(--moss);
  box-shadow: 0 0 0 4px rgba(91, 107, 77, 0.12);
}

.form-field input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  padding: 0.7rem 0;
  min-width: 0;
}
.form-field input::placeholder { color: var(--ink-light); }
.form-field input:focus { outline: none; }

.btn-submit {
  padding: 0.7rem 1.8rem;
  font-size: 0.95rem;
}

.form-message {
  font-size: 0.9rem;
  margin-top: 1rem;
  min-height: 1.4em;
  color: var(--moss);
  font-weight: 500;
}
.form-message.error { color: #B85450; }

.signup-fineprint {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-top: 0.5rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-deep);
  color: rgba(255, 252, 247, 0.7);
  padding: clamp(3rem, 6vw, 4rem) 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 252, 247, 0.1);
}

.logo-footer {
  color: var(--cream);
}
.logo-footer .logo-mark { color: var(--sage); }

.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(255, 252, 247, 0.6);
  margin-top: 0.6rem;
}

.footer-nav ul {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 0.95rem;
  color: rgba(255, 252, 247, 0.7);
  transition: color var(--t-fast);
}
.footer-nav a:hover { color: var(--sage); }

.footer-bottom {
  padding-top: 1.5rem;
}
.footer-bottom p {
  font-size: 0.85rem;
  color: rgba(255, 252, 247, 0.45);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .philosophy-inner {
    grid-template-columns: 1fr;
  }
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .nav-menu {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 85vw);
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform var(--t-med);
    box-shadow: -10px 0 40px rgba(44, 42, 38, 0.1);
    z-index: 100;
  }
  .nav-menu.open {
    transform: translateX(0);
  }
  .nav-menu a {
    font-size: 1.2rem;
    color: var(--ink);
  }
  .nav-toggle { display: flex; }

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

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn { width: 100%; }

  .form-field {
    flex-direction: column;
    border-radius: var(--radius);
    padding: 1rem;
    gap: 1rem;
  }
  .form-field input {
    text-align: center;
    padding: 0.5rem;
  }
  .btn-submit {
    width: 100%;
    padding: 0.85rem 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1.5rem;
  }
  .footer-nav ul {
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .category-card { padding: 1.8rem 1.4rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-eyebrow, .hero-title, .hero-tagline, .hero-copy, .hero-actions, .hero-scroll {
    opacity: 1;
  }
}
