/* ============================================================================
   PETERSBURG VETERINARY CLINIC / CORNERSTONE ANIMAL HOSPITAL
   Design tokens. Drop this in first; build everything else on top of it.

   Every value here was sampled from the supplied logo artwork
   (Petersburg Vet Sign_FINAL.pdf / circle.pdf) or derived from it.
   DO NOT substitute "close enough" colours — these are the brand.

   Print equivalents (for signage / print handoff, not for CSS):
     Navy = PANTONE 2766 C      Gold = PANTONE 7574
   ========================================================================= */

:root {
  /* ---- Core brand ------------------------------------------------------ */
  --navy:        #121C4D;   /* primary ground. The sign field.               */
  --navy-deep:   #0C1338;   /* footer, scrims, pressed states                */
  --navy-mid:    #223879;   /* hairlines & dividers ON navy only             */
  --gold:        #C49A6C;   /* keylines, icons, rules, display accents       */
  --gold-lt:     #D9BC97;   /* hover / highlight                            */
  --bronze:      #9C765A;   /* engraving shade, pressed gold — GRAPHICS ONLY */
  --bronze-dk:   #7F5E42;   /* the text-safe bronze. Eyebrows/labels on      */
                            /* light grounds. Plain --bronze is only 3.72:1  */
                            /* on cream and FAILS AA for text.               */
  --cream:       #F8F4EC;   /* page ground. Never use pure #FFF as the page. */
  --cream-deep:  #EFE7D8;   /* alternating band, card ground on cream        */
  --white:       #FFFFFF;   /* card surfaces, reversed type                  */
  --ink:         #1E2233;   /* body copy on cream                            */
  --ink-soft:    #55596B;   /* secondary copy, captions                      */

  /* ---- Restricted ------------------------------------------------------ */
  /* Barn red is the ONLY colour not present in the logo. It exists because
     the emergency line is the single most important function on this site
     and gold cannot signal urgency. USE IT FOR NOTHING ELSE.               */
  --barn:        #8C2F27;
  --barn-lt:     #A8463C;

  /* ---- Cornerstone only ------------------------------------------------ */
  /* Tempered from the legacy Cornerstone ribbon (#508DF9), which is far too
     saturated to sit beside the navy/gold. Cornerstone uses the same core
     palette plus this one hue for links, rules and the banner.             */
  --corner-blue:     #3E6FB0;
  --corner-blue-dk:  #2E568C;

  /* ---- Type ------------------------------------------------------------ */
  /* Display = Bodoni Moda. The sign is a fat-face Didone (very heavy stems,
     thin flat serifs, high contrast) with Bodoni numerals — NOT a Clarendon
     slab. Bodoni Moda at 700-900, all caps, tracked, is a near-exact match. */
  --font-display: "Bodoni Moda", "Didot", "Bodoni MT", Georgia, serif;
  /* Body = Libre Franklin. American gothic; heritage-correct next to the
     Didone and highly legible for the older rural audience this clinic
     actually serves.                                                       */
  --font-body:    "Libre Franklin", "Franklin Gothic", Helvetica, Arial, sans-serif;

  --track-display: .06em;   /* letter-spacing for display caps              */
  --track-eyebrow: .18em;   /* letter-spacing for small caps eyebrows       */

  /* Fluid type scale. min 360px viewport -> max 1280px. */
  --fs-eyebrow: clamp(0.688rem, 0.65rem + 0.19vw, 0.75rem);
  --fs-small:   clamp(0.813rem, 0.78rem + 0.16vw, 0.875rem);
  --fs-body:    clamp(1rem,     0.96rem + 0.20vw, 1.125rem);
  --fs-lead:    clamp(1.125rem, 1.05rem + 0.38vw, 1.375rem);
  --fs-h4:      clamp(1.125rem, 1.05rem + 0.38vw, 1.375rem);
  --fs-h3:      clamp(1.375rem, 1.24rem + 0.68vw, 1.875rem);
  --fs-h2:      clamp(1.75rem,  1.50rem + 1.25vw, 2.75rem);
  --fs-h1:      clamp(2.25rem,  1.75rem + 2.50vw, 4.25rem);

  --lh-tight: 1.06;   /* display caps                                       */
  --lh-snug:  1.25;   /* sub-heads                                          */
  --lh-body:  1.65;   /* body copy — generous, the audience skews older     */

  /* ---- Spacing (8px base) ---------------------------------------------- */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 96px;  --s-10: 128px;

  --section-y:   clamp(56px, 4vw + 40px, 112px);  /* vertical section rhythm */
  --gutter:      clamp(20px, 4vw, 48px);
  --measure:     60ch;    /* max line length for body copy                  */
  --wrap:        1200px;  /* max content width                              */
  --wrap-narrow: 780px;

  /* ---- The sign keyline ------------------------------------------------ */
  /* Lifted literally from the sign: a gold rule inset from the panel edge,
     with navy showing outside it. This is THE signature device.            */
  --keyline-w:      3px;
  --keyline-inset:  clamp(12px, 1.6vw, 20px);

  /* ---- Radius & elevation ---------------------------------------------- */
  /* Heritage signage is square. Keep radii minimal; the medallion supplies
     all the roundness this identity needs.                                 */
  --r-sm: 2px;
  --r-md: 4px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(12,19,56,.08), 0 2px 6px rgba(12,19,56,.06);
  --shadow-md: 0 2px 6px rgba(12,19,56,.10), 0 10px 24px rgba(12,19,56,.10);

  --dur: 180ms;
  --ease: cubic-bezier(.32,.72,.32,1);
}

