/* MedFinale landing page. Its own small stylesheet (no Tailwind) so it
   loads fast on phones. The hero is a patient's case-notes folder: the cover
   swings open on question 1 on a clerking sheet, with a coloured divider tab
   for each course down the edge. That is the page's one moment of motion. */

:root {
  --linen: #F2F4F1;
  --sheet: #FFFFFF;
  --ink: #15242B;
  --ink-soft: #4E5F66;
  --ink-faint: #85959B;
  --rule: #D6DDDA;
  --rule-strong: #B4C0BC;
  --scrub: #0B5D63;
  --scrub-dark: #07454A;
  --scrub-wash: #E3F0EF;
  --pulse: #D94148;
  --pulse-dark: #A82A31;
  --correct: #1B7A4B;
  --wrong: #B3261E;
  --med: #7A2E4F;
  --comh: #A86E14;
  --surg: #2F5DA0;
  --chart-line: #E6ECE9;
  --section: clamp(4.5rem, 9vw, 7.5rem);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--scrub); text-underline-offset: 3px; }
a:hover { color: var(--scrub-dark); }
:focus-visible { outline: 2px solid var(--scrub); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: 74rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.4rem;
  border-radius: 8px;
  border: 1.5px solid transparent;
  font: 600 16px/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn svg { width: 1.15em; height: 1.15em; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--scrub); color: #fff; }
.btn-primary:hover { background: var(--scrub-dark); color: #fff; }
.btn-quiet { background: var(--sheet); color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--rule-strong); color: var(--ink); }
.btn-small { padding: .5rem .95rem; font-size: 15px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(242, 244, 241, .88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--rule); }
.topbar .wrap { display: flex; align-items: center; gap: 1rem; height: 4rem; }
.wordmark { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; }
.wordmark svg { flex: none; }
.wordmark > span { font: 700 26px/1 var(--display); letter-spacing: .005em; }
.wordmark > span span { font-weight: 600; }
.wordmark:hover { color: var(--ink); }
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 1.1rem; white-space: nowrap; }
@media (max-width: 419px) { .topbar .signin { display: none; } }
.topbar nav a:not(.btn) { color: var(--ink-soft); font-weight: 600; font-size: 15px; text-decoration: none; }
.topbar nav a:not(.btn):hover { color: var(--ink); }
.only-wide { display: none; }
@media (min-width: 760px) { .only-wide { display: inline; } }

/* ---------- Hero: the case notes ---------- */
.hero { padding: clamp(2rem, 6vw, 4.5rem) 0 var(--section); }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 4rem; } }
.kicker { font-weight: 500; font-size: 15px; color: var(--ink-soft); }
.hero h1 {
  margin-top: .5rem;
  font: 700 clamp(3.6rem, 10.5vw, 7rem)/.88 var(--display);
  letter-spacing: -.005em;
  max-width: 8ch;
}
.lead { margin-top: 1.4rem; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-soft); max-width: 34rem; }
.actions { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: .7rem; }
.small { margin-top: 1rem; font-size: 15px; color: var(--ink-soft); }

/* The folder: dividers down the right edge, the clerking sheet, and the cover on top. */
.notes {
  position: relative;
  width: min(28rem, calc(100% - 2.6rem));
  margin: 0 2.6rem 0 0;
  perspective: 1600px;
}
@media (min-width: 560px) { .notes { margin: 0 auto; } }
@media (min-width: 960px) { .notes { margin: 0 2.6rem 0 auto; } }
.dividers {
  list-style: none; margin: 0; padding: 0;
  position: absolute; top: 1.6rem; right: -2.45rem; bottom: 1.6rem;
  display: flex; flex-direction: column; gap: .4rem;
}
.dividers li {
  flex: 1;
  width: 2.6rem; padding: .7rem 0;
  white-space: nowrap;
  display: flex; align-items: center; justify-content: center;
  background: var(--course); color: #fff;
  border-radius: 0 9px 9px 0;
  font: 700 15px/1 var(--display); letter-spacing: .03em;
  writing-mode: vertical-rl;
  box-shadow: inset 6px 0 6px -4px rgba(0, 0, 0, .25);
}
.sheet {
  position: relative; z-index: 1;
  background:
    linear-gradient(90deg, transparent 2.6rem, rgba(217, 65, 72, .35) 2.6rem, rgba(217, 65, 72, .35) calc(2.6rem + 1px), transparent calc(2.6rem + 1px)),
    var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 6px 14px 14px 6px;
  box-shadow: 0 1px 0 rgba(21, 36, 43, .04), 0 28px 52px -30px rgba(21, 36, 43, .55);
  padding: 1.1rem 1.15rem 1.2rem 3.4rem;
}
.sheet-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .6rem; margin-bottom: .9rem; }
/* The addressograph sticker on every page of a patient's notes. */
.sticker {
  display: inline-grid; gap: .1rem;
  padding: .4rem .7rem;
  border: 1px solid #C9D3CF; border-radius: 4px;
  background: #F7FAF8;
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.25;
}
.sticker b { font: 700 18px/1 var(--display); color: var(--ink); }
.due { font: 700 18px/1 var(--display); color: var(--pulse); padding-top: .3rem; }
.stem { font: 400 18px/1.45 var(--body); color: var(--ink); }

