/* Smilewave site styles. One file for the whole site.
   Colours and fonts live in :root below. Change a value once here and it changes everywhere.
   Palette: porcelain base, deep sea-teal ink, soft sand accent. Deliberately not the orange
   of the original logo artwork (about #F08848).
   Every text/background pair below passes WCAG AA (checked: see README "Colours"). */

/* ---------- Fonts (self-hosted, latin subset, variable; same files as the SmileForge site) ---------- */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 500;
  font-display: swap;
  src: url("/assets/fonts/fraunces-italic-latin.woff2") format("woff2");
}

:root {
  --bg: #F7F5F1;          /* porcelain page background */
  --bg-alt: #E8F0ED;      /* sea-mist band */
  --surface: #FFFFFF;     /* cards */
  --ink: #12312F;         /* text (12.8:1 on --bg) */
  --text: #4A5B59;        /* secondary text (6.6:1 on --bg) */
  --brand: #1E6B64;       /* sea teal: buttons, links, logo (5.8:1 on --bg, white on it 6.3:1) */
  --brand-deep: #0F3E3A;  /* dark bands, footer, hover */
  --sand: #D8C3A0;        /* accent on dark only (6.9:1 on --brand-deep) */
  --on-dark: #F7F5F1;
  --on-dark-muted: #B9CCC7;
  --hairline: #D6DFDC;
  --hairline-dark: #295A55;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1200px;
  --gutter: 20px;
  --radius: 18px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
html.nav-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (min-width: 900px) {
  body { font-size: 17px; }
  :root { --gutter: 48px; --header-h: 80px; }
}

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

h1, h2, h3 { font-family: var(--serif); font-weight: 350; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 6.4vw, 5rem); letter-spacing: -0.03em; line-height: 1.04; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 1.8vw, 1.45rem); font-weight: 450; line-height: 1.25; letter-spacing: -0.01em; }
h1 em, h2 em { font-style: italic; font-weight: 300; color: var(--brand); }
.on-dark h1 em, .on-dark h2 em { color: var(--sand); }
p, ul, ol { margin: 0 0 1em; }

a { color: var(--brand); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-deep); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible, #site-footer :focus-visible { outline-color: var(--sand); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.muted { color: var(--text); }
.lead { font-size: clamp(1.08rem, 1.4vw, 1.25rem); line-height: 1.6; color: var(--text); max-width: 56ch; }
.small { font-size: .9rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px;
}
.skip-link { position: absolute; left: 8px; top: -80px; z-index: 200; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 8px; }
.skip-link:focus { top: 8px; color: var(--bg); }

.eyebrow {
  display: block; font-size: .75rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--brand); margin: 0 0 18px;
}
.on-dark .eyebrow { color: var(--sand); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  background: var(--brand); color: #FFFFFF; border: 1px solid var(--brand);
  font: inherit; font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #FFFFFF; }
.btn-line { background: transparent; color: var(--brand); }
.btn-line:hover { background: var(--brand); color: #FFFFFF; }
.on-dark .btn { background: var(--on-dark); color: var(--brand-deep); border-color: var(--on-dark); }
.on-dark .btn:hover { background: #FFFFFF; color: var(--brand-deep); }
.on-dark .btn-line { background: transparent; color: var(--on-dark); border-color: var(--on-dark-muted); }
.on-dark .btn-line:hover { background: var(--on-dark); color: var(--brand-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " \2192"; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; color: var(--brand); text-decoration: none; }
.logo:hover { color: var(--brand-deep); }
.logo svg { height: 40px; width: auto; }
.logo-word { font-family: var(--serif); font-weight: 500; font-variation-settings: "opsz" 144; }
#site-footer .logo { color: var(--on-dark); }
#site-footer .logo svg { height: 46px; }

/* ---------- Header ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--hairline); } /* no backdrop-filter: it would trap the fixed mobile menu */
#site-header { position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: var(--header-h); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; white-space: nowrap; font-weight: 500; font-size: .95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--brand); }
.nav-toggle { display: none; }
.noscript-nav { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px var(--gutter); }

@media (max-width: 899px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
    background: transparent; border: 1px solid var(--hairline); border-radius: 999px;
    font: inherit; font-weight: 600; color: var(--ink); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
  .nav-toggle-bars::before { content: ""; position: absolute; top: 6px; }
  .nav-toggle-bars { top: -3px; }
  .site-nav { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); padding: 24px var(--gutter); overflow-y: auto; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--hairline); }
  .site-nav a:not(.btn) { display: block; padding: 16px 0; font-size: 1.2rem; border-bottom: 0; }
  .site-nav .nav-cta { border: 0; padding-top: 24px; }
  .site-nav .nav-cta .btn { width: 100%; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--bg-alt); }
.on-dark { background: var(--brand-deep); color: var(--on-dark); }
.on-dark .muted, .on-dark .lead { color: var(--on-dark-muted); }
.on-dark a:not(.btn) { color: var(--on-dark); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.split { display: grid; gap: 40px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(72px, 11vw, 150px) 0 clamp(64px, 9vw, 120px); background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%); }
.hero .wrap { position: relative; z-index: 1; }
.hero-waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(90px, 14vw, 180px); color: var(--brand); opacity: .14; pointer-events: none; }
.page-hero { padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--hairline); }

