/* ============================================================
   SLOIVY — design system
   Rooted in the Central Coast.
   Fonts: Fraunces (display serif) · Inter (text/UI), self-hosted
   ============================================================ */

/* ---------- fonts ---------- */
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-latin-300-normal.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-latin-300-italic.woff2') format('woff2'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  /* palette — deep ivy anchor, warm bone ground, photography carries color */
  --paper:      #F5F2EA;   /* warm bone — page ground */
  --paper-2:    #EDE9DC;   /* stone panel */
  --ink:        #22261E;   /* near-black, green undertone */
  --ink-soft:   #4A4F44;   /* body text on paper */
  --ivy-deep:   #142819;   /* brand dark — footer, dark bands */
  --ivy:        #24422C;   /* links, accents, logo */
  --ivy-bright: #386343;   /* hover states */
  --sage:       #7C8874;   /* decorative sage — rules, arrows */
  --sage-text:  #5C6754;   /* sage for small text — AA on paper */
  --brass-text: #8A6D33;   /* brass for small text — AA on paper */
  --sage-2:     #9AA48F;   /* muted text on dark */
  --brass:      #A98849;   /* rare metallic accent — hairline flourishes */
  --hairline:   #DAD4C4;   /* rules on paper */
  --hairline-d: #2A4432;   /* rules on ivy-deep */
  --paper-on-d: #EFEDE3;   /* text on dark */

  /* type */
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --text: 1.0625rem;                                   /* 17px body */
  --h-hero: clamp(2.6rem, 6.2vw, 5.4rem);
  --h-1: clamp(2.2rem, 4.6vw, 3.6rem);
  --h-2: clamp(1.6rem, 3vw, 2.35rem);
  --h-3: 1.35rem;
  --label: 0.72rem;                                    /* eyebrows */

  /* rhythm */
  --space-section: clamp(5rem, 11vw, 9.5rem);
  --space-block: clamp(2.4rem, 5vw, 4rem);
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 62ch;
  --max: 82.5rem;                                      /* 1320px */
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: var(--text);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--ivy); text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--ivy-bright); }
::selection { background: var(--ivy); color: var(--paper); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 300; color: var(--ink); line-height: 1.12; margin: 0 0 1.2rem; letter-spacing: -0.01em; }
h1 { font-size: var(--h-1); }
h2 { font-size: var(--h-2); }
h3 { font-size: var(--h-3); line-height: 1.3; }
p { margin: 0 0 1.35rem; max-width: var(--measure); }
em { font-family: var(--serif); font-style: italic; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.measure { max-width: var(--measure); }

/* eyebrow label — the letterspaced uppercase tell */
.eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: var(--label);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-text);
  margin-bottom: 1.4rem;
}
.eyebrow--brass { color: var(--brass-text); }
.eyebrow .num { color: var(--brass-text); margin-right: .75em; font-variant-numeric: tabular-nums; }

/* hairline rule with brass tick */
.rule { border: 0; height: 1px; background: var(--hairline); margin: 0; position: relative; }
.rule::after { content: ''; position: absolute; left: 0; top: -1px; width: 48px; height: 3px; background: var(--brass); }

/* ---------- header ---------- */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 40;
  padding: 1.6rem 0;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; }
.brand svg { display: block; }
.brand-word {
  font-family: var(--serif); font-weight: 400; font-size: 1.06rem;
  letter-spacing: .26em; color: var(--ink); text-transform: uppercase;
}
.brand-word .accent { color: var(--ivy); }
.site-header--overlay .brand-word, .site-header--overlay .brand-word .accent { color: var(--paper-on-d); }
.footer-brand .brand-word, .footer-brand .brand-word .accent { color: var(--paper-on-d); }
.brand-leaf { color: var(--ivy); }
.site-header--overlay .brand-leaf, .footer-brand .brand-leaf { color: var(--brass); }
.site-nav { display: flex; align-items: center; gap: 2.2rem; }
.site-nav a {
  font-size: var(--label); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink); padding: .3rem 0; border-bottom: 1px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ivy); border-bottom-color: var(--brass); }
