/* ============================================================
   Calphos / Canton Mills, Inc.
   Design system  ·  earthy editorial, phosphate-earth palette
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* color */
  --ink:        #1b1a16;
  --ink-soft:   #4a463c;
  --ink-faint:  #7b7566;
  --bone:       #f3eee2;
  --bone-deep:  #ece5d4;
  --paper:      #fbf9f3;
  --forest:     #2c3826;
  --forest-deep:#212b1c;
  --moss:       #6c7a53;
  --clay:       #b0592f;
  --clay-deep:  #944a26;
  --sand:       #e5d9c0;
  --sand-line:  #d9ccb1;
  --line:       rgba(27, 26, 22, 0.12);
  --line-soft:  rgba(27, 26, 22, 0.07);
  --on-dark:    #eee7d6;
  --on-dark-soft: rgba(238, 231, 214, 0.66);

  /* type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* fluid scale */
  --step--1: clamp(0.80rem, 0.77rem + 0.15vw, 0.88rem);
  --step-0:  clamp(1.02rem, 0.99rem + 0.18vw, 1.14rem);
  --step-1:  clamp(1.22rem, 1.14rem + 0.4vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.34rem + 0.8vw, 2.1rem);
  --step-3:  clamp(2rem, 1.66rem + 1.7vw, 3.1rem);
  --step-4:  clamp(2.6rem, 2rem + 3vw, 4.6rem);
  --step-5:  clamp(3.1rem, 2.2rem + 4.6vw, 6rem);

  /* structure */
  --wrap: 1220px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 3px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--ink);
  background: var(--bone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.06; letter-spacing: -0.012em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Type helpers ---------- */
.display  { font-family: var(--serif); font-optical-sizing: auto; }
.serif    { font-family: var(--serif); }
h1.display, h2.display { font-weight: 380; }
.h-xl { font-family: var(--serif); font-size: var(--step-5); font-weight: 340; line-height: 1.0; letter-spacing: -0.02em; }
.h-lg { font-family: var(--serif); font-size: var(--step-4); font-weight: 360; line-height: 1.03; letter-spacing: -0.018em; }
.h-md { font-family: var(--serif); font-size: var(--step-3); font-weight: 380; line-height: 1.06; }
.h-sm { font-family: var(--serif); font-size: var(--step-2); font-weight: 400; }

.eyebrow {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow::before {
  content: "";
  width: 1.9em; height: 1px;
  background: var(--clay);
  opacity: 0.7;
}
.eyebrow.center::before { display: none; }
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); font-weight: 400; }
.muted { color: var(--ink-faint); }
.measure { max-width: 62ch; }
.measure-sm { max-width: 46ch; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: 1440px; }
.section { padding-block: clamp(4rem, 9vw, 8.5rem); }
.section-tight { padding-block: clamp(3rem, 6vw, 5.5rem); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 0; }

.grid { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 860px) {
  .cols-2, .cols-3, .cols-4, .split { grid-template-columns: 1fr; }
  .split.reverse > :first-child { order: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--sans); font-size: var(--step--1);
  font-weight: 600; letter-spacing: 0.05em;
  padding: 0.95em 1.6em; border-radius: 100px;
  border: 1px solid transparent; transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-deep); transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(148,74,38,0.7); }
.btn-dark { background: var(--forest); color: var(--on-dark); }
.btn-dark:hover { background: var(--forest-deep); transform: translateY(-1px); }
.btn-outline { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--ink); background: var(--ink); color: var(--bone); }
.btn-ghost-light { color: var(--on-dark); border-color: rgba(238,231,214,0.32); }
.btn-ghost-light:hover { background: rgba(238,231,214,0.1); border-color: var(--on-dark); }
.link-arrow {
  font-weight: 600; font-size: var(--step--1); letter-spacing: 0.04em;
  color: var(--clay); display: inline-flex; align-items: center; gap: 0.5em;
  border-bottom: 1px solid transparent; padding-bottom: 2px; transition: all 0.25s var(--ease);
}
.link-arrow .arrow { transition: transform 0.25s var(--ease); }
.link-arrow:hover { border-color: var(--clay); }
.link-arrow:hover .arrow { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bone) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow 0.3s var(--ease);
}
.site-header.scrolled { box-shadow: 0 1px 0 var(--line), 0 14px 30px -26px rgba(27,26,22,0.4); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 74px; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { line-height: 1; }
.brand-name { font-family: var(--serif); font-size: 1.32rem; font-weight: 500; letter-spacing: -0.01em; display: block; }
.brand-sub { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.3rem); }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--ink-soft);
  position: relative; padding: 0.4em 0; transition: color 0.2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--clay); transition: width 0.28s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 1.2rem; }
.nav-phone { font-size: 0.9rem; font-weight: 600; color: var(--ink); display: inline-flex; gap: 0.45em; align-items: center; }
.nav-toggle { display: none; background: none; border: 0; padding: 0.4rem; color: var(--ink); }

