/* Wood Advisor — Design System
   Palette, type, and components per research/03-build-brief.md */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --green: #1F3D2B;
  --green-dark: #16301F;
  --green-light: #2E5940;
  --paper: #F7F5F0;
  --paper-dim: #EFEBE3;
  --ink: #1A1A18;
  --ink-soft: #4A4944;
  --amber: #A6743E;
  --amber-light: #C79A5D;
  --border: #E1DCD1;
  --white: #FFFFFF;

  --font-head: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 1180px;
  --radius: 10px;
  --radius-sm: 6px;

  --shadow-sm: 0 1px 3px rgba(26, 26, 24, 0.08);
  --shadow-md: 0 8px 24px rgba(26, 26, 24, 0.10);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

ul { list-style: none; }

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  color: var(--green-dark);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.3rem; }

p { color: var(--ink-soft); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }

@media (max-width: 640px) {
  section { padding: 64px 0; }
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--green);
  background-image: url('../assets/images/forest-canopy-texture.jpg');
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply;
  color: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--green-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--green-dark);
  border: 1.5px solid var(--green-dark);
}

.btn-outline:hover {
  background: var(--green-dark);
  color: var(--white);
}

.btn-light {
  background: var(--paper);
  color: var(--green-dark);
}

.btn-light:hover { background: var(--white); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .mark-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-cta { display: flex; align-items: center; gap: 20px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--green-dark);
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: 66px; left: 0; right: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 24px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.25s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--border); }
  .nav-cta .btn-primary { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 100px 0 90px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%; right: -10%;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(31,61,43,0.10) 0%, transparent 70%);
  z-index: 0;
}

/* Faded full-bleed texture behind the hero copy — low opacity so it reads as
   atmosphere, not a photo, and the paper background underneath keeps the
   dark-green heading/body text at essentially unchanged contrast. */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/forest-canopy-texture.jpg');
  background-size: cover;
  background-position: center 35%;
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 { margin-bottom: 20px; }

.hero .lede {
  font-size: 1.15rem;
  max-width: 46ch;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--green-dark); /* shows briefly while the photo loads */
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22,48,31,0.78) 0%, rgba(22,48,31,0.05) 45%, transparent 68%);
  pointer-events: none;
}

.hero-visual .grain-label {
  position: absolute;
  bottom: 24px; left: 24px;
  z-index: 1;
  color: var(--paper);
  font-family: var(--font-head);
  font-size: 0.85rem;
  opacity: 0.9;
  letter-spacing: 0.04em;
}

/* ---------- Trust bar ---------- */
.trust-bar {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

@media (max-width: 760px) {
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
}

.trust-item .stat {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--green);
}

.trust-item .label {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Supplier logo ticker (About page) ---------- */
.logo-ticker {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.logo-ticker-track {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 56px;
  padding-right: 56px;
  animation: ticker-scroll 34s linear infinite;
}

.logo-ticker:hover .logo-ticker-track { animation-play-state: paused; }

.logo-ticker-track img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  filter: grayscale(1) opacity(0.75);
  transition: filter 0.2s ease;
}

.logo-ticker-track img:hover { filter: none; }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .logo-ticker-track { animation: none; }
}

/* ---------- Poster carousel (Products page Learning Center) ---------- */
.poster-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.poster-track {
  display: flex;
  align-items: center;
  gap: 28px;
  overflow-x: auto;
  overflow-y: hidden; /* setting overflow-x alone implicitly makes overflow-y
    scrollable too (CSS spec upgrades a default 'visible' to 'auto') — without
    this, the focused card's scale-up visually exceeds the track's height and
    the track itself becomes vertically scrollable, trapping page scroll */
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 76px calc(50% - 110px);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.poster-track::-webkit-scrollbar { display: none; }

.poster-card {
  flex-shrink: 0;
  width: 220px;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transform: scale(0.82);
  opacity: 0.55;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.poster-card img {
  width: 100%;
  display: block;
  aspect-ratio: 1545 / 2000;
  object-fit: cover;
  pointer-events: none;
}

.poster-nav {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--green-dark);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.poster-nav:hover { border-color: var(--green-light); color: var(--green); }

@media (max-width: 640px) {
  .poster-nav { display: none; }
  .poster-track { padding: 58px calc(50% - 90px); }
  .poster-card { width: 180px; }
}

/* ---------- Poster lightbox ---------- */
.poster-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 20, 18, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.poster-lightbox[hidden] { display: none; }

.poster-lightbox.is-visible { opacity: 1; }

.poster-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.poster-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.poster-lightbox-close:hover { background: rgba(255, 255, 255, 0.24); }

@media (prefers-reduced-motion: reduce) {
  .poster-card { transition: none; }
  .poster-track { scroll-behavior: auto; }
  .poster-lightbox { transition: none; }
}

/* ---------- Section headers ---------- */
.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Category / feature cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  overflow: hidden; /* clips .card-media's bleed to the card's own rounded corners */
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-light);
}

