/* Vale Heart Co — site stylesheet
   Palette is a surveyor's set: pine ink on a faintly green paper, brass for the
   contour work and for anything the eye is meant to follow. Brass never carries
   body text — it does not clear 4.5:1 on paper and is used only at display sizes
   or as line work. */

:root {
  --paper:    #F5F7F3;
  --paper-2:  #EAEFE7;
  --ink:      #12312A;
  --ink-deep: #0C221D;
  --soft:     #41574E;
  --line:     #D3DCD5;
  --line-ink: #2C4A41;
  --brass:    #B0862B;
  --brass-lt: #D8B45C;

  --measure: 66ch;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --page: 1240px;
  --rail: 13rem;
  --rail-gap: clamp(2rem, 5vw, 4.5rem);

  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.9rem); letter-spacing: -0.032em; line-height: 1.03; }
h2 { font-size: clamp(1.8rem, 3.3vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 1.7vw, 1.4rem); font-weight: 600; letter-spacing: -0.014em; line-height: 1.25; }
h4 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.008em; }

p { margin: 0 0 1.15em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

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

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

.wrap { max-width: var(--page); margin: 0 auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper);
  padding: 0.75rem 1.15rem; z-index: 50; font-family: var(--sans); font-size: 0.9rem;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ── Masthead ───────────────────────────────────────────────────────────── */

.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 5rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; color: var(--brass); }
.brand-name {
  font-family: var(--sans); font-weight: 700; font-size: 1.0625rem;
  letter-spacing: -0.015em; color: var(--ink);
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); }
.nav a {
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 500;
  color: var(--soft); text-decoration: none; padding: 0.3rem 0; position: relative;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.1rem;
  height: 2px; background: var(--brass);
}

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 2px;
  font-family: var(--sans); font-size: 0.9rem; font-weight: 500; color: var(--ink);
  padding: 0.5rem 0.85rem; cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); z-index: 40;
    padding: 0.5rem var(--gutter) 1.25rem;
  }
  .masthead .wrap { position: relative; }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.7rem 0; border-top: 1px solid var(--line); font-size: 1.0625rem; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav a[aria-current="page"] { color: var(--brass); }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 2; padding-block: clamp(4rem, 11vw, 8.5rem); }
.hero-text { max-width: none; }
/* On the h1, not on the wrapper: `ch` is measured in the element's own font,
   and the wrapper inherits the 17px body serif rather than the headline face. */
.hero-text h1 { max-width: 24ch; }
.hero h1 + .lede { margin-top: clamp(1.75rem, 3vw, 2.5rem); }

.lede {
  font-size: clamp(1.15rem, 1.85vw, 1.375rem);
  line-height: 1.62; color: var(--soft); max-width: 58ch;
}

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

.contour-field {
  position: absolute; z-index: 1; pointer-events: none;
  color: var(--brass);
  top: 50%; right: -8%; transform: translateY(-50%);
  width: min(720px, 62vw); aspect-ratio: 1; opacity: 0.62;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 52%);
  mask-image: linear-gradient(to right, transparent 0%, #000 52%);
}
.contour-field .contour { width: 100%; height: 100%; display: block; }