@media (max-width: 940px) {
  .nav-links, .nav-actions .nav-phone { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bone); border-bottom: 1px solid var(--line);
    padding: 1rem var(--gutter) 1.6rem;
  }
  .nav-links.open a { font-size: 1.1rem; padding: 0.6em 0; width: 100%; border-bottom: 1px solid var(--line-soft); }
  .nav-links.open .btn { margin-top: 0.8rem; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--forest-deep); }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20,26,17,0.55) 0%, rgba(20,26,17,0.15) 38%, rgba(20,26,17,0.62) 100%),
    linear-gradient(90deg, rgba(20,26,17,0.66) 0%, rgba(20,26,17,0.1) 62%);
}
.hero-inner { position: relative; z-index: 2; padding-block: clamp(5.5rem, 15vh, 11rem); }
.hero .eyebrow { color: #f0c9a0; }
.hero .eyebrow::before { background: #f0c9a0; }
.hero h1 { color: #fdfbf5; max-width: 16ch; margin-top: 1.3rem; }
.hero .lede { color: rgba(253,251,245,0.85); margin-top: 1.6rem; max-width: 52ch; }
.hero-actions { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero-meta {
  position: relative; z-index: 2; border-top: 1px solid rgba(238,231,214,0.18);
  display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 5vw, 4rem); padding-block: 1.6rem;
}
.hero-meta div { color: rgba(253,251,245,0.9); }
.hero-meta .k { font-family: var(--serif); font-size: 1.35rem; display: block; }
.hero-meta .l { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(253,251,245,0.6); }

/* ---------- Marquee / trust strip ---------- */
.trust { background: var(--forest); color: var(--on-dark); }
.trust .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem 2rem; padding-block: 1.1rem; }
.trust-item { display: inline-flex; align-items: center; gap: 0.6em; font-size: 0.82rem; letter-spacing: 0.06em; color: var(--on-dark-soft); }
.trust-item strong { color: var(--on-dark); font-weight: 600; }
.trust-item svg { color: #d9a66f; flex: none; }

/* ---------- Section headings ---------- */
.sec-head { max-width: 46rem; }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head .eyebrow { margin-bottom: 1.1rem; }
.sec-head p.lede { margin-top: 1.2rem; }

/* ---------- Feature cards ---------- */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.3rem); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
  height: 100%;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 24px 50px -34px rgba(27,26,22,0.45); border-color: var(--sand-line); }
.card .num { font-family: var(--serif); font-size: 0.95rem; color: var(--clay); letter-spacing: 0.05em; }
.card h3 { font-family: var(--serif); font-size: var(--step-1); margin: 0.9rem 0 0.6rem; font-weight: 420; }
.card p { color: var(--ink-soft); font-size: 0.98rem; }
.card-ico { width: 40px; height: 40px; color: var(--forest); margin-bottom: 1.1rem; }

/* plain feature (no card) */
.feat h3 { font-family: var(--serif); font-size: var(--step-1); font-weight: 420; margin-bottom: 0.5rem; }
.feat p { color: var(--ink-soft); font-size: 0.98rem; }
.feat .card-ico { margin-bottom: 0.9rem; }

/* ---------- Figure / imagery ---------- */
.figure { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bone-deep); }
.figure img { width: 100%; height: 100%; object-fit: cover; }
.figure.tall { aspect-ratio: 4 / 5; }
.figure.wide { aspect-ratio: 16 / 11; }
.figure.square { aspect-ratio: 1 / 1; }
.figure-tag {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 2;
  background: rgba(27,26,22,0.72); color: var(--bone); backdrop-filter: blur(4px);
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  padding: 0.5em 0.9em; border-radius: 100px;
}
.stamp {
  position: absolute; z-index: 3; right: -14px; top: -14px;
  width: 116px; height: 116px; color: var(--clay);
}

