/* MediSense — medisense.in
 *
 * ADMIN 2026-09-26: "it must reflect our app's UI exactly, proper logo and
 * proper functionality, so a user is never confused with other sites —
 * it's MediSense, it's a brand."
 *
 * So nothing here is a designer's interpretation. Every value below is read
 * from the app's own locked tokens:
 *
 *   lib/core/design_tokens/medisense_physical.dart   surfaces + shadows
 *   lib/core/design_tokens/medisense_palette.dart    brand colours
 *   lib/main.dart                                    GoogleFonts.lora()
 *   lib/core/design_components/ms_physical.dart      _raisedShadows()
 *
 * Three things were wrong before and are corrected here:
 *
 *   1. TYPEFACE. The app is set in LORA, a serif. The site used Archivo,
 *      a grotesque. That single difference stopped it reading as MediSense.
 *   2. DARK GROUND. The app's dark identity is GREY (#616870 page, #545454
 *      face) — locked after on-device approval. The site used voidNavy
 *      #0E0E22, which is near-black. ADMIN: "without dark mode app looks
 *      totally black in colour."
 *   3. SURFACES. The app is neumorphic: a white highlight offset -6/-6 at
 *      blur 15, and inkNavy at 64% offset +6/+6 at blur 17. The site used an
 *      ordinary drop shadow.
 */

/* ─────────────────────────────────────────────────────────────
   LIGHT — MediSensePhysical.light (medisense_physical.dart:257)
   "ADMIN B4 light (tuner, locked): white page and face, inkNavy
    shadow 64% / blur 17 / distance 6, white highlight."
   ───────────────────────────────────────────────────────────── */
:root {
  --page:        #FFFFFF;             /* page        cottonWhite   */
  --face:        #FFFFFF;             /* face        cottonWhite   */
  --well:        #EDEEF2;             /* well                      */
  --hairline:    #C3C8D0;             /* inputHairline             */

  --ink:         #1F1F4D;             /* textHeading inkNavy       */
  --ink-2:       #5B6472;             /* textSecondary slate       */

  --accent:      #007FAE;             /* forwardInk  cyanInk       */
  --accent-face: #DDF3FB;             /* mainActionFace            */
  --ember:       #C5522D;             /* emberInk                  */
  --destructive: #7A1F2B;             /* destructiveInk            */

  /* _raisedShadows(): highlight then shadow, exact offsets and blurs. */
  --hl:          #FFFFFF;
  --hl-off:      6px;
  --hl-blur:     15px;
  --sh:          rgba(31, 31, 77, 0.64);   /* inkNavy @ 64%        */
  --sh-off:      6px;
  --sh-blur:     17px;

  --raised:  calc(-1 * var(--hl-off)) calc(-1 * var(--hl-off)) var(--hl-blur) var(--hl),
             var(--sh-off) var(--sh-off) var(--sh-blur) var(--sh);
  --sunk:    inset calc(-1 * var(--hl-off)) calc(-1 * var(--hl-off)) var(--hl-blur) var(--hl),
             inset var(--sh-off) var(--sh-off) var(--sh-blur) var(--sh);

  /* GoogleFonts.lora() — main.dart:187, and loraTextTheme() for everything. */
  --font: "Lora", Georgia, "Times New Roman", serif;

  --gutter: 16px;
  --measure: 66ch;
  --radius: 24px;                     /* floatingRadius            */
}

/* ─────────────────────────────────────────────────────────────
   DARK — MediSensePhysical.dark (medisense_physical.dart:305)
   "ADMIN dark identity 'grey text fixed' (on-device approval,
    locked): grey page and face, black shadow 63% / blur 2 /
    distance 6, no highlight."
   GREY, not black. This is the brand's dark, not a generic one.
   ───────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page:        #616870;
    --face:        #545454;
    --well:        #4A4F56;
    --hairline:    #6E757D;

    --ink:         #F6F4FA;           /* warmWhite                 */
    --ink-2:       #ECEDF2;

    --accent:      #66F4FF;           /* brightCyan reads on grey  */
    --accent-face: #123C54;           /* mainActionFace dark       */
    --ember:       #E9A088;
    --destructive: #E28C97;

    --hl:          rgba(0, 0, 0, 0);  /* highlight: 0x00000000     */
    --hl-blur:     2px;
    --sh:          rgba(0, 0, 0, 0.63);   /* 0xA1000000            */
    --sh-blur:     2px;
  }
}

:root[data-theme="dark"] {
  --page:        #616870;
  --face:        #545454;
  --well:        #4A4F56;
  --hairline:    #6E757D;
  --ink:         #F6F4FA;
  --ink-2:       #ECEDF2;
  --accent:      #66F4FF;
  --accent-face: #123C54;
  --ember:       #E9A088;
  --destructive: #E28C97;
  --hl:          rgba(0, 0, 0, 0);
  --hl-blur:     2px;
  --sh:          rgba(0, 0, 0, 0.63);
  --sh-blur:     2px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; 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;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* ---- Shell ---- */
/* ADMIN 2026-09-26: the width was not being used. The app fills the screen;
   a 1080px column on a desktop left most of it empty. */
.wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 40px); }
.band { padding-block: clamp(44px, 7vw, 84px); }
.band + .band { padding-top: 0; }

