/* ==========================================================================
   Elder CPA page layout. Consumes tokens from styleguide.css only.
   Solid fills, square corners, no background patterns.
   ========================================================================== */

/* ---- Sections ---------------------------------------------------------------- */
.section { padding-block: var(--space-9); }
.section-stone { background: var(--color-stone); }

/* A short solid bar above each section title stands in for eyebrow text. */
.section-title {
  font-size: var(--text-2xl);
}
.section-title::before {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-bottom: var(--space-5);
  background: var(--color-accent);
}
.section-intro {
  max-width: 44rem;
  margin-top: var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}
.lead {
  color: var(--color-heading);
  font-size: var(--text-xl);
  line-height: 1.5;
}

.split { display: grid; gap: var(--space-6); }
.split-body { max-width: 42rem; }
.split-body > p:not(.lead) { color: var(--color-text-muted); }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-8); }
}

/* ---- Header ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--color-rule);
  background: var(--color-white);
}
.site-header.is-compact { height: auto; box-shadow: 0 1px 8px rgb(20 32 46 / 0.08); }
.site-header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: 4.5rem;
}
.wordmark {
  margin: 0 auto 0 0;
  color: var(--color-navy);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}
.wordmark:hover { color: var(--color-navy); }
.wordmark-suffix { font-weight: 400; }

.site-nav { display: none; }
.site-nav ul { display: flex; gap: var(--space-6); list-style: none; }
.site-nav a {
  display: block;
  padding-block: var(--space-2);
  border-bottom: 2px solid transparent;
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { border-bottom-color: var(--color-navy); color: var(--color-navy); }
.site-header-cta { min-height: 2.75rem; padding: 0.5rem 1.25rem; }
@media (min-width: 760px) {
  .site-nav { display: block; }
}

/* ---- Hero ---------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden; /* the 3D canvas bleeds past its column; clip at the hero edge */
  background: var(--color-navy);
  color: var(--color-on-navy);
}
.hero-grid {
  display: grid;
  gap: var(--space-7);
  padding-block: var(--space-8) 0;
}
.hero-copy { padding-bottom: var(--space-2); }
.hero-title {
  max-width: 16ch;
  color: var(--color-on-navy);
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.025em;
}
.hero-lede {
  max-width: 34rem;
  margin-top: var(--space-5);
  color: var(--color-on-navy-muted);
  font-size: var(--text-lg);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.hero :focus-visible { outline-color: var(--color-focus-on-navy); }

/* The hero visual column: poster first, live 3D canvas layered over it. */
.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 22rem);
  margin: 0;
}
.hero-scene {
  position: relative;
  aspect-ratio: 3 / 4;
  width: 100%;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}
/* Poster and canvas share one box that bleeds a little past the column, so
   shapes are not cut at its edges and the two line up during the crossfade. */
.hero-poster {
  position: absolute;
  inset: -4% -12%;
  width: 124%;
  height: 108%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 0.9s ease;
}
.hero-canvas {
  position: absolute;
  inset: -4% -12%;
  width: 124%;
  height: 108%;
  display: block;
  opacity: 0;
  transition: opacity 0.9s ease;
  touch-action: pan-y;
  cursor: default;
}
.hero-scene.is-live .hero-poster { opacity: 0; }
.hero-scene.is-live .hero-canvas { opacity: 1; }

/* On narrow screens the poster and canvas stay inside the column. */
@media (max-width: 767.98px) {
  .hero-poster, .hero-canvas { inset: 0; width: 100%; height: 100%; }
}
/* Poster only for people who prefer reduced motion. The loader also declines
   to start the scene; this rule is the guarantee if the preference changes
   after the scene has mounted. */
@media (prefers-reduced-motion: reduce) {
  .hero-canvas { display: none; }
  .hero-poster, .hero-canvas { transition: none; }
  .hero-scene.is-live .hero-poster { opacity: 1; }
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
    align-items: end;
    gap: var(--space-8);
    padding-top: var(--space-9);
  }
  .hero-copy { align-self: center; padding-bottom: var(--space-9); }
  .hero-visual { justify-self: end; width: min(100%, 26rem); }
  .hero-scene { aspect-ratio: auto; height: clamp(30rem, 60vh, 38rem); margin-top: calc(-1 * var(--space-6)); }
}

