/* ===================================================================
   KAIRDU SYSTEMS — Website v3
   Built from brand, not a template.
   =================================================================== */

/* --- CSS Custom Properties --- */
:root {
  /* Brand Colors */
  --deep-forest: #151F20;
  --deep-petrol: #2C5C70;
  --forest-green: #47766F;
  --amber: #E1A031;
  --burnt-orange: #CA6F1D;
  --terracotta: #9D4627;
  --warm-parchment: #F2F0EA;
  --aged-paper: #E8E4D9;

  /* Extended */
  --panel: #1a2e30;
  --text-secondary: #B8B5AD;
  --text-muted: #7a7a72;
  --divider: rgba(255,255,255,0.08);
  --light-petrol: #5a9ab0;

  /* Light mode — warm parchment base */
  --light-bg: #F2F0EA;
  --light-section: #E8E4D9;
  --light-body: #2a2a28;
  --light-muted: #6e6e64;

  /* Typography */
  --font-headline: 'Space Grotesk', sans-serif;
  --font-body: 'Satoshi', sans-serif;

  /* Spacing */
  --section-pad: clamp(80px, 10vw, 140px);
  --content-max: 1200px;
  --content-narrow: 800px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--warm-parchment);
  background: var(--deep-forest);
  overflow-x: hidden;
}

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

a {
  color: var(--burnt-orange);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--amber);
}

/* --- Textures --- */

/* Dark sections: film grain noise */
.section-dark::before,
.hero::before,
.photo-section::before,
.footer::before,
.blog-header::before,
.post-page::before,
.blog-footer::before,
.contact-header::before,
.contact-footer::before,
.svc-footer::before,
.about-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
}

/* Light sections: subtle paper fiber texture */
.section-light::before,
.section-aged::before,
.svc-header::before,
.about-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 400px 400px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }

.kicker {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--burnt-orange);
  margin-bottom: 12px;
}

/* --- Layout --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 60px);
  position: relative;
  z-index: 1;
}

.container--narrow {
  max-width: var(--content-narrow);
}

/* --- Sections --- */
section {
  position: relative;
  z-index: 1;
}

.section-dark {
  background: var(--deep-forest);
  color: var(--warm-parchment);
  padding: var(--section-pad) 0;
}

.section-light {
  background: var(--light-bg);
  color: var(--light-body);
  padding: var(--section-pad) 0;
}

.section-aged {
  background: var(--aged-paper);
  color: var(--light-body);
  padding: var(--section-pad) 0;
}

.section-light .kicker,
.section-aged .kicker {
  color: var(--burnt-orange);
}

.section-light h2,
.section-aged h2 {
  color: var(--deep-petrol);
}

.section-light .text-muted,
.section-aged .text-muted {
  color: var(--light-muted);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(21, 31, 32, 0.95);
  backdrop-filter: blur(12px);
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-brand img {
  height: 32px;
  width: auto;
}

.navbar-brand span {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--burnt-orange);
}

.navbar-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.navbar-links a {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

.navbar-links a:hover {
  color: var(--warm-parchment);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--warm-parchment);
  margin: 6px 0;
  transition: 0.3s;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--deep-forest);
}

/* Match the noise grain used by .section-dark so there's no visible seam. */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
}

/* Image fills full width; top cropped as needed to fit the viewport.
   Scale from bottom crops more off the top — image is higher-res than viewport
   so scaling up still stays below 1:1 native, no upscaling artifacts. */
.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: translateY(-25%) scale(1.25);
  transform-origin: center top;
  display: block;
  opacity: 1;
}

.hero-bg::after { display: none; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: 0 20px;
}

.hero-wordmark {
  height: 200px;
  width: auto;
  margin: 0 auto 40px;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

.hero h1 {
  margin-bottom: 8px;
  color: var(--warm-parchment);
}

.hero h1 + h1 {
  margin-bottom: 28px;
}

.hero h1 em {
  font-style: normal;
  color: var(--amber);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  margin: 0 auto;
}

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  animation: pulse 2s ease-in-out infinite;
}

.scroll-hint span {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--text-muted), transparent);
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* --- Photo Section (full bleed image with overlay text) --- */
.photo-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.photo-section-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.photo-section-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-section-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(21, 31, 32, 0.82);
}

.photo-section .container {
  position: relative;
  z-index: 2;
}

/* --- Cards --- */
.card-grid {
  display: grid;
  gap: 24px;
}

.card-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

/* Dark card */
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 32px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  color: var(--forest-green);
}

.card h3 {
  margin-bottom: 12px;
  color: var(--warm-parchment);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Light card */
.section-light .card,
.section-aged .card {
  background: var(--warm-parchment);
  border: 1px solid #dddad2;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.section-light .card:hover,
.section-aged .card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.section-light .card h3,
.section-aged .card h3 {
  color: var(--deep-petrol);
}

.section-light .card p,
.section-aged .card p {
  color: var(--light-body);
}

/* Color accents for cards */
.card--green .card-icon { color: var(--forest-green); }
.card--petrol .card-icon { color: var(--deep-petrol); }
.card--amber .card-icon { color: var(--amber); }
.card--terracotta .card-icon { color: var(--terracotta); }

.card--green { border-top: 3px solid var(--forest-green); }
.card--petrol { border-top: 3px solid var(--deep-petrol); }
.card--amber { border-top: 3px solid var(--amber); }
.card--terracotta { border-top: 3px solid var(--terracotta); }

/* --- Product cards (Our Tools) --- */
.product-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
}

.product-card img {
  height: 160px;
  width: auto;
  margin: 0 auto 32px;
  object-fit: contain;
}

.product-card h3 {
  margin-bottom: 8px;
}

.product-card .tm {
  font-size: 0.6em;
  vertical-align: super;
}

.product-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Pillars (Organize/Refine/Evolve) --- */
.pillar {
  text-align: center;
  padding: 40px 24px;
}

.pillar-number {
  font-family: var(--font-headline);
  font-size: 3rem;
  font-weight: 700;
  color: var(--burnt-orange);
  opacity: 0.3;
  margin-bottom: 8px;
}

.pillar h3 {
  margin-bottom: 12px;
}

/* --- Getting Started chain --- */
.chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 48px 0;
}

