@layer reset, layout, components;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  :root {
    color-scheme: light;
    --paper: #f9f5ee;
    --plum: #342439;
    --wine: #75213e;
    --ink: #251f27;
    --muted: #635a64;
    --line: #e2d8d6;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
  }
  body, figure, h1, h2, h3, p, dl, dd { margin: 0; }
  img { display: block; max-width: 100%; }
  a { color: inherit; }
  button, select { font: inherit; }
  :focus-visible { outline: 3px solid #a43b64; outline-offset: 4px; }
  [hidden] { display: none !important; }
}

@layer layout {
  .wrap { width: min(100% - 3rem, 1160px); margin-inline: auto; }
  .top { border-bottom: 1px solid var(--line); }
  .header-row, .footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .header-row { min-height: 78px; }
  nav, .actions { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
  .hero { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); align-items: center; gap: clamp(2rem, 5vw, 5.5rem); padding-block: clamp(3rem, 8vw, 7.5rem); }
  .section-head { max-width: 660px; margin-bottom: 2rem; }
  .workflow { padding-block: 4rem; background: #efe7ec; }
  .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; list-style: none; padding: 0; margin: 0; }
  .demo-section { padding-block: 5rem; }
  .demo-grid, .clinic-inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
  .clinic-section { background: var(--plum); color: #fff9f3; padding-block: 3.5rem; }
  .clinic-inner { align-items: center; }
  .clinic-note { margin-top: 1.3rem; }
  .footer { min-height: 88px; }
  @media (max-width: 850px) {
    .hero { grid-template-columns: 1fr; max-width: 700px; }
    .hero-image img { max-height: 440px; }
  }
  @media (max-width: 720px) {
    .wrap { width: calc(100% - 2rem); }
    .steps, .demo-grid, .clinic-inner { grid-template-columns: minmax(0, 1fr); }
    .workflow, .demo-section { padding-block: 3.2rem; }
    nav { gap: .7rem 1rem; }
  }
  @media (max-width: 490px) {
    .header-row { align-items: flex-start; flex-direction: column; padding-block: .8rem; gap: .6rem; }
    .actions { gap: 1rem; }
  }
}

@layer components {
  .skip { position: absolute; z-index: 2; inset: .5rem auto auto .5rem; padding: .65rem 1rem; background: #fff; transform: translateY(-200%); }
  .skip:focus { transform: translateY(0); }
  .logo { display: inline-flex; align-items: center; gap: .48rem; font-weight: 800; font-size: 1.17rem; letter-spacing: -.035em; text-decoration: none; white-space: nowrap; }
  .logo span { color: var(--wine); }
  nav a, .footer > a:last-child { color: var(--plum); font-size: .93rem; font-weight: 650; text-decoration: none; }
  nav a:hover, .footer > a:last-child:hover { text-decoration: underline; }
  .small-button { border: 1px solid #cab9c2; border-radius: 8px; padding: .52rem .8rem; }
  .mode { font-size: .75rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 790; color: #782e4b; }
  h1, h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 500; letter-spacing: -.045em; text-wrap: balance; }
  h1 { font-size: clamp(3.05rem, 6.4vw, 6rem); line-height: .99; margin: .9rem 0 1.35rem; }
  h1 em { display: block; color: var(--wine); font-weight: inherit; }
  h2 { font-size: clamp(2.1rem, 4.5vw, 3.45rem); line-height: 1.05; }
  h3 { font-size: 1.13rem; line-height: 1.25; }
  p { line-height: 1.58; }
  .lead { color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.25rem); max-width: 29rem; margin-bottom: 1.65rem; }
  .button, .quiet-link { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; text-decoration: none; }
  .button { background: var(--wine); color: white; padding: .78rem 1rem; border: 1px solid var(--wine); border-radius: 8px; cursor: pointer; line-height: 1.42; text-align: left; }
  .button:hover { background: #57152d; }
  .quiet-link:hover { text-decoration: underline; }
  .hero-image { position: relative; padding: .65rem; border: 1px solid var(--line); border-radius: 18px; background: #fffaf6; box-shadow: 0 15px 55px #341c3618; }
  .hero-image img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #d8c4b0; }
  .section-head > p, .steps p { color: var(--muted); margin-top: .6rem; }
  .steps li { padding: 1.25rem 1.35rem; border-top: 2px solid #a85e7a; background: #ffffff70; border-radius: 0 0 10px 10px; }
  .demo-card { border: 1px solid var(--line); border-radius: 14px; background: #fffcf9; overflow: hidden; scroll-margin-top: 1rem; }
  .card-top { padding: 1rem 1.5rem .95rem; background: #efe7ec; border-bottom: 1px solid var(--line); }
  .card-top h3 { margin-top: .28rem; }
  .demo-body { padding: 1.4rem 1.5rem; }
  .patient-label { font-size: 1.15rem; font-weight: 700; margin-bottom: .8rem; }
  .patient-label span { display: block; color: var(--muted); font-size: .86rem; font-weight: 450; }
  .demo-body label { display: block; margin: .72rem 0 .3rem; font-weight: 650; font-size: .9rem; }
  .demo-body select { width: 100%; min-height: 43px; padding: .55rem 1.8rem .55rem .62rem; border: 1px solid #b9aab0; border-radius: 7px; color: var(--ink); background: #fff; }
  .demo-body .button { margin-top: 1rem; }
  .chart > div { padding-bottom: .8rem; margin-bottom: .85rem; border-bottom: 1px solid var(--line); }
  .chart dt { color: var(--muted); font-size: .83rem; font-weight: 680; margin-bottom: .27rem; }
  .chart dd { font-weight: 650; }
  .chart-note { color: var(--muted); font-size: .9rem; }
  .demo-status { color: #1f613d; font-size: .9rem; font-weight: 700; min-height: 1.5rem; margin-top: .8rem; }
  .clinic-inner p, .clinic-note { color: #efdee7; }
  .clinic-inner p { margin-top: .55rem; }
  .clinic-link { display: flex; gap: 1rem; align-items: center; padding: 1rem; background: #fff9f3; color: var(--ink); text-decoration: none; border-radius: 10px; }
  .clinic-link:hover { background: #f4e4eb; }
  .clinic-link small { display: block; margin-top: .28rem; color: var(--muted); }
  .clinic-link .arrow { margin-left: auto; color: var(--wine); }
  .clinic-note { font-size: .9rem; }
}
