/* Patients First — template 10: the type board.
   Type on black ground; flat tiles only where items form a set. Theme colours and space only. */

:root {
  /* palette (from the brand) */
  --black: #000000;
  --ground: #000000;
  --t1: #11161C;
  --t2: #1A2129;
  --ink: #EEF2F6;
  --muted: #A9B4C0;
  --lime: #7BD62B;
  --on-lime: #07090C;
  --blue: #2A9DF4;
  --link: #62B8FF;

  /* type: one face, two weights */
  --font: "Switzer", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-legal: 0.875rem;                                        /* SMS text only */
  --fs-body: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);         /* 17–19 */
  --fs-lead: clamp(1.25rem, 1.05rem + 0.6vw, 1.75rem);          /* 20–28 */
  --fs-head: clamp(1.75rem, 1.1rem + 2.4vw, 3.5rem);            /* 28–56 */

  /* layout */
  --gap: 14px;
  --edge: 16px;
  --pad: clamp(24px, 2.4vw, 44px);
  --radius: 14px;
  --radius-sm: 10px;
  --edge-grad: linear-gradient(135deg, rgba(123, 214, 43, 0.45), rgba(42, 157, 244, 0.45));
  --max: 1600px;
  --sec: clamp(72px, 9vw, 160px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (min-width: 768px) { :root { --edge: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--lime); color: var(--on-lime); }

/* ---------- language: one at a time once script runs ---------- */
html.js[lang="en"] [lang="es"]:not(html),
html.js[lang="es"] [lang="en"]:not(html) { display: none !important; }
/* without script both languages show; inline pairs get a slash between them */
html:not(.js) .bi > [lang="es"]::before { content: " / "; }
html:not(.js) h1 > span, html:not(.js) h2 > span, html:not(.js) h3 > span { display: block; }

/* ---------- frame ---------- */
.board {
  max-width: calc(var(--max) + 2 * var(--edge));
  margin: 0 auto;
  padding: 0 var(--edge) var(--edge);
}
main { display: flex; flex-direction: column; gap: var(--sec); }
.foot { margin-top: var(--sec); }
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}
.tile {
  border-radius: var(--radius);
  padding: var(--pad);
  min-width: 0;
}
.t1 { background: var(--t1); }
.t2 { background: var(--t2); }
.paper { background: var(--ink); color: var(--on-lime); }
.lime { background: var(--lime); color: var(--on-lime); }

/* premium edge: 1px lime-to-blue gradient border on the set tiles and the cards */
.tile.t1, .tile.t2, .tile.paper { position: relative; border: 1px solid transparent; }
.tile.t1 { background: linear-gradient(var(--t1), var(--t1)) padding-box, var(--edge-grad) border-box; }
.tile.t2 { background: linear-gradient(var(--t2), var(--t2)) padding-box, var(--edge-grad) border-box; }
.tile.paper { background: linear-gradient(var(--ink), var(--ink)) padding-box, var(--edge-grad) border-box; }
/* hover / focus glow: drawn once on a layer, animated by opacity only */
.tile.t1::after, .tile.t2::after, .tile.paper::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 0 1px var(--lime), 0 12px 40px rgba(123, 214, 43, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease-out);
}
.tile.t1:hover::after, .tile.t2:hover::after, .tile.paper:hover::after,
.tile.t1:focus-within::after, .tile.t2:focus-within::after, .tile.paper:focus-within::after { opacity: 1; }

/* hero glow: lime from the top-left corner, blue from the bottom-right, over black */
body { position: relative; }
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: clamp(760px, 100vh, 1100px);
  background:
    radial-gradient(ellipse 70% 80% at 0% 0%, rgba(123, 214, 43, 0.20), rgba(123, 214, 43, 0) 70%),
    radial-gradient(ellipse 45% 55% at 100% 100%, rgba(42, 157, 244, 0.12), rgba(42, 157, 244, 0) 70%);
  pointer-events: none;
  z-index: -1;
}

/* ---------- type roles ---------- */
h1 {
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
  text-wrap: balance;
}
h2 {
  font-size: var(--fs-head);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}
