/* ==========================================================================
   WEBB EYECARE — DESIGN SYSTEM
   Palette is locked by the brand guidelines. Roles below are our decisions.
   Depth comes from surface layering, never from drop shadows.
   ========================================================================== */

:root {
  /* --- The tint ladder. Depth is built by stacking these, not by shadows. --- */
  --paper:      #FFFFFF;   /* dominant ground */
  --tint:       #DCEAF8;   /* Pale Blue — section surfaces */
  --tint-deep:  #CFE1F4;   /* one step down, for surface-on-surface */
  --haze:       #A9C8EA;   /* Soft Light Blue — arcs, rings, decoration */
  --signal:     #0070B8;   /* Webb Blue — CTAs, eyebrows, active states ONLY */
  --ink:        #005C99;   /* Deep Blue — the ONLY saturated dark. Headings, links */
  --ink-press:  #004A7C;   /* pressed state for ink surfaces */
  --text:       #222222;   /* Charcoal — body copy. Never pure black */
  --text-soft:  #55606B;   /* secondary copy */
  --muted:      #666666;   /* caption/meta TEXT. Brand Medium Gray #8E8E8E is only 3.3:1 on white,
                             under the 4.5:1 minimum for small text, so text uses this; the
                             brand gray survives as --gray-mark for dots and other non-text marks */
  --gray-mark:  #8E8E8E;   /* Medium Gray, non-text only */
  --on-ink-soft: #C9DDEE;  /* secondary TEXT on Deep Blue: 5:1. Soft Light Blue is only 4.06:1 */
  --signal-text: var(--signal); /* Webb Blue used AS TEXT. Swapped to Deep Blue on pale blue, below */
  --rule:       #E8E8E8;   /* Light Gray — hairlines */

  /* --- Type --- */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Fluid type scale. Body never drops below 17px — this brand's documented
     weakness is copy too small to read on a phone. */
  --fs-label: 0.75rem;
  --fs-small: 0.9375rem;
  --fs-body:  clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  --fs-lead:  clamp(1.1875rem, 0.7vw + 1.05rem, 1.375rem);
  --fs-h3:    clamp(1.375rem, 1vw + 1.1rem, 1.75rem);
  --fs-h2:    clamp(2rem, 3vw + 1.1rem, 3.25rem);
  --fs-h1:    clamp(2.6rem, 5.4vw + 1rem, 5.25rem);
  --fs-mega:  clamp(4rem, 13vw, 13rem);

  /* --- Space --- */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 62ch;
  --wrap: 1240px;
  --wrap-narrow: 780px;
  --section-y: clamp(4.5rem, 9vw, 8.5rem);

  /* --- One radius system. No exceptions. --- */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 28px;
  --r-pill: 999px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: .45s;
}

/* --------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------------------------------------------------------------- type -- */
h1, h2, h3, h4 {
  font-family: var(--display);
  /* Fraunces variable axes: soft edges, minimal wonk. Light weight always —
     weight comes from size and space, never from thickness. */
  font-variation-settings: "SOFT" 55, "WONK" 0, "opsz" 40;
  font-weight: 300;
  color: var(--ink);
  line-height: 1.06;
  letter-spacing: -0.022em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.026em; }
h3 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.015em; }

/* The signature type move: an italic phrase inside a roman headline.
   Used once per heading, on the words that carry the meaning. */
.em {
  font-style: italic;
  font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 40;
  color: var(--signal-text);
}

p { margin: 0 0 1.15em; max-width: var(--measure); }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--text-soft); }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--signal-text); }

/* Eyebrow label — a tracking treatment on the body face, not a third family. */
.eyebrow {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--signal-text);
  margin: 0 0 1.1rem;
  display: block;
}
.eyebrow--quiet { color: var(--muted); }

/* -------------------------------------------------------------- layout -- */
.wrap { width: min(100% - (var(--gutter) * 2), var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - (var(--gutter) * 2), var(--wrap-narrow)); margin-inline: auto; }
.section { padding-block: var(--section-y); }

/* Surfaces. Stacking these is how depth is made. */
.surface-tint { background: var(--tint); }
/* Brand rule: never Webb Blue text on Pale or Soft Light Blue (it is 4.28:1, failing AA for
   small text). Every pale-blue container switches blue text and icons to Deep Blue.
   Buttons keep Webb Blue: they use --signal as a background, not as text. */