@media (max-width: 860px) {
  .contour-field { right: -32%; width: 132vw; opacity: 0.34;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 40%);
    mask-image: linear-gradient(to right, transparent 0%, #000 40%); }
  .hero-text h1 { max-width: none; }
}

/* One orchestrated moment: the survey draws itself in, once, on load. */
@media (prefers-reduced-motion: no-preference) {
  .contour-field.is-drawing path { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
  .contour-field.is-drawn path {
    stroke-dasharray: var(--len); stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.5s cubic-bezier(.22,.61,.36,1);
    transition-delay: var(--delay, 0s);
  }
}

/* ── Banded rail layout ─────────────────────────────────────────────────── */

.band { border-top: 1px solid var(--line); }
.band > .wrap {
  display: grid; grid-template-columns: var(--rail) 1fr; gap: 0 var(--rail-gap);
  padding-block: clamp(3rem, 7vw, 5.5rem);
}
.band-rail { grid-column: 1; }
.band-body { grid-column: 2; min-width: 0; }

.rail-label {
  font-family: var(--sans); font-size: 0.875rem; font-weight: 600;
  color: var(--ink); margin: 0 0 0.5rem; letter-spacing: 0;
}
.rail-note {
  font-size: 0.9375rem; line-height: 1.55; color: var(--soft); margin: 0; max-width: 24ch;
}

@media (max-width: 900px) {
  .band > .wrap { grid-template-columns: 1fr; gap: 1.5rem; }
  .band-rail, .band-body { grid-column: 1; }
  .rail-note { max-width: var(--measure); }
}

.band.inverse { background: var(--ink); color: var(--paper); border-top-color: var(--line-ink); }
.band.inverse .rail-label { color: var(--paper); }
.band.inverse .rail-note, .band.inverse .lede { color: #AFC4BB; }
.band.inverse a { text-decoration-color: var(--brass-lt); }
.band.inverse a:hover { text-decoration-color: var(--paper); }
.band.tint { background: var(--paper-2); }

/* ── Practice list — ruled rows, not cards ──────────────────────────────── */

.plist { list-style: none; margin: 0; padding: 0; }
.plist > li { border-top: 1px solid var(--line); padding: 1.65rem 0; }
.plist > li:first-child { border-top: 0; padding-top: 0; }
.plist > li:last-child { padding-bottom: 0; }
.band.inverse .plist > li { border-top-color: var(--line-ink); }

.plist-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 0.4rem 2.5rem; align-items: baseline; }
@media (max-width: 720px) { .plist-row { grid-template-columns: 1fr; gap: 0.35rem; } }

.plist h3 { margin: 0; }
.plist h3 a { text-decoration: none; }
.plist h3 a:hover { text-decoration: underline; text-decoration-color: var(--brass); }
.plist p { color: var(--soft); margin: 0; font-size: 1rem; }
.band.inverse .plist p { color: #AFC4BB; }

/* ── Prose stacks ───────────────────────────────────────────────────────── */

.stack > * + * { border-top: 1px solid var(--line); margin-top: 2.25rem; padding-top: 2.25rem; }
.band.inverse .stack > * + * { border-top-color: var(--line-ink); }
.stack h3 { margin-bottom: 0.6rem; }

.prose > * + * { margin-top: 1.15em; }
.prose h2 { margin-top: 2.6em; margin-bottom: 0.55em; }
.prose h3 { margin-top: 2.1em; margin-bottom: 0.5em; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose ul, .prose ol { max-width: var(--measure); padding-left: 1.25rem; margin-block: 0 1.15em; }
.prose li { margin-bottom: 0.45em; }
.prose blockquote {
  margin: 2rem 0; padding-left: 1.5rem; border-left: 2px solid var(--brass);
  font-size: 1.1875rem; line-height: 1.6; color: var(--ink);
}
.prose blockquote p { max-width: 54ch; }

/* ── Deliverables ───────────────────────────────────────────────────────── */

.spec { list-style: none; margin: 1.35rem 0 0; padding: 0; max-width: var(--measure); }
.spec li {
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; line-height: 1.5;
  color: var(--soft); padding: 0.55rem 0 0.55rem 1.5rem; border-top: 1px solid var(--line);
  position: relative;
}
.spec li::before {
  content: ""; position: absolute; left: 0; top: 1.1rem;
  width: 0.55rem; height: 0.55rem; border: 1.5px solid var(--brass); border-radius: 50%;
}

/* ── Phases — a real sequence, so it is drawn as one ────────────────────── */

.phases { list-style: none; margin: 0; padding: 0; counter-reset: phase; }
.phases > li {
  counter-increment: phase; position: relative;
  padding: 0 0 2.5rem 3.25rem; border-left: 1px solid var(--line);
}
.phases > li:last-child { padding-bottom: 0; border-left-color: transparent; }
.phases > li::before {
  content: counter(phase); position: absolute; left: 0; top: 0; transform: translateX(-50%);
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--paper);
  border: 1px solid var(--brass); color: var(--ink);
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 600;
  display: grid; place-items: center; line-height: 1;
}
.phases h3 { margin: -0.3rem 0 0.55rem; }
@media (max-width: 720px) { .phases > li { padding-left: 2.25rem; } }

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600;
  letter-spacing: -0.005em; padding: 0.85rem 1.6rem; border-radius: 2px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  text-decoration: none; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.btn:hover { background: var(--ink-deep); border-color: var(--ink-deep); }
.band.inverse .btn { background: var(--brass); border-color: var(--brass); color: var(--ink-deep); }
.band.inverse .btn:hover { background: var(--brass-lt); border-color: var(--brass-lt); }

.btn-quiet {
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 0.3em;
}
.band.inverse .btn-quiet { color: var(--paper); }

/* ── Articles ───────────────────────────────────────────────────────────── */

.arts { list-style: none; margin: 0; padding: 0; }
.arts > li { border-top: 1px solid var(--line); padding: 1.9rem 0; }
.arts > li:first-child { border-top: 0; padding-top: 0; }
.arts h3 { margin: 0 0 0.5rem; font-size: clamp(1.25rem, 1.9vw, 1.55rem); font-weight: 700; }
.arts h3 a { text-decoration: none; }
.arts h3 a:hover { text-decoration: underline; text-decoration-color: var(--brass); }
.arts p { color: var(--soft); margin: 0; }

.meta { font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; color: var(--soft); margin: 0 0 0.45rem; }

.article-head { border-bottom: 1px solid var(--line); }
.article-head .wrap { padding-block: clamp(2.75rem, 7vw, 5rem); }
.article-head h1 { font-size: clamp(2rem, 4.3vw, 3.4rem); max-width: 19ch; }
.article-body .wrap { padding-block: clamp(2.75rem, 6vw, 4.5rem); }

/* ── Form ───────────────────────────────────────────────────────────────── */

.form { max-width: 34rem; }
.field { margin-bottom: 1.35rem; }
.field label {
  display: block; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600;
  margin-bottom: 0.45rem; color: var(--ink);
}
.field .hint { font-family: var(--sans); font-size: 0.8125rem; font-weight: 400; color: var(--soft); display: block; margin-top: 0.2rem; }
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--serif); font-size: 1rem; line-height: 1.55;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: 2px; padding: 0.7rem 0.85rem;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brass); outline-offset: 1px; }
.field textarea { min-height: 9rem; resize: vertical; }

