@font-face {
  font-family: "Figtree";
  src: url("/shared-assets/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/shared-assets/fonts/figtree-latin-ext.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Sans";
  src: url("/shared-assets/fonts/noto-sans-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans Arabic";
  src: url("/shared-assets/fonts/noto-sans-arabic-arabic.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* ==========================================================================
   DrScribe design system
   --------------------------------------------------------------------------
   Every colour on the public surfaces comes from the mark: the deep teal of
   the stethoscope tubing, the lighter teal of its highlight, and the near-white
   of the tile it sits on. Nothing else is invented.

   The canvas stays near-white so that blocks can carry real elevation: a
   hairline border, an inner top highlight, and a wide, very soft shadow. No
   heavy grey borders, no black drop shadows.
   ========================================================================== */

:root {
  /* Brand — sampled from logo-512.png */
  --brand-950: #062220;
  --brand-900: #0a2b29;
  --brand-800: #103838;
  --brand-700: #184848;
  --brand-600: #215d57;
  --brand-500: #2f7469;
  --brand-400: #4e9b8c;
  --brand-300: #7fbcb0;
  --brand-200: #b3d8d1;
  --brand-100: #dcebe7;
  --brand-50: #eff6f4;

  /* Text */
  --ink: #10201e;
  --ink-2: #3a5450;
  --ink-3: #5f7772;
  --ink-on-dark: #f2f7f5;
  --ink-on-dark-2: #b7cbc6;

  /* Surfaces */
  --canvas: #fbfcfa;
  --canvas-2: #f5f8f6;
  --surface: #ffffff;
  --surface-2: #f4f7f5;
  --surface-3: #eaf0ee;
  --line: #e4ebe8;
  --line-2: #eef3f1;
  --line-strong: #cfdcd8;

  /* Semantic */
  --ok: #0f7a53;
  --ok-bg: #eefaf3;
  --warn: #9a5b06;
  --warn-bg: #fdf6e7;
  --danger: #b02a1c;
  --danger-bg: #fdf1ef;
  --info: #1d4f8c;
  --info-bg: #eef4fd;

  /* Elevation — soft, wide, colour-tinted with the brand, never black */
  --sh-1: 0 1px 2px rgba(10, 43, 41, 0.05), 0 1px 1px rgba(10, 43, 41, 0.03);
  --sh-2: 0 1px 2px rgba(10, 43, 41, 0.04), 0 8px 20px -10px rgba(10, 43, 41, 0.14);
  --sh-3: 0 2px 4px rgba(10, 43, 41, 0.04), 0 20px 44px -20px rgba(10, 43, 41, 0.2);
  --sh-4: 0 4px 8px rgba(10, 43, 41, 0.04), 0 40px 80px -36px rgba(10, 43, 41, 0.28);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* Radii */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-2xl: 32px;
  --r-3xl: 40px;
  --r-pill: 999px;

  /* Type */
  --font: "Figtree", "Noto Sans", "Noto Sans Arabic", system-ui, sans-serif;
  --font-ar: "Noto Sans Arabic", "Noto Sans", "Figtree", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --fs-display: clamp(2.55rem, 4.15vw, 3.7rem);
  --fs-h1: clamp(2.15rem, 4.6vw, 3.4rem);
  --fs-h2: clamp(1.85rem, 3.4vw, 2.75rem);
  --fs-h3: clamp(1.2rem, 1.6vw, 1.4rem);
  --fs-h4: 1.06rem;
  --fs-body: 1.0625rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* Motion — real mass, no linear easing anywhere */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.48, 0.64, 1);
  --dur-1: 160ms;
  --dur-2: 280ms;
  --dur-3: 520ms;
  --dur-4: 820ms;

  /* Layout */
  --wrap: 1200px;
  --wrap-narrow: 760px;
  --gutter: clamp(20px, 4vw, 40px);
  --nav-h: 76px;

  color-scheme: light;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.62;
  font-weight: 400;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

a {
  color: var(--brand-700);
  text-decoration-color: color-mix(in srgb, var(--brand-700) 30%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-1) var(--ease-out),
    text-decoration-color var(--dur-1) var(--ease-out);
}

a:hover {
  color: var(--brand-600);
  text-decoration-color: currentColor;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
  line-height: 1.08;
}
h3 {
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h4 {
  font-size: var(--fs-h4);
  line-height: 1.3;
  letter-spacing: -0.012em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

::selection {
  background: var(--brand-200);
  color: var(--brand-950);
}

/* Focus: always visible, always the same shape. */
:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ── Layout primitives ──────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap-narrow {
  max-width: var(--wrap-narrow);
}

.section {
  padding-block: clamp(64px, 8.5vw, 128px);
  position: relative;
}

.stack > * + * {
  margin-top: var(--sp-4);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.skip {
  position: fixed;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  z-index: 200;
  transform: translateY(-200%);
  background: var(--surface);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  box-shadow: var(--sh-3);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--dur-2) var(--ease-out);
}

.skip:focus-visible {
  transform: translateY(0);
}

/* ── Type helpers ───────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-600);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.eyebrow.is-plain::before {
  display: none;
}

.display {
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -0.042em;
  font-weight: 700;
}

.lede {
  font-size: clamp(1.05rem, 1.25vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: var(--fs-sm);
}

.tiny {
  font-size: var(--fs-xs);
}

.mono {
  font-family: var(--mono);
  font-size: 0.86em;
  letter-spacing: -0.01em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[lang="ar"],
.is-ar {
  font-family: var(--font-ar);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  --btn-bg: var(--brand-800);
  --btn-fg: #fff;
  --btn-bd: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding-inline: 24px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  transition: transform var(--dur-2) var(--ease-spring),
    box-shadow var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}

.btn:hover {
  color: var(--btn-fg);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn-primary {
  --btn-bg: var(--brand-800);
  --btn-fg: #fff;
  box-shadow: 0 1px 2px rgba(10, 43, 41, 0.2), 0 10px 24px -12px rgba(10, 43, 41, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-primary:hover {
  --btn-bg: var(--brand-700);
  box-shadow: 0 2px 4px rgba(10, 43, 41, 0.18), 0 18px 36px -14px rgba(10, 43, 41, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-ghost {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  box-shadow: var(--sh-1);
}

.btn-ghost:hover {
  --btn-fg: var(--brand-800);
  --btn-bd: var(--brand-300);
  box-shadow: var(--sh-2);
}

.btn-quiet {
  --btn-bg: transparent;
  --btn-fg: var(--ink-2);
  --btn-bd: transparent;
  padding-inline: 14px;
}

.btn-quiet:hover {
  --btn-fg: var(--brand-800);
  background: var(--brand-50);
}

.btn-light {
  --btn-bg: #fff;
  --btn-fg: var(--brand-900);
  box-shadow: 0 10px 30px -12px rgba(6, 34, 32, 0.5);
}

.btn-light:hover {
  --btn-fg: var(--brand-800);
  box-shadow: 0 16px 40px -12px rgba(6, 34, 32, 0.55);
}

.btn-outline-light {
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-fg: #fff;
  --btn-bd: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(6px);
}

.btn-outline-light:hover {
  --btn-bg: rgba(255, 255, 255, 0.13);
  --btn-bd: rgba(255, 255, 255, 0.6);
}

.btn-sm {
  min-height: 44px;
  padding-inline: 18px;
  font-size: 0.94rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Button-in-button: the arrow lives in its own machined circle. */
.btn-ico {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-inline: 2px -8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  transition: transform var(--dur-2) var(--ease-spring), background-color var(--dur-2) var(--ease-out);
}

.btn-ico svg {
  width: 13px;
  height: 13px;
}

.btn:hover .btn-ico {
  transform: translateX(2px) translateY(-1px) scale(1.06);
  background: rgba(255, 255, 255, 0.26);
}

.btn-ghost .btn-ico,
.btn-quiet .btn-ico {
  background: color-mix(in srgb, var(--brand-800) 8%, transparent);
}

.btn-ghost:hover .btn-ico,
.btn-quiet:hover .btn-ico {
  background: color-mix(in srgb, var(--brand-800) 14%, transparent);
}

.btn-light .btn-ico {
  background: color-mix(in srgb, var(--brand-800) 9%, transparent);
}

/* Text link with a moving underline */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand-700);
}

.link-arrow svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur-2) var(--ease-spring);
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

/* ── Surfaces ───────────────────────────────────────────────────────────── */
/* Single-layer card: hairline, inner highlight, wide soft shadow. */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2), var(--sh-inset);
}

/* Double bezel: an outer tray that holds an inner core. Used for the pieces
   that must read as machined hardware rather than a flat panel. */
.bezel {
  padding: 7px;
  border-radius: var(--r-2xl);
  background: linear-gradient(168deg, rgba(16, 56, 56, 0.055), rgba(16, 56, 56, 0.012) 52%, rgba(16, 56, 56, 0.04));
  border: 1px solid rgba(16, 56, 56, 0.07);
  box-shadow: 0 1px 2px rgba(10, 43, 41, 0.05), 0 24px 56px -30px rgba(10, 43, 41, 0.35);
}

.bezel-core {
  height: 100%;
  border-radius: calc(var(--r-2xl) - 7px);
  background: var(--surface);
  border: 1px solid rgba(16, 56, 56, 0.06);
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

/* The lift used on interactive cards. */
.lift {
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out),
    border-color var(--dur-3) var(--ease-out);
}

.lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-3), var(--sh-inset);
  border-color: var(--brand-200);
}

