/* Cedar Collective — redesign prototype
   One dark canvas; tree rings drawn in code grow as you scroll (site.js).
   Brand: forest #1F3D2E, terracotta #B85C3A, warm-white #F0EBE3, sage #5E9580.
   Headings: Newsreader. Body: Inter. Annotations: IBM Plex Mono. */

:root {
  --forest: #1F3D2E;
  --forest-deep: #0B1A12;
  --forest-deeper: #07120C;
  --terracotta: #B85C3A;
  --terracotta-soft: #d08a6e;
  --warm-white: #F0EBE3;
  --sage: #5E9580;
  --max: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--forest-deeper);
  color: var(--warm-white);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Newsreader', Georgia, serif; font-weight: 500; line-height: 1.08; margin: 0; }
p { margin: 0 0 1.1em; }
a { color: inherit; }

.container {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding-left: var(--gutter); padding-right: var(--gutter);
}

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
}

/* ---------- Fixed canvas: rings + grain ---------- */
.stage {
  position: fixed; z-index: 0; top: 50%; right: -8vw;
  transform: translateY(-50%);
  width: clamp(480px, 60vw, 940px); aspect-ratio: 1 / 1;
  pointer-events: none;
}
.stage svg { width: 100%; height: 100%; overflow: visible; display: block; }
.ring { fill: none; stroke: var(--warm-white); stroke-linejoin: round;
        transition: stroke 0.8s ease; }
.ring.active { stroke: var(--terracotta-soft); }
.heartwood { fill: var(--terracotta); transform-origin: 300px 300px; }

/* short pages (contact, cookies): the tree is fully grown at once, so keep it quiet */
body.quiet .stage { opacity: 0.35; }

.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ring counter */
.ring-counter {
  position: fixed; bottom: 1.6rem; left: var(--gutter); z-index: 4;
  color: rgba(240,235,227,0.5); display: flex; align-items: center; gap: 0.7rem;
}
.ring-counter .bar { width: 34px; height: 1px; background: rgba(240,235,227,0.25); position: relative; overflow: hidden; }
.ring-counter .bar i { position: absolute; inset: 0; background: var(--terracotta); transform-origin: left; transform: scaleX(0); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}
.site-header.scrolled {
  background: rgba(7, 18, 12, 0.78);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.menu-open .site-header { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 78px;
}
.site-header .logo { display: block; height: 44px; width: auto; }
.nav { display: flex; gap: clamp(1.1rem, 2.4vw, 2.2rem); }
.nav a {
  text-decoration: none; color: rgba(240,235,227,0.82); font-size: 0.9rem;
  letter-spacing: 0.02em; padding-bottom: 3px;
  border-bottom: 1px solid transparent; transition: color 0.2s ease, border-color 0.2s ease;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--warm-white); border-bottom-color: var(--terracotta); }

.menu-btn {
  display: none; background: none; border: none; padding: 0.6rem; margin: -0.6rem;
  cursor: pointer; z-index: 30; position: relative;
}
.menu-btn span {
  display: block; width: 26px; height: 1.5px; background: var(--warm-white);
  margin: 6px 0; transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-open .menu-btn span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.menu-overlay {
  position: fixed; inset: 0; z-index: 25; background: rgba(7,18,12,0.96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--gutter); gap: 0.4rem;
  opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0.35s ease;
}
.menu-open .menu-overlay { opacity: 1; visibility: visible; }
.menu-overlay a {
  font-family: 'Newsreader', Georgia, serif; font-size: clamp(2.2rem, 9vw, 3.2rem);
  color: var(--warm-white); text-decoration: none; padding: 0.35rem 0;
  display: flex; align-items: baseline; gap: 1rem;
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.menu-open .menu-overlay a { opacity: 1; transform: none; }
.menu-open .menu-overlay a:nth-child(1) { transition-delay: 0.06s; }
.menu-open .menu-overlay a:nth-child(2) { transition-delay: 0.12s; }
.menu-open .menu-overlay a:nth-child(3) { transition-delay: 0.18s; }
.menu-open .menu-overlay a:nth-child(4) { transition-delay: 0.24s; }
.menu-overlay a .mono { color: var(--terracotta-soft); font-size: 0.72rem; }

/* ---------- Content sits above the canvas ---------- */
main { position: relative; z-index: 2; }

/* label with dash (shared) */
.label {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--terracotta-soft); margin-bottom: 1.4rem;
}
.label::before { content: ""; width: 22px; height: 1px; background: var(--terracotta); }

/* ---------- Hero (home, full height) ---------- */
.hero {
  min-height: 100svh; min-height: 100dvh;
  display: flex; align-items: center; position: relative;
}
.hero .container { padding-top: clamp(6rem, 12vh, 8rem); padding-bottom: clamp(3rem, 8vh, 5rem); }
.hero-copy { max-width: 38rem; }
.eyebrow {
  color: var(--terracotta-soft); display: inline-flex; align-items: center;
  gap: 0.7rem; margin-bottom: 1.8rem;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--terracotta); }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); letter-spacing: -0.02em; max-width: 19ch; }