h3 {
  font-size: var(--fs-lead);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
.lead { font-size: var(--fs-lead); line-height: 1.35; letter-spacing: -0.012em; text-wrap: pretty; }
p { text-wrap: pretty; }
.label { color: var(--link); font-size: var(--fs-body); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  min-height: 56px;
  padding: 14px 28px;
  border-radius: var(--radius);
  background: var(--lime);
  color: var(--on-lime);
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 220ms var(--ease-pop), background-color 200ms ease;
}
.btn:hover { background: #8fe043; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-dark { background: var(--on-lime); color: var(--ink); }
.btn-dark:hover { background: var(--t2); }
.lime .btn-dark:focus-visible, .paper .btn-dark:focus-visible { outline-color: var(--on-lime); }

/* ---------- announcement + header bar (no tiles) ---------- */
.announce { padding: 16px 0 4px; color: var(--muted); }
.announce p { max-width: 70ch; }
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 12px 0;
}
.logo { display: block; flex: none; }
.logo img { width: clamp(132px, 10vw, 176px); }
/* the logo is drawn on solid black; screen keeps it clean over the hero glow */
.logo img, .f-logo img { mix-blend-mode: screen; }
.bar-right { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 44px); }
.nav-links { display: flex; gap: clamp(20px, 2.6vw, 40px); }
.nav-links a, .f-links a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  text-decoration-color: transparent;
  padding-block: 6px;
  transition: text-decoration-color 220ms ease, color 200ms ease;
}
.nav-links a:hover, .f-links a:hover { color: var(--link); text-decoration-color: currentColor; }
.bar-call { color: var(--link); font-weight: 600; white-space: nowrap; transition: color 200ms ease; }
.bar-call:hover { color: var(--ink); }

.lang { display: flex; gap: 6px; }
.lang button {
  min-width: 48px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--t1);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, transform 200ms var(--ease-pop);
}
.lang button:hover { color: var(--ink); transform: translateY(-1px); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--on-lime); }
html:not(.js) .lang { display: none; }

/* ---------- hero: type on the ground, one light card ---------- */
.hero { row-gap: clamp(32px, 3.4vw, 56px); padding-top: clamp(32px, 4vw, 72px); }
.h1-block {
  grid-column: 1 / -1;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2vw, 28px);
}
.h1-block h1 { font-size: clamp(1.75rem, min(7.3cqi, 11vh), 7.5rem); max-width: 15em; }
.lead-block {
  grid-column: 1 / span 7;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}
.lead-block .lead { max-width: 44ch; }

