/* ==========================================================================
   Mills Value Adviser site styles
   Palette drawn from the firm's logo: bronze #958069 / #a08973, brown #422d1b
   Typography: system serif for display (Charter/Sitka/Georgia), system sans body
   ========================================================================== */

:root {
  /* Weathered paper + navy ink + bronze. Light values stay warm (parchment);
     dark bands are navy-ink, not brown. Bronze stays as the logo accent. */
  --ink: #161f2b;
  --espresso: #1f2b3a;
  --brown: #26374d;
  --bronze: #958069;
  --bronze-text: #77654e; /* darker bronze for small text on light backgrounds (AA 4.5:1) */
  --bronze-light: #b3a08c;
  --bronze-soft: #d8ccbc;
  --cream: #faf8f4;
  --paper: #f3eee6;
  --line: #e6ddcf;
  --text: #2f3340;
  --muted: #66635b;
  --white: #ffffff;
  --serif: "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 72rem;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 23, 16, 0.06), 0 8px 24px rgba(31, 23, 16, 0.07);
}

/* --- Reset / base ------------------------------------------------------- */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5.5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.375rem; line-height: 1.3; }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brown); text-decoration-color: var(--bronze-light); text-underline-offset: 3px; }
a:hover { color: var(--bronze); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze-text);
  margin-bottom: 1rem;
}

.quote-band .eyebrow { color: var(--bronze-light); }

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-intro { max-width: 44rem; }
.section-intro p { color: var(--muted); font-size: 1.125rem; }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.9rem 1.6rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

/* Motion hovers are for hover-capable (mouse) devices only; on touch they
   trigger on tap and stick, which reads as glitchy */
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22, 31, 43, 0.18); }
  .btn:active { transform: translateY(0); box-shadow: none; }
}

.btn-primary { background: var(--brown); color: var(--cream); }
.btn-primary:hover { background: var(--espresso); color: var(--white); }

.btn-outline { background: transparent; color: var(--brown); border-color: var(--bronze-light); }
.btn-outline:hover { border-color: var(--brown); color: var(--ink); background: rgba(149, 128, 105, 0.08); }

.btn-light { background: var(--cream); color: var(--brown); }
.btn-light:hover { background: var(--white); }

.btn-outline-light { background: transparent; color: var(--cream); border-color: rgba(250, 248, 244, 0.45); }
.btn-outline-light:hover { border-color: var(--cream); color: var(--white); background: rgba(250, 248, 244, 0.08); }

.btn-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* --- Header / nav ------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled { box-shadow: 0 4px 20px rgba(22, 31, 43, 0.09); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  margin-right: auto;
}

.brand img { width: 42px; height: auto; }

.brand-name {
  /* Palatino, matching the old Webflow lockup Chris and Cam liked */
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.9875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0;
  position: relative;
}

/* Hover underline is a desktop-nav affordance only */
@media (min-width: 56rem) and (hover: hover) {
  .nav-links a:not(.btn):not([aria-current="page"])::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--bronze);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
  }

  .nav-links a:not(.btn):not([aria-current="page"]):hover::after { transform: scaleX(1); }
}

.nav-links a:hover { color: var(--bronze); }
.nav-links a[aria-current="page"] {
  color: var(--brown);
  box-shadow: inset 0 -2px 0 var(--bronze);
}

.nav-links .btn { padding: 0.65rem 1.15rem; font-size: 0.9375rem; }
.nav-links a.btn[aria-current="page"] { box-shadow: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
}

.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (max-width: 55.9rem) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 0.25rem 1.5rem 1.5rem;
    box-shadow: var(--shadow);
  }

  .nav-links.open { display: flex; animation: menu-in 0.22s ease; }

  .nav-links a {
    display: block;
    padding: 0.95rem 0.25rem;
    font-size: 1.0625rem;
    border-bottom: 1px solid rgba(149, 128, 105, 0.22);
  }
  .nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 transparent; color: var(--bronze); }
  .nav-links li:last-child a:not(.btn) { border-bottom: 0; }
  .nav-links .btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    text-align: center;
    border: 1px solid var(--bronze-light);
  }

  .nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--espresso) 0%, var(--ink) 60%, #10151d 100%);
  color: var(--cream);
}

.hero::after {
  /* Bronze monogram watermark, kept fully inside the hero so the whole mark reads */
  content: "";
  position: absolute;
  right: clamp(1rem, 5vw, 5rem);
  top: 50%;
  transform: translateY(-50%);
  width: min(30rem, 42vw);
  aspect-ratio: 1963 / 943;
  background: url("../assets/mv-monogram.svg") no-repeat center / contain;
  opacity: 0.14;
  pointer-events: none;
  animation: watermark-in 1.4s ease-out 0.3s backwards;
}