.hero h1 em { font-style: italic; color: var(--terracotta-soft); }
.hero .lead {
  font-size: clamp(1.02rem, 1.35vw, 1.2rem); color: rgba(240,235,227,0.8);
  max-width: 52ch; margin-top: 1.8rem; line-height: 1.65;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2.4rem; }

/* ---------- Hero (inner pages, shorter) ---------- */
.page-hero { min-height: 56svh; display: flex; align-items: flex-end; }
.page-hero .container { padding-top: clamp(7rem, 16vh, 10rem); padding-bottom: clamp(2.5rem, 6vh, 4rem); }
.page-hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); letter-spacing: -0.02em; }
.page-hero .lead {
  font-size: clamp(1.02rem, 1.35vw, 1.2rem); color: rgba(240,235,227,0.8);
  max-width: 52ch; margin-top: 1.6rem; line-height: 1.65;
}

.btn {
  display: inline-block; text-decoration: none; padding: 0.85rem 1.7rem;
  border-radius: 2px; font-size: 0.92rem; font-weight: 500; letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  border: none; cursor: pointer; font-family: inherit;
}
.btn--ember { background: var(--terracotta); color: var(--warm-white); border: 1px solid var(--terracotta); }
.btn--ember:hover { transform: translateY(-2px); background: #a64f30; border-color: #a64f30; }
.btn--line { background: transparent; color: var(--warm-white); border: 1px solid rgba(240,235,227,0.35); }
.btn--line:hover { border-color: var(--warm-white); }

.scroll-cue {
  position: absolute; bottom: 1.6rem; right: var(--gutter);
  color: rgba(240,235,227,0.55); display: flex; align-items: center; gap: 0.7rem;
}
.scroll-cue .dot {
  width: 34px; height: 1px;
  background: linear-gradient(90deg, rgba(240,235,227,0.55), rgba(240,235,227,0));
  animation: slide 2.4s ease-in-out infinite;
}
@keyframes slide { 0%,100%{opacity:0.3; transform:translateX(0);} 50%{opacity:0.9; transform:translateX(6px);} }

/* ---------- Editorial band (why evidence, who, about blocks) ---------- */
.band { padding: clamp(4rem, 12vh, 8rem) 0; }
.band .pull {
  font-family: 'Newsreader', Georgia, serif; font-weight: 500;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.2;
  max-width: 24ch; margin-bottom: 1.6rem;
}
.band .pull em { font-style: italic; color: var(--terracotta-soft); }
.band .body { max-width: 54ch; color: rgba(240,235,227,0.78); font-size: clamp(1rem, 1.3vw, 1.15rem); }

/* ---------- Section head ---------- */
.ways-head { padding: clamp(3rem, 8vh, 5rem) 0 clamp(1rem, 3vh, 2rem); }
.ways-head .mono { display: block; color: var(--terracotta-soft); margin-bottom: 0.9rem; }
.ways-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); max-width: 18ch; }