.site-nav .nav-portal { color: var(--ivy); }

/* header over photography */
.site-header--overlay .site-nav a, .site-header--overlay .brand { color: var(--paper-on-d); }
.site-header--overlay .site-nav a:hover { color: #fff; border-bottom-color: var(--brass); }

/* mobile nav */
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: currentColor; margin: 5px 0; transition: transform .3s; }
.site-header--overlay .nav-toggle { color: var(--paper-on-d); }
@media (max-width: 860px) {
  .nav-toggle { display: block; z-index: 60; color: var(--ink); }
  .site-nav {
    position: fixed; inset: 0; z-index: 50; flex-direction: column; justify-content: center; gap: 1.6rem;
    background: var(--ivy-deep); transform: translateY(-102%); visibility: hidden;
    transition: transform .45s cubic-bezier(.6,.05,.2,1), visibility 0s .45s;
  }
  .site-nav a { color: var(--paper-on-d) !important; font-size: .95rem; }
  body.nav-open .site-nav { transform: translateY(0); visibility: visible; transition: transform .45s cubic-bezier(.6,.05,.2,1), visibility 0s; }
  body.nav-open .nav-toggle { position: fixed; right: var(--gutter); top: 1.8rem; color: var(--paper-on-d); }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  body.nav-open { overflow: hidden; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 92vh; display: flex; align-items: flex-end;
  color: var(--paper-on-d); isolation: isolate;
}
.hero--short { min-height: 62vh; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(12,20,13,.5), rgba(12,20,13,0) 24%),
    linear-gradient(to top, rgba(12,20,13,.78) 0%, rgba(12,20,13,.28) 45%, rgba(12,20,13,.14) 100%);
}
.hero-inner { width: 100%; padding-bottom: clamp(3rem, 7vw, 5.5rem); padding-top: 9rem; }
.hero h1, .hero .hero-title {
  font-family: var(--serif); font-weight: 300; color: #fff;
  font-size: var(--h-hero); line-height: 1.06; letter-spacing: -0.015em;
  max-width: 15em; margin: 0 0 1.6rem;
}
.hero .hero-title em { font-style: italic; }
.hero .eyebrow { color: rgba(240,238,228,.85); }
.hero-sub { font-size: 1.05rem; line-height: 1.6; color: rgba(240,238,228,.88); max-width: 44ch; }
.hero-meta {
  margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid rgba(240,238,228,.28);
  display: flex; flex-wrap: wrap; gap: .6rem 2.6rem;
  font-size: var(--label); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: rgba(240,238,228,.75);
}

/* ---------- sections ---------- */
.section { padding: var(--space-section) 0; }
.section--tight { padding: var(--space-block) 0; }
.section--panel { background: var(--paper-2); }
.section--dark { background: var(--ivy-deep); color: var(--sage-2); }
.section--dark h2, .section--dark h3 { color: var(--paper-on-d); }
.section--dark .eyebrow { color: var(--sage-2); }
.section--dark a { color: var(--paper-on-d); }
.section--dark .rule { background: var(--hairline-d); }

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: var(--space-block); }
.section-head h2 { margin-bottom: 0; max-width: 18em; }
.section-link { font-size: var(--label); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; padding-bottom: .35rem; border-bottom: 1px solid var(--brass); }

/* two-column editorial */
.cols { display: grid; grid-template-columns: minmax(0,5fr) minmax(0,7fr); gap: clamp(2rem,6vw,6rem); align-items: start; }
.cols--even { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .cols, .cols--even { grid-template-columns: 1fr; } }

