/* ==========================================================================
   AskaDoktor base: reset, typography, layout, loader
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-900);
  background: var(--cream-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv05";
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul[role="list"] { list-style: none; padding: 0; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: var(--lh-tight); letter-spacing: -0.02em; color: var(--ink-900); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; }
p { color: var(--ink-700); }

/* ---- layout primitives ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(56px, 8vw, 120px); }
.section-tight { padding-block: clamp(40px, 5vw, 72px); }
.stack > * + * { margin-top: var(--sp-4); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal-600);
}
.eyebrow::before {
  content: ""; flex: none; width: 22px; height: 22px; margin-top: -1px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http://www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4.8%202.3A.3.3%200%201%200%205%202H4a2%202%200%200%200-2%202v5a6%206%200%200%200%206%206%206%206%200%200%200%206-6V4a2%202%200%200%200-2-2h-1a.3.3%200%201%200%20.3.3%27/%3E%3Cpath%20d%3D%27M8%2015v1a6%206%200%200%200%206%206%206%206%200%200%200%206-6v-4%27/%3E%3Ccircle%20cx%3D%2720%27%20cy%3D%2710%27%20r%3D%272%27/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http://www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4.8%202.3A.3.3%200%201%200%205%202H4a2%202%200%200%200-2%202v5a6%206%200%200%200%206%206%206%206%200%200%200%206-6V4a2%202%200%200%200-2-2h-1a.3.3%200%201%200%20.3.3%27/%3E%3Cpath%20d%3D%27M8%2015v1a6%206%200%200%200%206%206%206%206%200%200%200%206-6v-4%27/%3E%3Ccircle%20cx%3D%2720%27%20cy%3D%2710%27%20r%3D%272%27/%3E%3C/svg%3E") center / contain no-repeat;
}
.muted { color: var(--slate-500); }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-700); }

/* visually hidden (accessibility) */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink-900); color: #fff; padding: 12px 18px; border-radius: 12px;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: 8px; }

/* ==========================================================================
   Loading screen: healthcare heartbeat (ECG) line
   ========================================================================== */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: var(--cream-50);
  transition: opacity 520ms var(--ease), visibility 520ms var(--ease);
}
.loader[hidden] { display: grid; }               /* keep painting while fading */
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.loader__inner { display: grid; justify-items: center; gap: 22px; width: min(340px, 78vw); }
.loader__mark { width: 58px; height: 58px; }

.ecg {
  width: 100%; height: 72px; overflow: visible;
}
.ecg__base { fill: none; stroke: var(--line-strong); stroke-width: 2; opacity: .5; }
.ecg__line {
  fill: none; stroke: var(--teal-500); stroke-width: 3.4;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 620; stroke-dashoffset: 620;
  animation: ecgDraw 1.9s var(--ease-out) infinite;
}
.ecg__dot { fill: var(--coral-500); }
.ecg__dot { animation: ecgPulse 1.9s var(--ease-out) infinite; transform-box: fill-box; transform-origin: center; }

@keyframes ecgDraw {
  0%   { stroke-dashoffset: 620; }
  55%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -620; }
}
@keyframes ecgPulse {
  0%, 38% { transform: scale(.7); opacity: 0; }
  48%     { transform: scale(1.5); opacity: 1; }
  60%     { transform: scale(1); opacity: .9; }
  100%    { transform: scale(.7); opacity: 0; }
}
.loader__label {
  font-size: var(--fs-sm); color: var(--slate-500); letter-spacing: .02em;
  display: flex; align-items: center; gap: 8px;
}
.loader__label strong { font-family: var(--font-brand); font-weight: 700; color: var(--ink-900); letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce) {
  .ecg__line { animation: none; stroke-dashoffset: 0; }
  .ecg__dot { animation: none; opacity: 1; }
}

/* reveal-on-scroll (progressive enhancement; visible by default if JS off) */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