@keyframes watermark-in {
  from { opacity: 0; }
}

/* Hero content entrance: gentle staggered rise on page load */
.hero-inner > * { animation: rise-in 0.7s ease-out backwards; }
.hero-inner > *:nth-child(2) { animation-delay: 0.1s; }
.hero-inner > *:nth-child(3) { animation-delay: 0.2s; }
.hero-inner > *:nth-child(4) { animation-delay: 0.3s; }

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* Painting heroes: YCBA watercolors carried over from the old site.
   The painting lives on ::before (its own layer, so it can drift slowly);
   ::after is repurposed from the watermark into the flat dim overlay. */
.hero-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: hero-drift 50s ease-in-out infinite alternate;
}

.hero-image::after {
  inset: 0;
  width: auto;
  aspect-ratio: auto;
  transform: none;
  opacity: 1;
  background: rgba(26, 19, 12, 0.52);
  animation: none;
}

@keyframes hero-drift {
  from { transform: scale(1); }
  to { transform: scale(1.045); }
}

.hero-image .hero-inner { text-shadow: 0 1px 3px rgba(26, 19, 12, 0.45); }
.hero-image .eyebrow {
  color: var(--cream);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(26, 19, 12, 0.7), 0 1px 8px rgba(26, 19, 12, 0.5);
}

.hero-boat::before { background-image: url("../assets/hero-boat.webp"); }

.hero-boat2::before {
  background-image: url("../assets/hero-boat2.webp");
  background-position: 50% 62%;
}

/* Give the compact painting hero enough height for the ship to read */
.hero-compact.hero-image .hero-inner { padding-block: clamp(4.5rem, 10vw, 7rem); }

.hero-washington::before {
  background-image: url("../assets/hero-washington.webp");
  background-position: 36% 32%;
}

.hero-washington::after { background: rgba(26, 19, 12, 0.5); }

.hero-washington .hero-inner { padding-block: clamp(4.5rem, 9vw, 7rem); }

@media (max-width: 47.9rem) {
  .hero-boat::before { background-image: url("../assets/hero-boat-sm.webp"); }
  .hero-boat2::before { background-image: url("../assets/hero-boat2-sm.webp"); }
  .hero-washington::before { background-image: url("../assets/hero-washington-sm.webp"); }
  .hero-boat::after, .hero-boat2::after { background: rgba(26, 19, 12, 0.6); }
  .hero-washington::after { background: rgba(26, 19, 12, 0.55); }
}

/* 2K / ultrawide viewports and retina laptops get the 2560px paintings */
@media (min-width: 100rem), (min-resolution: 144dpi) and (min-width: 48rem) {
  .hero-boat::before { background-image: url("../assets/hero-boat-xl.webp"); }
  .hero-boat2::before { background-image: url("../assets/hero-boat2-xl.webp"); }
  .hero-washington::before { background-image: url("../assets/hero-washington-xl.webp"); }
}

/* Centered hero (About): white emblem over the painting, like the old site */
.hero-center .hero-inner {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
}

.hero-center .hero-inner .btn-group { justify-content: center; }

.hero-emblem {
  width: min(20rem, 60vw);
  margin: 0 auto 1.75rem;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.35));
}

.hero .container { position: relative; z-index: 1; }

.hero-inner { padding-block: clamp(4.5rem, 11vw, 8.5rem); max-width: 46rem; }

.hero h1 { color: var(--white); margin-bottom: 1.25rem; }

.hero .eyebrow { color: var(--bronze-light); }

.hero p.lede {
  font-size: clamp(1.0625rem, 2vw, 1.1875rem);
  color: rgba(250, 248, 244, 0.85);
  margin-bottom: 2rem;
  max-width: 40rem;
}

.hero-compact .hero-inner { padding-block: clamp(3.5rem, 8vw, 5.5rem); }

/* --- Trust bar ---------------------------------------------------------- */

.trust-bar { background: var(--paper); border-bottom: 1px solid var(--line); }

.trust-bar ul {
  list-style: none;
  margin: 0;
  padding: 1.1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  justify-content: center;
}

.trust-bar li {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.trust-bar li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bronze);
  flex-shrink: 0;
}

/* --- Service cards ------------------------------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

/* In the 2-across range, let an odd last card span the full row
   instead of orphaning next to an empty cell */
@media (min-width: 35rem) and (max-width: 55.9rem) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .card-grid .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    border-color: var(--bronze-soft);
    box-shadow: 0 2px 4px rgba(22, 31, 43, 0.06), 0 14px 32px rgba(22, 31, 43, 0.12);
  }
}

.card svg { color: var(--bronze); margin-bottom: 1.1rem; }

.card h3 { margin-bottom: 0.5rem; }

.card p { color: var(--muted); font-size: 1rem; }

/* --- Quote band --------------------------------------------------------- */