/* ── Pills, tags, badges ────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 11px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-2);
  white-space: nowrap;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-400);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-400) 18%, transparent);
}

.pill.is-live .pill-dot {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
  animation: pulse-dot 2.4s var(--ease-soft) infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.06);
  }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field {
  display: grid;
  gap: 7px;
}

.field > label,
.label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-2);
}

.input,
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  box-shadow: inset 0 1px 2px rgba(10, 43, 41, 0.03);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
}

.field textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.55;
}

.input:hover,
.field input:hover:not([type="checkbox"]):not([type="radio"]),
.field select:hover,
.field textarea:hover {
  border-color: var(--brand-300);
}

.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-400) 18%, transparent);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.hint {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  line-height: 1.45;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.45;
}

.checkbox input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--brand-700);
  cursor: pointer;
}

.alert {
  display: none;
  padding: 13px 15px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.alert.is-visible {
  display: block;
  animation: alert-in var(--dur-2) var(--ease-out) both;
}

@keyframes alert-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.alert.is-error {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 22%, transparent);
  color: var(--danger);
}

.alert.is-ok {
  background: var(--ok-bg);
  border-color: color-mix(in srgb, var(--ok) 22%, transparent);
  color: var(--ok);
}

.alert.is-info {
  background: var(--info-bg);
  border-color: color-mix(in srgb, var(--info) 20%, transparent);
  color: var(--info);
}

/* ── Motion primitives ──────────────────────────────────────────────────── */
/* Only ever hidden once JavaScript has confirmed it is running, so the page
   is fully readable without it. */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  will-change: transform, opacity;
}

.js [data-reveal="blur"] {
  filter: blur(9px);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
  transition: opacity var(--dur-4) var(--ease-out) var(--d, 0ms),
    transform var(--dur-4) var(--ease-out) var(--d, 0ms),
    filter var(--dur-3) var(--ease-out) var(--d, 0ms);
  will-change: auto;
}

/* A hairline rule that draws itself across the section on entry. */
.js .rule-draw {
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.js .rule-draw.is-in {
  transform: scaleX(1);
  transition: transform 1.1s var(--ease-out);
}

@keyframes float-y {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -9px, 0);
  }
}

/* ── Utilities ──────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}

.is-dark {
  color: var(--ink-on-dark);
  background: var(--brand-900);
}

.is-dark .lede,
.is-dark .muted {
  color: var(--ink-on-dark-2);
}

.is-dark .eyebrow {
  color: var(--brand-300);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