/* ---- The app's two surfaces, exactly ----
   MsRaised: face colour, raised shadows, superellipse corners.
   MsRecessed: the well, the same shadows turned inward.
   CSS has no true superellipse; a generous radius is the closest honest
   approximation and keeps the family resemblance. */
.plate {
  background: var(--face);
  border-radius: var(--radius);
  box-shadow: var(--raised);
}

.well {
  background: var(--well);
  border-radius: var(--radius);
  box-shadow: var(--sunk);
}

/* ---- Type. One family, as the app has one. ---- */
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 14px;
}

h1, h2, h3 {
  font-family: var(--font);
  color: var(--ink);
  text-wrap: balance;
  margin: 0;
  line-height: 1.2;
}

h1 { font-size: clamp(27px, 4.4vw, 42px); font-weight: 700; }
h2 { font-size: clamp(24px, 3.6vw, 34px); font-weight: 700; }
h3 { font-size: clamp(17px, 2.2vw, 20px); font-weight: 700; }

p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-2); line-height: 1.55; }
.fine { font-size: 15px; color: var(--ink-2); line-height: 1.6; }

/* ---- Header ---- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--page);
  border-bottom: 1px solid var(--hairline);
}

.masthead .wrap { display: flex; align-items: center; gap: 16px; min-height: 66px; }

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.brand b { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }

.masthead nav { display: flex; gap: 4px; }
.masthead nav a { font-size: 15px; color: var(--ink-2); text-decoration: none; padding: 7px 11px; border-radius: 10px; }
.masthead nav a:hover { color: var(--ink); background: var(--well); }

@media (max-width: 760px) { .masthead nav { display: none; } }

/* ---- Hero ---- */
.hero { padding-block: clamp(40px, 8vw, 78px) clamp(26px, 4vw, 44px); }
/* ADMIN: the logo must be bigger. It is the brand mark, not an icon. */
.hero-mark { width: clamp(132px, 22vw, 208px); height: auto; margin-bottom: 28px; }
.hero h1 { max-width: 20ch; }

.tagline {
  font-weight: 700;
  font-style: italic;
  font-size: clamp(16px, 2.3vw, 20px);
  line-height: 1.4;
  color: var(--accent);
  max-width: 26ch;
  margin: 18px 0 0;
}

.hero .lede { margin-top: 24px; }

/* ---- Buttons: MsPhysicalButton. 48dp floor, the app's rule. ---- */
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 16px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  background: var(--face);
  color: var(--ink);
  box-shadow: var(--raised);
  transition: box-shadow 0.12s ease;
}

.btn-main { background: var(--accent-face); color: var(--ink); }
.btn:hover { color: var(--ink); }
.btn:active { box-shadow: var(--sunk); }   /* it presses in, as the app does */

/* ---- The disclaimer well ---- */
.caution { padding: clamp(22px, 3.4vw, 32px); border-left: 5px solid var(--ember); }
.caution h2 { font-size: clamp(19px, 2.6vw, 23px); color: var(--ember); margin-bottom: 12px; }
.caution p { color: var(--ink); font-size: 16px; }
.verbatim { font-size: 17px; font-weight: 700; line-height: 1.55; }

/* ---- Section heading: MsPhysicalSectionHeading's short rule ---- */
.head { margin-bottom: 32px; }
.head p { margin-top: 14px; }

.group + .group { margin-top: 36px; }

.group-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 18px;
}

.group-name::after {
  content: "";
  display: block;
  width: 72px;                 /* MsPhysicalSectionHeading.ruleWidth  */
  height: 3px;                 /* ruleHeight                          */
  background: var(--accent);
  margin-top: 8px;
}

/* ---- Menu cards, as the app draws them: raised plate, icon disc left ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }

.tool {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--face);
  border-radius: 20px;
  box-shadow: var(--raised);
}

/* MsIconDisc: a recessed circle. Never coloured — the app's rule. */
.disc {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--well);
  box-shadow: var(--sunk);
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}

.tool h3 { margin-bottom: 3px; }
.tool p { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; margin: 0; }

.soon {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember);
  border: 1.5px solid currentColor;
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 7px;
  vertical-align: 2px;
}

/* ---- Two audiences ---- */
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.who { padding: clamp(24px, 3.4vw, 32px); }
.who .disc { margin-bottom: 16px; }
.who h3 { font-size: clamp(19px, 2.5vw, 23px); margin-bottom: 10px; }
.who p { font-size: 16px; color: var(--ink-2); }
.who ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.who li { position: relative; padding-left: 22px; font-size: 15.5px; color: var(--ink-2); line-height: 1.5; }
.who li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---- The 36 categories ---- */
/* ADMIN 2026-09-26: the 36 categories must be CARDS, as the app draws them --
   a raised plate with a recessed icon disc, not an indented list. */