.quote-band { background: var(--espresso); color: var(--cream); }

.quote-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.quote-band blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.6vw, 1.625rem);
  line-height: 1.5;
  color: var(--white);
}

.quote-band blockquote::before {
  content: "\201C";
  display: block;
  font-size: 4rem;
  line-height: 0.6;
  color: var(--bronze);
  margin-bottom: 1.25rem;
}

.quote-band cite {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.9375rem;
  color: var(--bronze-light);
}

.portrait { position: relative; max-width: 22rem; justify-self: center; }

.portrait img {
  border-radius: var(--radius);
  border: 1px solid rgba(179, 160, 140, 0.35);
}

.portrait figcaption {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--bronze);
}

.portrait figcaption strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.0625rem;
  color: var(--white);
}

.portrait figcaption span { font-size: 0.875rem; color: var(--bronze-light); }

@media (max-width: 47.9rem) {
  .quote-grid { grid-template-columns: 1fr; }
  .portrait { justify-self: start; }
}

/* --- Split section (history) -------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.split-media img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

@media (max-width: 47.9rem) {
  .split { grid-template-columns: 1fr; }
}

.text-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--brown);
}
.text-link::after {
  content: "\2192";
  display: inline-block;
  margin-left: 0.35em;
  transition: transform 0.2s ease;
}
.text-link:hover { color: var(--bronze); }

@media (hover: hover) {
  .text-link:hover::after { transform: translateX(4px); }
}

/* --- CTA band ----------------------------------------------------------- */

.cta-band { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.cta-inner { max-width: 50rem; margin-inline: auto; text-align: center; }

.cta-inner .btn-group { justify-content: center; margin-top: 2rem; }

.risk-note {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
  text-align: left;
}

/* --- Article (about, disclosures, privacy) ------------------------------ */

.article { max-width: 46rem; }

.article h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
}

.article h2:first-child { margin-top: 0; }

.article p { color: var(--text); }

.doc-meta {
  font-size: 0.9375rem;
  color: var(--muted);
  border-left: 3px solid var(--bronze);
  padding-left: 1rem;
  margin: 2rem 0;
}

.doc-links {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}

.doc-links ul { margin: 0; padding-left: 1.2rem; }
.doc-links li { margin-bottom: 0.5rem; }
.doc-links li:last-child { margin-bottom: 0; }

/* --- Contact ------------------------------------------------------------ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

@media (max-width: 47.9rem) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-list { list-style: none; margin: 2rem 0 0; padding: 0; }

.contact-list li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.contact-list li:last-child { border-bottom: 0; }

.contact-list svg { color: var(--bronze); flex-shrink: 0; margin-top: 0.2rem; }

.contact-list .label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-field { margin-bottom: 1.25rem; }

.form-field label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.form-field .optional { font-weight: 400; color: var(--muted); }

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.form-field select { cursor: pointer; }
.form-field select:invalid { color: var(--muted); }

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid var(--bronze);
  outline-offset: 0;
  border-color: var(--bronze);
}

.form-field textarea { min-height: 9rem; resize: vertical; }

.form-consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.form-consent input { margin-top: 0.3rem; accent-color: var(--brown); }

.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.form-status { margin-top: 1rem; font-size: 0.9875rem; display: none; }
.form-status.success { display: block; color: #2e6b34; }
.form-status.error { display: block; color: #a13333; }

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: rgba(250, 248, 244, 0.75);
  font-size: 0.9375rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
  padding-block: 3.5rem 2.5rem;
}

@media (max-width: 47.9rem) {
  .footer-top { grid-template-columns: 1fr; }
}

.footer-brand img { width: 150px; margin-bottom: 1.25rem; }

.footer-heading {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bronze-light);
  margin-bottom: 1rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.6rem; }

.site-footer a { color: rgba(250, 248, 244, 0.85); text-decoration: none; }
.site-footer a:hover { color: var(--bronze-light); text-decoration: underline; }

.footer-legal {
  border-top: 1px solid rgba(179, 160, 140, 0.2);
  padding-block: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  font-size: 0.875rem;
  color: rgba(250, 248, 244, 0.55);
}

.footer-legal ul { display: flex; gap: 1.5rem; }
.footer-legal li { margin: 0; }

.footer-disclosure {
  padding-bottom: 2rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(250, 248, 244, 0.5);
  max-width: 60rem;
}

/* --- Scroll reveal -------------------------------------------------------
   Hidden states only exist under html.js-motion, which main.js adds when JS
   is running AND the visitor has not requested reduced motion. No-JS and
   reduced-motion visitors always see the full page. */

html.js-motion .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

html.js-motion .reveal.revealed {
  opacity: 1;
  transform: none;
}

/* --- Utility ------------------------------------------------------------ */

.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