.card-tile {
  grid-column: 8 / span 5;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.h-card { font-size: var(--fs-lead); letter-spacing: -0.02em; line-height: 1.15; }
.card-phone {
  color: var(--on-lime);
  font-size: clamp(1.5rem, 1.2rem + 0.6vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.16em;
  align-self: flex-start;
  transition: text-decoration-color 200ms ease;
}
.card-phone:hover { text-decoration-color: var(--blue); }
.card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.card-list li:first-child { grid-column: 1 / -1; }

/* ---------- section heads: on the ground ---------- */
.sec-head { grid-column: 1 / span 6; display: flex; flex-direction: column; gap: 16px; }
.sec-intro { grid-column: 8 / span 5; align-self: end; }

/* ---------- services: one board of six ---------- */
.services { row-gap: clamp(32px, 3vw, 48px); }
.svc-list { grid-column: 1 / -1; }
.svc { grid-column: span 3; display: flex; flex-direction: column; gap: 14px; }
.svc.wide { grid-column: span 6; gap: 18px; }
.svc.wide h3 { font-size: var(--fs-head); letter-spacing: -0.035em; line-height: 1.02; }
.svc.wide p { font-size: var(--fs-lead); line-height: 1.35; max-width: 34ch; }
.svc p { max-width: 40ch; }

/* ---------- how it works: one board of three, growing ---------- */
.steps { row-gap: clamp(32px, 3vw, 48px); }
.step-list { grid-column: 1 / -1; }
.step { display: flex; flex-direction: column; gap: 14px; }
.step p { max-width: 44ch; }
.s1 { grid-column: span 3; }
.s2 { grid-column: span 4; }
.s3 { grid-column: span 5; }
.s3 h3 { font-size: var(--fs-head); letter-spacing: -0.035em; line-height: 1.02; }
.s3 p { font-size: var(--fs-lead); line-height: 1.35; max-width: 32ch; }

/* ---------- why: head on the ground, one board of four ---------- */
.why-head {
  grid-column: 1 / span 5;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
}
.why-head .lead { margin-top: 16px; max-width: 30ch; }
.why-list { grid-column: 6 / -1; display: grid; gap: var(--gap); }
.reason {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 12px 32px;
  align-items: baseline;
  padding-block: clamp(22px, 2vw, 32px);
}
.reason p { grid-column: 2; max-width: 46ch; }
.reason h3 { grid-row: span 2; }

/* ---------- contact: plain rows on the ground + one card ---------- */
.contact { row-gap: clamp(28px, 2.6vw, 40px); }
.c-head { grid-column: 1 / -1; }
.rows { grid-column: 1 / span 7; display: grid; gap: clamp(20px, 2vw, 28px); align-content: start; }
.c-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 6px 32px;
  align-items: baseline;
}
.c-key { color: var(--muted); font-size: 1rem; font-weight: 600; }
.c-val { font-size: clamp(1.25rem, 1.1rem + 0.35vw, 1.625rem); line-height: 1.3; letter-spacing: -0.012em; display: grid; gap: 6px; }
.c-val p { font-size: inherit; }
.c-phone { color: var(--link); font-size: clamp(1.5rem, 1.2rem + 0.6vw, 2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; justify-self: start; transition: color 200ms ease; }
.c-phone:hover { color: var(--ink); }
.c-link { color: var(--link); font-size: inherit; font-weight: 600; justify-self: start; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.c-link:hover { color: var(--ink); }
.c-note .c-val { grid-column: 2; }
.c-note em { font-style: italic; color: var(--muted); }

.ready {
  grid-column: 8 / span 5;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

/* ---------- final CTA: one lime tile ---------- */
.cta-tile {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px var(--gap);
  align-items: end;
  padding-block: clamp(32px, 3.4vw, 56px);
}
.cta-tile h2 { grid-column: 1 / span 7; }
.cta-side { grid-column: 8 / span 5; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }

/* ---------- footer: no tiles ---------- */
.foot { row-gap: 32px; align-items: center; padding-bottom: 16px; }
.f-logo { grid-column: 1 / span 4; }
.f-logo img { width: min(100%, 240px); }
.f-contact { grid-column: 5 / span 4; display: flex; flex-direction: column; gap: 6px; }
.f-contact a { color: var(--link); font-weight: 600; }
.f-contact a:hover { color: var(--ink); }
.f-links { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 4px; }
.f-legal { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 16px 32px; padding-top: 16px; }
.f-legal .sms { grid-column: 2; font-size: var(--fs-legal); line-height: 1.6; color: var(--muted); max-width: 75ch; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .bar { flex-wrap: wrap; }
  .lead-block, .card-tile { grid-column: 1 / -1; }
  .sec-head, .sec-intro { grid-column: 1 / -1; }
  .svc { grid-column: span 6; }
  .svc.wide { grid-column: 1 / -1; }
  .s1, .s2 { grid-column: span 6; }
  .s3 { grid-column: 1 / -1; }
  .why-head, .why-list { grid-column: 1 / -1; }
  .why-head .lead { max-width: 40ch; }
  .rows, .ready { grid-column: 1 / -1; }
  .cta-tile h2, .cta-side { grid-column: 1 / -1; }
  .f-logo { grid-column: span 6; }
  .f-contact { grid-column: span 6; }
  .f-links { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 8px 32px; }
  .f-legal { grid-template-columns: 1fr; }
  .f-legal .sms { grid-column: 1; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  :root { --gap: 12px; --pad: 20px; }
  .bar { display: grid; grid-template-columns: auto 1fr; row-gap: 8px; }
  .logo img { width: 124px; }
  .bar-right { display: contents; }
  .bar-call { grid-column: 2; grid-row: 1; justify-self: end; }
  .nav-links { grid-column: 1; grid-row: 2; gap: 24px; align-items: center; }
  .lang { grid-column: 2; grid-row: 2; justify-self: end; }
  .h1-block h1 > [lang="es"] { font-size: 0.86em; }
  .lead-block .btn { width: 100%; }
  .card-list { grid-template-columns: 1fr; }
  .svc { grid-column: 1 / -1; }
  .s1, .s2 { grid-column: 1 / -1; }
  .reason { grid-template-columns: 1fr; }
  .reason p { grid-column: 1; }
  .reason h3 { grid-row: auto; }
  .c-row { grid-template-columns: 1fr; }
  .c-note .c-val { grid-column: 1; }
  .ready .btn, .cta-side .btn { width: 100%; }
  .ready, .cta-side { align-items: stretch; }
  .f-logo, .f-contact { grid-column: 1 / -1; }
  .f-links { flex-direction: column; }
}

/* ---------- pop-in on scroll (only with script) ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}
html.js [data-reveal="pop"] { transition-timing-function: var(--ease-out), var(--ease-pop); }
html.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn, .lang button { transition: none; }
}