/* ---------- Full-height numbered sections (home) ---------- */
.way { min-height: 82svh; display: flex; align-items: center; position: relative; }
.way .container { position: relative; }
.big-num {
  position: absolute; top: 50%; transform: translateY(-58%);
  left: calc(var(--gutter) * 0.4);
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(9rem, 26vw, 20rem); line-height: 1;
  color: rgba(240,235,227,0.045);
  pointer-events: none; user-select: none;
}
.way-copy { max-width: 36rem; position: relative; padding-left: clamp(0rem, 6vw, 5rem); }
.way-copy .mono { display: flex; align-items: center; gap: 0.7rem; color: var(--terracotta-soft); margin-bottom: 1.1rem; }
.way-copy .mono::before { content: ""; width: 22px; height: 1px; background: var(--terracotta); }
.way-copy h3 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); margin-bottom: 0.9rem; max-width: 16ch; }
.way-copy p { color: rgba(240,235,227,0.78); max-width: 48ch; font-size: clamp(1rem, 1.3vw, 1.15rem); margin: 0; }

/* ---------- Services (what we do page) ---------- */
.service { padding: clamp(3.5rem, 10vh, 7rem) 0; position: relative; }
.service .container { position: relative; }
.service + .service { border-top: 1px solid rgba(240,235,227,0.1); }
.service h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); margin-bottom: 1.2rem; max-width: 20ch; }
.service .body { max-width: 54ch; color: rgba(240,235,227,0.78); font-size: clamp(1rem, 1.3vw, 1.15rem); }
.service .body p { margin: 0 0 1.1em; }
.service .body p:last-child { margin-bottom: 0; }
.get { margin-top: 2rem; max-width: 44rem; }
.get .mono { display: block; color: var(--terracotta-soft); margin-bottom: 0.6rem; }
.get ul { list-style: none; margin: 0; padding: 0; }
.get li {
  display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.8rem; align-items: baseline;
  padding: 0.85rem 0; border-bottom: 1px solid rgba(240,235,227,0.12);
  color: rgba(240,235,227,0.85);
}
.get li:first-child { border-top: 1px solid rgba(240,235,227,0.12); }
.get li::before { content: "—"; color: var(--terracotta); }

/* ---------- Numbered rule list (how we work) ---------- */
.rule-list { list-style: none; margin: 0; padding: 0; max-width: 44rem; }
.rule-list li {
  display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem; align-items: baseline;
  padding: 1.4rem 0; border-bottom: 1px solid rgba(240,235,227,0.12);
  font-size: clamp(1.02rem, 1.35vw, 1.2rem); color: rgba(240,235,227,0.85);
}
.rule-list li:first-child { border-top: 1px solid rgba(240,235,227,0.12); }
.rule-list li .mono { color: var(--terracotta-soft); }
.rule-list li strong { color: var(--warm-white); font-weight: 500; }

/* ---------- People (about page) ---------- */
.people { display: grid; gap: clamp(2.5rem, 6vw, 5rem); grid-template-columns: 1fr; margin-top: 2.5rem; max-width: 60rem; }
@media (min-width: 760px) { .people { grid-template-columns: 1fr 1fr; } }
.person .portrait {
  display: block; width: min(100%, 240px); height: auto; aspect-ratio: 1 / 1;
  object-fit: cover; border-radius: 3px; margin-bottom: 1.3rem;
  border: 1px solid rgba(240,235,227,0.14);
}
.person h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 0.3rem; }
.person .mono { display: block; color: var(--terracotta-soft); margin-bottom: 1rem; }
.person p { color: rgba(240,235,227,0.78); margin: 0; }

/* ---------- Work examples (about page) ---------- */
.example {
  display: grid; grid-template-columns: 4rem 1fr; gap: clamp(1rem, 3vw, 3rem);
  padding: 2rem 0; border-bottom: 1px solid rgba(240,235,227,0.12); align-items: start;
  max-width: 60rem;
}
.example:first-of-type { border-top: 1px solid rgba(240,235,227,0.12); }
.example .num { font-family: 'Newsreader', Georgia, serif; font-size: 1.5rem; color: var(--terracotta-soft); }
.example h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 0.5rem; }
.example p { max-width: 56ch; margin: 0; color: rgba(240,235,227,0.78); }
@media (max-width: 620px) { .example { grid-template-columns: 1fr; gap: 0.4rem; } }

