/* =====================================================================
   Dx Lab — base.css
   Design tokens, reset and primitives.
   ===================================================================== */

:root {
  /* Brand */
  --c-blue:        #063BFF;        /* DX logo royal blue */
  --c-blue-deep:   #071C58;        /* brochure navy — primary surface */
  --c-blue-700:    #0731B8;
  --c-blue-100:    #E9F2FF;
  --c-red:         #EF233C;        /* DX logo red */
  --c-red-soft:    #FF8FA0;
  --c-cyan:        #28BFEF;        /* brochure laboratory cyan */
  --c-cyan-soft:   #D9F6FF;
  --c-gold:        #F1C75B;        /* subtle premium accent */
  --c-gold-soft:   #FFF1C7;

  /* Neutrals — warm, academic */
  --c-bg:          #F5FBFF;        /* brochure light medical blue */
  --c-bg-2:        #EAF6FC;        /* secondary blue surface */
  --c-surface:     #FFFFFF;
  --c-surface-2:   #F0F8FE;
  --c-border:      #CFE1F4;
  --c-border-2:    #A8C2DF;
  --c-ink:         #071532;        /* primary text */
  --c-ink-2:       #24344F;
  --c-muted:       #51657F;        /* slate blue-gray */
  --c-faint:       #93A8BF;
  --c-title:       #061B5F;
  --c-title-2:     #0731B8;
  --c-title-soft:  #2442A4;

  /* Semantic */
  --c-link:        var(--c-blue);
  --c-link-hover:  var(--c-blue-700);
  --c-success:     #1F7A4D;
  --c-error:       var(--c-red);

  /* Type */
  --ff-display: "Be Vietnam Pro", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ff-body:    "Source Sans 3", "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Type scale (clamp for fluid) */
  --fs-hero:    clamp(2.35rem, 3.4vw + 0.8rem, 4.15rem);
  --fs-h1:      clamp(2.2rem, 3vw + 0.75rem, 3.55rem);
  --fs-h2:      clamp(1.65rem, 1.45vw + 1.05rem, 2.38rem);
  --fs-h3:      clamp(1.08rem, 0.28vw + 1.02rem, 1.28rem);
  --fs-lede:    clamp(1.05rem, 0.3vw + 1.0rem, 1.18rem);
  --fs-body:    1rem;
  --fs-small:   0.875rem;
  --fs-xs:      0.78rem;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-pill: 999px;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(6,59,255,0.08), 0 1px 1px rgba(7,28,88,0.05);
  --sh-2: 0 10px 28px -10px rgba(6,59,255,0.22), 0 2px 8px rgba(7,28,88,0.08);
  --sh-3: 0 28px 70px -24px rgba(6,59,255,0.28), 0 10px 30px -14px rgba(7,28,88,0.14);

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1rem, 3vw, 2rem);
  --header-h: 52px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 160ms;
  --t-med:  280ms;
  --t-slow: 520ms;
}

@media (max-width: 540px) {
  :root {
    --fs-hero: clamp(2rem, 10vw, 2.72rem);
  }
}

[data-theme="dark"] {
  --c-bg:        #0A1424;
  --c-bg-2:      #0E1A2F;
  --c-surface:   #11203A;
  --c-surface-2: #152A48;
  --c-border:    #20355A;
  --c-border-2:  #2D4778;
  --c-ink:       #ECEEF3;
  --c-ink-2:     #C4CDDD;
  --c-muted:     #8E99B0;
  --c-faint:     #6A7691;
  --c-title:     #F4F7FF;
  --c-title-2:   #BFD0FF;
  --c-title-soft:#D7E0FF;
  --c-blue:      #4F80FF;
  --c-blue-deep: #060E20;
  --c-blue-700:  #2C5DD9;
  --c-blue-100:  #16234A;
  --c-cyan:      #6FD2EE;
  --c-gold:      #D7BC78;
  --c-gold-soft: #3E3422;
  --c-link:        var(--c-cyan);
  --c-link-hover:  var(--c-blue);
}

/* ----------------------------------------------------- */
/* Reset                                                   */
/* ----------------------------------------------------- */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

img, svg, video { display: block; max-width: 100%; height: auto; }
img { font-style: italic; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: var(--c-link); text-decoration: none; transition: color var(--t-fast) var(--ease-out); }
a:hover { color: var(--c-link-hover); }

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

html, body { height: 100%; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11", "tnum";
}