/* ---------- Spec / analysis ---------- */
.spec {
  background: var(--forest); color: var(--on-dark); border-radius: var(--radius);
  padding: clamp(1.8rem, 3.4vw, 2.8rem);
}
.spec h3 { font-family: var(--serif); color: #fff; font-size: var(--step-2); font-weight: 400; }
.spec .eyebrow { color: #d9a66f; } .spec .eyebrow::before { background: #d9a66f; }
.spec-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid rgba(238,231,214,0.16); }
.spec-row:last-child { border-bottom: 0; }
.spec-row .label { color: var(--on-dark-soft); font-size: 0.95rem; }
.spec-row .val { font-family: var(--serif); font-size: 1.7rem; color: #fff; }
.spec-row .val small { font-size: 0.85rem; color: var(--on-dark-soft); font-family: var(--sans); }

.spec-note { font-size: 0.8rem; color: var(--on-dark-soft); margin-top: 1.4rem; line-height: 1.55; }

/* ---------- Data table (spread rates) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table.rate { width: 100%; border-collapse: collapse; min-width: 520px; }
table.rate caption { text-align: left; font-family: var(--serif); font-size: var(--step-1); padding: 1.3rem 1.4rem 0.2rem; font-weight: 440; }
table.rate th, table.rate td { text-align: left; padding: 0.95rem 1.4rem; font-size: 0.96rem; }
table.rate thead th { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; border-bottom: 1px solid var(--line); }
table.rate tbody tr { border-bottom: 1px solid var(--line-soft); }
table.rate tbody tr:last-child { border-bottom: 0; }
table.rate td.use { font-weight: 500; }
table.rate td.rate-val { font-family: var(--serif); font-size: 1.05rem; white-space: nowrap; }
table.rate tbody tr:hover { background: var(--bone); }

/* ---------- Steps / process ---------- */
.steps { counter-reset: step; display: grid; gap: clamp(1.5rem, 3vw, 2.4rem); }
.step { display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: start; padding-bottom: clamp(1.5rem,3vw,2.4rem); border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; padding-bottom: 0; }
.step .idx { counter-increment: step; font-family: var(--serif); font-size: 1.5rem; color: var(--clay); width: 2.6rem; }
.step .idx::before { content: counter(step, decimal-leading-zero); }
.step h3 { font-family: var(--serif); font-size: var(--step-1); font-weight: 420; margin-bottom: 0.4rem; }
.step p { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Pull / quote ---------- */
.pull { border-left: 2px solid var(--clay); padding-left: clamp(1.2rem, 3vw, 2.2rem); }
.pull blockquote { margin: 0; font-family: var(--serif); font-size: var(--step-2); line-height: 1.3; font-weight: 380; color: var(--ink); }
.pull cite { display: block; margin-top: 1.2rem; font-style: normal; font-size: 0.9rem; letter-spacing: 0.04em; color: var(--ink-faint); }

/* ---------- Two-tone panels ---------- */
.panel-sand { background: var(--bone-deep); }
.panel-paper { background: var(--paper); }

/* ---------- CTA band ---------- */
.cta {
  position: relative; overflow: hidden; color: var(--on-dark);
  background: var(--forest-deep);
}
.cta::before {
  content: ""; position: absolute; inset: 0; opacity: 0.14;
  background: radial-gradient(circle at 82% 18%, #d9a66f 0, transparent 42%),
              radial-gradient(circle at 12% 88%, #6c7a53 0, transparent 46%);
}
.cta .wrap { position: relative; z-index: 2; }
.cta h2 { color: #fff; max-width: 20ch; }
.cta .lede { color: rgba(238,231,214,0.82); }

/* ---------- Contact form ---------- */
.form { display: grid; gap: 1.15rem; }
.field { display: grid; gap: 0.4rem; }
.field.row-2 { grid-template-columns: 1fr 1fr; gap: 1.15rem; }
@media (max-width: 560px) { .field.row-2 { grid-template-columns: 1fr; } }
.field label { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--ink-soft); }
.field label .req { color: var(--clay); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 0.98rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--sand-line); border-radius: var(--radius);
  padding: 0.8em 0.95em; width: 100%; transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 128px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(44,56,38,0.12);
}
.form-note { font-size: 0.82rem; color: var(--ink-faint); }
.form-success { display: none; background: var(--forest); color: var(--on-dark); padding: 1.2rem 1.4rem; border-radius: var(--radius); }
.form-success.show { display: block; }

.contact-cards { display: grid; gap: 1.1rem; }
.contact-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.3rem 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.contact-card svg { color: var(--clay); flex: none; margin-top: 2px; }
.contact-card .t { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; margin-bottom: 0.25rem; }
.contact-card .v { font-size: 1.05rem; font-weight: 500; }
.contact-card a.v:hover { color: var(--clay); }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest-deep); color: var(--on-dark-soft); padding-block: clamp(3.2rem, 6vw, 5rem) 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: clamp(2rem, 4vw, 3.5rem); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-sub { color: var(--on-dark-soft); }
.footer-blurb { margin-top: 1.1rem; max-width: 34ch; font-size: 0.92rem; line-height: 1.6; color: var(--on-dark-soft); }
.footer-col h4 { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: #d9a66f; margin-bottom: 1.1rem; font-family: var(--sans); font-weight: 700; }
.footer-col a, .footer-col p { display: block; color: var(--on-dark-soft); font-size: 0.92rem; padding: 0.35em 0; transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.6rem; border-top: 1px solid rgba(238,231,214,0.14); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: 0.8rem; }
.footer-bottom .tm { max-width: 62ch; line-height: 1.5; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Misc ---------- */
.kicker-list { display: grid; gap: 0.9rem; }
.kicker-list li { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: start; font-size: 0.98rem; color: var(--ink-soft); }
.kicker-list li svg { color: var(--clay); margin-top: 4px; flex: none; }
.tag { display: inline-block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--forest); background: var(--sand); padding: 0.4em 0.85em; border-radius: 100px; }
.grade-badge { font-family: var(--serif); font-size: 0.85rem; color: var(--clay); }
.overline-num { font-family: var(--serif); font-size: clamp(2.4rem,5vw,3.6rem); color: var(--sand-line); line-height: 1; }
.anchor-offset { scroll-margin-top: 96px; }
