/* ==========================================================================
   HORIZON AGENCY — styles.css
   Doar ce nu există nativ în Tailwind: font imports, tokens de culoare,
   animații custom, tratament logo wall, wordmark, accordion, stamp.
   Restul layout-ului e Tailwind (CDN).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800;900&family=Inter:wght@400;500;600&display=swap');

/* ---------- 2.2 Paletă de culori ----------
   Notă: culorile din markup sunt exprimate în Tailwind, cu perechi
   `X` (light, default) / `dark:X-d` — vezi tailwind.config din index.html.
   Variabilele de mai jos deservesc EXCLUSIV utilitățile custom din acest
   fișier (stamp, wordmark, card, field, text-stroke...), care nu au
   echivalent nativ în Tailwind. Light = :root, dark = html.dark. */
:root {
  --bg-primary:      #FAFAF8;
  --bg-surface:      #F0EFEB;
  --bg-surface-alt:  #E6E4DE;
  --text-primary:    #141414;
  --text-muted:      #5C5C5C;
  /* §11.2: accentul de brand e EXACT acelasi hex in light si in dark (#FA3C00),
     fara variatie de luminozitate intre teme. Contrast pe #FAFAF8 = 3.52:1,
     deci AA valid pentru text MARE (>=3:1) si pentru elemente grafice/CTA cu
     fundal propriu, dar NU pentru text mic continuu -> acela foloseste
     --accent-text (#CC3100, 5.02:1), singura exceptie permisa. */
  --accent:          #FA3C00;
  --accent-hover:    #A82800;
  --accent-text:     #CC3100;
  --accent-grad-end: #D93300;
  --border-subtle:   #D8D6D0;

  --accent-rgb:      250, 60, 0;
  --accent-hover-rgb: 168, 40, 0;
  --grid-line:       rgba(20, 20, 20, .10);
  --stroke-color:    rgba(20, 20, 20, .52);
  --placeholder:     #8A8A84;
  /* Logo-uri flat, fundal transparent -> siluetă neagră pe fundal deschis */
  --logo-mono-filter: grayscale(1) brightness(0);
}

html.dark {
  --bg-primary:      #0A0A0A;
  --bg-surface:      #151515;
  --bg-surface-alt:  #1C1C1C;
  --text-primary:    #F5F5F5;
  --text-muted:      #9C9C9C;
  --accent:          #FA3C00;
  --accent-hover:    #F7744A;
  /* In dark, textul mic pe accent nu are problema de contrast (5.38:1),
     deci --accent-text e identic cu accentul de baza. */
  --accent-text:     #FA3C00;
  --accent-grad-end: #F7744A;
  --border-subtle:   #2A2A2A;

  --accent-rgb:      250, 60, 0;
  --accent-hover-rgb: 247, 116, 74;
  --grid-line:       rgba(42, 42, 42, .55);
  --stroke-color:    rgba(245, 245, 245, .42);
  --placeholder:     #6E6E6E;
  /* ...și siluetă albă pe fundal închis */
  --logo-mono-filter: grayscale(1) brightness(0) invert(1);
}

/* ---------- Bază ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  transition: background-color .3s ease, color .3s ease;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.font-display { font-family: 'Poppins', system-ui, sans-serif; font-weight: 900; }
.font-black-display { font-family: 'Poppins', system-ui, sans-serif; font-weight: 900; }

/* Selecție text pe accent */
::selection { background: var(--accent); color: #fff; }

/* Scrollbar discret, on-brand */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Focus vizibil (a11y) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
}

/* ---------- 2.4 Wordmark H⊙RIZON ---------- */
.wordmark {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.wordmark__ring {
  display: inline-block;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  width: 0.62em;
  height: 0.62em;
  margin: 0 0.12em;
  transition: box-shadow .35s ease, transform .35s ease, background-color .35s ease;
}
.wordmark:hover .wordmark__ring,
a:hover > .wordmark .wordmark__ring {
  box-shadow: 0 0 14px 1px rgba(var(--accent-rgb), .75);
  transform: rotate(180deg) scale(1.06);
}
.wordmark__sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.42em;
  color: var(--text-muted);
}