/* ---------- practice index (01–04) ---------- */
.practice-list { border-top: 1px solid var(--hairline); }
.practice-row {
  display: grid; grid-template-columns: 5rem minmax(0,1fr) minmax(0,1.6fr) auto;
  gap: 1.5rem 2.5rem; align-items: center;
  padding: 2.1rem 0; border-bottom: 1px solid var(--hairline);
  color: inherit; transition: padding-left .35s ease, background .35s ease;
}
.practice-row:hover { padding-left: 1.2rem; background: linear-gradient(90deg, rgba(36,66,44,.05), transparent 65%); }
.practice-row .num { font-family: var(--serif); font-size: 1rem; color: var(--brass-text); font-variant-numeric: tabular-nums; }
.practice-row h3 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); transition: color .25s; }
.practice-row:hover h3 { color: var(--ivy); }
.practice-row p { margin: 0; font-size: .98rem; color: var(--ink-soft); }
.practice-row .arrow { font-family: var(--serif); font-size: 1.4rem; color: var(--sage); transition: transform .3s, color .3s; }
.practice-row:hover .arrow { transform: translateX(.5rem); color: var(--brass); }
@media (max-width: 860px) {
  .practice-row { grid-template-columns: 3rem 1fr auto; }
  .practice-row p { grid-column: 2 / -1; }
}

/* ---------- project / card grids ---------- */
.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.75rem); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.card { color: inherit; display: block; }
.card figure { margin: 0 0 1.1rem; overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-2); }
.card--tall figure { aspect-ratio: 3 / 4; }
.card--wide figure { aspect-ratio: 16 / 9; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.6,.2,1); }
.card:hover img { transform: scale(1.045); }
.card h3 { margin-bottom: .3rem; transition: color .25s; }
.card:hover h3 { color: var(--ivy); }
.card-meta {
  display: block;
  font-size: var(--label); font-weight: 500; letter-spacing: .15em; text-transform: uppercase; color: var(--sage-text);
}
.card-meta .sep { color: var(--brass-text); margin: 0 .45em; }
.card--static:hover img { transform: none; }
.card--static:hover h3 { color: var(--ink); }
.card p { font-size: .96rem; margin: .55rem 0 0; }

/* ---------- stat / fact band (honest facts only) ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 2.5rem; }
.fact .fact-value { font-family: var(--serif); font-weight: 300; font-size: clamp(2rem, 4vw, 3.1rem); color: var(--paper-on-d); line-height: 1.1; }
.fact .fact-label { margin-top: .6rem; font-size: var(--label); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-2); }
.section:not(.section--dark) .fact .fact-value { color: var(--ink); }
.section:not(.section--dark) .fact .fact-label { color: var(--sage-text); }

/* ---------- pull quote / manifesto ---------- */
.manifesto {
  font-family: var(--serif); font-weight: 300; font-style: italic;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem); line-height: 1.35; color: var(--ink);
  max-width: 26em; margin: 0;
}
.section--dark .manifesto { color: var(--paper-on-d); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-size: var(--label); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; text-align: center;
  padding: 1.05rem 2.4rem; border: 1px solid var(--ivy); color: var(--ivy); background: transparent;
  cursor: pointer; transition: background .3s, color .3s, border-color .3s;
}
.btn:hover { background: var(--ivy); color: var(--paper); }
.btn--solid { background: var(--ivy); color: var(--paper); }
.btn--solid:hover { background: var(--ivy-bright); border-color: var(--ivy-bright); color: #fff; }
.btn--light { border-color: rgba(240,238,228,.6); color: var(--paper-on-d); }
.btn--light:hover { background: var(--paper-on-d); color: var(--ivy-deep); border-color: var(--paper-on-d); }

/* ---------- full-bleed brand interlude (ivy texture) ---------- */
.interlude { position: relative; min-height: 46vh; display: flex; align-items: center; color: var(--paper-on-d); isolation: isolate; }
.interlude .hero-media img { filter: saturate(.82) brightness(.92); }
.interlude::after { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(14,26,16,.55); }
.interlude .manifesto { color: var(--paper-on-d); }

/* framed figure for editorial columns */
.figure-frame { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
.figure-frame--tall { aspect-ratio: 3 / 4; }
.figure-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- vine divider ---------- */
.vine-divider { display: flex; justify-content: center; padding: 0 0 var(--space-block); color: var(--sage); }
.section--dark .vine-divider { color: var(--hairline-d); }

/* ---------- forms (portal, contact) ---------- */
.form-field { margin-bottom: 1.5rem; }
.form-field label {
  display: block; font-size: var(--label); font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sage-text); margin-bottom: .55rem;
}
.form-field input, .form-field textarea {
  width: 100%; padding: .95rem 1.1rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--hairline); transition: border-color .25s;
}
.form-field input:focus-visible, .form-field textarea:focus-visible {
  border-color: var(--ivy); outline: 2px solid var(--ivy); outline-offset: 1px;
}
.form-note { font-size: .85rem; color: var(--sage-text); }
.form-alert {
  display: none; padding: 1.1rem 1.3rem; margin: 1.4rem 0 0; font-size: .93rem; line-height: 1.55;
  background: rgba(36,66,44,.07); border-left: 2px solid var(--brass); color: var(--ink-soft);
}
.form-alert.visible { display: block; }

