/* ============================================================
   AUDYRA — Shared site stylesheet
   Thermal Precision: Glut-Orange (Hitze/Aktion) + Thermal-Blau (Technik/Trust)
   ============================================================ */

/* ---------- Tokens: DARK (default) ---------- */
:root,
:root[data-theme="dark"] {
  --bg:        #1a1714;
  --bg-2:      #221d19;
  --bg-3:      #2a231e;
  --line:      #3a312a;
  --line-2:    #4a3f36;
  --fg:        #faf6f1;
  --fg-2:      #c9bfb3;
  --fg-3:      #8a7f72;

  --ember:      #d94a1f;
  --ember-soft: #f06a3a;
  --ember-deep: #8a2a10;

  --blue:       #5aa6dd;   /* light thermal-blue, AA on dark */
  --blue-soft:  #7dbbe8;
  --blue-deep:  #1e3a5f;   /* logo navy — fills / tiles */

  --critical:  #ff5638;
  --warn:      #f0a040;
  --ok:        #6fb88a;

  --r:  4px;
  --r2: 8px;
  --t:  300ms cubic-bezier(.2,.7,.2,1);

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 18px 40px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.4);

  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-body:    "IBM Plex Sans", system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  --header-h: 68px;
  --maxw: 1180px;

  color-scheme: dark;
}

/* ---------- Tokens: LIGHT ---------- */
:root[data-theme="light"] {
  --bg:        #fafaf7;
  --bg-2:      #f1ede5;
  --bg-3:      #e8e2d6;
  --line:      #ddd6c8;
  --line-2:    #c6bca8;
  --fg:        #1a1714;
  --fg-2:      #423a31;
  --fg-3:      #6a6052;

  --ember:      #d94a1f;
  --ember-soft: #c0401a;
  --ember-deep: #f06a3a;

  --blue:       #1f5d8c;   /* deep thermal-blue, AA on light */
  --blue-soft:  #2b6cb0;
  --blue-deep:  #1e3a5f;

  --shadow-1: 0 1px 2px rgba(40,30,20,.08);
  --shadow-2: 0 18px 40px rgba(40,30,20,.12), 0 2px 8px rgba(40,30,20,.08);

  color-scheme: light;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background var(--t), color var(--t);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--ember); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 400; line-height: 1.12; letter-spacing: -0.01em; min-height: 0; }
h1 { font-size: clamp(40px, 6vw, 76px); }
h2 { font-size: clamp(32px, 4.4vw, 54px); }
h3 { font-size: clamp(22px, 2.4vw, 28px); }
.italic { font-style: italic; }
.ember  { color: var(--ember); }
.blue   { color: var(--blue); }
p { text-wrap: pretty; }

.mono {
  font-family: var(--f-mono);
  font-size: 0.74em;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue);
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--blue); opacity: .6;
}
.eyebrow.warm { color: var(--ember); }
.eyebrow.warm::before { background: var(--ember); }

.lead { font-size: clamp(18px, 2vw, 22px); color: var(--fg-2); line-height: 1.55; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .container { padding: 0 20px; } }
.section { padding: clamp(64px, 10vw, 120px) 0; }
.section-sm { padding: clamp(48px, 7vw, 80px) 0; }
.section-head { max-width: 720px; }
.section-head .eyebrow { margin-bottom: 20px; }
.section-head h2 { margin-bottom: 18px; }
.section-head p { color: var(--fg-2); font-size: 18px; }
.divider { height: 1px; background: var(--line); border: 0; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-1); }
.nav-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav-mid { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative;
  font-size: 14.5px; color: var(--fg-2);
  padding: 8px 12px; border-radius: var(--r);
  transition: color var(--t), background var(--t);
  white-space: nowrap;
}
.nav-link:hover { color: var(--fg); }
.nav-link[aria-current="page"] { color: var(--fg); }
.nav-link[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 2px; background: var(--ember); border-radius: 2px;
}
.nav-right { display: flex; align-items: center; gap: 10px; }

/* Logo lockup */
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-word { font-family: var(--f-display); font-size: 25px; letter-spacing: -0.01em; color: var(--fg); line-height: 1; }

/* Theme toggle */
.theme-toggle {
  width: 40px; height: 40px; border-radius: var(--r);
  border: 1px solid var(--line); display: grid; place-items: center;
  color: var(--fg-2); transition: all var(--t);
}
.theme-toggle:hover { color: var(--blue); border-color: var(--blue); }
.theme-toggle svg { width: 17px; height: 17px; }
:root[data-theme="dark"]  .theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun  { display: none; }

.nav-login {
  font-size: 14.5px; color: var(--fg-2); padding: 8px 12px;
  transition: color var(--t);
}
.nav-login:hover { color: var(--fg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 500; line-height: 1;
  padding: 13px 20px; border-radius: var(--r);
  border: 1px solid transparent;
  transition: transform var(--t), background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
  white-space: nowrap; min-height: 44px;
}
.btn .arrow { transition: transform var(--t); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--ember); color: #fff; box-shadow: 0 6px 18px rgba(217,74,31,.28); }
.btn-primary:hover { background: var(--ember-soft); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(217,74,31,.36); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }
.btn-sm { padding: 10px 16px; font-size: 14px; min-height: 40px; }
.nav-cta { padding: 10px 18px; font-size: 14.5px; min-height: 40px; }

/* text link with arrow */
.tlink {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue); transition: gap var(--t), color var(--t);
}
.tlink:hover { gap: 12px; color: var(--blue-soft); }