.chain-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
}

.chain-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 36px;
  background: rgba(21, 31, 32, 0.85);
  border: 1px solid var(--divider);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chain-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.chain-card.card--green { border-top: 3px solid var(--forest-green); }
.chain-card.card--petrol { border-top: 3px solid var(--deep-petrol); }
.chain-card.card--amber { border-top: 3px solid var(--amber); }

.chain-card span {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1rem;
  color: var(--warm-parchment);
}

.compact-card {
  background: rgba(21, 31, 32, 0.85);
  backdrop-filter: blur(8px);
  padding: 20px 24px;
  text-align: center;
}

.compact-icon {
  display: block;
  margin: 0 auto 12px;
}

.chain-step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chain-step-icon.green { background: rgba(71, 118, 111, 0.2); color: var(--forest-green); }
.chain-step-icon.petrol { background: rgba(44, 92, 112, 0.2); color: var(--deep-petrol); }
.chain-step-icon.amber { background: rgba(225, 160, 49, 0.2); color: var(--amber); }

.chain-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
}

/* --- CTA --- */
.cta-btn {
  display: inline-block;
  padding: 16px 40px;
  background: var(--burnt-orange);
  color: var(--warm-parchment);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.cta-btn:hover {
  background: var(--amber);
  color: var(--deep-forest);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(202, 111, 29, 0.3);
}

/* --- Section header --- */
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}

.section-header p {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.section-light .section-header p,
.section-aged .section-header p {
  color: var(--light-muted);
}

/* --- Jordan Pond closing section --- */
.jordan-pond-section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.jordan-pond-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.jordan-pond-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

/* Parchment fade at top — clouds blend into previous section */
.jordan-pond-fade-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  z-index: 1;
  background: linear-gradient(
    180deg,
    #F2F0EA 0%,
    rgba(242, 240, 234, 0.85) 30%,
    rgba(242, 240, 234, 0.4) 60%,
    transparent 100%
  );
}

/* Content layered across the full image */
.jordan-pond-content {
  position: relative;
  z-index: 2;
  padding: 8vh 0 40px;
}

/* Logo — big, in the clouds */
.jordan-logo {
  height: 140px;
  width: auto;
  margin: 0 auto 20px;
  opacity: 0.9;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.3));
}

/* Kicker — just below logo, still in cloud */
.jordan-kicker {
  margin-bottom: 6vh;
}

/* Headline — at the mountain/tree line */
.jordan-headline {
  color: var(--warm-parchment);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 6vh;
}

/* Cards — in the water */
.jordan-cards {
  margin-bottom: 4vh;
}

/* Button — over the rocks */
.jordan-cta {
  margin-bottom: 6vh;
}

/* Legal — anchored to very bottom of pond section */
.jordan-legal {
  margin-top: 12vh;
  padding: 16px 0;
}

.jordan-legal .footer-legal {
  color: var(--warm-parchment);
  font-size: 0.8rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* --- Footer elements (shared) --- */
.footer {
  background: var(--deep-forest);
  border-top: 1px solid var(--divider);
  padding: 60px 0 40px;
  text-align: center;
}

.footer-wordmark {
  height: 24px;
  width: auto;
  margin: 0 auto 20px;
  opacity: 0.7;
}

.footer-email {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.footer-legal {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Bookend quote --- */
.bookend {
  font-family: var(--font-headline);
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
  font-weight: 500;
}

/* --- Four Pillars compact --- */
.pillars-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.pillar-compact {
  text-align: center;
  padding: 24px 16px;
  border: 1px solid #dddad2;
  border-radius: 8px;
  background: var(--warm-parchment);
}

.section-dark .pillar-compact {
  border-color: var(--divider);
  background: rgba(255,255,255,0.02);
}

.pillar-compact h4 {
  font-family: var(--font-headline);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 8px;
}

.pillar-compact .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 auto 8px;
}

.dot--green { background: var(--forest-green); }
.dot--petrol { background: var(--deep-petrol); }
.dot--amber { background: var(--amber); }
.dot--terracotta { background: var(--terracotta); }

.pillar-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
}

.pillar-icon svg {
  width: 100%;
  height: 100%;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .navbar-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .navbar-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(21, 31, 32, 0.98);
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--divider);
  }

  .card-grid--3 {
    grid-template-columns: 1fr;
  }

  .card-grid--2 {
    grid-template-columns: 1fr;
  }

  .chain {
    flex-direction: column;
  }

  .chain-arrow {
    transform: rotate(90deg);
  }

  .hero-wordmark {
    height: 120px;
  }
}