/* ---------- Text stroke (outline headings) ---------- */
.text-stroke {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--stroke-color);
  text-stroke: 1.5px var(--stroke-color);
}
@supports not ((-webkit-text-stroke: 1px #000) or (text-stroke: 1px #000)) {
  .text-stroke { color: var(--text-muted); }
}

/* ---------- Gradient text pe accent ---------- */
.text-accent-gradient {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-grad-end) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Eyebrow / kicker de secțiune ---------- */
.eyebrow {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  /* §11.2: 0.75rem = text mic, foloseste varianta AA-safe in light */
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}
.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}

/* ---------- 3.3 Stamp / tagline vizual ---------- */
/* Stare de eroare pentru #form-status (submit eșuat, endpoint indisponibil) */
.form-status--error { color: #DC2626 !important; }
.dark .form-status--error { color: #F87171 !important; }

.stamp {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent);
  border: 2px solid var(--accent);
  letter-spacing: 0.04em;
  line-height: 1.15;
  transform: rotate(-2.2deg);
  padding: 1rem 1.75rem;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0);
  transition: box-shadow .4s ease, transform .4s ease;
}
.stamp:hover {
  transform: rotate(-2.2deg) scale(1.02);
  box-shadow: 0 0 28px -4px rgba(var(--accent-rgb), .55);
}

/* ---------- Carduri ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: background-color .3s ease, border-color .3s ease, transform .3s ease;
}
.card:hover {
  background: var(--bg-surface-alt);
  border-color: var(--accent);
  transform: translateY(-4px);
}

/* Underline animat pe linkurile din nav */
.nav-link { position: relative; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  height: 2px; width: 0;
  background: var(--accent);
  transition: width .28s ease;
}
.nav-link:hover::after, .nav-link:focus-visible::after { width: 100%; }

/* Glow pe CTA-uri */
.btn-accent {
  background: var(--accent);
  color: #fff;
  transition: background-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 30px -6px rgba(var(--accent-hover-rgb), .8);
  transform: translateY(-2px);
}
.btn-ghost {
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: border-color .25s ease, color .25s ease, background-color .25s ease;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: rgba(var(--accent-rgb), .07);
}

/* ---------- 2.5 Logo wall: monocrom + opacitate, culoare pe hover ---------- */
.logo-img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: filter .35s ease, opacity .35s ease, transform .35s ease;
}
/* Logo-uri flat, cu fundal transparent -> siluetă albă */
.logo-mono {
  filter: var(--logo-mono-filter);
  opacity: .72;
}
/* Logo-uri cu fundal opac deschis / embleme detaliate -> doar desaturate */
.logo-mono-soft {
  filter: grayscale(1);
  opacity: .72;
}
.logo-tile:hover .logo-mono,
.logo-tile:hover .logo-mono-soft {
  filter: none;
  opacity: 1;
  transform: scale(1.05);
}

/* ---------- FAQ accordion ---------- */
.faq-item[open] .faq-icon { transform: rotate(45deg); color: var(--accent); }
.faq-icon { transition: transform .3s ease, color .3s ease; }
.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary .faq-question { color: var(--accent-hover); }
.faq-answer { animation: faq-in .32s ease both; }
@keyframes faq-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Reveal on scroll ----------
   Progressive enhancement: fără JS (sau dacă IntersectionObserver nu rulează),
   conținutul rămâne vizibil. Ascundem doar când clasa .js-reveal e pusă de script. */
html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
  will-change: opacity, transform;
}
html.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- §8.3 Bandă marquee de logo-uri în HERO ----------
   CSS pur (fără JS / librărie de slider): lista de logo-uri e dublată în DOM,
   trackul se translatează cu exact -50% => bucla e perfectă, fără gap vizibil. */
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.logo-marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.logo-marquee__track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 3.25rem;
  animation: marquee-scroll 46s linear infinite;
  will-change: transform;
}
.logo-marquee:hover .logo-marquee__track { animation-play-state: paused; }
.logo-marquee__item { flex: 0 0 auto; display: flex; align-items: center; }
.logo-marquee .logo-img { opacity: .7; }

/* ---------- §8.7 + §9.3 Fundal hero: orizont + corp ceresc ----------
   Înlocuiește vechiul `.bg-grid` din hero. Totul e CSS/SVG nativ, decorativ,
   `pointer-events: none`, fără JS per-frame. */
.horizon-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.horizon-line {
  position: absolute;
  left: -6%;
  width: 112%;
  bottom: 34%;
  height: auto;
  opacity: .22;
}
.horizon-line--far { bottom: 44%; opacity: .1; }

