/* ============================================
   TREETOP TROUBLE — Tree Climbing Safety
   Modern Editorial + Outdoor Luxury
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Custom Properties --- */
:root {
  --forest-900: #0d1f0d;
  --forest-800: #1a3a1a;
  --forest-700: #2d5a2d;
  --forest-600: #3d7a3d;
  --forest-500: #4a9a4a;
  --forest-400: #6db86d;
  --forest-300: #98d098;
  --forest-200: #c4e4c4;
  --forest-100: #e8f5e8;

  --bark-900: #2a1810;
  --bark-800: #4a2c1a;
  --bark-700: #6b3f24;
  --bark-600: #8b5e3c;
  --bark-500: #a67c5b;
  --bark-400: #c49b7a;
  --bark-300: #d4b896;
  --bark-200: #e8d5be;
  --bark-100: #f5ede3;

  --cream: #faf6f0;
  --cream-warm: #f7f0e5;
  --parchment: #efe8db;
  --charcoal: #1a1a18;
  --ink: #2d2d2a;
  --stone: #6b6b63;
  --moss: #5a7247;
  --sage: #8fa seventeen;
  --amber: #d4890c;
  --amber-light: #f0b844;
  --rust: #b85c38;
  --sky: #7eb8c9;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 10rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --shadow-subtle: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-medium: 0 4px 20px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-dramatic: 0 20px 60px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.06);

  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--grain);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
}

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

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

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  color: var(--charcoal);
}

h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; font-family: var(--font-body); font-weight: 600; }

p {
  max-width: 65ch;
  color: var(--stone);
}

.lead {
  font-size: 1.2rem;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 300;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moss);
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1400px;
}

section {
  padding: var(--space-2xl) 0;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-sm) 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

.nav.scrolled {
  background: rgba(250, 246, 240, 0.85);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--forest-800);
  transition: opacity 0.3s;
}

.nav__logo:hover { opacity: 0.7; }

.nav__logo svg {
  width: 28px;
  height: 28px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav__links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--stone);
  transition: color 0.3s;
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--forest-600);
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav__links a:hover { color: var(--forest-700); }
.nav__links a:hover::after { width: 100%; }
.nav__links a.active { color: var(--forest-700); }
.nav__links a.active::after { width: 100%; }

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--forest-800);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--forest-900);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(0.8);
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13,31,13,0.3) 0%, rgba(13,31,13,0.1) 40%, rgba(13,31,13,0.6) 100%),
    linear-gradient(135deg, rgba(13,31,13,0.4) 0%, transparent 60%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-md) var(--space-2xl);
  width: 100%;
}

.hero h1 {
  color: var(--cream);
  max-width: 14ch;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 40px rgba(0,0,0,0.3);
}

.hero h1 em {
  font-style: italic;
  color: var(--forest-300);
}

.hero .lead {
  color: rgba(250,246,240,0.85);
  max-width: 48ch;
  margin-bottom: var(--space-lg);
}

.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--forest-300);
  margin-top: var(--space-xl);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* --- Page Hero (subpages) --- */
.page-hero {
  position: relative;
  padding: calc(80px + var(--space-2xl)) 0 var(--space-2xl);
  overflow: hidden;
}

.page-hero--green {
  background: linear-gradient(145deg, var(--forest-900) 0%, var(--forest-800) 50%, var(--forest-700) 100%);
  color: var(--cream);
}

.page-hero--green h1 { color: var(--cream); }
.page-hero--green .lead { color: rgba(250,246,240,0.8); }
.page-hero--green .label { color: var(--forest-300); }

.page-hero--warm {
  background: linear-gradient(145deg, var(--bark-900) 0%, var(--bark-800) 50%, var(--bark-700) 100%);
  color: var(--cream);
}

.page-hero--warm h1 { color: var(--cream); }
.page-hero--warm .lead { color: rgba(250,246,240,0.8); }
.page-hero--warm .label { color: var(--bark-300); }