.surface-tint, .page-hero, .door, .hub-card, .program--big, .callout, .person, .rating-band,
.half, .mission, .mapframe__legend, .mapload, .icon-chip, .ph, .picker__card.is-usual { --signal-text: var(--ink); }
.surface-ink  { background: var(--ink); color: #E8F1F9; }
.surface-ink h1, .surface-ink h2, .surface-ink h3 { color: var(--paper); }
.surface-ink .eyebrow { color: var(--on-ink-soft); }
.surface-ink p { color: #C9DDEE; }
.surface-ink a { color: var(--paper); }

.hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--body); font-size: var(--fs-small); font-weight: 600;
  line-height: 1; text-decoration: none; cursor: pointer;
  padding: 1.05rem 1.6rem; border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

.btn--primary { background: var(--signal); color: #fff; }
.btn--primary:hover { background: var(--ink); color: #fff; }

.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: #fff; }

.btn--ghost { color: var(--ink); padding-inline: .25rem; }
.btn--ghost:hover { color: var(--signal-text); }

.btn--on-ink { background: var(--paper); color: var(--ink); }
.btn--on-ink:hover { background: var(--tint); color: var(--ink); }
/* Buttons must keep their own colors inside .surface-ink, whose generic
   `a { color: paper }` rule otherwise outranks them (0,1,1 vs 0,1,0). */
.surface-ink .btn--on-ink, .surface-ink .btn--on-ink:hover { color: var(--ink); }

.btn--outline-light { border-color: rgba(255,255,255,.85); background: transparent; }
.surface-ink .btn--outline-light { color: var(--paper); }
.surface-ink .btn--outline-light:hover { background: var(--paper); color: var(--ink); }

.btn__arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ------------------------------------------------- the ring motif ------- */
/* Three interlocking lens rings, taken straight from the wordmark. In the
   practice these are trial lenses — the flippers stacked in front of your eye
   until things resolve. Used as the page's one recurring device. */
.rings { position: absolute; pointer-events: none; z-index: 0; color: var(--haze); }
.rings ellipse { fill: none; stroke: currentColor; stroke-width: 1.25; }

/* -------------------------------------------------------------- header -- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.site-header[data-stuck="true"] { border-bottom-color: var(--rule); }
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; height: 78px; }
.site-header__logo { display: block; width: 82px; color: var(--signal-text); flex: none; } /* 82px wide = 67px tall: fits the 78px bar with room */
.site-header__logo svg { width: 100%; height: auto; }

.nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.nav__link {
  position: relative; text-decoration: none; color: var(--text); white-space: nowrap;
  font-size: inherit; font-weight: inherit; /* same as the dropdown buttons, which inherit too */
  padding: .55rem .7rem; border-radius: var(--r-sm);
  transition: color var(--dur) var(--ease);
}
.nav__link::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .3rem;
  height: 1.5px; background: var(--signal);
  transform: scaleX(0); transform-origin: left; border-radius: 2px;
  transition: transform var(--dur) var(--ease);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--ink); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* Reordering contacts is high-intent but low-volume next to booking, so it is a
   utility link, not a second competing button. */
.nav__util {
  margin-left: .9rem; font-size: .875rem; font-weight: 600; color: var(--signal-text);
  text-decoration: none; white-space: nowrap;
}
.nav__util:hover { text-decoration: underline; text-underline-offset: 3px; }
.nav__util:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.header-cta { margin-left: .75rem; white-space: nowrap; flex: none; } /* one line, always a true pill */

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: var(--r-sm); color: var(--ink);
}
.nav-toggle:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: currentColor; margin: 5px auto; transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 1279px) {
  .nav, .header-cta, .nav__util { display: none; }
  .nav-toggle { display: block; }
}