.card .icon {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--paper-dim);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 1.3rem;
}

/* Photo-bearing cards: image bleeds to the card's edges, icon becomes a badge
   overlaid on the photo instead of a standalone block above the heading. */
.card-media {
  position: relative;
  margin: -32px -28px 20px;
  height: 170px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-media .icon {
  position: absolute;
  top: 12px;
  left: 12px;
  margin-bottom: 0;
  background: rgba(247, 245, 240, 0.92);
  box-shadow: var(--shadow-sm);
}

.card h3 { margin-bottom: 10px; }

.card p { font-size: 0.95rem; margin-bottom: 16px; }

.card .card-link {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card .card-link .arrow { transition: transform 0.15s ease; }
.card:hover .card-link .arrow { transform: translateX(3px); }

/* ---------- Dark band (rhythm section) ---------- */
.band-dark {
  background: var(--green-dark);
  color: var(--paper);
}

.band-dark h2, .band-dark h3 { color: var(--paper); }
.band-dark p { color: rgba(247, 245, 240, 0.78); }

.band-dark .eyebrow { color: var(--amber-light); }

/* Optional photo variant: background-image set inline per-section, darkened
   with the same green so text stays legible without a separate overlay element. */
.band-dark.has-bg {
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply;
}

/* ---------- About page: consultation image beside the direct-contact card ---------- */
.consult-image {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  padding: 56px;
  text-align: center;
  margin: 0 24px;
}

.cta-band h2 { color: var(--white); margin-bottom: 12px; }
.cta-band p { color: rgba(255,255,255,0.85); margin-bottom: 28px; }

/* Optional photo variant, same darkening technique as .band-dark.has-bg —
   background-image set inline per-section, blended with the existing green
   so the brand color still reads through and text stays legible. */
.cta-band.has-bg {
  background-size: cover;
  background-position: center 30%;
  background-blend-mode: multiply;
}

@media (max-width: 640px) {
  .cta-band { padding: 40px 24px; }
}

/* ---------- Footer ---------- */
.site-footer {
  background-color: var(--green-dark);
  background-image: url('../assets/images/forest-canopy-texture.jpg');
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply;
  color: rgba(247, 245, 240, 0.85);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

.footer-grid h4 {
  color: var(--paper);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-grid a, .footer-grid p {
  color: rgba(247, 245, 240, 0.72);
  font-size: 0.92rem;
  display: block;
  margin-bottom: 10px;
}

.footer-grid a:hover { color: var(--amber-light); }

.footer-bottom {
  border-top: 1px solid rgba(247, 245, 240, 0.15);
  padding-top: 24px;
  font-size: 0.82rem;
  color: rgba(247, 245, 240, 0.55);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .form-card { padding: 28px 22px; }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Spam-bot honeypot: off-screen (not display:none/visibility:hidden, which some
   bots detect and skip), aria-hidden so screen reader users never encounter it. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
}

.field textarea { resize: vertical; min-height: 100px; }

.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-option:has(input:checked) {
  border-color: var(--green);
  background: var(--paper-dim);
}

.radio-option input { width: auto; }

.form-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 8px;
}

.form-status {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  display: none;
}

.form-status.visible { display: block; }
.form-status.success { background: #E7F0EA; color: var(--green-dark); border: 1px solid var(--green-light); }
.form-status.error { background: #FBEAE5; color: #8A3324; border: 1px solid #E0A793; }

/* ---------- Utility / animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-dim);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--green-dark);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
}

.list-check li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--ink);
}

.list-check li .check {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.band-dark .list-check li { color: var(--paper); }
.band-dark .list-check li .check { background: var(--amber); color: var(--green-dark); }

.breadcrumb-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Same faded-texture treatment as .hero — see its ::after for the reasoning. */
.breadcrumb-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/forest-canopy-texture.jpg');
  background-size: cover;
  background-position: center 35%;
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
}

.breadcrumb-hero .container { position: relative; z-index: 1; }

.breadcrumb-hero .eyebrow { margin-bottom: 10px; }
.breadcrumb-hero p { max-width: 60ch; }

/* ---------- Multi-step form ---------- */
.step-progress { margin-bottom: 28px; }

.step-progress-track {
  height: 4px;
  background: var(--paper-dim);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.step-progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s ease;
}

.step-progress-label {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.step-heading { margin-bottom: 6px; }
.step-heading:focus { outline: none; }

.step-sub {
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: #E0A793;
  background: #FBEAE5;
}

.field-error {
  font-size: 0.8rem;
  color: #8A3324;
  margin-top: 6px;
}

.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

/* .btn's `display: inline-flex` and .step-nav's `display: flex` are author-origin
   rules, which beat the browser default `[hidden] { display: none }` (a user-agent
   rule) at equal specificity regardless of source order — so buttons toggled via
   the `hidden` attribute would otherwise stay visible. Explicit override needed. */
.btn[hidden],
.step-nav[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .step-progress-fill { transition: none; }
}
