/* ==========================================================================
   theonlywangwhocares — Emery Wang, licensed insurance agent
   Mobile-first. Built as a single-goal landing page: every route leads to
   the contact form at #contact.
   ========================================================================== */

:root {
  --cream: #fbf8f4;
  --surface: #ffffff;
  --tint: #f3eee6;
  --ink: #17211e;
  --muted: #5f6b66;
  --brand: #0f5f52;
  --brand-dark: #0b4a40;
  --brand-soft: #e3efeb;
  --accent: #d9744f;
  --line: rgba(23, 33, 30, 0.12);
  --line-soft: rgba(23, 33, 30, 0.07);
  --shadow-sm: 0 1px 2px rgba(23, 33, 30, 0.06), 0 4px 12px rgba(23, 33, 30, 0.04);
  --shadow-md: 0 2px 6px rgba(23, 33, 30, 0.06), 0 12px 32px rgba(23, 33, 30, 0.08);
  --shadow-lg: 0 4px 12px rgba(23, 33, 30, 0.07), 0 24px 56px rgba(23, 33, 30, 0.10);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --pad: 1.25rem;
  --maxw: 1160px;
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 700px) { :root { --pad: 2.5rem; } }
@media (min-width: 1100px) { :root { --pad: 3.5rem; } }

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

html {
  scroll-behavior: smooth;
  /* Anchored sections clear the sticky header instead of hiding under it. */
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.wrap--narrow { max-width: 760px; }

/* ---------- Type ---------- */
.h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 5.5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 0;
  text-wrap: balance;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0;
}

.lede {
  font-size: 1.0625rem;
  color: var(--muted);
  margin: 0.85rem 0 0;
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  padding: 0.9rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 100px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s,
              transform 0.2s var(--ease), box-shadow 0.2s;
  /* Comfortable thumb target on phones. */
  min-height: 48px;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--ink); background: rgba(23, 33, 30, 0.03); }

.btn--lg { font-size: 1rem; padding: 1.05rem 1.75rem; min-height: 54px; }
.btn--sm { font-size: 0.875rem; padding: 0.7rem 1.1rem; min-height: 42px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.is-busy .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(251, 248, 244, 0.85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.header.is-stuck { border-bottom-color: var(--line-soft); box-shadow: var(--shadow-sm); }

.header__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.75rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.logo__mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.logo__text { font-size: 0.9375rem; white-space: nowrap; }
.logo__text em { font-style: normal; color: var(--brand); }

.header__nav { display: none; gap: 1.75rem; font-size: 0.9375rem; }
.header__nav a { text-decoration: none; color: var(--muted); transition: color 0.2s; }
.header__nav a:hover { color: var(--ink); }

.header__cta { display: none; }

@media (min-width: 900px) {
  .header__nav { display: flex; }
  .header__cta { display: inline-flex; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.section--tint { background: var(--tint); }
.section--contact { background: var(--brand-soft); }

.section__head { margin-bottom: clamp(2rem, 5vw, 3rem); max-width: 640px; }
.section__head--center { max-width: 620px; margin-inline: auto; text-align: center; }
.section__head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: none;
}

.section__cta { margin-top: clamp(2rem, 5vw, 3rem); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3rem, 8vw, 5.5rem); }

.hero__grid {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  gap: clamp(2rem, 6vw, 4rem);
}

.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.25rem, 8.5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0.75rem 0 0;
  text-wrap: balance;
}
.hero__title em { font-style: italic; color: var(--brand); }

.hero__sub {
  font-size: clamp(1.0625rem, 2.2vw, 1.1875rem);
  color: var(--muted);
  margin: 1.25rem 0 0;
  max-width: 46ch;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}
.trust strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}

.hero__portrait { position: relative; }
.hero__portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero__badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border-radius: 100px;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}
.hero__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(15, 95, 82, 0.5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(15, 95, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 95, 82, 0); }
}

@media (min-width: 860px) {
  .hero__grid { grid-template-columns: 1.15fr 0.85fr; align-items: center; }
  .hero__portrait img { max-height: 560px; }
}