.options { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .1rem; }
.option {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  padding: .42rem .5rem; margin: 0 -.5rem;
  border: 0; border-radius: 8px; background: transparent;
  font: 400 16px/1.35 var(--body); color: var(--ink); text-align: left; cursor: pointer;
}
.option:hover { background: rgba(11, 93, 99, .06); }
.well {
  position: relative; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.8rem; height: 1.8rem; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--sheet);
  font: 600 13px/1 var(--body); color: var(--ink);
  overflow: hidden; isolation: isolate;
}
.well::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; z-index: -1;
  background: var(--scrub); transform: scale(0); transition: transform .28s cubic-bezier(.3, .7, .2, 1);
}
.option.is-picked .well { color: #fff; border-color: var(--scrub); }
.option.is-picked .well::before { transform: scale(1); }
.option.is-picked.is-right .well { border-color: var(--correct); }
.option.is-picked.is-right .well::before { background: var(--correct); }
.option.is-picked.is-wrong .well { border-color: var(--wrong); }
.option.is-picked.is-wrong .well::before { background: var(--wrong); }
.verdict { margin-top: .6rem; font-size: 15px; font-weight: 600; color: var(--correct); min-height: 1.4em; }
.verdict.is-wrong { color: var(--wrong); }

/* The cover: shut when the page loads, then it swings open on its spine (left edge). */
.cover {
  position: absolute; inset: 0; z-index: 3;
  border-radius: 6px 14px 14px 6px;
  background:
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(255, 255, 255, .05) 13px 14px),
    var(--scrub);
  color: #fff;
  padding: 1.6rem 1.5rem;
  display: flex; flex-direction: column; justify-content: space-between;
  transform-origin: left center;
  transform: rotateY(-178deg);
  backface-visibility: hidden;
  pointer-events: none;
  box-shadow: inset 10px 0 0 rgba(0, 0, 0, .14);
}
.cover-label {
  align-self: flex-start;
  display: grid; gap: .15rem;
  padding: .7rem 1rem .75rem;
  background: var(--sheet); color: var(--ink);
  border-radius: 4px;
  font-size: 13px; color: var(--ink-soft);
}
.cover-label b { font: 700 30px/1 var(--display); color: var(--ink); }
.cover-trace { width: 100%; height: auto; color: rgba(255, 255, 255, .85); }
html.motion .notes:not(.is-open) .cover { transform: rotateY(0deg); pointer-events: auto; }
html.motion .notes .cover { transition: transform 1.25s cubic-bezier(.55, .05, .25, 1); }
/* The answer shades in once the folder is open. */
html.motion .notes:not(.is-open) .option.is-picked .well::before { transform: scale(0); }
html.motion .notes:not(.is-open) .option.is-picked .well { color: var(--ink); border-color: var(--ink); }
html.motion .notes.is-open .options.intro .option.is-picked .well::before { transition-delay: 1.15s; }
html.motion .notes:not(.is-open) .verdict { opacity: 0; }
html.motion .notes .verdict { transition: opacity .4s ease 1.4s; }

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; }
.section-head { max-width: 44rem; }
.section-head h2 { font: 700 clamp(2.5rem, 6vw, 4rem)/.95 var(--display); }
.section-head p { margin-top: 1rem; font-size: 18px; color: var(--ink-soft); }

