/* ============================================================
   Melconian Health — tokens, reset, base
   ============================================================ */

:root {
  /* Palette — cool porcelain, deep marine ink, azure action, marigold signal */
  --porcelain: #eff3f8;
  --milk: #fbfcfe;
  --white: #ffffff;
  --marine: #12365c;
  --marine-deep: #0b2540;
  --marine-soft: #1e4e7e;
  --azure: #2569c7;
  --azure-dark: #1b4f9e;
  --mist: #dae5f1;
  --mist-line: #c4d2e3;
  --mist-border: #74889f;
  --mist-text: #a9bfd6;
  --mist-text-bright: #d6e2ee;
  --mist-faint: #7e92ab;
  --marigold: #e8b44c;
  --ink: #0f2237;
  --ink-soft: #3e5570;
  --ink-faint: #52667e;

  /* Type */
  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", sans-serif;
  --font-mono: "Spline Sans Mono", "Consolas", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  --text-hero: clamp(2.5rem, 1.6rem + 4.4vw, 4.75rem);

  /* Rhythm */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-section: clamp(4rem, 3rem + 4vw, 7.5rem);

  /* Shape + depth */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(20, 38, 34, 0.05), 0 10px 30px -12px rgba(20, 38, 34, 0.14);
  --shadow-float: 0 18px 45px -18px rgba(15, 38, 32, 0.35);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 160ms;
  --duration-normal: 300ms;

  /* Signature: rounded medical plus mask */
  --plus-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='0' y='28' width='100' height='44' rx='17'/%3E%3Crect x='28' y='0' width='44' height='100' rx='17'/%3E%3C/svg%3E");

  --container: 72rem;
}

/* ---------- Reset ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--porcelain);
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 640;
  color: var(--marine);
}

h1 {
  font-size: var(--text-hero);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-lg);
  line-height: 1.25;
}

p {
  color: var(--ink-soft);
}

::selection {
  background: var(--azure);
  color: var(--white);
}

/* ---------- Focus + a11y ---------- */

:focus-visible {
  outline: 3px solid var(--azure);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--marine);
  color: var(--white);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus-visible {
  top: 0;
}

/* ---------- Layout helpers ---------- */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

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

/* Halves the top gap when two light sections sit back-to-back,
   keeping every visible seam close to one --space-section. */
.section-tight {
  padding-block-start: calc(var(--space-section) / 2);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--azure-dark);
}

.eyebrow::before {
  content: "";
  width: 0.7em;
  height: 0.7em;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: var(--plus-mask) center / contain no-repeat;
  mask: var(--plus-mask) center / contain no-repeat;
}

.section-head {
  max-width: 38rem;
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1.2;
  transition: background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--azure-dark);
  color: var(--white);
  box-shadow: 0 8px 20px -10px rgba(27, 79, 158, 0.55);
}

.btn-primary:hover {
  background: var(--marine);
}

.btn-secondary {
  background: transparent;
  color: var(--marine);
  box-shadow: inset 0 0 0 1.5px var(--mist-line);
}

.btn-secondary:hover {
  box-shadow: inset 0 0 0 1.5px var(--marine);
}

.btn-light {
  background: var(--white);
  color: var(--marine);
}

.btn-light:hover {
  background: var(--mist);
}

.btn .icon {
  width: 1.1em;
  height: 1.1em;
}

/* ---------- Icons ---------- */

.icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

/* ---------- Reveal on scroll ----------
   Hidden state only applies when JS has stamped html.js,
   so the page stays fully readable without JavaScript. */

html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