.page-hero__pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image:
    radial-gradient(circle at 20% 50%, white 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, white 1px, transparent 1px),
    radial-gradient(circle at 60% 80%, white 0.5px, transparent 0.5px);
  background-size: 60px 60px, 80px 80px, 40px 40px;
}

.page-hero h1 {
  margin-bottom: var(--space-sm);
}

.page-hero .label {
  margin-bottom: var(--space-sm);
  display: block;
}

/* --- Cards Grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-subtle);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-dramatic);
}

.card__img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover .card__img img {
  transform: scale(1.06);
}

.card__img::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(transparent, rgba(0,0,0,0.04));
}

.card__body {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--forest-500);
  margin-bottom: 0.5rem;
}

.card__body h3 {
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.card:hover .card__body h3 { color: var(--forest-700); }

.card__body p {
  font-size: 0.92rem;
  flex: 1;
}

.card__arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--forest-600);
  margin-top: var(--space-sm);
  transition: gap 0.3s;
}

.card:hover .card__arrow { gap: 0.7rem; }

/* --- Content Sections --- */
.content-section {
  padding: var(--space-2xl) 0;
}

.content-section:nth-child(even) {
  background: var(--cream-warm);
}

.content-section__header {
  margin-bottom: var(--space-xl);
}

.content-section__header .label {
  margin-bottom: var(--space-xs);
  display: block;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.content-grid--reverse {
  direction: rtl;
}

.content-grid--reverse > * {
  direction: ltr;
}

.content-text h3 {
  margin-bottom: var(--space-sm);
}

.content-text p {
  margin-bottom: var(--space-sm);
}

.content-text p:last-child {
  margin-bottom: 0;
}

.content-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-medium);
}

.content-image img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* --- Checklist --- */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: var(--space-sm) var(--space-md);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  font-size: 0.95rem;
  line-height: 1.5;
  transition: transform 0.3s, box-shadow 0.3s;
}

.checklist li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-medium);
}

.checklist__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--forest-100);
  color: var(--forest-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin-top: 1px;
}

.checklist--warning .checklist__icon {
  background: #fef3e2;
  color: var(--rust);
}

.checklist--danger .checklist__icon {
  background: #fde8e8;
  color: #c53030;
}

/* --- Info Box --- */
.info-box {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
}

.info-box--tip {
  background: var(--forest-100);
  border-left: 4px solid var(--forest-500);
}

.info-box--warning {
  background: #fef9ee;
  border-left: 4px solid var(--amber);
}

.info-box--danger {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
}

.info-box h4 {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-box p {
  font-size: 0.93rem;
}

/* --- Feature Strip --- */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.feature-item {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-medium);
}

.feature-item__icon {
  font-size: 2.4rem;
  margin-bottom: var(--space-sm);
}

.feature-item h4 {
  margin-bottom: 0.4rem;
}

.feature-item p {
  font-size: 0.88rem;
  margin: 0 auto;
}

/* --- About / CTA Section --- */
.about-section {
  background: var(--forest-900);
  color: var(--cream);
  padding: var(--space-2xl) 0;
  position: relative;
  overflow: hidden;
}

.about-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(77,154,77,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(77,154,77,0.1) 0%, transparent 50%);
}

.about-section h2 { color: var(--cream); }
.about-section p { color: rgba(250,246,240,0.75); }
.about-section .lead { color: rgba(250,246,240,0.85); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  position: relative;
}

/* --- Footer --- */
.footer {
  background: var(--charcoal);
  color: rgba(250,246,240,0.5);
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-xl);
}

.footer__brand {
  max-width: 300px;
}

.footer__brand .nav__logo {
  color: var(--cream);
  margin-bottom: var(--space-sm);
}

.footer__brand p {
  font-size: 0.85rem;
  color: rgba(250,246,240,0.4);
}

.footer__nav h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250,246,240,0.6);
  margin-bottom: var(--space-sm);
}