/* ---------- tables (trade page) ---------- */
.def-list { border-top: 1px solid var(--hairline); }
.def-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: 1rem 3rem; padding: 1.5rem 0; border-bottom: 1px solid var(--hairline); }
.def-row dt { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.def-row dd { margin: 0; font-size: .97rem; }
@media (max-width: 640px) { .def-row { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { background: var(--ivy-deep); color: var(--sage-2); position: relative; overflow: hidden; }
.site-footer .roots-svg { position: absolute; right: -4rem; bottom: -2rem; width: 34rem; max-width: 80vw; opacity: .5; pointer-events: none; }
.footer-main { position: relative; display: grid; grid-template-columns: minmax(0,2fr) repeat(3, minmax(0,1fr)); gap: 3rem; padding: clamp(3.5rem,7vw,5.5rem) 0 3rem; }
@media (max-width: 960px) { .footer-main { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-main { grid-template-columns: 1fr; } }
.footer-tag { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 1.15rem; color: var(--paper-on-d); margin: 1.2rem 0 0; max-width: 22em; }
.footer-col h4, .footer-col .footer-heading { font-family: var(--sans); font-size: var(--label); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--sage-2); margin: 0 0 1.2rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .7rem; font-size: .95rem; }
.footer-col a { color: var(--paper-on-d); }
.footer-col a:hover { color: #fff; }
.footer-legal {
  position: relative; display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: space-between; align-items: center;
  padding: 1.6rem 0 2rem; border-top: 1px solid var(--hairline-d);
  font-size: .8rem; color: var(--sage-2);
}
.footer-legal a { color: var(--sage-2); } .footer-legal a:hover { color: var(--paper-on-d); }

/* ---------- reveal on scroll (JS-gated: no JS, no hiding) ---------- */
html.js .reveal { opacity: 0; transform: translateY(1.6rem); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.6,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .card img, .practice-row { transition: none; }
}

/* ---------- page intro (inner pages) ---------- */
.page-intro { padding: 11rem 0 var(--space-block); }
.page-intro h1 { max-width: 14em; }
.page-intro .lede { font-size: 1.2rem; line-height: 1.6; color: var(--ink-soft); max-width: 52ch; }

/* ---------- long-form prose (privacy, legal) ---------- */
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.55rem; margin-top: 3.2rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1.35rem; }
.prose li { margin-bottom: .6rem; max-width: var(--measure); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose .policy-meta { font-size: .9rem; color: var(--sage); letter-spacing: .04em; }

/* ---------- utilities ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.small { font-size: .9rem; }
.muted { color: var(--sage); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--ivy-deep); color: #fff; padding: .8rem 1.2rem; }
.skip-link:focus { left: 0; }
