/* ==========================================================================
   Crane Cove Health — site styles
   Design tokens live in :root. Change colors, type, and spacing there.
   ========================================================================== */

:root {
  /* Color */
  --color-bg: #ffffff;
  --color-surface: #f3f7f9;      /* cool off-white section background */
  --color-tint: #e8f5f2;         /* soft mint for the contact band */
  --color-text: #0c1c26;         /* primary text, near-black ink */
  --color-muted: #3f5361;        /* secondary text (≈8:1 on white) */
  --color-line: #d8e3e8;         /* hairlines and dividers */
  --color-accent: #0a716d;       /* teal accent (≈5.8:1 on white) */
  --color-accent-strong: #075955;
  --color-accent-soft: #5fb8ad;  /* decorative only, never for text */
  --color-focus: #0b63c4;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 0.4vw + 1.03rem, 1.3125rem);
  --text-h3: 1.25rem;
  --text-h2: clamp(1.75rem, 2.2vw + 1.1rem, 2.75rem);
  --text-h1: clamp(2.5rem, 4.4vw + 1.2rem, 4.5rem);

  /* Spacing & layout */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --max-width: 1120px;
  --measure: 38rem;
  --radius: 10px;
  --header-h: 72px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-accent-strong);
}

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

svg {
  display: block;
}

.container {
  width: 100%;
  max-width: calc(var(--max-width) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-text);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button--primary {
  background: var(--color-text);
  color: #fff;
}

.button--primary:hover {
  background: var(--color-accent-strong);
  color: #fff;
}

.button--small {
  min-height: 44px;
  padding: 0.625rem 1rem;
}

.button svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom-color: rgba(216, 227, 232, 0.7);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  color: var(--color-text);
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark:hover {
  color: var(--color-text);
}

.wordmark__mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.site-nav__list {
  display: flex;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.75rem;
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
}

.site-nav__list a:hover {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Sections (shared)
   -------------------------------------------------------------------------- */

.section {
  padding-block: var(--section-y);
}

.section--surface {
  background: var(--color-surface);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: var(--space-3);
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.section__title {
  max-width: 22ch;
  font-size: var(--text-h2);
}

.lede {
  display: grid;
  gap: var(--space-2);
  max-width: var(--measure);
  color: var(--color-muted);
  font-size: var(--text-lg);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3rem, 6vw, 5rem);
  background:
    radial-gradient(60% 70% at 85% 30%, rgba(95, 184, 173, 0.12), transparent 70%),
    var(--color-bg);
}

.hero__inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

.hero__title {
  font-size: clamp(2.5rem, 3.6vw + 1.2rem, 4.25rem);
  letter-spacing: -0.032em;
  line-height: 1.04;
}

.hero__line {
  display: block;
}

.hero__line + .hero__line {
  color: var(--color-accent);
}

.hero__copy {
  margin-top: var(--space-4);
  max-width: 34rem;
  color: var(--color-muted);
  font-size: var(--text-lg);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--space-5);
}

.hero__visual {
  display: none; /* decorative; shown only beside the text on wide screens */
}

.hero__visual svg {
  width: 100%;
  height: auto;
}

@media (min-width: 960px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: var(--space-5);
  }

  .hero__visual {
    display: block;
    width: 100%;
    max-width: 440px;
    margin-inline: 0;
    justify-self: end;
  }
}

/* --------------------------------------------------------------------------
   What we do
   -------------------------------------------------------------------------- */

.intro {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 900px) {
  .intro {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-6);
    align-items: end;
  }
}

.problem-list {
  display: grid;
  gap: var(--space-4) var(--space-5);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .problem-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .problem-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.problem-list li {
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-line);
}

.problem-list h3 {
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.problem-list p {
  margin-top: 0.5rem;
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.statement {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-line);
}

.statement__title {
  font-size: var(--text-h3);
  line-height: 1.3;
}

.statement p {
  max-width: 40rem;
  color: var(--color-muted);
  font-size: var(--text-lg);
  line-height: 1.55;
}

@media (min-width: 900px) {
  .statement {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: var(--space-6);
  }
}

/* --------------------------------------------------------------------------
   Split section (heading left, body right)
   -------------------------------------------------------------------------- */

.split {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--space-6);
    align-items: start;
  }
}

.split__title {
  max-width: 18ch;
  font-size: var(--text-h2);
}

.split__body {
  display: grid;
  gap: var(--space-3);
  max-width: var(--measure);
  color: var(--color-muted);
  font-size: var(--text-lg);
}

@media (min-width: 900px) {
  .split__body {
    padding-top: 2.75rem; /* aligns body with title, below the eyebrow */
  }
}

/* --------------------------------------------------------------------------
   Facts (plain summary list)
   -------------------------------------------------------------------------- */

.facts {
  display: grid;
  gap: var(--space-4) var(--space-5);
  margin: var(--space-6) 0 0;
}

@media (min-width: 640px) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.facts div {
  padding-top: var(--space-3);
  border-top: 2px solid var(--color-accent);
}

.facts dt {
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 600;
}

.facts dd {
  margin: 0.5rem 0 0;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  padding-block: 0 var(--section-y);
}

.contact__panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: var(--space-4);
  padding: clamp(2rem, 6vw, 4.5rem);
  background: var(--color-tint);
  border-radius: calc(var(--radius) * 1.6);
}

@media (min-width: 900px) {
  .contact__panel {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: end;
    gap: var(--space-6);
  }
}

.contact__title {
  max-width: 20ch;
  font-size: var(--text-h2);
}

.contact__copy {
  margin-top: var(--space-3);
  max-width: 34rem;
  color: var(--color-muted);
  font-size: var(--text-lg);
}

.contact__actions {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}

.contact__email {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact__note {
  max-width: 30rem;
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding-block: var(--space-5);
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-muted);
}

.site-footer__links a:hover {
  color: var(--color-text);
}

.site-footer .wordmark {
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Privacy / simple document pages
   -------------------------------------------------------------------------- */

.doc {
  padding-block: clamp(3rem, 7vw, 5.5rem) var(--section-y);
}

.doc__inner {
  max-width: 44rem;
}

.doc h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
}

.doc__meta {
  margin-top: var(--space-2);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.doc h2 {
  margin-top: var(--space-5);
  font-size: 1.375rem;
  letter-spacing: -0.015em;
}

.doc p,
.doc ul {
  margin-top: var(--space-2);
  color: #23343f;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.375rem;
}

.doc__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--space-5);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 719px) {
  :root {
    --header-h: 64px;
  }

  html {
    scroll-padding-top: 1rem;
  }

  /* Header becomes static and the nav drops to its own row: no JS menu needed. */
  .site-header {
    position: static;
  }

  .site-header__inner {
    flex-wrap: wrap;
    row-gap: 0;
    padding-block: 0.5rem;
  }

  .site-nav {
    order: 3;
    margin-inline: -0.75rem;
    width: calc(100% + 1.5rem);
  }

  .site-nav__list {
    flex-wrap: wrap;
    gap: 0;
  }

  .site-header .button--small {
    padding-inline: 0.875rem;
  }

  .hero__actions .button {
    flex: 1 1 auto;
  }

}

@media (max-width: 359px) {
  .wordmark {
    font-size: 1rem;
  }

  .site-nav__list a {
    padding-inline: 0.3rem;
    font-size: 0.875rem;
  }

  .site-nav {
    margin-inline: -0.3rem;
    width: calc(100% + 0.6rem);
  }

  .site-header .button--small {
    display: none; /* Contact remains in the nav row below */
  }
}
