/* ==========================================================================
   MediFlow AI — concept healthcare scheduling assistant
   Light, calm clinical: warm whites, sage + teal. Fraunces + Figtree.
   ========================================================================== */

:root {
  --paper: #f7f6f1;
  --paper-2: #fdfcf9;
  --tint: #eef2ea;          /* sage wash */
  --ink: #26332d;
  --ink-soft: #5a6b62;
  --ink-faint: #8fa096;
  --sage: #7d9b7d;
  --sage-deep: #4f6e52;
  --teal: #3e8e8b;
  --teal-deep: #2c6e6b;
  --line: #dde3d8;
  --care: #b0532e;           /* warm rust, only for escalation moments */
  --radius: 18px;
  --wrap: 1120px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2.5rem, 760px); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--sage-deep); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 8px 0; z-index: 60; font-weight: 600; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 3px; border-radius: 3px; }
::selection { background: rgba(125, 155, 125, 0.3); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; }
h1 em, h2 em { font-style: italic; color: var(--teal-deep); }

/* ---------- Masthead ---------- */
.masthead { position: sticky; top: 0; z-index: 50; background: rgba(247, 246, 241, 0.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color 0.3s ease; }
.masthead.is-stuck { border-bottom-color: var(--line); }
.masthead__inner { display: flex; align-items: center; gap: 2rem; padding-block: 0.9rem; }
.logo { font-family: var(--serif); font-size: 1.28rem; font-weight: 600; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.logo__glyph { color: var(--teal); display: inline-flex; }
.logo__ai { font-family: var(--sans); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; color: var(--teal-deep); background: var(--tint); border: 1px solid var(--sage); border-radius: 999px; padding: 0.15rem 0.45rem; margin-left: 0.15rem; align-self: center; }
.masthead__nav { margin-left: auto; display: flex; gap: 1.5rem; }
.masthead__nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.94rem; font-weight: 500; padding-block: 0.3rem; border-bottom: 2px solid transparent; transition: color 0.2s ease, border-color 0.2s ease; }
.masthead__nav a:hover { color: var(--teal-deep); border-bottom-color: var(--sage); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-family: var(--sans); font-weight: 600; font-size: 0.95rem; text-decoration: none; border-radius: 999px; padding: 0.72rem 1.5rem; cursor: pointer; border: 1.5px solid transparent; transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.2s ease, color 0.2s ease; }
.btn:active { transform: translateY(1px); }
.btn--solid { background: var(--teal-deep); color: #fbfdfb; box-shadow: 0 8px 24px -12px rgba(44, 110, 107, 0.7); }
.btn--solid:hover { background: var(--sage-deep); transform: translateY(-1px); }
.btn--outline { border-color: var(--sage); color: var(--sage-deep); background: transparent; }
.btn--outline:hover { background: var(--tint); }
.btn--text { color: var(--ink-soft); padding-inline: 0.4rem; }
.btn--text:hover { color: var(--teal-deep); }
.btn--text .arrow { transition: transform 0.2s ease; }
.btn--text:hover .arrow { transform: translateX(4px); }
.btn--wide { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.hero__inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; position: relative; z-index: 1; }
.tagline { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sage-deep); font-weight: 600; margin: 0 0 1.1rem; }
.hero__title { font-size: clamp(2.4rem, 5.4vw, 3.9rem); margin: 0 0 1.2rem; font-weight: 500; }
.hero__lede { color: var(--ink-soft); font-size: 1.06rem; max-width: 52ch; margin: 0 0 1.8rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-bottom: 2rem; }
.hero__assurances { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin: 0; padding: 0; font-size: 0.86rem; color: var(--ink-faint); }
.hero__assurances li { display: flex; align-items: center; gap: 0.45rem; }
.hero__assurances li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); }

.hero__leaves { position: absolute; inset: 0; pointer-events: none; color: var(--sage); opacity: 0.25; }
.leaf { position: absolute; }
.leaf--1 { width: 130px; top: 6%; right: -30px; transform: rotate(24deg); animation: sway 9s ease-in-out infinite alternate; }
.leaf--2 { width: 90px; bottom: -10px; left: -20px; transform: rotate(-160deg); animation: sway 11s ease-in-out infinite alternate-reverse; }
@keyframes sway { from { rotate: 0deg; } to { rotate: 7deg; } }

