/* Ivylane visual system
   ---------------------------------------------------------------
   One stylesheet for every page. Editorial serif display, system
   sans UI, restrained ivy/gold palette, generous whitespace.
   No webfonts, no frameworks — the <1s load time is part of the brand. */

:root {
  --ink: #161d18;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --ivy: #2f6b4f;
  --ivy-dark: #23503b;
  --ivy-deep: #182e23;
  --gold: #c8a24a;
  --gold-deep: #8a6d2f; /* gold dark enough for small text on white (WCAG AA) */
  --muted: #5d655e;
  --faint: #8a9089;
  --line: #e5e2d7;
  --line-strong: #d5d1c3;

  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --w-wide: 1120px;
  --w-text: 720px;

  --space-section: clamp(72px, 10vw, 128px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.wrap { max-width: var(--w-wide); margin: 0 auto; padding: 0 clamp(20px, 4vw, 32px); }
.wrap.narrow { max-width: var(--w-text); }

::selection { background: rgba(200, 162, 74, 0.35); }

a { color: var(--ivy-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ivy); }

/* ---------------------------------------------------------------
   Type
   --------------------------------------------------------------- */

h1, h2, h3 { font-weight: normal; }

h1 {
  font-size: clamp(2.2rem, 5.6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 26px;
  text-wrap: balance;
}
h1 em { font-style: italic; color: var(--ivy-dark); }

h2 {
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  text-wrap: balance;
}

h3 { font-size: 1.12rem; line-height: 1.35; }

.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ivy);
  margin-bottom: 20px;
}

.lede {
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  color: var(--muted);
  max-width: 640px;
  text-wrap: pretty;
}

.sub {
  color: var(--muted);
  margin-bottom: 44px;
  max-width: 640px;
  text-wrap: pretty;
}

.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head .sub { margin-bottom: 0; }

.meta-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-deep);
}

/* ---------------------------------------------------------------
   Header / navigation
   --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
}
.logo {
  font-family: var(--serif);
  font-size: 1.28rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivy-dark);
  font-weight: bold;
  text-decoration: none;
  flex-shrink: 0;
}
.logo span { color: var(--gold); }
.logo:hover { color: var(--ivy-dark); }

.site-nav { display: flex; gap: 4px; margin-left: 8px; }
.site-nav a {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 3px;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: rgba(47, 107, 79, 0.07); }
.site-nav a[aria-current="page"] { color: var(--ivy-dark); font-weight: 600; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.search-btn {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 7px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.search-btn:hover { border-color: var(--ivy); color: var(--ink); }
.search-btn kbd {
  font-family: var(--sans);
  font-size: 0.66rem;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  background: var(--paper);
}

.menu-btn {
  display: none;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ivy-dark);
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 10px clamp(20px, 4vw, 32px) 18px;
    gap: 2px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 10px; font-size: 0.95rem; }
  .menu-btn { display: inline-block; }
  .search-btn kbd { display: none; }
  .nav-actions .btn { display: none; }
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--ivy);
  color: #fff;
  padding: 14px 28px;
  text-decoration: none;
  border: 1px solid var(--ivy-dark);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--ivy-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--ivy-dark); }
.btn.ghost:hover { background: rgba(47, 107, 79, 0.08); }
.btn.small { padding: 9px 18px; font-size: 0.78rem; }
.btn.gold { background: var(--gold); color: var(--ink); border-color: #b08d3c; }
.btn.gold:hover { background: #d9b45e; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.text-link {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ivy-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}
.text-link:hover { border-bottom-color: var(--ivy); }
.text-link::after { content: " →"; }

/* ---------------------------------------------------------------
   Sections
   --------------------------------------------------------------- */

section { padding: var(--space-section) 0; border-top: 1px solid var(--line); }
section.flush { border-top: none; }
section.alt { background: var(--surface); }