.cat-group + .cat-group { margin-top: 34px; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

.cat {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  background: var(--face);
  border-radius: 20px;
  box-shadow: var(--raised);
  min-height: 78px;
}

.cat .disc { width: 48px; height: 48px; font-size: 23px; }

.cat-txt { min-width: 0; }

.cat-no {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.cat-name {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

/* ---- Your data ---- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.fact { padding: 24px; }
.fact h3 { margin-bottom: 8px; }
.fact p { font-size: 15.5px; color: var(--ink-2); margin: 0; }

/* ---- Maker ---- */
.maker {
  padding: clamp(26px, 4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
}

@media (max-width: 760px) { .maker { grid-template-columns: 1fr; } }

.card-id { font-style: normal; font-size: 15.5px; line-height: 1.75; color: var(--ink-2); }
.card-id dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 16px;
}
.card-id dt:first-child { margin-top: 0; }
.card-id dd { margin: 3px 0 0; color: var(--ink); font-size: 15.5px; }
.card-id dd.code { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ---- Footer ---- */
.foot { border-top: 1px solid var(--hairline); padding-block: 32px 44px; margin-top: clamp(40px, 7vw, 76px); }
.foot-row { display: flex; flex-wrap: wrap; gap: 16px 26px; align-items: center; justify-content: space-between; }
.foot .fine { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-links a { font-size: 15px; color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }

/* ---- Theme toggle: MsPhysicalIconButton, 48dp floor ---- */
.toggle {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--face);
  box-shadow: var(--raised);
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
  color: var(--ink);
}

.toggle:active { box-shadow: var(--sunk); }

/* ---- Capability chip ---- */
.capability {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 0;
  padding: 8px 18px 8px 9px;
  background: var(--face);
  border-radius: 999px;
  box-shadow: var(--raised);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.disc-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--well);
  box-shadow: var(--sunk);
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

/* ---- Scroll reveal ---- */
.rise { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.rise.shown { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; } }

/* ---- Security notice ----
   ADMIN 2026-09-26: "make it a security notice, not an alarming red failure
   panel. The red should communicate stop / do not disclose, without making
   the whole verification section feel dangerous."
   So: the ordinary well, a red rule and a red flag line. The heading and body
   stay in normal ink -- the colour marks the instruction, not the section. */
.notice { padding: clamp(22px, 3.4vw, 32px); border-left: 5px solid var(--destructive); }

.notice-flag {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--destructive);
}

.notice h3 { margin-bottom: 12px; }

.never { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }

.never li {
  position: relative;
  padding-left: 24px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

/* A small bar, not a bullet: it reads as "no", quietly. */
.never li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--destructive);
}

.notice p { font-size: 15.5px; color: var(--ink-2); }

/* ---- What comes next: one door, no clues ----
   The door replaces every unreleased module. It carries the MediSense logo,
   watermarked and split by the centre seam, and nothing product-specific --
   so the section can never leak a roadmap. */
.door-well {
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.door {
  width: clamp(150px, 25vw, 196px);
  height: auto;
  flex: 0 0 auto;
  color: var(--ink);                 /* frame + seam inherit this */
}

/* The leaves sit proud of the well, lit like every other raised surface. */
.door .leaf { fill: var(--face); }
.door .port { fill: var(--page); opacity: 0.92; }
.door .plate-bar { fill: var(--well); }
.door .door-watermark { opacity: 0.13; }

/* The lamp over the door. Red is the app's own emberInk, not a new colour,
   and it is the one saturated thing in the section -- everything around it
   stays quiet. */
.door .lamp-stem { fill: currentColor; opacity: 0.28; }
.door .lamp-glow { fill: url(#lampGlow); }
.glow-in  { stop-color: var(--ember); stop-opacity: 0.40; }
.glow-mid { stop-color: var(--ember); stop-opacity: 0.16; }
.glow-out { stop-color: var(--ember); stop-opacity: 0; }
.door .lamp-lens { fill: var(--ember); }
.door .lamp-rim  { fill: none; stroke: var(--ember); stroke-width: 2; opacity: 0.55; }
.door .lamp-bar  { fill: var(--face); }

/* The nameplate: a recessed plate, set in the app's own face. */
.door .plate-sign { fill: var(--well); stroke: var(--hairline); stroke-width: 1; }
.door .sign-line {
  fill: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  text-anchor: middle;
  letter-spacing: 0.09em;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .door .door-watermark {
    filter: brightness(0) invert(1);
    opacity: 0.11;
  }
}
:root[data-theme="dark"] .door .door-watermark {
  filter: brightness(0) invert(1);
  opacity: 0.11;
}

/* "No entry", said in words as well as by the lamp. */
.door-shut {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px !important;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--face);
  box-shadow: var(--raised);
  color: var(--ember) !important;
  font-size: 13px !important;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.door-shut-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ember) 22%, transparent);
  flex: 0 0 auto;
}

.door-copy { min-width: 0; max-width: 34ch; }

.door-tag {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.door-copy h3 {
  font-size: clamp(22px, 3.4vw, 32px);
  margin: 0 0 12px;
  line-height: 1.2;
}

.door-copy p { font-size: 16px; color: var(--ink-2); margin: 0; max-width: none; }

@media (max-width: 620px) {
  .door-well { flex-direction: column; text-align: center; }
  .door-copy { max-width: none; }
}
