/* ==========================================================================
   E-HUNTER AI - Brand design system
   Dark-first, gold-accented. Gold holds roughly 10-15% of the interface.
   ========================================================================== */

:root {
  /* Brand palette */
  --color-black: #000000;
  --color-background: #0b0b0d;
  --color-surface: #17181c;
  --color-surface-2: #121316;
  --color-elevated: #1d1f24;
  --color-gold: #f5a900;
  --color-gold-light: #ffc83d;
  --color-gold-dark: #c77b00;
  --color-white: #f5f5f5;
  --color-silver: #c8c9cc;
  --color-muted: #858890;
  --color-border: #292b31;
  --color-border-soft: #1f2126;

  /* Gradients */
  --gold-gradient: linear-gradient(135deg, #ffd45a 0%, #f5a900 50%, #c77b00 100%);
  --silver-gradient: linear-gradient(135deg, #ffffff 0%, #d8d9dc 55%, #9b9ea5 100%);
  --dark-gradient: linear-gradient(135deg, #17181c 0%, #050506 100%);
  --surface-gradient: linear-gradient(160deg, #17181c 0%, #0e0f12 100%);

  /* Typography */
  --font-heading: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  /* Shape */
  --radius-button: 8px;
  --radius-card: 14px;
  --radius-pill: 999px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Elevation */
  --shadow-gold: 0 10px 35px rgba(245, 169, 0, 0.14);
  --shadow-gold-strong: 0 18px 50px rgba(245, 169, 0, 0.26);
  --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.45);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 0.35s;

  /* Layout */
  --header-height: 76px;
  --section-padding: clamp(64px, 8vw, 120px);

  /* ---- Semantic tokens ----
     These are the ones that must differ between the themes by more than a
     value swap. --color-gold stays the brand fill everywhere; --color-gold-ink
     is the accent used as *text*, which needs a darker mix to stay readable on
     a light page. In dark mode the two are the same colour. */
  --color-gold-ink: var(--color-gold);
  --color-gold-ink-hover: var(--color-gold-light);
  /* Primary reading colour. Aliased to --color-white so both themes get it
     from the one place they already invert. */
  --color-text: var(--color-white);
  /* Text that sits on top of a gold fill. */
  --color-on-gold: #080808;
  /* A border that is visible rather than merely present. */
  --color-border-strong: #474b55;
  /* Neutral wash used for hovers and subtle fills. */
  --wash-subtle: rgba(255, 255, 255, 0.04);
  --wash-soft: rgba(255, 255, 255, 0.07);
  --wash-strong: rgba(255, 255, 255, 0.16);
  /* Translucent header background. */
  --header-scrolled-bg: rgba(11, 11, 13, 0.86);
  /* Tint behind gold-accented chips, icons and outlines. */
  --gold-tint: rgba(245, 169, 0, 0.10);
  --gold-tint-strong: rgba(245, 169, 0, 0.18);
  --gold-outline: rgba(245, 169, 0, 0.30);
}

/* Light mode - an inverted surface set that keeps the gold identity. */
[data-theme="light"] {
  --color-black: #ffffff;
  --color-background: #f4f5f8;
  --color-surface: #ffffff;
  --color-surface-2: #ffffff;
  --color-elevated: #ffffff;
  --color-white: #101114;
  --color-silver: #3a3d44;
  --color-muted: #5e626b;
  --color-border: #d6d9e0;
  --color-border-soft: #e6e8ee;
  --dark-gradient: linear-gradient(135deg, #ffffff 0%, #eef0f4 100%);
  --surface-gradient: linear-gradient(160deg, #ffffff 0%, #f4f5f8 100%);
  --silver-gradient: linear-gradient(135deg, #23252b 0%, #3d4048 55%, #5d616a 100%);
  --shadow-card: 0 16px 40px rgba(16, 17, 20, 0.08);
  --shadow-gold: 0 12px 32px rgba(154, 98, 0, 0.16);
  --shadow-gold-strong: 0 18px 44px rgba(154, 98, 0, 0.26);

  /* Semantic overrides.

     The brand gold is a 1.9:1 contrast against white, so using it for text or
     a hairline the way dark mode does leaves both invisible. Gold stays the
     fill colour; anything that has to be *read* switches to the darker ink. */
  --color-gold-ink: #9a6200;
  --color-gold-ink-hover: #7a4d00;
  --color-on-gold: #241900;
  --color-border-strong: #a9aeba;
  --wash-subtle: rgba(16, 17, 20, 0.035);
  --wash-soft: rgba(16, 17, 20, 0.06);
  --wash-strong: rgba(16, 17, 20, 0.14);
  --header-scrolled-bg: rgba(255, 255, 255, 0.92);
  --gold-tint: rgba(154, 98, 0, 0.09);
  --gold-tint-strong: rgba(154, 98, 0, 0.16);
  --gold-outline: rgba(154, 98, 0, 0.34);

  /* The gold text gradient washes out on white; darken its stops so
     .text-gradient-gold headings stay legible. */
  --gold-gradient-text: linear-gradient(135deg, #b07000 0%, #9a6200 55%, #7a4d00 100%);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  background-color: var(--color-background);
  color: var(--color-silver);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4 {
  font-family: var(--font-heading);
  color: var(--color-white);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.85rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }

p { color: var(--color-silver); }

a {
  color: var(--color-gold-ink);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}

a:hover { color: var(--color-gold-ink-hover); }

::selection {
  background: var(--color-gold);
  color: var(--color-on-gold);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-background); }
::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-gold-dark); }

/* --------------------------------------------------------------------------
   Typographic utilities
   -------------------------------------------------------------------------- */

.text-gradient-gold {
  background: var(--gold-gradient-text, var(--gold-gradient));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-gradient-silver {
  background: var(--silver-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-gold { color: var(--color-gold-ink) !important; }
.text-silver { color: var(--color-silver) !important; }
.text-muted-eh { color: var(--color-muted) !important; }
.text-white-eh { color: var(--color-white) !important; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold-ink);
  padding: 7px 16px;
  border: 1px solid var(--gold-outline);
  border-radius: var(--radius-pill);
  background: var(--gold-tint);
  margin-bottom: 20px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-gold);
  box-shadow: 0 0 10px var(--color-gold);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.75); }
}

.section-title {
  margin-bottom: 18px;
}

.section-subtitle {
  color: var(--color-muted);
  font-size: 1.06rem;
  max-width: 640px;
  margin-inline: auto;
}

.section-padding { padding: var(--section-padding) 0; }

.divider-gold {
  width: 72px;
  height: 3px;
  background: var(--gold-gradient);
  border-radius: var(--radius-pill);
  margin: 22px auto 0;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: var(--radius-button);
  padding: 13px 26px;
  transition: all var(--speed) var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary-eh {
  background: linear-gradient(135deg, #ffc83d, #f5a900);
  color: var(--color-on-gold);
  border: none;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(245, 169, 0, 0.22);
}

.btn-primary-eh:hover {
  background: linear-gradient(135deg, #ffd45a, #ffc83d);
  color: var(--color-on-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-strong);
}

.btn-secondary-eh {
  background: transparent;
  color: var(--color-white);
  border: 1px solid var(--color-gold-ink);
}

.btn-secondary-eh:hover {
  background: var(--gold-tint-strong);
  color: var(--color-gold-ink-hover);
  border-color: var(--color-gold-ink-hover);
  transform: translateY(-2px);
}

.btn-ghost-eh {
  background: transparent;
  color: var(--color-silver);
  border: 1px solid var(--color-border);
}

.btn-ghost-eh:hover {
  border-color: var(--color-gold-ink);
  color: var(--color-gold-ink);
  background: var(--gold-tint);
}

/* A light sheen that sweeps across the primary button on hover. */
.btn-primary-eh::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -120%;
  width: 60%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease);
}

.btn-primary-eh:hover::after { left: 130%; }

.btn-lg-eh { padding: 16px 34px; font-size: 1.02rem; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.eh-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 28px;
  height: 100%;
  transition: all var(--speed) var(--ease);
  position: relative;
  overflow: hidden;
}

.eh-card:hover {
  border-color: var(--color-gold-ink);
  box-shadow: var(--shadow-gold);
  transform: translateY(-6px);
}

/* Gold line that draws itself along the top edge on hover. */
.eh-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 2px;
  background: var(--gold-gradient);
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform 0.45s var(--ease);
}

.eh-card:hover::before { transform: scaleX(1); }

.card-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--gold-tint);
  border: 1px solid var(--gold-outline);
  color: var(--color-gold-ink);
  font-size: 1.6rem;
  margin-bottom: 20px;
  transition: all var(--speed) var(--ease);
}

.eh-card:hover .card-icon {
  background: var(--gold-gradient);
  color: var(--color-on-gold);
  transform: rotateY(180deg);
}

.card-title {
  font-size: 1.22rem;
  margin-bottom: 12px;
}

.card-text {
  color: var(--color-muted);
  font-size: 0.96rem;
  margin-bottom: 0;
}

.card-link-eh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-gold-ink);
}