.band {
  background: var(--ivy-deep);
  color: #e6ede6;
  border-top: none;
}
.band h2, .band h3 { color: #fff; }
.band p { color: #c3d1c3; }
.band strong { color: var(--gold); }
.band a { color: var(--gold); }
.band .kicker { color: var(--gold); }

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */

.hero { padding: clamp(72px, 11vw, 150px) 0 clamp(56px, 8vw, 110px); }
.hero .lede { margin: 0 0 38px; }
.hero-proof {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--faint);
  margin-top: 46px;
}
.hero-proof a { color: var(--muted); }

/* ---------------------------------------------------------------
   Stats
   --------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  margin-top: 40px;
}
.stat .n { font-size: 2.4rem; line-height: 1.15; color: var(--gold); }
.stat .l {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 4px;
}
.band .stat .l { color: #9fb3a0; }
.stat .d { font-size: 0.88rem; color: var(--muted); margin-top: 6px; }
.band .stat .d { color: #9fb3a0; }

/* ---------------------------------------------------------------
   Cards & grids
   --------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.grid.g2 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 30px 28px;
  border-radius: 4px;
}
section.alt .card { background: var(--paper); }
.card h3 { color: var(--ivy-dark); margin-bottom: 10px; }
.card p { font-size: 0.95rem; color: var(--muted); }
.card .meta-label { display: block; margin-bottom: 10px; }
.card ul { list-style: none; margin-top: 12px; }
.card li {
  font-size: 0.92rem;
  color: var(--muted);
  padding: 4px 0 4px 22px;
  position: relative;
}
.card li::before { content: "—"; position: absolute; left: 0; color: var(--gold); }

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
a.card:hover {
  border-color: var(--ivy);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -18px rgba(22, 46, 35, 0.35);
}
a.card .text-link { margin-top: 14px; display: inline-block; }

/* Case-study cards (image on top) */
.case-card { padding: 0; overflow: hidden; }
.case-card .shot {
  width: 100%;
  border-bottom: 1px solid var(--line);
  aspect-ratio: 8 / 5;
  object-fit: cover;
  object-position: top;
}
.case-card .case-body { padding: 26px 28px 30px; }

/* ---------------------------------------------------------------
   Quote wall
   --------------------------------------------------------------- */

.situations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.situations blockquote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  padding: 18px 22px;
  font-style: italic;
  font-size: 1.02rem;
}
section.alt .situations blockquote { background: var(--paper); }

/* ---------------------------------------------------------------
   Steps
   --------------------------------------------------------------- */

.steps { max-width: 720px; }
.step { display: flex; gap: 22px; margin-bottom: 30px; }
.step:last-child { margin-bottom: 0; }
.step .num {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--gold-deep);
  border: 1px solid var(--gold);
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.step h3 { color: var(--ivy-dark); margin-bottom: 4px; font-size: 1.05rem; }
.step p { font-size: 0.96rem; color: var(--muted); }

/* ---------------------------------------------------------------
   Era timeline (About + homepage band)
   --------------------------------------------------------------- */