/* The courses: one folder each, with its divider tab */
.course { background: var(--sheet); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.folders { margin-top: 2.6rem; display: grid; gap: 2rem 1.2rem; }
@media (min-width: 860px) { .folders { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.folder { position: relative; padding-top: 2rem; }
.folder-tab {
  position: absolute; top: 0; left: 0;
  height: 2.1rem; padding: 0 1rem;
  display: inline-flex; align-items: center;
  background: var(--course); color: #fff;
  border-radius: 9px 9px 0 0;
  font: 700 17px/1 var(--display); letter-spacing: .02em;
}
.folder-body {
  height: 100%;
  background: var(--linen);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--course);
  border-radius: 0 14px 14px 14px;
  padding: 1.2rem 1.25rem 1.4rem;
}
.folder h3 { font: 700 36px/1 var(--display); }
.folder .count { margin-top: .35rem; font-size: 15px; color: var(--ink-soft); }
.folder .count b { color: var(--ink); }
.parts { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.parts li {
  padding: .2rem .6rem; border-radius: 5px;
  background: var(--sheet); border: 1px solid var(--rule);
  font-size: 13.5px; color: var(--ink);
}
.course-foot { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .4rem 1.8rem; color: var(--ink-soft); font-size: 15px; }
.course-foot b { color: var(--ink); font: 700 24px/1 var(--display); }

/* Features */
.feature-grid { margin-top: 2.8rem; display: grid; gap: 1.2rem; }
@media (min-width: 860px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
.feature { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 1.2rem 1.2rem 1.5rem; }
@media (min-width: 640px) { .feature { padding: 1.4rem 1.6rem 1.8rem; } }
.feature h3 { margin-top: 1.4rem; font: 700 27px/1.05 var(--display); }
.feature > p { margin-top: .6rem; color: var(--ink-soft); }
.feature ul { margin: .8rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: 15px; }
.feature li { margin-top: .25rem; }
.feature li::marker { color: var(--pulse); }
.demo {
  border-radius: 10px; padding: 1.1rem; min-height: 11.5rem;
  display: flex; flex-direction: column; justify-content: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 15px, var(--chart-line) 15px 16px),
    repeating-linear-gradient(90deg, transparent 0 15px, var(--chart-line) 15px 16px),
    #FAFBFA;
  border: 1px solid var(--rule);
}

.demo-title { font-weight: 600; }
.chips { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.chips span { padding: .12rem .55rem; border-radius: 5px; background: var(--sheet); border: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-soft); }
.rank { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .45rem; }
.rank li { display: grid; grid-template-columns: 1.1rem 4.2rem minmax(0, 1fr) 2.6rem; align-items: center; gap: .55rem; font-size: 14px; color: var(--ink-soft); }
.rank li > span:first-child { font-weight: 700; color: var(--ink); text-align: right; }
.rank li > span:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank .track { height: 12px; border-radius: 0 3px 3px 0; background: #DCE3E0; overflow: hidden; }
.rank .track span { display: block; height: 100%; border-radius: inherit; background: var(--rule-strong); }
.rank li.top .track span { background: var(--pulse); }
.rank li.you { color: var(--ink); font-weight: 700; }
.rank li.you .track span { background: var(--scrub); }

.score { font: 700 4rem/.85 var(--display); }
.score small { font-size: .5em; }
.meters { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .55rem; }
.meters li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .6rem; font-size: 13.5px; color: var(--ink-soft); }
.meters b { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter { grid-column: 1 / -1; height: 8px; border-radius: 2px; background: #DCE3E0; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--scrub); }

.mini-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; max-width: 22rem; width: 100%; margin: 0 auto; box-shadow: 0 16px 30px -24px rgba(21, 36, 43, .6); }
.mini-label { padding: .45rem .9rem .4rem; border-bottom: 2px solid var(--course); font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.mini-stem, .mini-item, .mini-q { padding: 0 .9rem; font-size: 15px; }
.mini-stem { padding-top: .7rem; color: var(--ink-soft); }
.mini-item { margin-top: .25rem; font-size: 17px; }
.mini-q { margin-top: .5rem; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.mini-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; padding: .7rem .9rem .9rem; }
.mini-btns span { padding: .45rem; border-radius: 7px; text-align: center; font-size: 13px; font-weight: 600; background: var(--scrub); color: #fff; }
.mini-btns span.quiet { background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); }

.rounds-num { font-size: 15px; color: var(--ink-soft); }
.rounds-num b { font: 700 3rem/.85 var(--display); color: var(--ink); margin-right: .2rem; }
.rounds { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.rounds li {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: .4rem 0 .5rem; border-radius: 6px; background: var(--sheet); border: 1px solid var(--rule);
  font-size: 11.5px; font-weight: 600; color: var(--ink-soft);
}
.rounds i { width: 1.3rem; height: 1.3rem; border-radius: 999px; border: 1.5px dashed var(--rule-strong); }
.rounds li.is-done i {
  border: 0;
  background: var(--scrub) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.6L12 5.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.rounds li.is-today { border-color: var(--pulse); box-shadow: 0 0 0 1px var(--pulse); color: var(--ink); }

/* Checked before it reaches you: a real sequence, so numbered */
.steps { list-style: none; margin: 2.6rem 0 0; padding: 0; display: grid; gap: 1.6rem; counter-reset: none; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; } }
.steps li { display: flex; gap: 1rem; }
@media (min-width: 860px) { .steps li { flex-direction: column; } }
.num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem; border-radius: 6px; border: 1.5px solid var(--ink);
  font: 700 19px/1 var(--display);
}
.steps li:last-child .num { background: var(--scrub); border-color: var(--scrub); color: #fff; }
.steps h3 { font: 700 23px/1.1 var(--display); }
.steps p { margin-top: .4rem; font-size: 15.5px; color: var(--ink-soft); }

/* Install */
.install { background: var(--sheet); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.install-grid { display: grid; gap: 2.4rem; }
@media (min-width: 960px) { .install-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; } }
.install-state { margin-top: 1.2rem; padding: .8rem 1rem; border-radius: 12px; background: var(--scrub-wash); font-weight: 600; }
.install-now { margin-top: 1.4rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.install-now span { color: var(--ink-soft); font-size: 15px; }
.laptop { margin-top: 1.4rem; font-size: 15px; color: var(--ink-soft); }
.howto-box { border: 1px solid var(--rule); border-radius: 14px; padding: 1.1rem; background: var(--linen); }
@media (min-width: 640px) { .howto-box { padding: 1.5rem; } }
.tabs { display: inline-flex; gap: .3rem; padding: .25rem; border-radius: 10px; background: var(--sheet); border: 1px solid var(--rule); }
.tabs button {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border: 0; border-radius: 7px; background: transparent;
  font: 600 15px/1 var(--body); color: var(--ink-soft); cursor: pointer;
}
.tabs button svg { width: 1.05em; height: 1.05em; }
.tabs button[aria-selected="true"] { background: var(--scrub); color: #fff; }
.howto { margin-top: 1.2rem; }
.howto h3 { font: 700 23px/1.1 var(--display); }
.howto ol { margin: .8rem 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: .7rem; }
.howto ol li { counter-increment: step; display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: .6rem; align-items: start; }
.howto ol li::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; border-radius: 999px; background: var(--sheet); border: 1.5px solid var(--ink);
  font-weight: 700; font-size: 13px;
}
.howto ol p { padding-top: .1rem; }
.key { display: inline-flex; vertical-align: middle; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 7px; background: var(--sheet); border: 1px solid var(--rule); }
.key svg { width: 1rem; height: 1rem; }
.note { margin-top: 1rem; font-size: 15px; color: var(--ink-soft); }
html.js .howto[hidden] { display: none; }

/* Questions */
.faq-list { margin-top: 2rem; max-width: 50rem; border-top: 1px solid var(--rule); }
.faq-list details { border-bottom: 1px solid var(--rule); }
.faq-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 0; cursor: pointer; list-style: none;
  font-size: 18px; font-weight: 600;
}
.faq-list summary::-webkit-details-marker { display: none; }
.plus { position: relative; width: 1rem; height: 1rem; flex: none; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--ink); transition: transform .2s ease; }
.plus::after { transform: rotate(90deg); }
.faq-list details[open] .plus::after { transform: rotate(0); }
.faq-list details p { padding: 0 0 1.2rem; max-width: 44rem; color: var(--ink-soft); }

/* Last word */
.last { text-align: center; }
.last h2 { font: 700 clamp(2.8rem, 7vw, 4.8rem)/.95 var(--display); }
.last p { margin: 1rem auto 0; max-width: 32rem; color: var(--ink-soft); font-size: 18px; }
.last .actions { justify-content: center; }

.footer { padding: 2rem 0 2.6rem; border-top: 1px solid var(--rule); font-size: 15px; color: var(--ink-soft); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }

@media (display-mode: standalone) { .hide-installed { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

[hidden] { display: none !important; }
