/* Ridgeline Digital Works — site styles.
   Layout: mobile-first single column; from 1024px a 12-column grid with the hero text
   on the left seven columns and the contour map bleeding off the right edge. */

:root {
  /* Palette — drawn from the Driftless */
  --limestone: #E4E2DA; /* page base */
  --fog: #F2F1EC;       /* raised surfaces */
  --hemlock: #1C2320;   /* text, dark sections */
  --shale: #555B55;     /* secondary text */
  --river: #24504B;     /* links, focus, contours */
  --goldenrod: #D9A441; /* the one accent: quote button, markers. Never text on light. */
  --rule: #C9C6BB;      /* hairlines */

  /* Type */
  --font-display: "Big Shoulders Display", "Big Shoulders Fallback", "Arial Narrow", sans-serif;
  --font-body: "Public Sans", "Public Sans Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-mark: "Isometra", "Copperplate", Georgia, serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 1.953rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.052rem);
  --step-4: clamp(2.75rem, 1.9rem + 3.6vw, 5rem);

  /* Motion tokens (mirrored in assets/js/site.js) */
  --dur-fast: 0.25s;
  --dur-base: 0.6s;
  --dur-slow: 1.2s;
  --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-glide: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-contour: cubic-bezier(0.37, 0, 0.63, 1);

  /* Space */
  --gutter: 1rem;
  --maxw: 84rem;
  --header-h: 4rem;
}
@media (min-width: 768px) { :root { --gutter: 2rem; } }
@media (min-width: 1024px) { :root { --gutter: 3rem; --header-h: 4.5rem; } }

/* Width-matched fallbacks: while the web fonts load, text takes the same space,
   so the swap doesn't shift the layout (ratios measured against the hero copy). */
@font-face {
  font-family: "Big Shoulders Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Neue Bold"), local("Roboto Bold"), local("Liberation Sans Bold"), local("Arial");
  font-weight: 800;
  size-adjust: 77.6%;
}
@font-face {
  font-family: "Public Sans Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica Neue"), local("Roboto"), local("Liberation Sans");
  font-weight: 400 600;
  size-adjust: 105%;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--limestone);
  color: var(--hemlock);
  font: 400 var(--step-0)/1.6 var(--font-body);
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--river); text-underline-offset: 0.15em; }
:focus-visible { outline: 3px solid var(--river); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
a[data-tel] { white-space: nowrap; }

.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 {
  position: absolute; left: var(--gutter); top: -5rem; z-index: 50;
  background: var(--hemlock); color: var(--fog); padding: 0.75rem 1rem;
}
.skip:focus { top: 0.5rem; }


/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 48px; padding: 0 1.5rem;
  font: 600 var(--step-0)/1 var(--font-body); text-decoration: none; white-space: nowrap;
  border: 2px solid transparent; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-glide);
}
.btn--primary { background: var(--goldenrod); color: var(--hemlock); border-color: var(--hemlock); }
.btn--primary:hover { background: #E3B45A; }
.btn--quiet { padding: 0 0.25rem; color: var(--hemlock); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.btn--quiet:hover { color: var(--river); }
.btn--small { min-height: 44px; padding: 0 1rem; font-size: var(--step--1); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--header-h);
  padding: 0 var(--gutter);
  background: var(--limestone);
  border-bottom: 1px solid var(--rule);
}
.wordmark { display: inline-flex; align-items: center; gap: 0.65rem; min-height: 44px; color: var(--hemlock); text-decoration: none; }
.wordmark__mark { width: auto; height: 2.5rem; flex: none; }
@media (max-width: 420px) {
  .wordmark { gap: 0.5rem; }
  .wordmark__mark { height: 2rem; }
  .site-header .wordmark__name { font-size: 1.125rem; }
  .site-header .wordmark__sub { font-size: 0.5625rem; letter-spacing: 0.16em; }
}
@media (max-width: 360px) {
  .wordmark { gap: 0.4rem; }
  .wordmark__mark { height: 1.5rem; }
  .site-header .wordmark__name { font-size: 1rem; }
  .site-header .btn--small { padding: 0 0.7rem; }
}
.wordmark__text { display: inline-flex; flex-direction: column; gap: 0.2rem; }
.wordmark__name { font: 400 1.375rem/1 var(--font-mark); letter-spacing: 0.03em; text-transform: uppercase; }
.wordmark__sub { font: 400 0.6875rem/1 var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--shale); }
.site-nav { display: none; }
@media (min-width: 1024px) {
  .wordmark__name { font-size: 1.625rem; }
  .site-nav { display: block; margin-left: auto; }
  .site-nav ul { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
  .site-nav a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.85rem;
    color: var(--hemlock); text-decoration: none; font-weight: 600; font-size: var(--step--1);
  }
  .site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
}

