/* FOX TERMINAL theme layer (2026-10-30). Loaded after style.css on every page.
   Colours only + glow: no layout, no animation changes. Dark = deep navy-black + orange/amber glow.
   Light = white-ish + orange accents. Brand assets live in /brand/ (see brand/README.md). */
:root,
:root[data-theme="dark"] {
  --fox-orange: #ff8a1f;
  --fox-amber: #ffb020;
  --fox-ember: #ff5f0f;
  --fox-grad: linear-gradient(135deg, #ff6a13 0%, #ff8a1f 45%, #ffb020 100%);
  --fox-glow: 0 0 18px rgba(255, 138, 31, 0.35), 0 0 2px rgba(255, 176, 32, 0.6);
  --fox-glow-soft: 0 0 24px rgba(255, 122, 26, 0.18);
  --fox-ink: #0a0e17;
}
:root[data-theme="light"] {
  --fox-glow: 0 4px 14px rgba(255, 122, 26, 0.28);
  --fox-glow-soft: 0 2px 10px rgba(194, 65, 12, 0.10);
}

/* Deep navy-black canvas behind the (recoloured) wave animation */
html[data-theme="dark"] body,
html:not([data-theme]) body {
  background-color: #0a0e17;
  background-image: radial-gradient(120% 80% at 50% 115%, rgba(255, 106, 19, 0.10) 0%, rgba(10, 14, 23, 0) 60%);
  background-attachment: fixed;
}
html[data-theme="light"] body {
  background-color: #fcfbf9;
  background-image: radial-gradient(120% 70% at 50% 120%, rgba(255, 138, 31, 0.07) 0%, rgba(252, 251, 249, 0) 60%);
  background-attachment: fixed;
}

/* Primary actions: orange -> amber gradient with soft glow (both themes) */
.btn.primary,
a.btn.primary,
a.btn.primary:hover,
a.btn.primary:visited,
a.btn.primary:active {
  background: var(--fox-grad);
  border-color: transparent;
  color: var(--fox-ink);
  box-shadow: var(--fox-glow);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.primary:disabled { box-shadow: none; }

/* Cards: faint warm rim light in dark mode */
html[data-theme="dark"] .card,
html:not([data-theme]) .card { box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 138, 31, 0.06); }

/* Brand logo: fox icon with glow */
.brand-logo,
.login-logo img { filter: drop-shadow(0 0 10px rgba(255, 122, 26, 0.45)); }
html[data-theme="light"] .brand-logo,
html[data-theme="light"] .login-logo img { filter: drop-shadow(0 2px 6px rgba(194, 65, 12, 0.25)); }
.brand-logo { object-fit: contain; border-radius: 8px; }
.brand h1 { letter-spacing: 0.06em; }
html[data-theme="dark"] .brand h1 { background: var(--fox-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* AI Studio mind-map: each domain keeps its own neon colour at rest (sample look); hover/active unchanged */
.ai-node[data-domain="STRATEGY"] { --node-hot: #4ade80; }
html[data-theme="dark"] body.page-ai .ai-node:not(.is-on):not(.is-done) {
  border-color: color-mix(in srgb, var(--node-hot) 70%, transparent);
  color: color-mix(in srgb, var(--node-hot) 55%, #ffffff);
  background: color-mix(in srgb, var(--node-hot) 8%, #0b0f19);
  box-shadow: 0 0 10px color-mix(in srgb, var(--node-hot) 35%, transparent);
}

/* Focus ring in brand colour */
:focus-visible { outline-color: var(--fox-orange); }

/* ---------- Login: split layout (banner shown whole + form) ----------
   Desktop >= 900px: banner left, form right, over the dark brand background.
   Below 900px: banner on top at full width, form below. The banner is never cropped or stretched
   (width 100%, height auto, native 2:1 ratio). Its baked-in CTA is decorative: no link, no pointer events. */
html, body.page-login { max-width: 100%; }
body.page-login { overflow-x: hidden; }
body.page-login .login-wrap.login-split {
  min-height: calc(100vh - 60px);
  min-height: calc(100dvh - 60px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  align-content: start;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 8px;
  box-sizing: border-box;
}
body.page-login .login-banner {
  margin: 0;
  width: 100%;
  max-width: 100%;
  line-height: 0;
  background: #0a0e17;
  overflow: hidden;
  pointer-events: none;      /* artwork only: the drawn "Discover Fox Terminal" button is not clickable */
  user-select: none;
  -webkit-user-select: none;
}
body.page-login .login-banner picture,
body.page-login .login-banner-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1774 / 887;
  object-fit: contain;
}
body.page-login .login-split .login-card {
  width: min(420px, calc(100vw - 24px));
  max-width: 100%;
  box-sizing: border-box;
}
@media (min-width: 900px) {
  body.page-login .login-wrap.login-split {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    align-content: center;
    gap: clamp(24px, 3vw, 48px);
    max-width: 1440px;
    padding: 32px clamp(20px, 3vw, 48px) 8px;
  }
  body.page-login .login-banner {
    border-radius: 18px;
    border: 1px solid rgba(255, 138, 31, 0.22);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 42px rgba(255, 122, 26, 0.16);
  }
  body.page-login .login-split .login-card { width: 100%; }
}
html[data-theme="light"] body.page-login .login-banner {
  border-color: rgba(194, 65, 12, 0.18);
  box-shadow: 0 18px 44px rgba(10, 14, 23, 0.18), 0 0 30px rgba(255, 138, 31, 0.12);
}
@media (max-width: 899px) {
  body.page-login .login-split .login-card { margin: 0 auto; }
}
/* Wordmark under the icon on login */
.login-wordmark { text-align: center; margin: 6px 0 4px; }
.login-wordmark strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: 0.14em; background: var(--fox-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-wordmark span { display: block; font-size: 10px; letter-spacing: 0.22em; color: var(--muted); margin-top: 2px; }
body.page-login .login-logo img { width: min(128px, 40%); }

/* Light mode: keep the wave animation but draw it as warm orange lines on white (was a grey veil). */
html[data-theme="light"] body #wave-bg.wave-bg,
html[data-theme="light"] body #studio-wave-bg.studio-wave-bg,
html[data-theme="light"] body #studio-wave-bg.wave-bg {
  filter: invert(1) hue-rotate(180deg) saturate(1.2);
  opacity: 0.22;
}
html[data-theme="light"] body:has(.ai-desk[data-state="speaking"]) #wave-bg,
html[data-theme="light"] body:has(.ai-desk[data-state="listening"]) #wave-bg,
html[data-theme="light"] body:has(.ai-desk[data-state="working"]) #wave-bg,
html[data-theme="light"] body:has(.ai-desk.is-speaking) #wave-bg { opacity: 0.32; }

/* Home > Engine: News window / News trade pills — spacing, wrap on narrow screens */
#engine .news-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; max-width: 100%; }
#engine .news-chip-row > .chip { margin: 0; max-width: 100%; }

/* FOX footer2 (2026-10-30): "Technology & Integrations" block above the Privacy / Terms links.
   Transparent (no box/border/shadow) since footer2; layout, sizes and padding unchanged from footer1.
   Dark theme: light text; light theme: dark text. Logos are inline SVG using currentColor. */
.foot .fox-integrations {
  display: block;
  box-sizing: border-box;
  width: min(620px, calc(100% - 24px));
  margin: 0 auto 16px;
  padding: 22px 24px 20px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  color: #f4f6fa;
  line-height: 1.4;
}
html[data-theme="light"] .foot .fox-integrations { color: #0a0e17; }
.foot .fox-integrations p { margin: 0; }
.foot .fox-int-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #8b95a8;
}
.foot .fox-int-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  margin: 12px 0 10px !important;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #f4f6fa;
}
.foot .fox-int-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.foot .fox-int-logo {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: block;
}
.foot .fox-int-logo-tv { width: 22px; }
.foot .fox-int-sep { color: #5c667a; font-weight: 400; }
html[data-theme="light"] .foot .fox-int-label,
html[data-theme="light"] .foot .fox-int-note { color: #5f6673; }
html[data-theme="light"] .foot .fox-int-list { color: #0a0e17; }
html[data-theme="light"] .foot .fox-int-sep { color: #9aa0aa; }
.foot .fox-int-note {
  font-size: 12px;
  color: #8b95a8;
  max-width: 46ch;
  margin-left: auto !important;
  margin-right: auto !important;
}
@media (max-width: 520px) {
  .foot .fox-integrations { padding: 18px 16px 16px; }
  .foot .fox-int-list { font-size: 16px; gap: 6px 12px; }
  .foot .fox-int-logo { width: 18px; height: 18px; }
  .foot .fox-int-logo-tv { width: 20px; }
}
@media (max-width: 340px) {
  .foot .fox-int-sep { display: none; }
}

/* FOX footer2 (2026-10-30) b: mobile — keep Privacy / Terms links clear of the floating "Ask AI" button
   (.home-ask: fixed, bottom 20px, 44px tall). Body already has 40px bottom padding; add 48px under the links. */
@media (max-width: 760px) {
  .foot { padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
}

/* FOX footer2 (2026-10-30) c: DESKTOP login only (>= 980px) — banner + tech block + Privacy / Terms fit one viewport.
   Page is a 100dvh flex column; the banner stage scales with viewport height (2:1 artwork, min 980px so the
   overlaid form keeps its >= 980px composition); footer spacing tightened. Mobile / tablet login unchanged. */
@media (min-width: 980px) {
  html body.page-login {
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: 12px;
  }
  html body.page-login .login-wrap.login-v2 {
    flex: 1 0 auto;
    min-height: 0;
    padding-top: 20px;
  }
  html body.page-login .login-v2 .login-stage {
    width: min(1320px, 100%, max(980px, calc((100vh - 232px) * 2)));
    width: min(1320px, 100%, max(980px, calc((100dvh - 232px) * 2)));
  }
  html body.page-login .foot { margin-top: 8px; flex: 0 0 auto; }
  html body.page-login .foot .fox-integrations { padding: 12px 24px 10px; margin-bottom: 6px; }
  html body.page-login .foot .fox-int-list { margin: 8px 0 6px !important; }
}