.footer__nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__nav a {
  font-size: 0.88rem;
  color: rgba(250,246,240,0.45);
  transition: color 0.3s;
}

.footer__nav a:hover {
  color: var(--forest-300);
}

.footer__bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(250,246,240,0.08);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.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; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

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

  .content-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .content-grid--reverse {
    direction: ltr;
  }

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

@media (max-width: 768px) {
  body { font-size: 16px; }

  section { padding: var(--space-xl) 0; }

  .nav__links { display: none; }
  .nav__toggle { display: block; }

  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(250,246,240,0.97);
    backdrop-filter: blur(20px);
    padding: var(--space-md);
    box-shadow: var(--shadow-medium);
    gap: var(--space-sm);
  }

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

  .feature-strip {
    grid-template-columns: 1fr;
  }

  .hero__content {
    padding-top: calc(80px + var(--space-xl));
  }

  .footer__inner {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .footer__bottom {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* --- Utilities --- */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.text-center { text-align: center; }

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #141412;
    --cream-warm: #1a1a17;
    --parchment: #222220;
    --charcoal: #e8e4dc;
    --ink: #dddad2;
    --stone: #9b9b90;
    --moss: #7da668;

    --forest-100: #1a2a1a;
    --forest-700: #6db86d;

    --shadow-subtle: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
    --shadow-dramatic: 0 20px 60px rgba(0,0,0,0.4), 0 8px 20px rgba(0,0,0,0.2);
  }

  body::after {
    opacity: 0.4;
    mix-blend-mode: soft-light;
  }

  /* Nav */
  .nav.scrolled {
    background: rgba(20, 20, 18, 0.85);
  }

  .nav__logo { color: var(--forest-300); }
  .nav__toggle { color: var(--forest-300); }

  .nav__links a:hover { color: var(--forest-300); }
  .nav__links a.active { color: var(--forest-300); }
  .nav__links a::after { background: var(--forest-400); }

  /* Mobile nav */
  .nav__links.open {
    background: rgba(20, 20, 18, 0.97) !important;
  }

  /* Cards */
  .card {
    background: #1e1e1b;
    border: 1px solid rgba(255,255,255,0.06);
  }

  .card:hover .card__body h3 { color: var(--forest-300); }

  .card__img::after {
    background: linear-gradient(transparent, rgba(0,0,0,0.15));
  }

  /* Feature items */
  .feature-item {
    background: #1e1e1b;
    border: 1px solid rgba(255,255,255,0.06);
  }

  /* Checklist */
  .checklist li {
    background: #1e1e1b;
    border: 1px solid rgba(255,255,255,0.06);
  }

  .checklist__icon {
    background: var(--forest-100);
    color: var(--forest-400);
  }

  .checklist--warning .checklist__icon {
    background: #2a2010;
    color: var(--amber-light);
  }

  .checklist--danger .checklist__icon {
    background: #2a1414;
    color: #f87171;
  }

  /* Info boxes */
  .info-box--tip {
    background: #1a2a1a;
    border-left-color: var(--forest-400);
  }

  .info-box--warning {
    background: #2a2010;
    border-left-color: var(--amber);
  }

  .info-box--danger {
    background: #2a1414;
    border-left-color: #ef4444;
  }

  /* Content images */
  .content-image {
    border: 1px solid rgba(255,255,255,0.06);
  }

  /* About section — already dark, just tweak the cards inside */
  .about-section {
    background: #0a150a;
  }

  /* Footer — already dark, slightly adjust */
  .footer {
    background: #0d0d0c;
    border-top: 1px solid rgba(255,255,255,0.05);
  }

  /* Content section alternating bg */
  .content-section:nth-child(even) {
    background: var(--cream-warm);
  }

  /* Borders on section dividers in subpages */
  [style*="border-top: 1px solid var(--parchment)"] {
    border-color: rgba(255,255,255,0.08) !important;
  }
}