/* Hero */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) 0;
  display: grid; gap: 2rem;
  position: relative;
}
.hero__text { display: grid; gap: 1.25rem; align-content: start; position: relative; z-index: 1; }
.eyebrow { margin: 0; font: 400 var(--step--1)/1.3 var(--font-mono); letter-spacing: 0.04em; color: var(--shale); }
.hero__title {
  margin: 0;
  font: 800 var(--step-4)/0.95 var(--font-display);
  letter-spacing: 0.005em;
  max-width: 17ch;
}
.hero__title span { display: block; margin-top: 0.15em; color: var(--river); }
.hero__sub { margin: 0; font-size: var(--step-1); line-height: 1.5; max-width: 34rem; }
.hero__ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding-top: 0.5rem; }

/* Contour map: a band under the text on phones, a bleed off the right edge on desktop */
.hero__map { margin: 0 calc(var(--gutter) * -1); position: relative; color: var(--river); overflow: hidden; }
.map { width: 170%; max-width: none; height: auto; margin-left: -70%; }
.map .contour { stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.map .contour--index { stroke-width: 2.25; }
.map__summit { fill: var(--goldenrod); stroke: var(--hemlock); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.map__label {
  position: absolute; left: var(--gutter); bottom: 0.75rem;
  font: 400 0.75rem/1 var(--font-mono); letter-spacing: 0.04em; color: var(--river);
  background: var(--limestone); padding: 0.25rem 0.4rem;
}
/* JS draws the rings in; without JS (or with reduced motion) they render fully drawn. */
.js .map .contour { stroke-dasharray: 1; stroke-dashoffset: 1; }

@media (min-width: 768px) {
  .map { width: 130%; margin-left: -40%; }
}
@media (min-width: 1024px) {
  .hero {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    padding-top: clamp(2.5rem, 5vh, 4.5rem);
    padding-bottom: clamp(3rem, 6vw, 5rem);
    align-items: center;
  }
  .hero__text { grid-column: 1 / span 7; grid-row: 1; }
  .hero__title { max-width: 20ch; }
  .hero__map {
    grid-column: 7 / -1; grid-row: 1;
    margin: 0 calc(var(--gutter) * -1) 0 0;
    overflow: visible;
  }
  .map { width: 100%; margin: 0; overflow: visible; }
  .map__label { left: auto; right: var(--gutter); bottom: 0; }
}
@media (min-width: 1440px) {
  /* Let the map bleed to the viewport edge when the content box is narrower than the screen */
  .hero__map { margin-right: calc((100vw - min(var(--maxw), 100vw)) / -2 - var(--gutter)); }
}

/* ---------- Shared section parts ---------- */
.section-head { display: grid; gap: 0.75rem; margin-bottom: 2.5rem; }
/* Alignment rhythm down the page: hero left, Work right, Services left, Process right, About centred. */
.section-head--end { justify-items: end; text-align: right; }
.section-title { margin: 0; font: 800 var(--step-3)/0.98 var(--font-display); letter-spacing: 0.005em; max-width: 18ch; }
.section-title .line-mask { padding-bottom: 0.06em; } /* keep descenders inside SplitText masks */

/* Contour dividers */
.divider { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); color: var(--river); }
.divider svg { width: 100%; height: clamp(2.5rem, 5vw, 4.5rem); }
.divider__line { fill: none; stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.js .divider__line { stroke-dasharray: 1; stroke-dashoffset: 1; }

/* ---------- Work ---------- */
.work { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter); }
.work__grid { display: grid; gap: 3rem; }
.project { display: grid; gap: 1.25rem; margin: 0; }
.project__media { overflow: hidden; background: var(--fog); }
.project__media a { display: block; }
.project__media img { width: 100%; height: auto; aspect-ratio: 9 / 4; object-fit: cover; transition: transform var(--dur-base) var(--ease-glide); }
.project:hover .project__media img { transform: scale(1.03); }
.project__body { display: grid; gap: 0.4rem; }
.project__trade { margin: 0; font: 400 var(--step--1)/1.3 var(--font-mono); color: var(--shale); text-transform: uppercase; letter-spacing: 0.06em; }
.project__name { margin: 0; font: 800 var(--step-2)/1.05 var(--font-display); }
.project__what { margin: 0; max-width: 40rem; }
@media (min-width: 768px) {
  .work__grid { grid-template-columns: 7fr 5fr; align-items: start; gap: 2.5rem; }
  .project--offset { margin-top: 8rem; }
}

/* ---------- Services ---------- */
.services { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter); border-top: 1px solid var(--rule); }
.services__body { display: grid; gap: 2rem; }
.services__lead { margin: 0; font-size: var(--step-1); line-height: 1.5; max-width: 36rem; }
.services__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; border-top: 2px solid var(--hemlock); }
.services__list li { padding: 1.25rem 0; border-bottom: 1px solid var(--rule); display: grid; gap: 0.35rem; align-content: start; }
.services__list h3 { margin: 0; font: 600 var(--step-1)/1.3 var(--font-body); }
.services__list p { margin: 0; color: var(--shale); max-width: 38rem; }
.services__price { margin: 0; }
.services .btn--quiet { justify-self: start; }
@media (min-width: 1024px) {
  .services { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 2rem; }
  .services .section-head { grid-column: 1 / span 4; align-self: start; position: sticky; top: calc(var(--header-h) + 2rem); }
  .services__body { grid-column: 6 / -1; }
  .services__list { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
}

/* ---------- Process (dark; pinned on ≥768px by JS) ---------- */
.process { background: var(--hemlock); color: var(--fog); }
.process__inner { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter); }
.process .eyebrow { color: var(--goldenrod); }
.process__stage { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; }
.process__rail { width: 2px; background: rgb(242 241 236 / 0.2); position: relative; overflow: hidden; }
.process__progress { position: absolute; inset: 0; background: var(--goldenrod); transform-origin: top; }
.process__steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 2.5rem; }
.process__step { display: grid; gap: 0.5rem; }
.process__num { margin: 0; font: 400 var(--step-1)/1 var(--font-mono); color: var(--goldenrod); }
.process__step h3 { margin: 0; font: 800 var(--step-3)/1 var(--font-display); }
.process__step p:not(.process__num) { margin: 0; max-width: 34rem; font-size: var(--step-1); line-height: 1.5; color: rgb(242 241 236 / 0.85); }
/* JS adds .is-pinned: steps share one slot and cross-fade while the section is pinned */
.process.is-pinned .process__inner { min-height: 100vh; min-height: 100svh; display: grid; align-content: center; }
.process.is-pinned .process__steps { grid-template-areas: "slot"; min-height: 14rem; align-items: start; }
.process.is-pinned .process__step { grid-area: slot; }
@media (min-width: 1024px) {
  .process__inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 2rem; }
  .process .section-head { grid-column: 9 / -1; grid-row: 1; }
  .process__stage { grid-column: 1 / span 7; grid-row: 1; }
  .process.is-pinned .process__inner { align-items: center; }
}