.form-note { font-size: 0.9375rem; color: var(--soft); max-width: 40ch; margin-top: 1rem; }

.form-status {
  display: none; margin-top: 1.5rem; padding: 1.1rem 1.25rem;
  border: 1px solid var(--brass); border-left-width: 3px; border-radius: 2px;
  background: var(--paper-2); font-size: 1rem;
}
.form-status.is-shown { display: block; }
.form-status p { margin: 0; }
.form-status p + p { margin-top: 0.5rem; }

/* ── Contact details ────────────────────────────────────────────────────── */

.deets { list-style: none; margin: 0; padding: 0; }
.deets > li { border-top: 1px solid var(--line); padding: 1.15rem 0; }
.deets > li:first-child { border-top: 0; padding-top: 0; }
.deets h4 { margin: 0 0 0.25rem; }
.deets p { margin: 0; color: var(--soft); font-size: 1rem; }

/* ── Colophon ───────────────────────────────────────────────────────────── */

.colophon { background: var(--ink); color: var(--paper); }
.colophon a { color: var(--paper); text-decoration-color: rgba(216,180,92,.6); }
.colophon a:hover { text-decoration-color: var(--paper); }
.colophon .wrap { padding-block: clamp(3rem, 6vw, 4.5rem); }
.colophon-top {
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 2.5rem var(--rail-gap);
}
@media (max-width: 800px) { .colophon-top { grid-template-columns: 1fr 1fr; } .colophon-blurb { grid-column: 1 / -1; } }
@media (max-width: 480px) { .colophon-top { grid-template-columns: 1fr; } }

.colophon .brand-name { color: var(--paper); }
.colophon-blurb p { color: #AFC4BB; font-size: 1rem; max-width: 34ch; margin: 1rem 0 0; }
.colophon h4 { font-size: 0.875rem; font-weight: 600; margin: 0 0 0.85rem; color: var(--paper); }
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { margin-bottom: 0.5rem; }
.colophon li a { font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; color: #AFC4BB; text-decoration: none; }
.colophon li a:hover { color: var(--paper); text-decoration: underline; }

.colophon-base {
  margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.5rem; border-top: 1px solid var(--line-ink);
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; justify-content: space-between;
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 400; color: #8FA9A0;
}
.colophon-base p { margin: 0; max-width: none; }
.colophon-base a { color: #8FA9A0; }

/* ── Utility ────────────────────────────────────────────────────────────── */

.measure { max-width: var(--measure); }
.lede-block { max-width: 58ch; }
.mt-l { margin-top: clamp(2rem, 4vw, 3rem); }
.anchor { scroll-margin-top: 6rem; }

/* A subheading inside a band body, where .prose margins do not apply. */
.subhead { margin-top: 2.25rem; }

/* Honeypot. Positioned from the stylesheet rather than an inline style
   attribute: the site's style-src has no 'unsafe-inline', so an inline style
   is blocked and the field renders visibly on the form. */
.hp { position: absolute; left: -9999px; }