.eras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px 0;
  margin-top: 44px;
}
.era {
  border-left: 1px solid rgba(200, 162, 74, 0.4);
  padding: 4px 20px 4px 18px;
}
.era .y {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.era h3 { font-size: 0.98rem; color: #fff; margin: 6px 0 6px; }
.era p { font-size: 0.85rem; color: #9fb3a0; line-height: 1.55; }

.eras.on-light .era { border-left-color: var(--gold); }
.eras.on-light .era .y { color: var(--gold-deep); }
.eras.on-light .era h3 { color: var(--ivy-dark); }
.eras.on-light .era p { color: var(--muted); }

/* ---------------------------------------------------------------
   Article / prose
   --------------------------------------------------------------- */

.prose { max-width: var(--w-text); }
.prose p { margin-bottom: 20px; color: #333b34; font-size: 1.06rem; line-height: 1.78; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); }
.prose h2 { margin-top: 52px; margin-bottom: 16px; font-size: 1.5rem; }
.prose h3 { margin-top: 36px; margin-bottom: 12px; color: var(--ivy-dark); }
.prose ul, .prose ol { margin: 0 0 20px 22px; color: #333b34; font-size: 1.02rem; }
.prose li { margin-bottom: 10px; }
.prose blockquote {
  border-left: 3px solid var(--gold);
  padding: 6px 0 6px 22px;
  margin: 28px 0;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ivy-dark);
}
.prose hr { border: none; border-top: 1px solid var(--line); margin: 44px 0; }

.article-header { padding: clamp(60px, 8vw, 100px) 0 clamp(28px, 4vw, 44px); }
.article-header .lede { margin-top: 4px; }
.byline {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: 22px;
}
.article-body { padding: clamp(28px, 4vw, 44px) 0 var(--space-section); border-top: none; }

/* Case-study meta table */
.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 22px 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
  margin: 40px 0;
}
.case-meta .meta-label { display: block; margin-bottom: 4px; }
.case-meta div { font-size: 0.95rem; }
.case-meta a { color: var(--ivy-dark); }

.case-hero-shot {
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 8px 0 12px;
}

/* Related-content rail */
.related { border-top: 1px solid var(--line); padding-top: 44px; margin-top: 60px; }
.related .grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Breadcrumb */
.crumb {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--faint);
  margin-bottom: 26px;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ivy-dark); }

/* ---------------------------------------------------------------
   Capability blocks
   --------------------------------------------------------------- */

.cap {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 32px 56px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.cap:first-of-type { border-top: none; padding-top: 0; }
.cap aside .meta-label { display: block; margin-bottom: 8px; }
.cap aside h2 { font-size: 1.4rem; }
.cap .body p { color: var(--muted); margin-bottom: 16px; max-width: 640px; }
.cap .body p strong { color: var(--ink); }
.cap ul { list-style: none; margin: 4px 0 18px; max-width: 640px; }
.cap li { padding: 5px 0 5px 24px; position: relative; color: var(--muted); font-size: 0.97rem; }
.cap li::before { content: "—"; position: absolute; left: 0; color: var(--gold); }
.cap .links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 760px) {
  .cap { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 12px 14px;
}
.field select { appearance: auto; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ivy);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}
.field textarea { min-height: 140px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row2 .field { min-width: 0; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; gap: 0; } }

.form-note { font-family: var(--sans); font-size: 0.85rem; margin-top: 14px; display: none; }
.form-note.ok { display: block; color: var(--ivy-dark); }
.form-note.err { display: block; color: #a03d2e; }
.hp { position: absolute; left: -9999px; }

.form-panel {
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 34px 32px;
}
.form-panel .promise { color: var(--muted); font-size: 0.94rem; margin: 4px 0 22px; }
.form-panel .mini {
  font-family: var(--sans);
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 14px;
  text-align: center;
}

/* ---------------------------------------------------------------
   FAQ
   --------------------------------------------------------------- */

.faq .qa { border-top: 1px solid var(--line); padding: 26px 0; }
.faq .qa:first-of-type { border-top: none; padding-top: 0; }
.faq .qa h3 { color: var(--ivy-dark); margin-bottom: 8px; font-size: 1.1rem; }
.faq .qa p { color: var(--muted); max-width: 720px; }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(48px, 6vw, 72px) 0 40px;
  font-family: var(--sans);
}
.footer-tag {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ivy-dark);
  margin-bottom: 40px;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 36px 28px;
  margin-bottom: 48px;
}
.footer-cols h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  margin-bottom: 14px;
}
.footer-cols ul { list-style: none; }
.footer-cols li { margin-bottom: 9px; }
.footer-cols a {
  font-size: 0.86rem;
  color: var(--muted);
  text-decoration: none;
}
.footer-cols a:hover { color: var(--ivy-dark); }
.footer-base {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: var(--faint);
}
.footer-base a { color: var(--muted); text-decoration: none; }
.footer-base a:hover { color: var(--ivy-dark); }

/* ---------------------------------------------------------------
   Command palette
   --------------------------------------------------------------- */

.palette[hidden] { display: none; }
.palette {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(22, 29, 24, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
}
.palette-box {
  width: 100%;
  max-width: 560px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 24px 64px -16px rgba(22, 29, 24, 0.45);
  overflow: hidden;
}
.palette-box input {
  width: 100%;
  font-family: var(--serif);
  font-size: 1.05rem;
  padding: 16px 18px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}
.palette-box input:focus { outline: none; }
.palette-list { list-style: none; max-height: 46vh; overflow-y: auto; padding: 6px; }
.palette-list li { border-radius: 5px; }
.palette-list a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 12px;
  text-decoration: none;
  border-radius: 5px;
}
.palette-list .t { font-size: 0.96rem; color: var(--ink); }
.palette-list .s {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-left: auto;
  white-space: nowrap;
}
.palette-list li.active a, .palette-list a:hover { background: rgba(47, 107, 79, 0.1); }
.palette-empty {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--faint);
  padding: 18px 16px;
}
.palette-hint {
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--faint);
  border-top: 1px solid var(--line);
  padding: 9px 16px;
  display: flex;
  gap: 16px;
}

/* ---------------------------------------------------------------
   Reveal on scroll
   --------------------------------------------------------------- */

/* Reveals are gated on the .js class (set by site.js) so content is fully
   visible for no-JS visitors, crawlers, and anything that never scrolls. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, a.card { transition: none; }
}