/* mobile drawer */
.mobile-nav { display: none; border-top: 1px solid var(--rule); background: var(--paper); }
.mobile-nav[data-open="true"] { display: block;
  /* The open menu is taller than a phone screen: it scrolls on its own, between the header
     and the bottom call bar, and the page behind it is locked (QA 2026-10-01). */
  max-height: calc(100vh - 78px - 56px); max-height: calc(100dvh - 78px - 56px);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
html.menu-open, html.menu-open body { overflow: hidden; }
.mobile-nav ul { list-style: none; margin: 0; padding: .75rem var(--gutter) 1.5rem; }
.mobile-nav a:not(.btn) { display: block; padding: .9rem 0; text-decoration: none;
  color: var(--text); font-weight: 500; border-bottom: 1px solid var(--rule); }
.mobile-nav .btn { display: flex; margin-top: 1.1rem; width: 100%; justify-content: center; }

/* ---------------------------------------------------- sticky call bar --- */
/* Mobile only. Half this audience is on a phone and wants to call, not type. */
.callbar {
  position: fixed; inset: auto 0 0 0; z-index: 70;
  display: none; gap: 1px; background: var(--rule);
  border-top: 1px solid var(--rule);
}
.callbar a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--paper); color: var(--ink); text-decoration: none;
  font-size: .9rem; font-weight: 600; padding: .95rem .5rem;
}
.callbar a.is-primary { background: var(--signal); color: #fff; }
@media (max-width: 760px) {
  .callbar { display: flex; }
  body { padding-bottom: 56px; }
}
@media (max-width: 460px) { .callbar a { font-size: .78rem; padding-inline: .25rem; } }

/* -------------------------------------------------------------- footer -- */
.site-footer { background: var(--ink); color: #C9DDEE; padding-block: clamp(3.5rem,7vw,6rem) 0; }
.site-footer a { color: #E8F1F9; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-grid { display: grid; gap: clamp(2rem,4vw,3.5rem); grid-template-columns: 1.4fr 1fr 1fr 1fr; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col__label { font-family: var(--body); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .16em; color: var(--on-ink-soft); font-weight: 600; margin-bottom: 1.1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; font-size: var(--fs-small); }
.footer__logo { width: 132px; color: #fff; margin-bottom: 1.25rem; }
.footer__logo svg { width: 100%; height: auto; }

/* The oversized wordmark closing the page — borrowed from Lassie/Menkind. */
.footer-mega {
  font-family: var(--display); font-weight: 300;
  font-variation-settings: "SOFT" 55, "WONK" 0, "opsz" 144;
  font-size: var(--fs-mega); line-height: .78; letter-spacing: -0.045em;
  color: rgba(255,255,255,.09);
  text-align: center; margin: clamp(3rem,7vw,5.5rem) 0 -0.12em;
  user-select: none; overflow: hidden;
}
.footer-legal { border-top: 1px solid rgba(255,255,255,.14); margin-top: 2.5rem; padding-block: 1.5rem; font-size: .8125rem; color: var(--on-ink-soft); display: flex; flex-wrap: wrap; gap: 1rem 2rem; }

/* ----------------------------------------------------- scroll reveal ----
   Content is visible by default. Only once JS has confirmed it can run does
   it get hidden for the entrance animation. Nothing is ever hidden by CSS
   alone — if the script fails, the page still reads. */
.js-anim .reveal { opacity: 0; transform: translateY(20px); }
.js-anim .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .js-anim .reveal, .js-anim .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* ------------------------------------------------------------ a11y ------ */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .9rem 1.3rem; border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { left: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------- nav About group --
   One dropdown holding the three trust pages (team, reviews, community) so
   the bar stays at six items. Opens on hover and on focus/click. */
.nav__group { position: relative; display: flex; }
.nav__trigger { display: inline-flex; align-items: center; gap: .3rem;
  background: none; border: 0; font: inherit; cursor: pointer; }
.nav__trigger svg { transition: transform .18s ease; }
.nav__group[data-open="true"] .nav__trigger svg { transform: rotate(180deg); }

.nav__menu { position: absolute; top: calc(100% + .55rem); left: 50%;
  transform: translateX(-50%) translateY(-4px); width: 288px; padding: .5rem;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r-md); box-shadow: 0 12px 32px -18px rgba(0,60,100,.35);
  display: grid; gap: .1rem; z-index: 60;
  opacity: 0; visibility: hidden; transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.nav__group:hover .nav__menu,
.nav__group[data-open="true"] .nav__menu,
.nav__menu:focus-within { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.nav__menu a { display: block; padding: .6rem .7rem; border-radius: 10px;
  text-decoration: none; color: var(--ink); font-size: .9375rem; font-weight: 600; line-height: 1.3; }
.nav__menu a span { display: block; font-weight: 400; font-size: .8125rem;
  color: var(--text-soft); margin-top: .12rem; }
.nav__menu a:hover, .nav__menu a:focus-visible { background: var(--tint); }
@media (prefers-reduced-motion: reduce) { .nav__menu { transition: none; } }
@media (max-width: 960px) { .nav__group { display: none; } }

/* social links — real marks, not a third-party follow widget */
.site-footer .social { display: inline-flex; align-items: center; gap: .42rem;
  margin-right: 1.05rem; text-decoration: none; }
.site-footer .social svg { flex: none; opacity: .82; transition: opacity .15s ease; }
.site-footer .social:hover svg, .site-footer .social:focus-visible svg { opacity: 1; }
.site-footer .social span { font-size: .875rem; }

/* Footer column labels: group labels, not document headings. */
.footer-col__label { font-size: .72rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--on-ink-soft); font-weight: 600; margin: 0 0 .85rem; }

/* WCAG 2.2 target size: footer links and breadcrumbs sat at 20-23px tall. */
.footer-col a, .site-footer .social, .crumbs a, .crumb a {
  display: inline-block; padding-block: .22rem; }
.footer-col li { margin-bottom: .1rem; }

/* Inline links inside a sentence are exempt from WCAG target size, but phone
   numbers are the one inline link people actually tap on a phone. */
/* Bigger tap target for bare phone links. Must not touch a phone number that
   is styled as a button — .btn owns its own box. */
a[href^="tel:"]:not(.btn):not(.callbar a) { display: inline-block; padding-block: .18rem; } /* the call bar centers its own links */
.legal a:not(.btn), .site-footer__legal a:not(.btn) { display: inline-block; padding-block: .22rem; }

/* second-level items in the flat mobile list — indented, not nested menus */
.mobile-nav__sub a { padding-left: 1.6rem; font-size: .9375rem; color: var(--text-soft); }
.mobile-nav__sub a::before { content: "—"; margin-right: .5rem; color: var(--haze); }


/* --------------------------------------------- specialty comparison ------ */
/* "Where do I go for vision therapy?" was answerable only by visiting three
   pages and remembering. One grid answers it. Scrolls inside itself on a
   phone rather than pushing the page sideways. */
.spec-table__scroll { overflow-x: auto; margin-top: 1.9rem; -webkit-overflow-scrolling: touch; }
.spec-table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: var(--fs-small); }
.spec-table th, .spec-table td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--rule); }
.spec-table thead th {
  font-family: var(--body); font-size: var(--fs-label); text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-soft); font-weight: 600;
  border-bottom: 1px solid var(--haze); white-space: nowrap;
}
.spec-table tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.spec-table tbody th a { color: inherit; text-decoration: none; }
.spec-table tbody th a:hover { color: var(--signal-text); text-decoration: underline; text-underline-offset: 3px; }
.spec-table tbody tr:last-child th, .spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table .yes { display: inline-flex; align-items: center; gap: .4rem; color: var(--signal-text); font-weight: 600; }
.spec-table .no  { color: var(--text-soft); }
/* Phones: four columns do not fit, and a sideways-scrolling table hid Bridgeport entirely.
   Each specialty becomes a small card that lists all three clinics down the side. */
@media (max-width: 640px) {
  .spec-table__scroll { overflow: visible; }
  .spec-table { min-width: 0; }
  .spec-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .spec-table, .spec-table tbody, .spec-table tr, .spec-table th, .spec-table td { display: block; }
  .spec-table tr { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md);
    padding: .9rem 1rem .35rem; margin-bottom: .75rem; }
  .spec-table tbody th { padding: 0 0 .4rem; border-bottom: 0; white-space: normal; font-size: 1rem; }
  .spec-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: .55rem 0; text-align: right; }
  .spec-table tbody tr td:last-child { border-bottom: 0; }
  .spec-table td::before { content: attr(data-l); color: var(--text); font-weight: 500; text-align: left; }
}

/* an icon inside a button takes the button's text color, so it never vanishes on a blue fill */
.btn .ic { color: currentColor; }

/* Tablets: once the layout drops to one column, a full-width 4:5 photo is ~700px wide and ~880px
   tall, too big for the screen and softer than the file. Cap it and center it. */
@media (min-width: 561px) and (max-width: 940px) {
  .framed, .page-hero__media { max-width: 520px; margin-inline: auto; width: 100%; }
}

/* Readable line breaks: no lone last word in paragraphs and leads (QA 2026-10-01). */
p, .lead, li { text-wrap: pretty; }

/* Footer legal row on phones: one item per line instead of a ragged wrap. */
@media (max-width: 460px) { .footer-legal { flex-direction: column; gap: .5rem; } }

.nowrap { white-space: nowrap; }
/* A box that opens with a heading must not inherit the article's large heading gap. */
.callout > :first-child { margin-top: 0; }