::selection { background: var(--c-blue); color: #fff; }

/* ----------------------------------------------------- */
/* Type                                                    */
/* ----------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--c-title);
}
h2 { letter-spacing: -0.018em; }
h3 { letter-spacing: -0.012em; }

.display {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: var(--fs-hero);
  line-height: 1.07;
  letter-spacing: -0.04em;
  color: var(--c-title);
}
.h2 {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: var(--fs-h2);
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--c-title);
}
.h3 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  line-height: 1.28;
  color: var(--c-title);
}

.kicker {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-blue);
  margin: 0 0 var(--sp-4);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 28px; height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.eyebrow {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-blue-700);
  margin: 0 0 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  background: linear-gradient(90deg, #FFFFFF 0%, var(--c-blue-100) 100%);
  border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, var(--c-blue) 14%, transparent);
}
[data-theme="dark"] .eyebrow {
  background: rgba(79,128,255,0.10);
  color: #B7C8FF;
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-red);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-red) 18%, transparent);
}

.lede {
  font-size: var(--fs-lede);
  color: var(--c-ink-2);
  max-width: 56ch;
  line-height: 1.62;
}

em {
  font-style: italic;
  color: var(--c-title-2);
  font-family: var(--ff-display);
  font-weight: 700;
}
[data-theme="dark"] em { color: var(--c-cyan); }

/* Soft em — italic emphasis without color */
.em-soft {
  font-style: italic;
  font-family: var(--ff-display);
  font-weight: 700;
  color: var(--c-blue-deep);
}
[data-theme="dark"] .em-soft { color: #E6ECF7; }

/* Underline accent — true underline, scoped to text width via inline-block + ::after */
.underline-accent {
  position: relative;
  display: inline-block;
  color: var(--c-blue-deep);
}
[data-theme="dark"] .underline-accent { color: #fff; }
.underline-accent::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -0.04em;
  height: 0.16em;
  background: linear-gradient(90deg, var(--c-red) 0%, var(--c-red) 34%, var(--c-blue) 100%);
  border-radius: 2px;
  opacity: 0.92;
}

.muted-em {
  color: var(--c-muted);
  font-weight: 600;
}



/* ----------------------------------------------------- */
/* Layout primitives                                       */
/* ----------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section {
  padding: clamp(4rem, 7vw, 7rem) 0;
  position: relative;
}
.section + .section { border-top: 1px solid var(--c-border); }
[data-theme="dark"] .section + .section { border-top-color: var(--c-border); }

.section-head {
  max-width: 760px;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.section-head--center {
  margin-left: auto; margin-right: auto;
  text-align: center;
}
.section-head--center .kicker { justify-content: center; }
.section-sub {
  margin-top: 1rem;
  color: var(--c-muted);
  font-size: 1.05rem;
  max-width: 56ch;
  margin-left: auto; margin-right: auto;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px; top: 0;
  background: var(--c-ink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--r-md) 0;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ----------------------------------------------------- */
/* Buttons                                                 */
/* ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.1;
  letter-spacing: -0.005em;
  padding: 0.85rem 1.4rem;
  min-height: 48px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--c-blue-deep) 0%, var(--c-blue) 100%);
  color: #fff;
  border-color: color-mix(in srgb, var(--c-blue) 76%, var(--c-blue-deep));
  box-shadow: 0 10px 22px -12px rgba(6,59,255,0.55), var(--sh-1);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--c-blue) 0%, var(--c-red) 120%);
  border-color: var(--c-blue);
  color: #fff;
  box-shadow: var(--sh-2);
}
[data-theme="dark"] .btn-primary {
  background: var(--c-blue);
  border-color: var(--c-blue);
}
[data-theme="dark"] .btn-primary:hover { background: var(--c-blue-700); border-color: var(--c-blue-700); }

.btn-secondary {
  background: linear-gradient(135deg, var(--c-blue-100) 0%, var(--c-cyan-soft) 100%);
  color: var(--c-blue-700);
  border-color: color-mix(in srgb, var(--c-blue) 22%, transparent);
}
.btn-secondary:hover {
  background: color-mix(in srgb, var(--c-blue) 18%, var(--c-blue-100));
  color: var(--c-blue-deep);
}
[data-theme="dark"] .btn-secondary {
  background: rgba(79,128,255,0.14);
  color: #B7C8FF;
  border-color: rgba(79,128,255,0.28);
}

.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-border-2);
}
.btn-ghost:hover {
  background: var(--c-blue-100);
  border-color: color-mix(in srgb, var(--c-blue) 40%, var(--c-border));
  color: var(--c-blue-700);
}
[data-theme="dark"] .btn-ghost { color: var(--c-ink-2); }
[data-theme="dark"] .btn-ghost:hover { background: var(--c-surface); border-color: var(--c-ink-2); }

.btn-block { width: 100%; }

/* Icon button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  color: var(--c-ink);
  border: 1px solid transparent;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.icon-btn:hover {
  background: var(--c-surface-2);
  border-color: var(--c-border);
}
.icon-btn svg { width: 22px; height: 22px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