/* ============================================================================
   CONTRAST RULES — these are not suggestions.

   All ratios below were computed, not estimated.

   PASS (WCAG AA or better):
     ink       #1E2233 on cream #F8F4EC  -> 14.37:1  body copy        AAA
     ink-soft  #55596B on cream #F8F4EC  ->  6.32:1  captions         AA
     white     #FFFFFF on navy  #121C4D  -> 16.17:1  reversed body    AAA
     gold      #C49A6C on navy  #121C4D  ->  6.30:1  reversed body    AA
     gold-lt   #D9BC97 on navy  #121C4D  ->  8.92:1  reversed body    AAA
     white     #FFFFFF on barn  #8C2F27  ->  8.23:1  emergency bar    AAA
     barn      #8C2F27 on cream #F8F4EC  ->  7.50:1  emergency text   AAA
     bronze-dk #7F5E42 on cream #F8F4EC  ->  5.34:1  eyebrows/labels  AA
     white     #FFFFFF on cblue #3E6FB0  ->  5.12:1  Cornerstone      AA
     cblue     #3E6FB0 on cream #F8F4EC  ->  4.66:1  Cornerstone link AA

   FAIL — never do these:
     gold   #C49A6C on cream #F8F4EC  ->  2.34:1  Gold on a light ground is
       DECORATIVE ONLY: rules, keylines, icon strokes >=24px, and display
       type >=32px. It must never carry body copy, labels, or links.
     gold   #C49A6C on white #FFFFFF  ->  2.57:1  Same rule.
     bronze #9C765A on cream #F8F4EC  ->  3.72:1  Graphics only. For text on
       a light ground use --bronze-dk instead.
     navy-mid #223879 on navy         ->  1.47:1  Hairlines only, never type.
   ========================================================================= */

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 900;
  /* CRITICAL — do not remove. Bodoni Moda is optical-size variable. At its
     display optical size (opsz 96) the hairlines are so fine they disappear on
     screen and headings become genuinely hard to read. Pinning opsz LOW gives
     us the cut drawn for small text, whose hairlines are far sturdier, while
     keeping the heavy-stem / thin-flat-serif character of the sign. This is
     what optical sizing is for. Tested against the sign artwork.            */
  font-variation-settings: "opsz" 8;
  text-transform: uppercase;
  letter-spacing: var(--track-display);
  line-height: var(--lh-tight);
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 800; }

h4 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: 0;
  text-transform: none;
  margin: 0 0 var(--s-3);
}

p { margin: 0 0 var(--s-4); max-width: var(--measure); }

/* Small-caps eyebrow that sits above section headings. */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-eyebrow);
  color: var(--bronze-dk);   /* NOT --bronze: that fails AA at this size */
  margin: 0 0 var(--s-3);
}
.on-navy .eyebrow, .sign-panel .eyebrow { color: var(--gold); }

/* ---- The sign-outline display effect ------------------------------------- */
/* Reproduces the sign's white letterform with a gold outline. Use ONLY for
   the hero wordmark and at >=40px — it collapses into mud below that.
   paint-order is supported in all current browsers; the @supports fallback
   drops to plain white type rather than a broken double-stroke.            */
.sign-type {
  color: var(--white);
  -webkit-text-stroke: 3px var(--gold);
  paint-order: stroke fill;
}
@supports not (paint-order: stroke) {
  .sign-type { -webkit-text-stroke: 0; color: var(--white); }
}

/* ---- Focus: visible on every ground -------------------------------------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.on-navy :where(a, button):focus-visible { outline-color: var(--gold-lt); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