/* ---------- Chat demo ---------- */
.chat-demo { position: relative; }
.chat-demo__frame {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 30px 70px -35px rgba(38, 51, 45, 0.35), 0 2px 0 rgba(255,255,255,0.7) inset;
  overflow: hidden;
  max-width: 430px;
  margin-inline: auto;
}
.chat-demo__top { display: flex; align-items: center; gap: 0.75rem; padding: 0.95rem 1.2rem; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, var(--paper-2)); }
.chat-demo__pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 0 rgba(125,155,125,0.5); animation: breathe 3s ease infinite; flex-shrink: 0; }
@keyframes breathe { 0%,100% { box-shadow: 0 0 0 0 rgba(125,155,125,0.45);} 50% { box-shadow: 0 0 0 7px rgba(125,155,125,0);} }
.chat-demo__name { margin: 0; font-weight: 700; font-size: 0.92rem; }
.chat-demo__role { font-weight: 400; color: var(--ink-faint); }
.chat-demo__status { margin: 0; font-size: 0.72rem; color: var(--teal-deep); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.chat-demo__menu { margin-left: auto; color: var(--ink-faint); font-size: 1.3rem; }
.chat-demo__log { padding: 1.15rem 1.1rem; display: grid; gap: 0.7rem; background:
  radial-gradient(500px 200px at 90% 0%, rgba(125,155,125,0.07), transparent 70%), var(--paper); }
.msg { max-width: 88%; padding: 0.65rem 0.95rem; border-radius: 16px; font-size: 0.9rem; line-height: 1.55; }
.msg p { margin: 0; }
.msg--bot { justify-self: start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--ink); }
.msg--user { justify-self: end; background: var(--teal-deep); color: #f5faf7; border-bottom-right-radius: 5px; }
.msg--care { border-color: rgba(176, 83, 46, 0.45); background: #fdf6f1; }
.msg--care strong { color: var(--care); }
.chat-demo__input { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1.1rem; border-top: 1px solid var(--line); background: #fff; color: var(--ink-faint); font-size: 0.9rem; }
.chat-demo__send { width: 30px; height: 30px; display: grid; place-items: center; background: var(--tint); color: var(--sage-deep); border-radius: 50%; font-weight: 700; }
.chat-demo__caption { text-align: center; font-size: 0.78rem; color: var(--ink-faint); margin: 0.9rem 0 0; font-style: italic; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--tinted { background: linear-gradient(180deg, var(--tint), color-mix(in srgb, var(--tint) 55%, var(--paper))); border-block: 1px solid var(--line); }
.sec-head { max-width: 640px; margin-bottom: 2.8rem; }
.sec-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0.4rem 0 0.8rem; }
.sec-lede { color: var(--ink-soft); margin: 0; }
.kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage-deep); margin: 0; }
.kicker--stop { color: var(--care); }

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.principle { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.9rem 1.6rem 1.6rem; position: relative; transition: transform 0.25s ease, box-shadow 0.3s ease; }
.principle:hover { transform: translateY(-5px); box-shadow: 0 24px 44px -30px rgba(38,51,45,0.4); }
.principle__n { position: absolute; top: -1.15rem; left: 1.4rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; font-family: var(--serif); font-size: 1.2rem; color: var(--teal-deep); background: var(--paper-2); border: 1px solid var(--sage); border-radius: 50%; }
.principle h3 { margin: 0.4rem 0 0.7rem; font-size: 1.3rem; }
.principle p { margin: 0 0 1rem; color: var(--ink-soft); font-size: 0.95rem; }
.principle__note { font-size: 0.8rem !important; color: var(--ink-faint) !important; font-style: italic; border-top: 1px dashed var(--line); padding-top: 0.8rem; margin-bottom: 0 !important; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.3rem; counter-reset: s; }
.step { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.4rem; position: relative; }
.step::after {
  content: ""; position: absolute; top: 2.6rem; right: -0.85rem; width: 1.1rem; height: 1.5px;
  background: var(--sage); opacity: 0.6;
}
.step:last-child::after { display: none; }
.step__art { width: 58px; height: 58px; border-radius: 14px; background: var(--tint); color: var(--teal-deep); display: grid; place-items: center; margin-bottom: 1.1rem; }
.step__art svg { width: 34px; height: 34px; }
.step h3 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.step p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Scope ---------- */
.scope { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.scope h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0.4rem 0 1.4rem; }
.check-list, .cross-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; color: var(--ink-soft); font-size: 0.97rem; }
.check-list li, .cross-list li { padding-left: 2.1rem; position: relative; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
  background: var(--tint); color: var(--sage-deep); border: 1px solid var(--sage);
}
.cross-list li::before {
  content: "✕"; position: absolute; left: 0; top: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700;
  background: #f8ece3; color: var(--care); border: 1px solid rgba(176,83,46,0.4);
}