/* Trackul se mișcă pe orizontală, corpul ceresc urcă/coboară în interiorul lui:
   compunerea celor două dă un arc natural peste linia de orizont. */
.celestial-track {
  position: absolute;
  bottom: 34%;
  left: 58%;
  width: 0;
  height: 0;
  animation: celestial-x 28s ease-in-out infinite alternate;
}
.celestial-body {
  display: block;
  animation: celestial-y 14s ease-in-out infinite alternate;
}
@keyframes celestial-x {
  from { transform: translateX(0); }
  to   { transform: translateX(min(34vw, 30rem)); }
}
@keyframes celestial-y {
  from { transform: translateY(-1rem); }
  to   { transform: translateY(-8rem); }
}

/* Lună (dark) vs soare (light), swap sincron cu theme-toggle prin clasa de pe <html> */
.celestial-moon,
.celestial-sun { border-radius: 50%; }
.celestial-moon {
  width: clamp(2.75rem, 5vw, 4.5rem); height: clamp(2.75rem, 5vw, 4.5rem);
  border: 2px solid rgba(245, 245, 245, .55);
  background: radial-gradient(circle at 34% 32%, rgba(245,245,245,.10), rgba(245,245,245,0) 70%);
  box-shadow: 0 0 42px -6px rgba(245, 245, 245, .28);
}
.celestial-sun {
  width: clamp(2.75rem, 5vw, 4.5rem); height: clamp(2.75rem, 5vw, 4.5rem);
  background: var(--accent);
  opacity: .82;
  box-shadow: 0 0 70px 6px rgba(var(--accent-rgb), .38);
}

/* ---------- Grid pattern subtil de fundal ---------- */
.bg-grid {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 0%, #000 20%, transparent 78%);
}

/* Halou de accent în hero */
.accent-glow {
  background: radial-gradient(circle, rgba(var(--accent-rgb),.20) 0%, rgba(var(--accent-rgb),0) 65%);
  filter: blur(28px);
}

/* Formular */
.field {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: border-color .25s ease, background-color .25s ease;
}
.field::placeholder { color: var(--placeholder); }
.field:focus { border-color: var(--accent); background: var(--bg-surface-alt); outline: none; }
.field option { background: var(--bg-surface); color: var(--text-primary); }

/* Respect pentru utilizatorii care nu vor animații */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html.js-reveal .reveal { opacity: 1; transform: none; }

  /* §8.3, banda de logo-uri rămâne statică și se așază pe mai multe rânduri */
  .logo-marquee__track {
    animation: none !important;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    row-gap: 1.75rem;
  }
  .logo-marquee { -webkit-mask-image: none; mask-image: none; }
  /* setul duplicat există doar pentru bucla infinită, static e redundant */
  .logo-marquee__item--clone { display: none; }

  /* §8.7, corpul ceresc rămâne fix, la mijlocul arcului */
  .celestial-track {
    animation: none !important;
    transform: translateX(min(17vw, 15rem));
  }
  .celestial-body {
    animation: none !important;
    transform: translateY(-4.5rem);
  }
}

/* ---------- 2.2bis Switcher temă: o singură iconiță vizibilă odată ---------- */
.theme-icon { transition: transform .35s ease, opacity .25s ease; }
.theme-icon--sun  { display: none; }
.theme-icon--moon { display: block; }
html.dark .theme-icon--sun  { display: block; }
html.dark .theme-icon--moon { display: none; }
#theme-toggle:hover .theme-icon,
#theme-toggle-mobile:hover .theme-icon { transform: rotate(35deg); }

/* În light mode, logo-urile „soft” (cu fundal propriu) au nevoie de puțin contrast în plus */
.logo-mono-soft { filter: grayscale(1) contrast(1.05); }
html.dark .logo-mono-soft { filter: grayscale(1); }

/* ---------- §6.1 Logo HORIZON real (swap light/dark prin clasele Tailwind
     `dark:hidden` / `hidden dark:block`, deci comută live cu theme-toggle) ---------- */
.horizon-logo {
  object-fit: contain;
  width: auto;
  transition: opacity .25s ease, transform .35s ease;
}
a:hover > .horizon-logo { transform: translateY(-1px); }

