/* Med2Y */

:root {
  --bg: #FFFFFF; --surface: #F5F7F9; --surface-2: #EBEFF3;
  --ink: #0E1726; --muted: #4A5768; --line: #DDE3EA;
  --accent: #0B9A8A; --accent-ink: #FFFFFF; --warn: #C7782A;
  --radius: 14px;
  --font-head: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --head-weight: 600; --head-tracking: -0.02em;
  --btn-radius: 10px;
  --shadow: 0 1px 2px rgba(14, 23, 38, .06), 0 14px 34px -14px rgba(14, 23, 38, .16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 68px;
  --strip-h: 76px;
  --gutter: 24px;
  --sec-pad: 120px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.55;
  overflow-x: clip; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-tracking); margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
.container { max-width: calc(1200px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 900px) { body { font-size: 18px; } }
@media (max-width: 639px) { :root { --gutter: 16px; --sec-pad: 72px; } }

.skip {
  position: absolute; left: 16px; top: 12px; z-index: 100; padding: 12px 18px; border-radius: var(--btn-radius);
  background: var(--accent); color: var(--accent-ink); font-weight: 500; text-decoration: none;
  transform: translateY(-200px);
}
.skip:focus { transform: none; }

.eyebrow {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: inline-flex; align-items: flex-start; gap: 10px; margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; margin-top: calc(.7em - 3.5px); border-radius: 999px; background: var(--accent); flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: var(--btn-radius); border: 1px solid transparent;
  font: 500 16px/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease), background-color 200ms ease-out, border-color 200ms ease-out, color 200ms ease-out, filter 200ms ease-out;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(14, 23, 38, .28); }
.btn-ghost:hover { background: rgba(14, 23, 38, .07); }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: 17px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.nav-in { height: var(--nav-h); display: flex; align-items: center; gap: 28px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--accent); min-height: 44px; }
.logo-word { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-tracking); font-size: 23px; color: var(--ink); }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--btn-radius);
  text-decoration: none; font-size: 15px; color: var(--muted); transition: color 160ms ease-out, background-color 160ms ease-out;
}
.nav-links a:hover { color: var(--ink); background: rgba(14, 23, 38, .06); }
.nav-cta { min-height: 44px; padding: 0 20px; font-size: 15px; }
.nav-toggle { display: none; }
@media (max-width: 759px) {
  .nav-in { gap: 12px; }
  .nav-cta { margin-left: auto; padding: 0 16px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--btn-radius);
    background: transparent; color: var(--ink); cursor: pointer; padding: 0;
  }
  .nav-toggle span { width: 18px; height: 1.6px; background: currentColor; border-radius: 2px; transition: transform 220ms var(--ease); }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.8px) rotate(-45deg); }
  .nav-links {
    position: absolute; top: calc(var(--nav-h) - 1px); left: 0; right: 0; flex-direction: column; gap: 0; margin: 0;
    padding: 8px var(--gutter) 14px; background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden;
    transition: opacity 200ms ease-out, transform 200ms var(--ease), visibility 0s linear 200ms;
  }
  .nav.is-open .nav-links { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
  .nav-links a { padding: 0 4px; font-size: 17px; color: var(--ink); border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-links a:last-child { border-bottom: 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: clip; color: #fff;
  min-height: calc(var(--vh, 1vh) * 100 - var(--nav-h));
  display: flex; align-items: flex-end;
}
@supports (height: 1svh) { .hero { min-height: calc(var(--vh, 1svh) * 100 - var(--nav-h)); } }
/* Scrim: left-to-right shade calms busy detail behind the headline; bottom shade carries the text and strip. */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .55) 0, rgba(0, 0, 0, 0) 60vw),
    linear-gradient(to top, rgba(0, 0, 0, .86), rgba(0, 0, 0, .56), rgba(0, 0, 0, .12), rgba(0, 0, 0, .2));
}
.hero-in-wrap { position: relative; z-index: 2; flex: 1 1 auto; min-width: 0; padding-top: 120px; padding-bottom: calc(var(--strip-h) + 56px); }
.hero-text { position: relative; max-width: 880px; min-width: 0; }
/* Soft shade tied to the text block, so the headline reads on any frame. */
.hero-text::before {
  content: ""; position: absolute; z-index: -1; inset: -56px -64px -48px -120px; pointer-events: none;
  border-radius: 120px; background: rgba(0, 0, 0, .5); filter: blur(64px);
}
.hero h1 {
  font-size: clamp(44px, 7.4vw, 104px); line-height: .98; color: #fff; text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .28);
}
.hero .eyebrow { color: #fff; }
.hero .sub { margin-top: 24px; max-width: 54ch; font-size: clamp(17px, 1.4vw, 19px); color: rgba(255, 255, 255, .88); }
.hero .btns { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn-ghost {
  color: #fff; border-color: rgba(255, 255, 255, .38); background: rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .18); }

.hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #2d3a40; container-type: size; }
.hero-media video { position: absolute; inset: 0; width: 100cqw; height: 100cqh; object-fit: cover; display: block; }
.hero-media[data-video="none"] video { visibility: hidden; }
.hero-media[data-video="ready"] .ph { display: none; }

/* Placeholder until the clip loads: dim, out-of-focus room. CSS only. */
.ph { position: absolute; inset: 0; overflow: hidden; container-type: size; background: linear-gradient(162deg, #3d4e53, #2e3c42, #252f35); }
.ph-b { position: absolute; aspect-ratio: 1; filter: blur(46px); will-change: transform; }
.ph-b1 { width: 58cqw; left: 48cqw; top: -24cqh;
  background: radial-gradient(circle 29cqw, rgba(255, 246, 232, .92) 0, rgba(255, 240, 220, .38) 17.2cqw, transparent 28.7cqw);
  animation: drift1 26s ease-in-out infinite alternate; }
.ph-b2 { width: 62cqw; left: 18cqw; top: 38cqh;
  background: radial-gradient(circle 31cqw, rgba(168, 224, 219, .62) 0, rgba(168, 224, 219, .22) 20.2cqw, transparent 30.7cqw);
  animation: drift2 22s ease-in-out infinite alternate; }
.ph-b3 { width: 52cqw; left: -18cqw; top: -6cqh;
  background: radial-gradient(circle 26cqw, rgba(204, 212, 216, .34) 0, rgba(204, 212, 216, .12) 18.4cqw, transparent 25.7cqw);
  animation: drift3 30s ease-in-out infinite alternate; }
.ph-b4 { width: 30cqw; left: 52cqw; top: 40cqh;
  background: radial-gradient(circle 15cqw, rgba(255, 250, 240, .5) 0, rgba(255, 250, 240, .14) 11.7cqw, transparent 15cqw);
  animation: drift4 24s ease-in-out infinite alternate; }
.ph-desk { position: absolute; left: -6cqw; right: -6cqw; bottom: -4cqh; height: 34cqh; filter: blur(20px);
  background: linear-gradient(to top, rgba(16, 22, 26, .78), rgba(104, 120, 126, .28), transparent); }
.ph-grain {
  position: absolute; inset: 0; opacity: .06; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n' filterUnits='userSpaceOnUse' x='0' y='0' width='220' height='220'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}
@keyframes drift1 { from { transform: translate3d(-2.3cqw, 1.2cqw, 0) scale(1); } to { transform: translate3d(2.9cqw, 3.5cqw, 0) scale(1.08); } }
@keyframes drift2 { from { transform: translate3d(2.5cqw, 1.9cqw, 0) scale(1.04); } to { transform: translate3d(-3.7cqw, -2.5cqw, 0) scale(.96); } }
@keyframes drift3 { from { transform: translate3d(0, 2.1cqw, 0) scale(1); } to { transform: translate3d(4.7cqw, -1.6cqw, 0) scale(1.1); } }
@keyframes drift4 { from { transform: translate3d(-1.5cqw, -1.2cqw, 0) scale(1); } to { transform: translate3d(1.8cqw, 1.5cqw, 0) scale(1.14); } }

/* Entrance on load */
html.enter .hero-in { animation: rise 760ms var(--ease) both; }
html.enter .hero-in:nth-child(2) { animation-delay: 70ms; }
html.enter .hero-in:nth-child(3) { animation-delay: 140ms; }
html.enter .hero-in:nth-child(4) { animation-delay: 210ms; }
html.enter .status-strip { animation: rise 760ms var(--ease) 320ms both; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

/* Status strip */
.status-strip {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: var(--strip-h); color: #fff;
  background: rgba(8, 12, 16, .5); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid rgba(255, 255, 255, .16);
  container-type: inline-size;
}
.strip-bar { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--accent); transform-origin: left center; transform: scaleX(0); }
.strip-in {
  max-width: calc(1200px + 2 * var(--gutter)); height: var(--strip-h); margin-inline: auto; padding-inline: var(--gutter);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
.sc { display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 0 20px; border-left: 1px solid rgba(255, 255, 255, .14); min-width: 0; }
.sc:first-child { padding-left: 0; border-left: 0; }
.sc-k { font: 400 10.5px/1 var(--font-mono); letter-spacing: .12em; color: rgba(255, 255, 255, .7); }
.sc-v { font: 500 15px/1.2 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-v.flip { animation: flip 200ms ease-out; }
@keyframes flip { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 899px) {
  .status-strip { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .status-strip::-webkit-scrollbar { display: none; }
  .strip-in { width: max-content; min-width: 100cqw; max-width: none; grid-template-columns: repeat(5, minmax(136px, auto)); }
  .strip-bar { position: sticky; left: 0; }
  .hero-in-wrap { padding-top: 96px; padding-bottom: calc(var(--strip-h) + 40px); }
  .hero-text::before { inset: -120px -150px -48px -120px; }
}

/* ---------- Sections ---------- */
.sec { padding: var(--sec-pad) 0; position: relative; }
.sec h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; text-wrap: balance; }
.lead { margin-top: 20px; max-width: 68ch; color: var(--muted); }
.sec-head { max-width: 780px; }
section[id] { scroll-margin-top: calc(var(--nav-h) - 8px); }
.sec-how, .sec-contact { background: var(--bg); }
.sec-int { background: var(--surface); }

/* ---------- Flowchart ---------- */
.flow-wrap { position: relative; margin: 72px 0 64px; }
.flow { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px; align-items: stretch; }
.fnode[data-id="urgent"] { grid-column: 3; grid-row: 1; align-self: end; margin-inline: 20px; }
.fnode[data-id="phone"] { grid-column: 1; grid-row: 2; }
.fnode[data-id="desk"] { grid-column: 2; grid-row: 2; }
.fnode[data-id="urgency"] { grid-column: 3; grid-row: 2; }
.fnode[data-id="assess"] { grid-column: 4; grid-row: 2; }
.fnode[data-id="photo"] { grid-column: 4; grid-row: 3; }
.fnode[data-id="clinician"] { grid-column: 3; grid-row: 3; }
.fnode[data-id="note"] { grid-column: 2; grid-row: 3; }
.fnode {
  position: relative; padding: 18px 20px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: border-color 240ms ease-out;
}
.fn-idx { display: block; font: 400 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.fnode h3 { font-size: 18px; line-height: 1.2; }
.fnode p { margin-top: 7px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.fnode::after {
  content: ""; position: absolute; inset: -5px; border-radius: calc(var(--radius) + 5px); pointer-events: none;
  box-shadow: 0 0 0 2px var(--accent), 0 0 26px rgba(11, 154, 138, .45);
  opacity: var(--ro, 0); transform: scale(var(--rs, .96));
}
.fnode.is-lit { border-color: var(--accent); }
.fnode.is-done { border-color: #6ABBB5; }
.fn-check {
  position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border-radius: 999px; background: var(--accent);
  opacity: 0; transform: scale(.6); transition: opacity 200ms ease-out, transform 240ms var(--ease);
}
.fn-check::before { content: ""; position: absolute; left: 6.5px; top: 4.6px; width: 4px; height: 8px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.fnode.is-done .fn-check { opacity: 1; transform: none; }
.fnode.is-side { padding: 14px 16px 15px; border-color: #D2AE8A; background: #F2EEEB; }
.fnode.is-side .fn-idx { color: #A86220; margin-bottom: 8px; }
.fnode.is-side h3 { font-size: 16px; }
.fnode.is-side p { font-size: 13.5px; margin-top: 5px; }
.fnode.is-side.is-lit { border-color: var(--warn); }
.fnode.is-side::after { box-shadow: 0 0 0 2px var(--warn), 0 0 24px rgba(199, 120, 42, .45); }

.flow-svg { position: absolute; left: 0; top: 0; z-index: 0; overflow: visible; pointer-events: none; }
.edge { fill: none; stroke: #9FA8B3; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.edge.is-urgent { stroke: #CFA173; stroke-dasharray: 5 6; }
.flow-wrap.is-static .edge:not(.is-urgent) { stroke: var(--accent); }
.fdot circle { fill: var(--accent); }
.fdot .halo { opacity: .22; }
.fdot.is-urgent circle { fill: var(--warn); }

@media (max-width: 899px) {
  .flow-wrap { margin: 48px 0; }
  .flow { grid-template-columns: minmax(0, 1fr); row-gap: 36px; }
  .fnode[data-id] { grid-column: 1; }
  .fnode[data-id="phone"] { grid-row: 1; }
  .fnode[data-id="desk"] { grid-row: 2; }
  .fnode[data-id="urgency"] { grid-row: 3; }
  .fnode[data-id="urgent"] { grid-row: 4; align-self: start; margin: 0 0 0 28px; padding: 12px 14px 13px; }
  .fnode[data-id="assess"] { grid-row: 5; }
  .fnode[data-id="photo"] { grid-row: 6; }
  .fnode[data-id="clinician"] { grid-row: 7; }
  .fnode[data-id="note"] { grid-row: 8; }
  .fnode.is-side h3 { font-size: 15px; }
  .fnode.is-side p { font-size: 13px; }
}

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tile { padding: 28px 26px 30px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.tile-ic { color: var(--accent); margin-bottom: 20px; display: block; }
.tile h3 { font-size: 21px; line-height: 1.2; }
.tile p { margin-top: 10px; font-size: 16px; color: var(--muted); }
@media (max-width: 899px) { .tiles { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

/* ---------- Integrations ---------- */
.int-grid { margin-top: 56px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; }
.int-group h3 { font: 500 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.int-group ul { display: grid; gap: 10px; }
.int-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 10px 14px;
  border-radius: calc(var(--radius) - 2px); background: var(--bg); border: 1px solid var(--line); font-size: 15px; line-height: 1.3; font-weight: 500;
}
.int-chip span { min-width: 0; }
.int-chip em {
  flex: none; font: 400 10.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; font-style: normal; color: var(--muted);
  padding: 4px 7px; border-radius: 999px; border: 1px dashed rgba(74, 87, 104, .55);
}
@media (max-width: 1019px) { .int-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) { .int-grid { grid-template-columns: minmax(0, 1fr); margin-top: 40px; } }

/* ---------- Contact ---------- */
.contact-card {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; align-items: end;
  padding: 64px; border-radius: calc(var(--radius) + 6px); background: var(--surface); border: 1px solid var(--line);
}
.contact-card .lead { max-width: 52ch; }
.contact-act { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; justify-self: end; }
.contact-mail {
  display: inline-flex; align-items: center; min-height: 44px; font: 400 15px/1.2 var(--font-mono); color: var(--muted);
  text-decoration: underline; text-decoration-color: #B9C3CE; text-underline-offset: 5px; transition: color 160ms ease-out, text-decoration-color 160ms ease-out;
}
.contact-mail:hover { color: var(--ink); text-decoration-color: var(--accent); }
@media (max-width: 899px) {
  .contact-card { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 40px 32px; }
  .contact-act { justify-self: start; }
}
@media (max-width: 639px) { .contact-card { padding: 32px 20px; } }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 40px 0 64px; background: var(--bg); color: var(--muted); font-size: 15px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.foot-copy { color: var(--ink); font-weight: 500; }
.foot-line { flex: 1 1 280px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--muted); transition: color 160ms ease-out; }
.foot-links a:hover { color: var(--ink); }

/* ---------- Not found ---------- */
.nf { min-height: calc(100vh - var(--nav-h) - 130px); display: flex; align-items: center; }
.nf > .container { flex: 1 1 auto; }
.nf h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; }
.nf .btn { margin-top: 32px; }

/* Scroll reveal */
html.js .reveal { opacity: 0; transform: translate3d(0, 16px, 0); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.enter .hero-in, html.enter .status-strip { animation: none; }
  .ph-b, .sc-v.flip { animation: none; }
  .fn-check, .btn, .nav-links, .nav-toggle span { transition: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .fdot { display: none; }
}