/* ---------- Plans ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; align-items: stretch; }
.plan { background: var(--paper-2); border: 1px solid var(--line); border-radius: 22px; padding: 1.9rem 1.7rem; display: flex; flex-direction: column; position: relative; transition: transform 0.25s ease; }
.plan:hover { transform: translateY(-4px); }
.plan h3 { font-size: 1.35rem; margin: 0 0 0.5rem; }
.plan__price { margin: 0 0 0.8rem; }
.plan__price span { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; color: var(--ink); }
.plan__price em { font-style: normal; font-size: 0.8rem; color: var(--ink-faint); display: block; margin-top: 0.15rem; }
.plan > p { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 1.1rem; }
.plan ul { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; gap: 0.5rem; font-size: 0.9rem; color: var(--ink-soft); }
.plan ul li { padding-left: 1.35rem; position: relative; }
.plan ul li::before { content: "—"; position: absolute; left: 0; color: var(--sage); font-weight: 700; }
.plan .btn { margin-top: auto; }
.plan--pick { border-color: var(--teal); box-shadow: 0 26px 60px -34px rgba(44, 110, 107, 0.55); background: linear-gradient(180deg, #fff, var(--paper-2)); }
.plan__tag { position: absolute; top: -0.85rem; left: 1.7rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; background: var(--teal-deep); color: #f4faf7; padding: 0.28rem 0.8rem; border-radius: 999px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0.8rem; }
details { background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 1.05rem 1.35rem; transition: border-color 0.25s ease, box-shadow 0.25s ease; }
details[open] { border-color: var(--sage); box-shadow: 0 14px 30px -22px rgba(38,51,45,0.4); }
summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--serif); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--teal-deep); font-size: 1.4rem; font-family: var(--sans); font-weight: 400; transition: transform 0.25s ease; line-height: 1; }
details[open] summary::after { transform: rotate(45deg); }
.faq__body { padding-top: 0.65rem; color: var(--ink-soft); font-size: 0.95rem; }
.faq__body p { margin: 0; }

/* ---------- Closing ---------- */
.closing { background: var(--sage-deep); color: #f3f6ee; padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.closing__inner { text-align: center; display: grid; gap: 0.9rem; justify-items: center; }
.closing h2 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); margin: 0; color: inherit; }
.closing p { margin: 0 0 1rem; opacity: 0.85; max-width: 46ch; }
.closing .btn--solid { background: #f3f6ee; color: var(--sage-deep); }
.closing .btn--solid:hover { background: #fff; }

/* ---------- Footer ---------- */
.footer { background: var(--paper-2); border-top: 1px solid var(--line); padding-top: 3rem; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 2.4rem; }
.footer__brand p { color: var(--ink-faint); font-size: 0.86rem; max-width: 300px; margin-top: 0.9rem; }
.footer h3 { font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin: 0.5rem 0 0.9rem; font-weight: 700; }
.footer nav a { display: block; text-decoration: none; color: var(--ink-soft); font-size: 0.92rem; padding: 0.3rem 0; transition: color 0.2s ease; }
.footer nav a:hover { color: var(--teal-deep); }
.footer__legal { border-top: 1px solid var(--line); padding-block: 1.35rem; text-align: center; font-size: 0.84rem; color: var(--ink-faint); }
.footer__legal a { color: var(--teal-deep); text-decoration: none; border-bottom: 1px solid rgba(44,110,107,0.35); }
.footer__legal a:hover { border-bottom-color: var(--teal-deep); }

/* ---------- Reveal ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { opacity: 0; translate: 0 26px; animation: fade-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
    @keyframes fade-rise { to { opacity: 1; translate: 0 0; } }
    .reveal-copy { opacity: 0; animation: fade-in 0.9s 0.15s ease both; }
    @keyframes fade-in { to { opacity: 1; } }
    .chat-demo__frame { opacity: 0; animation: float-in 1s 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
    @keyframes float-in { from { opacity: 0; transform: translateY(24px) rotate(-1deg); } to { opacity: 1; transform: none; } }
  }
}
@supports not (animation-timeline: view()) {
  .reveal { opacity: 0; transform: translateY(26px); }
  .reveal.is-visible { opacity: 1; transform: none; transition: opacity 0.8s ease, transform 0.8s ease; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero__inner { grid-template-columns: 1fr; }
  .chat-demo { order: 2; }
  .principles { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .step::after { display: none; }
  .plans { grid-template-columns: 1fr; max-width: 560px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .masthead__nav { display: none; }
  .masthead__cta { margin-left: auto; }
}
@media (max-width: 640px) {
  .scope { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .masthead__cta { display: none; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .footer__grid { grid-template-columns: 1fr; }
}
@supports not (color: color-mix(in srgb, red, blue)) {
  .section--tinted { background: var(--tint); }
}