/* ---------- About ---------- */
.about { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
.about__media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.about__body p { color: var(--muted); margin: 1rem 0 0; text-wrap: pretty; }

.creds {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.creds li { padding-left: 1.5rem; position: relative; }
.creds li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

@media (min-width: 860px) {
  .about { grid-template-columns: 0.85fr 1.15fr; align-items: center; }
  .about__media img { aspect-ratio: 4 / 5; }
}

/* ---------- Cards ---------- */
.cards { display: grid; gap: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card__num {
  font-family: var(--serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.06em;
}
.card h3 {
  font-family: var(--serif);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0.5rem 0 0.5rem;
}
.card p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

@media (min-width: 620px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; } }

.notfor {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(217, 116, 79, 0.05);
}
.notfor h3 {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--accent);
}
.notfor p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

/* ---------- Steps ---------- */
.steps { margin-top: clamp(2.5rem, 6vw, 4rem); }
.steps__list { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
.steps__list li { display: flex; gap: 1rem; align-items: flex-start; }
.steps__list span {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-family: var(--serif);
  font-weight: 600;
}
.steps__list h3 { font-size: 1.0625rem; font-weight: 600; margin: 0.35rem 0 0.2rem; }
.steps__list p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

@media (min-width: 800px) { .steps__list { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

/* ---------- Testimonial carousel ---------- */
.carousel__controls { display: none; gap: 0.5rem; }
@media (min-width: 800px) { .carousel__controls { display: flex; } }

.cbtn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}
.cbtn:hover:not([disabled]) { background: var(--brand); border-color: var(--brand); color: #fff; }
.cbtn[disabled] { opacity: 0.35; cursor: default; }

/* Card is deliberately narrower than the viewport so the next one peeks in —
   that sliver is what tells people the row swipes. */
.carousel { position: relative; --card-w: min(80vw, 360px); }

.carousel__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Side runway of half the leftover width, so the FIRST and LAST cards can
     actually reach the centre. Without it scrollLeft bottoms out at 0 and the
     opening card can never become the active one. */
  padding: 0.75rem max(var(--pad), calc(50% - var(--card-w) / 2)) 1.75rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  cursor: grab;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.carousel__track.is-dragging .tcard { pointer-events: none; }

.tcard {
  flex: 0 0 auto;
  width: var(--card-w);
  scroll-snap-align: center;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  /* JS nudges these per-card for the stacked-depth effect. */
  transform-origin: center;
  will-change: transform;
}

.tcard__quote p {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.5;
  margin: 0;
  text-wrap: pretty;
}

.tcard__who { display: flex; align-items: center; gap: 0.85rem; }
.tcard__who img {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--tint);
}
.tcard__who strong { display: block; font-size: 0.9375rem; }
.tcard__who span { display: block; font-size: 0.8125rem; color: var(--muted); }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: var(--pad);
}
.carousel__dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
  transition: background-color 0.25s, transform 0.25s var(--ease);
}
.carousel__dots button.is-active { background: var(--brand); transform: scale(1.4); }

@media (min-width: 800px) {
  .carousel { --card-w: 380px; }
  .carousel__track { gap: 1.25rem; }
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0.75rem; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 0 1.25rem;
  box-shadow: var(--shadow-sm);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: 1.15rem 2rem 1.15rem 0;
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--brand);
  transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0; padding: 0 0 1.25rem; color: var(--muted); font-size: 0.9375rem; }

/* ---------- Form ---------- */
.form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 1.15rem;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.9375rem; font-weight: 500; }
.req { color: var(--accent); }
.opt { color: var(--muted); font-weight: 400; font-size: 0.875rem; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  /* 16px minimum stops iOS Safari zooming the page on focus. */
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  min-height: 50px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 95, 82, 0.12);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--accent); }

.err { margin: 0; font-size: 0.8125rem; color: var(--accent); min-height: 0; }

.field-row { display: grid; gap: 1.15rem; }
@media (min-width: 620px) { .field-row { grid-template-columns: 1fr 1fr; } }

.field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.7rem;
  font-size: 0.9375rem;
}
.field--check input {
  width: 22px;
  height: 22px;
  min-height: 0;
  margin-top: 0.1rem;
  accent-color: var(--brand);
  padding: 0;
}
.field--check label { font-weight: 400; color: var(--muted); }
.field--check .err { grid-column: 1 / -1; }

.form__note { margin: 0; font-size: 0.8125rem; color: var(--muted); text-align: center; }
.form__note a { color: var(--brand); }

.form__status { margin: 0; font-size: 0.9375rem; text-align: center; }
.form__status.is-ok { color: var(--brand); font-weight: 500; }
.form__status.is-bad { color: var(--accent); }

.form.is-sent { text-align: center; }
.form__done { padding: clamp(1rem, 4vw, 2rem) 0; }
.form__done .h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); }
.form__done strong { color: var(--ink); }

.fallback { text-align: center; margin: 1.5rem 0 0; font-size: 0.9375rem; color: var(--muted); }
.fallback a { color: var(--brand); font-weight: 500; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: rgba(251, 248, 244, 0.75);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  font-size: 0.875rem;
}
.footer .logo__text { color: var(--cream); }
.footer .logo__text em { color: #7fd4c2; }
.footer .logo__mark { background: #7fd4c2; color: var(--ink); }

.footer__top {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(251, 248, 244, 0.14);
}
.footer__nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.footer__nav a { text-decoration: none; transition: color 0.2s; }
.footer__nav a:hover { color: var(--cream); }

.disclosure {
  margin: 1.75rem 0 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: rgba(251, 248, 244, 0.5);
  max-width: 75ch;
}
.copyright { margin: 1.25rem 0 0; font-size: 0.8125rem; }

@media (min-width: 700px) {
  .footer__top { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- Sticky mobile CTA ---------- */
.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  padding: 0.75rem var(--pad) calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(251, 248, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
  transform: translateY(110%);
  transition: transform 0.35s var(--ease);
}
.mobile-cta.is-visible { transform: translateY(0); }

/* Keep the bar from covering the end of the footer. */
body { padding-bottom: 5.5rem; }

@media (min-width: 900px) {
  .mobile-cta { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- Motion ---------- */
/* .reveal elements are deliberately NOT hidden here. js/main.js hides them
   with gsap.set() only after confirming GSAP loaded, so a blocked CDN can
   never leave the page invisible. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .carousel__track { scroll-behavior: auto; }
}