/* Mobile nav */
.nav-burger { display: none; width: 44px; height: 44px; border-radius: var(--r); border: 1px solid var(--line); place-items: center; color: var(--fg); }
.nav-burger svg { width: 20px; height: 20px; }
.mobile-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: 24px;
  transform: translateY(-100%);
  transition: transform 360ms cubic-bezier(.2,.7,.2,1);
  visibility: hidden;
}
.mobile-overlay.open { transform: translateY(0); visibility: visible; }
.mobile-overlay-top { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.mobile-links { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; }
.mobile-links a {
  font-family: var(--f-display); font-size: 32px; color: var(--fg);
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.mobile-links a[aria-current="page"] { color: var(--ember); }
.mobile-cta-row { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 24px; }

@media (max-width: 1040px) {
  .nav-mid { display: none; }
  .nav-login { display: none; }
  .nav-burger { display: grid; }
}

/* ---------- Hero / page header ---------- */
.page-hero { position: relative; padding: clamp(72px, 12vw, 140px) 0 clamp(48px, 7vw, 84px); overflow: hidden; }
.page-hero .container { position: relative; z-index: 1; }
.thermal-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .9;
  background:
    radial-gradient(60% 80% at 8% 120%, color-mix(in oklab, var(--ember) 26%, transparent) 0%, transparent 60%),
    radial-gradient(55% 75% at 100% -10%, color-mix(in oklab, var(--blue) 22%, transparent) 0%, transparent 58%);
}
:root[data-theme="light"] .thermal-bg { opacity: .5; }
.breadcrumb { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 22px; }
.breadcrumb a { color: var(--fg-3); transition: color var(--t); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .sep { margin: 0 8px; opacity: .5; }
.hero-title { margin: 18px 0 22px; max-width: 16ch; }
.page-hero .lead { max-width: 60ch; }
.hero-cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px)  { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  padding: 28px 26px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.card:hover { border-color: var(--blue); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card.warm:hover { border-color: var(--ember); }
.card .kicker { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue); margin-bottom: 14px; }
.card.warm .kicker { color: var(--ember); }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--fg-2); font-size: 14.5px; line-height: 1.55; }

/* icon tile */
.icon-tile {
  width: 46px; height: 46px; border-radius: var(--r);
  display: grid; place-items: center; margin-bottom: 18px;
  background: color-mix(in oklab, var(--blue) 16%, transparent);
  color: var(--blue);
  border: 1px solid color-mix(in oklab, var(--blue) 30%, transparent);
}
.icon-tile.warm { background: color-mix(in oklab, var(--ember) 16%, transparent); color: var(--ember); border-color: color-mix(in oklab, var(--ember) 30%, transparent); }
.icon-tile svg { width: 22px; height: 22px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.08em;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--fg-2);
  background: var(--bg-2);
}
.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--blue); }
.badge.warm .dot { background: var(--ember); }
.badge-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Tooltip on abbreviations */
.tip { border-bottom: 1px dotted var(--blue); cursor: help; position: relative; }
.tip::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 280px;
  background: var(--bg-3); color: var(--fg); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 10px 12px;
  font-family: var(--f-body); font-size: 12.5px; line-height: 1.45; letter-spacing: 0; text-transform: none;
  box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transition: opacity var(--t), transform var(--t); z-index: 50; pointer-events: none;
}
.tip:hover::after, .tip:focus::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ---------- CTA band ---------- */
.cta-band { position: relative; overflow: hidden; }
.cta-band .thermal-bg { opacity: 1; }
:root[data-theme="light"] .cta-band .thermal-bg { opacity: .55; }
.cta-inner { position: relative; z-index: 1; text-align: center; max-width: 720px; margin: 0 auto; }
.cta-inner h2 { margin-bottom: 18px; }
.cta-inner .lead { margin: 0 auto 30px; max-width: 52ch; }
.cta-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-top: 30px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--fg-3); }
.cta-trust span { display: inline-flex; align-items: center; gap: 8px; }
.cta-trust span::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--blue); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 64px 0 40px; background: var(--bg-2); color: var(--fg-2); font-size: 14.5px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand .brand { margin-bottom: 16px; }
.foot-brand p { color: var(--fg-3); font-size: 14px; max-width: 30ch; }
.foot-col h4 { font-family: var(--f-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 16px; }
.foot-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.foot-col a { color: var(--fg-2); transition: color var(--t); }
.foot-col a:hover { color: var(--blue); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 13px; }
.foot-bottom .mono { font-family: var(--f-mono); letter-spacing: 0.08em; }
.foot-siqmo { font-size: 13.5px; }
.foot-siqmo b { color: var(--fg); font-weight: 500; }

/* ---------- Reveal on scroll ----------
   NOTE: opacity is intentionally NOT animated — some embedded preview
   contexts pause the animation timeline, which would freeze an
   opacity transition at 0 and hide all content. Animating only
   transform keeps content fully visible even if the timeline stalls. */
.reveal { transform: translateY(18px); transition: transform 700ms cubic-bezier(.2,.7,.2,1); }
.reveal.in { transform: none; }
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
@media (prefers-reduced-motion: reduce) { .reveal { transform: none; transition: none; } }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mt-3 { margin-top: 40px; }
.muted { color: var(--fg-3); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; }
.flex { display: flex; }
.wrap { flex-wrap: wrap; }
.gap-s { gap: 10px; } .gap-m { gap: 20px; }
.no-scroll { overflow: hidden; }

/* Instant, flicker-free theme swap (suppress transitions during switch) */
:root.theme-switching, :root.theme-switching *, :root.theme-switching *::before, :root.theme-switching *::after { transition: none !important; }
