/* ============================================================
   Westcountry AI, site styles
   v3: editorial. Newsreader display, Hanken Grotesk text.
   Plain CSS, no framework, no build step.
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
ol, ul { list-style: none; }

/* ---- Tokens ---- */
:root {
  --paper:     #F4F1EA;
  --paper-2:   #ECE7DC;
  --ink:       #17211C;
  --text:      #333B35;
  --muted:     #62675F;
  --rule:      #D6CFC1;
  --rule-soft: #E3DDD1;
  --accent:    #264A3B;
  --accent-2:  #1B372B;
  --brass:     #8C6F3A;
  --night:     #17211C;
  --night-text:#E9E4D8;
  --night-mut: #A8AEA4;
  --night-rule:#34403A;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans:  'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;

  --fs-display: clamp(2.85rem, 7vw, 6rem);
  --fs-h1:      clamp(2.5rem, 5.4vw, 4.4rem);
  --fs-h2:      clamp(1.9rem, 3.6vw, 2.95rem);
  --fs-h3:      clamp(1.12rem, 1.4vw, 1.25rem);
  --fs-lead:    clamp(1.12rem, 1.5vw, 1.3rem);
  --fs-body:    1.0625rem;
  --fs-small:   0.95rem;

  --max:    1240px;
  --gutter: clamp(1.25rem, 4.5vw, 4.5rem);
  --space:  clamp(4rem, 9vw, 7.5rem);
  --radius: 2px;
}

/* ---- Base ---- */
body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 350;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
}
h1 { font-size: var(--fs-h1); font-weight: 320; letter-spacing: -0.022em; }
h2 { font-size: var(--fs-h2); }
h3 {
  font-family: var(--sans);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
}
em { font-style: italic; }
h1 em, h2 em { font-weight: 300; }

h1, h2, h3, blockquote { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
p { max-width: 64ch; }
p + p { margin-top: 1.05em; }
strong { font-weight: 600; color: var(--ink); }

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--accent-2); text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem; top: 1rem; z-index: 50;
  background: var(--paper); color: var(--ink);
  padding: 0.7rem 1rem; border: 2px solid var(--accent);
}

/* ---- Layout ---- */
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--space); }
.section--tight { padding-block: calc(var(--space) * 0.7); }
.section--alt { background: var(--paper-2); }
.section + .section:not(.section--alt):not(.statement) { border-top: 1px solid var(--rule); }

.label {
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.005em;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split > .sticky { position: sticky; top: 2rem; }

.head h2 { margin-top: 0.9rem; max-width: 22ch; }
.head p { margin-top: 1.4rem; color: var(--muted); }
.head .textlink { margin-top: 1.6rem; display: inline-block; }

.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--text); }
.muted { color: var(--muted); }

/* ---- Buttons and links ---- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.005em;
  padding: 1.02rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--paper); }
.btn--primary:hover { background: var(--accent-2); color: var(--paper); }
.btn--quiet { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--quiet:hover { background: var(--ink); color: var(--paper); }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: #FFFFFF; color: var(--ink); }

.textlink {
  font-weight: 500;
  color: var(--ink);
  text-decoration-color: var(--brass);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
.textlink:hover { color: var(--accent); text-decoration-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }

/* ---- Header ---- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 92px;
  padding-block: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand svg { color: var(--accent); flex: none; }
.brand-name {
  font-family: var(--sans);
  font-size: 1.14rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 2rem; }
.site-nav a:not(.btn) {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding-block: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.site-nav a:not(.btn):hover { color: var(--ink); border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.site-nav .btn { padding: 0.8rem 1.15rem; font-size: 0.92rem; }

/* ---- Home hero ---- */
.hero { padding-block: clamp(3.5rem, 9vw, 7.5rem) clamp(3rem, 7vw, 5.5rem); }
.hero h1 {
  font-size: var(--fs-display);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.028em;
  max-width: 16.5ch;
}
.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}
.hero-foot .place {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 26ch;
}
.hero-foot .actions { margin-top: 2rem; }

.proof { border-block: 1px solid var(--rule); }
.proof .wrap { padding-block: 1.25rem; }
.proof p { font-size: var(--fs-small); color: var(--muted); max-width: none; }

/* ---- Page head (inner pages) ---- */
.page-head { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem); border-bottom: 1px solid var(--rule); }
.page-head h1 { margin-top: 1rem; max-width: 17ch; }
.page-head .lead { margin-top: 1.6rem; max-width: 54ch; color: var(--muted); }
.page-head .actions { margin-top: 2.2rem; }

/* ---- Index rows (services, commitments) ---- */
.index { margin-top: clamp(2.5rem, 5vw, 3.75rem); border-top: 1px solid var(--ink); }
.index-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 4fr) minmax(0, 6fr);
  gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem);
  padding-block: clamp(1.75rem, 3vw, 2.4rem);
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.index-row .num {
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--brass);
}
.index-row h3 { margin: 0; }
.index-row p { color: var(--muted); }
.index-row .textlink { display: inline-block; margin-top: 0.9rem; font-size: var(--fs-small); }
.index--plain .index-row { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }

/* ---- Statement band ---- */
.statement { background: var(--night); color: var(--night-text); }
.statement .wrap { padding-block: clamp(4.5rem, 10vw, 8rem); }
.statement blockquote {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--night-text);
  max-width: 30ch;
}
.statement p {
  margin-top: 2rem;
  color: var(--night-mut);
  max-width: 52ch;
}