/* ---- Services -------------------------------------------------------------- */
.services {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-7);
}
@media (min-width: 900px) {
  .services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.service {
  padding: var(--space-6);
  border-top: 4px solid var(--color-navy);
  background: var(--color-white);
}
.service-name { font-size: var(--text-xl); }
.service-level {
  margin: var(--space-2) 0 var(--space-4);
  color: var(--color-accent-hover);
  font-size: var(--text-sm);
  font-weight: 600;
}
.service p:last-child { color: var(--color-text-muted); font-size: var(--text-sm); }
.standards-note {
  max-width: 44rem;
  margin-top: var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* ---- Josh ---------------------------------------------------------------------- */
.split-aside { display: grid; gap: var(--space-6); align-content: start; }
.josh-portrait {
  position: relative;
  width: min(100%, 22rem);
  margin: 0;
}
.josh-portrait img { width: 100%; aspect-ratio: 668 / 835; object-fit: cover; }
/* The "Josh Elder, CPA / Founder and principal" card sits with the photo. */
.josh-caption {
  display: grid;
  padding: var(--space-3) var(--space-4);
  background: var(--color-white);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  border-left: 4px solid var(--color-accent);
  box-shadow: 0 6px 20px rgb(7 22 39 / 0.12);
}
.josh-caption strong { color: var(--color-heading); font-weight: 600; }
@media (min-width: 900px) {
  /* The card floats over the bottom left of the photo and hangs past its edge. */
  .josh-portrait { margin-bottom: var(--space-4); }
  .josh-caption { position: absolute; left: -1.5rem; bottom: 1.5rem; box-shadow: 0 6px 20px rgb(7 22 39 / 0.25); }
}
.credentials {
  display: grid;
  margin-top: var(--space-7);
  border-top: 1px solid var(--color-rule);
}
.credentials > div {
  display: grid;
  gap: var(--space-1);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-rule);
}
@media (min-width: 640px) {
  .credentials > div { grid-template-columns: 10rem 1fr; gap: var(--space-5); }
}
.credentials dt { color: var(--color-text-muted); font-size: var(--text-sm); }
.credentials dd { color: var(--color-heading); font-weight: 600; }

/* ---- Contact --------------------------------------------------------------------- */
.contact-grid { display: grid; gap: var(--space-7); }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--space-8); align-items: start; }
}
.contact-copy .lead { margin-top: var(--space-5); }
.contact-copy > p:not(.lead) { color: var(--color-text-muted); }

.form-card {
  padding: clamp(1.25rem, 0.75rem + 2vw, 2.5rem);
  border-top: 4px solid var(--color-navy);
  background: var(--color-white);
}
.form-grid { display: grid; gap: var(--space-5); }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-wide { grid-column: 1 / -1; }
}
.field { display: grid; gap: 0.35rem; align-content: start; }
.field label { color: var(--color-heading); font-size: var(--text-sm); font-weight: 600; }
.field-optional { color: var(--color-text-muted); font-weight: 400; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border-field);
  border-radius: var(--radius);
  background: var(--color-field);
  color: var(--color-text);
  font: inherit;
  font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2314202e' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--color-ink); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
  border-color: var(--color-focus);
}
.field [aria-invalid="true"] { border-color: var(--color-error); box-shadow: inset 0 0 0 1px var(--color-error); }
.field-error { color: var(--color-error); font-size: var(--text-sm); font-weight: 600; }
.field-hint { color: var(--color-text-muted); font-size: var(--text-xs); }
.field-error[hidden], .form-status[hidden] { display: none; }
.honeypot-field { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.form-status {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--color-navy);
  background: var(--color-stone);
  color: var(--color-text);
  font-size: var(--text-sm);
}
.form-submit { margin-top: var(--space-6); }
.form-success-title { color: var(--color-heading); font-size: var(--text-xl); font-weight: 600; }
.form-success p + p { color: var(--color-text-muted); }

/* ---- Footer ------------------------------------------------------------------ */
.site-footer {
  padding-block: var(--space-7) var(--space-6);
  background: var(--color-navy);
  color: var(--color-on-navy-muted);
}
.site-footer-inner { display: grid; gap: var(--space-3); }
.wordmark-footer { color: var(--color-on-navy); }
.footer-meta { margin: 0; font-size: var(--text-sm); }
.footer-base {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-rule-on-navy);
  font-size: var(--text-xs);
}