/* inline-block so the transforms below actually paint: they are ignored on
   a non-replaced inline box, which <i> is by default. */
.card-link-eh i {
  display: inline-block;
  transition: transform var(--speed) var(--ease);
}

.card-link-eh:hover i { transform: translateX(5px); }
[dir="rtl"] .card-link-eh i { transform: scaleX(-1); }

/* The nudge on hover has to travel with the mirrored glyph, so it moves the
   other way once scaleX has flipped the axis. */
[dir="rtl"] .card-link-eh:hover i { transform: scaleX(-1) translateX(5px); }

/* --------------------------------------------------------------------------
   Surfaces and backgrounds
   -------------------------------------------------------------------------- */

.bg-surface { background: var(--color-surface); }
.bg-surface-2 { background: var(--color-surface-2); }
.bg-dark-gradient { background: var(--dark-gradient); }
.bg-black-eh { background: var(--color-black); }

.section-glow {
  position: relative;
  isolation: isolate;
}

/* .section-glow kept as a hook so the templates using it need no edit, but
   it no longer paints anything: the gold radial that bloomed above these
   sections was the same generated-design signature as the hero's. */

.grid-pattern {
  background-image:
    linear-gradient(rgba(245, 169, 0, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 169, 0, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
}

.noise-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.eh-input,
.form-control.eh-input,
.form-select.eh-input {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-white);
  border-radius: var(--radius-button);
  padding: 13px 17px;
  font-size: 0.97rem;
  transition: all var(--speed) var(--ease);
}

.eh-input::placeholder { color: var(--color-muted); }

.eh-input:focus,
.form-control.eh-input:focus,
.form-select.eh-input:focus {
  background: var(--color-surface);
  border-color: var(--color-gold-ink);
  color: var(--color-white);
  box-shadow: 0 0 0 3px var(--gold-tint-strong);
  outline: none;
}

.form-select.eh-input option {
  background: var(--color-surface);
  color: var(--color-white);
}

.form-label {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 8px;
}

.invalid-feedback, .errorlist {
  color: #ff6b6b;
  font-size: 0.85rem;
  list-style: none;
  padding: 0;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Badges and pills
   -------------------------------------------------------------------------- */

.badge-gold {
  background: var(--gold-tint);
  color: var(--color-gold-ink);
  border: 1px solid var(--gold-outline);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-heading);
}

.badge-outline {
  background: transparent;
  color: var(--color-silver);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Animation helpers
   -------------------------------------------------------------------------- */

/* Reveal-on-scroll. Elements only start hidden once JS confirms it can reveal
   them (main.js sets .js-reveal on <html>), so the content stays visible if
   JavaScript is blocked or fails to load. */
.js-reveal [data-animate] {
  opacity: 0;
  transform: translateY(28px);
}

[data-animate] {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js-reveal [data-animate="left"] { transform: translateX(-32px); }
.js-reveal [data-animate="right"] { transform: translateX(32px); }
.js-reveal [data-animate="zoom"] { transform: scale(0.94); }

[data-animate].is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* Typewriter caret.

   The caret only exists while main.js is typing - it is added with the text
   and removed when the line finishes - so a page without JS shows the plain
   sentence and no stray bar. */
.type-caret {
  display: inline-block;
  width: 2px;
  margin-inline-start: 3px;
  vertical-align: text-bottom;
  background: var(--color-gold);
  align-self: stretch;
  animation: caret-blink 1s step-end infinite;
}

/* The caret's height follows the line it sits on. */
.is-typing .type-caret,
.is-typed .type-caret {
  height: 1.05em;
}

.is-typed .type-caret { display: none; }

@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Cycling lines are not the same length, so as one is deleted and the next
   typed the paragraph can flip between one and two rendered lines - which
   shoves the buttons under it up and down by a whole line height while the
   visitor is reading.

   Reserving two lines' worth of height keeps the block below still. The text
   stays top-aligned inside that box so a short line does not float. */
[data-typewriter] {
  min-height: calc(2 * 1.62em);
}

/* Where the sentences are short enough that two lines are never needed, the
   reserved box would leave a visible gap. Below the lg breakpoint the column
   is narrower and wrapping is the norm, so the reservation grows rather than
   shrinks. */
@media (max-width: 991.98px) {
  [data-typewriter] {
    min-height: calc(3 * 1.75em);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  /* Never hide content for visitors who prefer reduced motion. */
  .js-reveal [data-animate],
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
  }
  .type-caret { animation: none; }
}