/* ---- Stages ---- */
.stages { counter-reset: stage; }
.stage {
  counter-increment: stage;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 1.25rem;
  padding-block: 1.9rem;
  border-top: 1px solid var(--rule);
}
.stage:last-child { border-bottom: 1px solid var(--rule); }
.stage::before {
  content: counter(stage, decimal-leading-zero);
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.65;
  color: var(--brass);
}
.stage .when { font-size: var(--fs-small); font-weight: 600; color: var(--accent); }
.stage h3 { margin-top: 0.35rem; }
.stage p { margin-top: 0.7rem; color: var(--muted); }

.parts { margin-top: 1rem; }
.parts > div { padding-block: 0.85rem; border-top: 1px solid var(--rule-soft); }
.parts > div:first-child { border-top: 0; padding-top: 0.2rem; }
.parts dt { font-weight: 600; color: var(--ink); }
.parts dt span { font-weight: 400; color: var(--muted); }
.parts dd { margin-top: 0.25rem; color: var(--muted); }

/* ---- Three columns of principles ---- */
.cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
.cols > div { padding-top: 1.4rem; border-top: 1px solid var(--ink); }
.cols h3 { margin-bottom: 0.8rem; }
.cols p { color: var(--muted); }

/* ---- Hairline lists ---- */
.hairlist { border-top: 1px solid var(--rule); }
.hairlist li {
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--rule);
  color: var(--text);
}
.hairlist--small li { padding-block: 0.75rem; font-size: var(--fs-small); color: var(--muted); }
.list-title { font-weight: 600; color: var(--ink); margin-bottom: 0.9rem; }

/* ---- Side note ---- */
.note {
  border-left: 2px solid var(--brass);
  padding-left: 1.5rem;
}
.note h3 { font-size: 1.2rem; margin-bottom: 0.8rem; }
.note p { color: var(--muted); font-size: var(--fs-small); }

/* ---- FAQ ---- */
.faq { border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-block: 1.35rem;
  font-family: var(--sans);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 12px; height: 12px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 12px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1.5px 12px no-repeat;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 1.5rem; color: var(--muted); }

/* ---- Closing ---- */
.closing h2 { max-width: 16ch; }
.closing .email {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 350;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration-color: var(--brass);
  text-underline-offset: 0.18em;
}
.closing .email:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---- Footer ---- */
.site-footer { background: var(--night); color: var(--night-mut); font-size: var(--fs-small); }
.site-footer .wrap { padding-block: clamp(3.5rem, 7vw, 5rem) 2rem; }
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr);
  gap: 2.5rem;
}
.site-footer .brand { color: var(--night-text); }
.site-footer .brand svg { color: var(--night-text); }
.site-footer .brand:hover { color: #FFFFFF; }
.site-footer p { max-width: 38ch; }
.footer-top > div > p { margin-top: 1rem; }
.site-footer h2 {
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--night-text);
  margin-bottom: 0.9rem;
}
.site-footer ul { display: grid; gap: 0.45rem; }
.site-footer a { color: var(--night-mut); text-decoration: none; }
.site-footer a:hover { color: #FFFFFF; text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--night-text); }
.footer-base {
  margin-top: 3.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--night-rule);
}

/* ---- Drawings ---- */
.has-art { position: relative; overflow: hidden; min-height: calc(min(74vw, 1480px) * 0.43 + 3rem); }
.has-art > .wrap { position: relative; z-index: 1; }
.art-copy { max-width: min(56%, 46rem); }
.art {
  position: absolute;
  top: 50%;
  right: 0;
  width: min(74vw, 1480px);
  transform: translateY(-50%);
  pointer-events: none;
}
.art img { width: 100%; height: auto; }
.art figcaption {
  position: absolute;
  right: var(--gutter);
  top: 100%;
  margin-top: 0.1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero.has-art { display: flex; align-items: center; }
.hero.has-art > .wrap { width: 100%; }
.hero.has-art h1 { font-size: clamp(2.8rem, 5.6vw, 5.2rem); }
.hero .place {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.hero .art-copy .lead { margin-top: 2rem; max-width: 46ch; }
.hero .art-copy .actions { margin-top: 2.2rem; }

.page-head.has-art { display: flex; align-items: center; }
.page-head.has-art > .wrap { width: 100%; }

.statement.has-art .art-copy { max-width: min(46%, 36rem); }
.statement.has-art blockquote { max-width: 20ch; }
.statement.has-art p { max-width: 42ch; }
.statement .art figcaption { color: var(--night-mut); }

/* ---- Motion preference ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .has-art,
  .hero.has-art,
  .page-head.has-art { min-height: 0; display: block; }
  .has-art .art-copy,
  .statement.has-art .art-copy { max-width: none; }
  .art { position: static; transform: none; width: 100%; margin-top: 2.5rem; }
  .art img { aspect-ratio: 3 / 2; object-fit: cover; object-position: right center; }
  .art figcaption { position: static; padding-inline: var(--gutter); text-align: right; margin-top: 0.4rem; }
  .statement.has-art .wrap { padding-bottom: 0; }
  .statement.has-art .art { padding-bottom: 2.5rem; }
  .split, .split--even, .hero-foot { grid-template-columns: 1fr; gap: 2rem; }
  .split > .sticky { position: static; }
  .cols { grid-template-columns: 1fr; }
  .index-row { grid-template-columns: 3rem minmax(0, 1fr); }
  .index-row > div:last-child { grid-column: 2; }
  .index--plain .index-row { grid-template-columns: 1fr; gap: 0.6rem; }
  .index--plain .index-row > div:last-child { grid-column: auto; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-top > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .site-header .wrap { flex-wrap: wrap; gap: 0.6rem 1.25rem; min-height: 0; padding-block: 1.1rem; }
  .site-nav { margin-left: 0; width: 100%; gap: 1.35rem; }
  .site-nav .btn { display: none; }
  .index-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .index-row > div:last-child { grid-column: auto; }
  .footer-top { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; text-align: center; }
  .stage { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.75rem; }
}