/* ---------- §6.6 Language switcher RO / EN ---------- */
.lang-btn {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  line-height: 1;
  padding: 0.72rem 0.6rem;
  min-width: 2.35rem;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: color .22s ease, background-color .22s ease;
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.is-active {
  color: #fff;
  background: var(--accent);
}
.lang-btn.is-active:hover { background: var(--accent-hover); color: #fff; }
.lang-btn--lg { padding: 1.05rem 0.85rem; font-size: 0.75rem; min-width: 2.9rem; }

/* ---------- §6.5 Echipă: poze reale + inițiale pentru cine nu are poză ---------- */
.team-photo {
  filter: grayscale(1) contrast(1.04);
  transition: filter .4s ease, transform .4s ease;
}
.card:hover .team-photo { filter: none; transform: scale(1.015); }

.team-initials {
  background: var(--bg-surface-alt);
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  transition: color .3s ease, border-color .3s ease;
}
.card:hover .team-initials { color: var(--accent); border-color: var(--accent); }

/* ---------- §3.6 Citate placeholder, marcate vizual ca fiind incomplete ---------- */
.quote-placeholder {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  opacity: .92;
}

/* ---------- NAV: fundal doar după scroll ---------- */
#site-nav.is-scrolled {
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border-subtle);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  #site-nav.is-scrolled { background: var(--bg-primary); }
}

/* Hamburger -> X */
#menu-toggle.is-open .menu-bar:first-child { transform: translateY(4px) rotate(45deg); }
#menu-toggle.is-open .menu-bar:last-child  { transform: translateY(-3px) rotate(-45deg); }

/* ---------- §9.1 Servicii, bento asimetric ----------
   Numărul mare (01-06) e pur decorativ (aria-hidden în markup), stă în fundal,
   iar descrierea rămâne VIZIBILĂ by default (fără hover-reveal, §9.1). */
.service-card { position: relative; overflow: hidden; }
.service-card__num {
  position: absolute;
  top: -0.06em;
  right: 0.08em;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(3.75rem, 8vw, 6.5rem);
  line-height: 1;
  color: var(--text-primary);
  opacity: .05;
  letter-spacing: -0.05em;
  pointer-events: none;
  transition: opacity .35s ease, color .35s ease;
}
.service-card:hover .service-card__num { opacity: .12; color: var(--accent); }
.service-card--featured .service-card__num { font-size: clamp(5rem, 11vw, 9rem); opacity: .07; }
.service-card:hover { transform: translateY(-4px); border-color: var(--accent); }

/* ---------- §9.2 Micro-badge „fără BS”, ton direct, fără secțiune nouă ---------- */
.bs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  /* §11.2: 0.66rem = text mic, doar culoarea de TEXT e AA-safe in light,
     border-ul si punctul raman pe accentul de brand #FA3C00 */
  color: var(--accent-text);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  line-height: 1;
  background: rgba(var(--accent-rgb), .07);
}
.bs-badge::before {
  content: "";
  width: 0.4rem; height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

/* §9.2, prima întrebare din FAQ (cea a scepticului) primește accent vizual */
.faq-item--featured {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .05), transparent 42%);
}

/* ---------- §11.2 Nota de audit: unde ramane #CC3100 ----------
   Accentul de brand (#FA3C00) e IDENTIC in ambele teme pe elemente mari,
   CTA-uri, cifre din stats, borduri, grafica si gradientul din H2-uri.
   Singura exceptie e textul MIC continuu, care pe fundal deschis ar cobori la
   3.52:1 (sub AA): acolo folosim tokenul `--accent-text` (Tailwind:
   `text-accent-text` / `accent-text-d`), adica #CC3100 in light (5.02:1) si
   #FA3C00 in dark, unde problema nu exista.
   Locuri auditate individual care folosesc varianta AA-safe:
     .eyebrow (0.75rem), .bs-badge (0.66rem, doar culoarea de text),
     badge-urile de serviciu din cardurile de portofoliu (0.62rem),
     tagline-urile EN din cardurile de Servicii (text-xs),
     rolurile din grid-ul de echipa (text-sm), status-ul formularului (text-xs),
     starile :hover ale linkurilor mici din nav mobil / footer / contact.
   Raman pe #FA3C00 (verificate individual, contrast suficient): btn-accent si
   lang-btn (text alb pe fundal accent solid), cifrele din stats bar, .stamp,
   .text-accent-gradient din H2-uri, initialele din echipa, toate bordurile,
   punctele, barele si iconurile. */