/* ---------- Contact form ---------- */
.contact-grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); grid-template-columns: 1fr; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); } }
.form { display: grid; gap: 1.25rem; }
.form label {
  display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 0.45rem;
  color: var(--terracotta-soft); font-family: 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.form input, .form textarea {
  width: 100%; padding: 0.8rem 0.95rem;
  border: 1px solid rgba(240,235,227,0.25); border-radius: 2px;
  background: rgba(240,235,227,0.05); font-family: inherit; font-size: 1rem;
  color: var(--warm-white);
}
.form input::placeholder, .form textarea::placeholder { color: rgba(240,235,227,0.4); }
.form input:focus, .form textarea:focus {
  outline: 2px solid var(--terracotta); outline-offset: 1px;
  border-color: transparent;
}
.form .note { color: rgba(240,235,227,0.55); font-size: 0.85rem; margin: 0; }
.contact-aside .body { color: rgba(240,235,227,0.78); max-width: 40ch; }
.contact-aside a { color: var(--terracotta-soft); text-decoration: none; border-bottom: 1px solid rgba(208,138,110,0.4); }
.contact-aside a:hover { border-bottom-color: var(--terracotta-soft); }

/* ---------- Prose (cookies) ---------- */
.prose { max-width: 44rem; padding-bottom: clamp(4rem, 10vh, 7rem); }
.prose h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); margin: 2.4rem 0 0.8rem; }
.prose p { color: rgba(240,235,227,0.8); }
.prose a { color: var(--terracotta-soft); }

/* ---------- CTA ---------- */
.cta { min-height: 88svh; display: flex; align-items: center; text-align: center; }
.cta .container { display: flex; flex-direction: column; align-items: center; }
.cta h2 { font-size: clamp(1.9rem, 4.6vw, 3.4rem); max-width: 22ch; margin-bottom: 2.2rem; line-height: 1.18; }
.cta--short { min-height: 50svh; }
.cta p.lead-in { color: rgba(240,235,227,0.78); max-width: 44ch; margin-bottom: 2rem; font-size: clamp(1.02rem, 1.35vw, 1.2rem); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; z-index: 2;
  background: var(--forest-deep); border-top: 1px solid rgba(240,235,227,0.1);
  padding: 3rem 0;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.site-footer .logo { height: 46px; width: auto; display: block; }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.92rem; align-items: center; }
.footer-nav a { text-decoration: none; color: rgba(240,235,227,0.8); }
.footer-nav a:hover { color: var(--terracotta-soft); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.9s cubic-bezier(0.2,0.7,0.2,1), transform 0.9s cubic-bezier(0.2,0.7,0.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Portrait / narrow ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .menu-btn { display: block; }
  .stage {
    top: 50%; left: 50%; right: auto;
    transform: translate(-50%, -50%);
    width: 130vmin; opacity: 0.3;
  }
  .way { min-height: 72svh; }
  .big-num { left: auto; right: 0; transform: translateY(-58%); font-size: clamp(8rem, 38vw, 13rem); }
  .way-copy { padding-left: 0; }
  .rule-list li { grid-template-columns: 2.6rem 1fr; }
  .scroll-cue { right: auto; left: var(--gutter); }
  .ring-counter { display: none; }
  .page-hero { min-height: 44svh; }
}

/* ---------- Landscape phones ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero .container { padding-top: 5rem; }
  .hero h1 { font-size: clamp(1.8rem, 5vh, 2.4rem); }
  .stage { width: 130vh; opacity: 0.5; }
  .way, .cta { min-height: auto; padding: 4rem 0; }
  .page-hero { min-height: auto; }
  .scroll-cue, .ring-counter { display: none; }
}

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