/* ---------- About ---------- */
.about { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter); display: block; }
.about__text { display: grid; gap: 1.25rem; align-content: center; max-width: 38rem; margin: 0 auto; text-align: center; justify-items: center; }
.about__text p { margin: 0; max-width: 36rem; font-size: var(--step-1); line-height: 1.55; }
.about__text p.eyebrow { font-size: var(--step--1); }
.about .btn--quiet { justify-self: center; }

/* ---------- Contact ---------- */
.contact { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(4rem, 10vw, 7rem); display: grid; gap: 2.5rem; }
.contact__intro { display: grid; gap: 1.25rem; align-content: start; }
.contact__intro .eyebrow { margin: 0; }
.contact__intro > p:not(.eyebrow) { margin: 0; font-size: var(--step-1); line-height: 1.5; max-width: 30rem; }
.contact__direct { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; font-size: var(--step-1); }
.contact__label { display: inline-block; min-width: 5.5rem; font: 400 var(--step--1)/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--shale); }
.contact__map { margin: 0; color: var(--river); max-width: 30rem; }
.contact__map svg { width: 100%; height: auto; }
.contact__map .contour { stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.contact__map .contour--index { stroke-width: 2.25; }
.js .contact__map .contour { stroke-dasharray: 1; stroke-dashoffset: 1; }
.contact__pin { fill: var(--goldenrod); stroke: var(--hemlock); stroke-width: 2; }
.contact__pin-label { font: 400 15px var(--font-mono); fill: var(--hemlock); paint-order: stroke; stroke: var(--limestone); stroke-width: 6px; stroke-linejoin: round; }

.quote { background: var(--fog); padding: 1.5rem; display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-content: start; }
@media (min-width: 768px) { .quote { padding: 2.5rem; grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.4rem; grid-column: 1 / -1; }
@media (min-width: 768px) { .field--half { grid-column: auto; } }
.field label { font-weight: 600; }
.field__opt { font-weight: 400; color: var(--shale); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.8rem;
  font: 400 var(--step-0)/1.4 var(--font-body); color: var(--hemlock);
  background: #fff; border: 1.5px solid var(--shale); border-radius: 0;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--river); outline-offset: 1px; border-color: var(--river); }
.quote__submit { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 1024px) {
  .contact { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 2rem; }
  .contact__intro { grid-column: 1 / span 5; }
  .quote { grid-column: 7 / -1; }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative; z-index: 1;
  background: var(--hemlock); color: var(--fog);
  padding: 3rem var(--gutter);
  display: grid; gap: 0.5rem;
}
.site-footer p { margin: 0; }
.site-footer__brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem !important; color: var(--fog); }
.site-footer__brand .wordmark__mark { height: clamp(2.25rem, 9vw, 3rem); }
.site-footer .wordmark__name { color: var(--fog); font-size: clamp(1.375rem, 6vw, 1.75rem); }
.site-footer__small { font: 400 var(--step--1)/1.4 var(--font-mono); color: rgb(242 241 236 / 0.7); }
.site-footer a { color: var(--fog); }
.contact__direct a { color: var(--hemlock); text-decoration-thickness: 1.5px; }
.contact__direct li, .site-footer p:has(a) { overflow-wrap: anywhere; }
.contact__direct a, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  .js .map .contour, .js .divider__line, .js .contact__map .contour { stroke-dashoffset: 0; }
  .project__media img { transition: none; }
  .btn { transition: none; }
}

/* Thank-you page */
.thanks { max-width: 40rem; margin: 0 auto; padding: clamp(3rem, 10vw, 7rem) var(--gutter); display: grid; gap: 1.25rem; justify-items: start; }
.thanks p { margin: 0; font-size: var(--step-1); line-height: 1.5; }
.thanks .eyebrow { font-size: var(--step--1); }
