/* ============================================================
   AtomicMD — « Ambre Garde »
   Night-first, instrument-grade design system.
   Palette + type direction are the product's own; honored exactly.
   ============================================================ */

:root {
  /* ---- Ground & surfaces ---- */
  --bg:        #0B0B0D;
  --surface:   #141417;
  --surface-2: #1A1A1F;
  --border:    #26262C;

  /* ---- Text ---- */
  --text:  #ECEAE4;
  --muted: #8E8C85;

  /* ---- Accent (the single bold hue) ---- */
  --accent:    #E8A33D;
  --on-accent: #17130A;

  /* ---- Clinical semantics — never decorative ---- */
  --ok:     #3DA96F;
  --danger: #E5484D;

  /* ---- Type ---- */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
             Arial, "Noto Sans", sans-serif;
  --font-serif: Charter, "Charter BT", Georgia, "Times New Roman", "Times", serif;

  /* ---- Rhythm ---- */
  --maxw: 1000px;
  --pad: clamp(20px, 5vw, 40px);
  --section-y: clamp(64px, 10vw, 116px);

  /* ---- Radii ---- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* wide content must never scroll the body sideways */
}

/* Subtle amber ambience anchored top-centre, behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 42% at 50% -6%, rgba(232, 163, 61, 0.10), transparent 70%),
    radial-gradient(50% 40% at 92% 4%, rgba(232, 163, 61, 0.04), transparent 72%);
  pointer-events: none;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: none;
}

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

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ============================================================
   Shared micro-elements
   ============================================================ */
.eyebrow,
.kicker,
.card-tag,
.trust-label,
.disclaimer-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61, 169, 111, 0.6);
}

.status-dot--amber {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.14);
  animation: pulse-dot 2.4s ease-out infinite;
}

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(232, 163, 61, 0.34); }
  70%  { box-shadow: 0 0 0 7px rgba(232, 163, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 163, 61, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot--amber { animation: none; }
}

/* Thin amber underline accent — the product's signature. */
.hl {
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}
.hl::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--accent);
  opacity: 0.75;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 13px 22px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset,
              0 8px 24px rgba(232, 163, 61, 0.16);
}
.btn-accent:hover {
  background: #F0AE4A;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset,
              0 10px 30px rgba(232, 163, 61, 0.26);
}
.btn-accent:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn-accent:hover { transform: none; }
}

/* ---- Chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.chip-beta { color: var(--text); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 13, 0.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  color: var(--accent);
  display: inline-flex;
}
.brand-word {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand-accent { color: var(--accent); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.header-nav > a:not(.btn) {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s ease;
}
.header-nav > a:not(.btn):hover { color: var(--text); }
.header-cta { padding: 9px 16px; }

/* Collapse nav links on small screens; keep the CTA. */
@media (max-width: 720px) {
  .header-nav > a:not(.btn) { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-top: clamp(56px, 9vw, 96px);
  padding-bottom: clamp(40px, 6vw, 72px);
  position: relative;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 26px;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2.7rem, 7.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 26px;
}

.hero-lede {
  font-size: clamp(1.06rem, 2.4vw, 1.28rem);
  line-height: 1.55;
  color: var(--text);
  max-width: 41ch;
  margin-bottom: 32px;
}
.hero-lede strong {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero-lede-note {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.94em;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---- ECG signature ---- */
.ecg {
  position: relative;
  width: 100%;
  height: clamp(88px, 13vw, 128px);
  margin-top: clamp(40px, 7vw, 72px);
  color: var(--accent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  /* faint grid, like graph paper on a monitor */
  background-image:
    linear-gradient(to right, rgba(232, 163, 61, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(232, 163, 61, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.ecg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* SVG fallback shown only if canvas/JS is unavailable. */
.ecg-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}
.ecg-canvas + .ecg-fallback { display: none; }

/* ============================================================
   Section scaffolding
   ============================================================ */
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section--alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-head {
  margin-bottom: clamp(32px, 5vw, 52px);
  max-width: 34ch;
}
.kicker {
  color: var(--accent);
  display: inline-block;
  margin-bottom: 14px;
  position: relative;
  padding-bottom: 8px;
}
.kicker::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 1.5px;
  background: var(--accent);
}
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* ============================================================
   Le flux (process — genuinely sequential → numbered)
   ============================================================ */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.flow-step {
  background: var(--bg);
  padding: clamp(22px, 2.6vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.section--alt .flow-step { background: var(--surface); }

.flow-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.9;
}
.flow-name {
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.flow-copy {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 860px) {
  .flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .flow { grid-template-columns: 1fr; }
}

/* ============================================================
   Cards (Québec)
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(22px, 2.6vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.section--alt .card { background: var(--bg); }
.card:hover {
  border-color: #3A3A42;
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: border-color 0.18s ease; }
  .card:hover { transform: none; }
}

.card-tag {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.16em;
}
.card-title {
  font-size: 1.22rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.card-copy {
  font-size: 0.96rem;
  color: var(--muted);
  line-height: 1.58;
}

.code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.code-pill {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

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

/* ============================================================
   Trust strip
   ============================================================ */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.trust-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 0 4px;
  border-top: 1px solid var(--border);
  position: relative;
}
.trust-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-bottom: 4px;
}
.trust-label {
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.trust-sub {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
@media (max-width: 720px) {
  .trust-strip { grid-template-columns: 1fr; }
}

/* ============================================================
   CTA band
   ============================================================ */
.cta-band {
  margin-top: clamp(48px, 7vw, 72px);
  background:
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 120% at 100% 0%, rgba(232, 163, 61, 0.10), transparent 60%);
  pointer-events: none;
}
.cta-band-text { position: relative; max-width: 46ch; }
.cta-band-title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 10px;
  text-wrap: balance;
}
.cta-band-copy {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}
.cta-band .btn { position: relative; flex-shrink: 0; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: clamp(40px, 6vw, 64px);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-word { font-size: 20px; }
.footer-tag {
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  font-family: var(--font-serif);
}

.disclaimer {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 68ch;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.disclaimer-label {
  display: block;
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 11px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-sep { color: var(--border); }
.footer-contact {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.footer-contact:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   Print — clean, ink-friendly (in case anyone prints the page)
   ============================================================ */
@media print {
  body { background: #fff; color: #111; }
  body::before, .ecg, .site-header .header-cta { display: none; }
  .section--alt, .card, .cta-band, .disclaimer, .site-footer { background: #fff; }
  .btn-accent { color: #111; border: 1px solid #111; background: #fff; box-shadow: none; }
}