/* Cards */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 26px 24px; height: 100%; }
.card h3 { margin-bottom: .35em; }
.card p { color: var(--text); margin: 0; font-size: .95rem; }
.card a { text-decoration: none; color: inherit; display: block; height: 100%; }
.card:has(a:hover) { border-color: var(--brand); }
.card-more { display: inline-block; margin-top: 14px; color: var(--brand); font-weight: 600; font-size: .9rem; }
.card-more::after { content: " \2192"; }

/* Principles list */
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.principles li { border-top: 1px solid var(--hairline); padding: 22px 0; }
.on-dark .principles li { border-top-color: var(--hairline-dark); }
.principles strong { display: block; font-family: var(--serif); font-weight: 450; font-size: 1.25rem; margin-bottom: 4px; }
@media (min-width: 900px) { .principles { grid-template-columns: 1fr 1fr; column-gap: 48px; } }

/* Service detail (services page) */
.service { display: grid; gap: 12px; padding: 40px 0; border-top: 1px solid var(--hairline); }
.service:first-child { border-top: 0; padding-top: 0; }
.service h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 0; }
.service p { color: var(--text); margin: 0 0 .6em; }
@media (min-width: 900px) { .service { grid-template-columns: 1fr 1.6fr; gap: 56px; } }

/* Visit / contact */
.address { font-style: normal; font-size: 1.1rem; line-height: 1.6; }
.facts { list-style: none; padding: 0; margin: 24px 0 0; }
.facts li { padding: 12px 0; border-top: 1px solid var(--hairline); display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.facts li > span:first-child { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text); padding-top: 3px; }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--hairline); background: var(--bg-alt); aspect-ratio: 4 / 3; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.note { background: var(--surface); border-left: 4px solid var(--brand); border-radius: 8px; padding: 18px 20px; color: var(--text); }
.note strong { color: var(--ink); }

/* CTA band */
.cta { text-align: center; }
.cta .lead { margin-left: auto; margin-right: auto; }
.cta .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
#site-footer { background: var(--brand-deep); color: var(--on-dark-muted); font-size: .95rem; }
#site-footer a { color: var(--on-dark); }
.footer-grid { display: grid; gap: 40px; padding: 64px 0 40px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h2 { font-family: var(--sans); font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--sand); margin: 0 0 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-legal { border-top: 1px solid var(--hairline-dark); padding: 24px 0 40px; font-size: .85rem; }
.footer-legal p { margin: 0 0 .5em; max-width: 90ch; }
.footer-addr { margin-top: 18px; }

/* Policy pages (long-form legal text) and the footer policy links */
.prose { max-width: calc(70ch + 2 * var(--gutter)); }
/* Manrope and Fraunces turn "(c)" into a copyright sign via contextual alternates; legal text must show it literally. */
.policy { font-feature-settings: "calt" 0, "liga" 0, "dlig" 0; font-variant-ligatures: none; }
.policy h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 1.2em; }
.policy h2 { font-size: 1.15rem; margin: 2.2em 0 .8em; }
.policy-entity { color: var(--text); font-size: .9rem; margin: 0 0 1.5em; }
.clause-list { list-style: none; padding-left: 1.5em; }
.clause-list li { margin-bottom: .6em; }
.clause-no { font-weight: 700; margin-right: .3em; }
.table-scroll { overflow-x: auto; margin: 1.5em 0; }
.policy table { border-collapse: collapse; font-size: .85rem; min-width: 640px; }
.policy th, .policy td { border: 1px solid var(--hairline); padding: .5em; text-align: left; vertical-align: top; }
.policy td { height: 2.5em; }
.footer-policies ul { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-wrap: wrap; gap: 6px 24px; }
