/* =========================================================================
   home.css — homepage only (enqueued conditionally on is_front_page()).
   Hero, Despre, Servicii preview, Programări preview, partners, FAQ preview,
   contact.
   ========================================================================= */

/* ---- Hero: editorial asymmetric layout on deep blue. Oversized display
   type, surname + tagline keyword in accent, city trust chips, layered
   static background depth (two outline rings + a soft radial glow — pure
   CSS pseudo-elements, nothing animating continuously, no backdrop-filter),
   portrait in a rounded mask with an offset accent ring and a floating
   phone card. Text sits on --brand, so it is white. ---- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: var(--white);
  overflow: hidden;
}
/* Static depth layers. Transform-only positioning, pointer-events off. */
.hero::before {
  /* Soft cyan glow behind the portrait side. */
  content: ""; position: absolute; pointer-events: none;
  right: -12%; bottom: -18%;
  width: clamp(420px, 55vw, 900px); aspect-ratio: 1;
  background: radial-gradient(circle, rgba(33, 188, 238, 0.14) 0%, rgba(33, 188, 238, 0) 62%);
}
.hero::after {
  /* Oversized outline ring drifting off the top-left. */
  content: ""; position: absolute; pointer-events: none;
  left: -10%; top: -32%;
  width: clamp(360px, 42vw, 720px); aspect-ratio: 1;
  border: 1.5px solid rgba(33, 188, 238, 0.14); border-radius: 50%;
}
.hero__grid { align-items: end; position: relative; z-index: 1; }
.hero__content {
  grid-column: 1 / span 7;
  padding-block: clamp(64px, 10vw, 140px);
}
.hero .hero__badge {
  /* .hero .hero__badge (not just .hero__badge): must outrank base.css's
     `.hero .kicker { color: var(--accent) }` so the chip text stays white. */
  display: inline-flex; align-items: center; gap: 0.55em;
  padding: 0.5em 1em; border-radius: 999px;
  background: rgba(33, 188, 238, 0.10);
  border: 1px solid rgba(33, 188, 238, 0.38);
  color: var(--white); letter-spacing: 0.12em;
  margin-bottom: 1.4rem;
}
.hero__badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: du-badge-pulse 2.4s ease-in-out infinite;
}
@keyframes du-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(33, 188, 238, 0.45); }
  55%      { box-shadow: 0 0 0 7px rgba(33, 188, 238, 0); }
}
.hero__title {
  color: var(--white); margin-bottom: 0.3em;
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
  line-height: 1.04; letter-spacing: -0.015em;
}
.hero__title-accent { color: var(--accent); display: inline-block; }
.hero__tagline {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  color: var(--white); margin: 0 0 1.4em;
}
.hero__tagline-accent { position: relative; display: inline-block; color: var(--accent); }
.hero__tagline-accent::after {
  /* Self-drawing underline; static state (no JS) is fully drawn. */
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.14em;
  height: 3px; border-radius: 2px; background: var(--accent);
  transform-origin: left center;
}
@keyframes du-underline-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.hero__cities {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.5rem; margin: 0 0 2em;
}
.hero__cities-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65); margin-right: 0.35rem;
}
.hero__city {
  padding: 0.38em 0.9em; border-radius: 999px; font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white); white-space: nowrap;
}
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__media {
  grid-column: 8 / span 5;
  align-self: end;
  position: relative;
  margin-top: clamp(24px, 4vw, 48px);
}
.hero__media::before {
  /* Offset accent ring peeking from behind the portrait's shoulder. */
  content: ""; position: absolute; pointer-events: none;
  top: -7%; right: -14%;
  width: clamp(220px, 24vw, 380px); aspect-ratio: 1;
  border: 2px solid rgba(33, 188, 238, 0.35); border-radius: 50%;
}
.hero__img {
  position: relative;
  width: 100%; height: auto;
  border-radius: clamp(22px, 3vw, 40px) clamp(22px, 3vw, 40px) 0 0;
  /* Soft fade into the blue at the base so the studio backdrop blends in. */
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
}
.hero__panel {
  position: absolute; left: clamp(-20px, -1.5vw, -12px); bottom: clamp(28px, 5vw, 56px);
  display: grid; gap: 0.15rem;
  padding: 0.85rem 1.15rem; border-radius: 12px;
  background: var(--white); color: var(--ink);
  border-left: 3px solid var(--accent);
  box-shadow: 0 18px 44px rgba(4, 29, 115, 0.35);
  text-decoration: none;
}
.hero__panel-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-500);
}
.hero__panel-value { font-family: var(--font-display); font-weight: 800; color: var(--brand); }

/* ---- Hero entrance: one-time, CSS-only (needs no scroll; gated behind
   .js-enabled so a no-JS visitor sees the complete final content immediately,
   same guard as the scroll-reveal system in base.css). Reduced motion kills
   it via the global animation:none in base.css.
   LCP note: the portrait wrapper animates TRANSFORM ONLY — the LCP image is
   never at opacity:0, so paint and LCP timing are unaffected. ---- */
@keyframes du-hero-rise {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes du-hero-drift {
  from { transform: translate3d(0, 26px, 0); }
  to   { transform: translate3d(0, 0, 0); }
}
.js-enabled .hero__content > * { animation: du-hero-rise 0.65s var(--ease-out) backwards; }
.js-enabled .hero__content .kicker { animation-delay: 0.05s; }
.js-enabled .hero__title           { animation-delay: 0.14s; }
.js-enabled .hero__tagline         { animation-delay: 0.24s; }
.js-enabled .hero__cities          { animation-delay: 0.32s; }
.js-enabled .hero__actions         { animation-delay: 0.42s; }
.js-enabled .hero__media { animation: du-hero-drift 0.9s var(--ease-out) backwards; }
/* The tagline underline draws itself after the tagline has risen, and the
   floating phone card rises last. Both are gated behind .js-enabled — the
   no-JS static state is the finished one. */
.js-enabled .hero__tagline-accent::after { animation: du-underline-draw 0.5s var(--ease-out) 0.85s backwards; }
.js-enabled .hero__panel { animation: du-hero-rise 0.6s var(--ease-out) 0.7s backwards; }

/* ---- Despre ---- */
.despre__body { grid-column: 2 / span 10; max-width: 800px; }
.despre__text { font-size: clamp(1.05rem, 1.6vw, 1.2rem); }

/* ---- Servicii preview: 3 cards on the 12-col grid ---- */
.services-preview > .service-card { grid-column: span 4; }
.services-preview > .service-card:nth-child(2) { --du-stagger: 90ms; }
.services-preview > .service-card:nth-child(3) { --du-stagger: 180ms; }

/* ---- Programări preview: 4 city cards on brand background ---- */
.section--brand .kicker { color: var(--accent); }
.cities-preview > .city-card { grid-column: span 3; }
.city-card {
  display: grid; gap: 0.35rem; align-content: start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  text-decoration: none; color: var(--white);
  transition: transform 0.25s var(--ease-out), border-color 0.25s, background-color 0.25s;
}
.city-card__name { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.city-card__count { font-size: 0.9rem; opacity: 0.85; }
.cities-preview > .city-card:nth-child(2) { --du-stagger: 80ms; }
.cities-preview > .city-card:nth-child(3) { --du-stagger: 160ms; }
.cities-preview > .city-card:nth-child(4) { --du-stagger: 240ms; }

/* ---- Partners strip. Styled names until real logo files exist.
   Continuous CSS-only marquee: the list is rendered twice in the markup
   (duplicate aria-hidden) and the track translates -50%, which is seamless
   because each copy carries a trailing padding equal to the item gap.
   overflow:hidden on the wrapper keeps it from ever widening the page.
   Reduced motion: animation dies (global rule in base.css) and the block
   below hides the duplicate + restores the static wrapped layout. ---- */
.partners { padding-block: clamp(40px, 6vw, 64px); }
.partners__label {
  text-align: center; font-family: var(--font-display); font-weight: 700;
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gray-500); margin-bottom: 1.5rem;
}
.partners__marquee { overflow: hidden; max-width: 100%; }
.partners__track {
  display: flex; width: max-content;
  animation: du-partners-marquee 32s linear infinite;
}
@keyframes du-partners-marquee {
  to { transform: translate3d(-50%, 0, 0); }
}
.partners__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: nowrap;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-right: clamp(1.5rem, 4vw, 3.5rem); /* = gap, for the seamless -50% loop */
}
.partners__item {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--gray-500);
  white-space: nowrap;
}

/* ---- Întrebări frecvente (homepage #intrebari). section--brand sits between
   partners (white) and contact (tint). ---- */
.faq-preview {
  max-width: 760px;
}
.faq-accordion {
  display: grid;
  gap: 0.75rem;
}
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item[open] {
  border-color: var(--brand);
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.1rem, 2.5vw, 1.35rem) clamp(1.25rem, 3vw, 1.6rem);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.08rem);
  line-height: 1.35;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease-out);
}
.faq-item[open] summary::after {
  transform: rotate(-135deg);
}
.faq-item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.faq-item__body {
  padding: 0 clamp(1.25rem, 3vw, 1.6rem) clamp(1.25rem, 3vw, 1.6rem);
  border-top: 1px solid var(--gray-200);
}
.faq-item__body p {
  margin: 0 0 1rem;
  line-height: 1.65;
  color: var(--ink);
}
.faq-accordion > .faq-item:nth-child(2) { --du-stagger: 70ms; }
.faq-accordion > .faq-item:nth-child(3) { --du-stagger: 140ms; }
.faq-accordion > .faq-item:nth-child(4) { --du-stagger: 210ms; }
.faq-accordion > .faq-item:nth-child(5) { --du-stagger: 280ms; }
.faq-accordion > .faq-item:nth-child(6) { --du-stagger: 350ms; }
.faq-closing {
  max-width: 760px;
  margin: clamp(1.5rem, 4vw, 2rem) 0 0;
  font-size: clamp(1rem, 1.6vw, 1.05rem);
  line-height: 1.6;
  color: var(--white);
}
.faq-closing a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.faq-closing a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Homepage services preview: whole card clickable, same behaviour as /servicii/.
   The overlay is anchored to the card so it covers the padding too. */
.services-preview > .service-card {
  position: relative;
}

.services-preview > .service-card h3 a {
  text-decoration: none;
}

.services-preview > .service-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.services-preview > .service-card h3 a:focus-visible {
  outline: none;
}

.services-preview > .service-card h3 a:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: var(--radius);
}

/* ---- Contact ---- */
.contact__intro { grid-column: 1 / span 5; align-self: center; }
.contact__cards {
  grid-column: 7 / span 6;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
/* .contact-card visual styles moved to base.css (1.3.0) — shared with the
   dedicated Contact page. Only the homepage section layout lives here. */

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hero__content { grid-column: 1 / span 7; }
  .hero__media { grid-column: 8 / span 5; }
  .services-preview > .service-card { grid-column: span 6; }
  .cities-preview > .city-card { grid-column: span 6; }
  .contact__intro { grid-column: 1 / span 12; }
  .contact__cards { grid-column: 1 / span 12; }
}
@media (max-width: 768px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__content { grid-column: auto; padding-block: 48px 0; }
  .hero__media { grid-column: auto; max-width: 420px; margin-inline: auto; width: 100%; }
  .hero__media::before { right: -6%; width: clamp(180px, 40vw, 240px); }
  .hero__panel { left: 12px; bottom: 20px; }
  .hero::after { left: -30%; top: -14%; width: 320px; }
  .services-preview > .service-card { grid-column: span 12; }
  .cities-preview > .city-card { grid-column: span 6; }
  .despre__body { grid-column: 1 / span 12; }
}
@media (max-width: 480px) {
  .cities-preview > .city-card { grid-column: span 12; }
  .contact__cards { grid-template-columns: 1fr; }
}

@media (hover: hover) and (pointer: fine) {
  .city-card:hover { transform: translateY(-4px); border-color: var(--accent); background: rgba(255, 255, 255, 0.1); }
  .partners__marquee:hover .partners__track { animation-play-state: paused; }
  .hero__panel { transition: transform 0.25s var(--ease-out), box-shadow 0.25s; }
  .hero__panel:hover { transform: translateY(-3px); box-shadow: 0 24px 54px rgba(4, 29, 115, 0.45); }
  .faq-item:not([open]):hover { border-color: var(--accent); }
}

/* ---- Reduced motion: base.css already kills every animation/transition;
   this restores the static partners layout (single wrapped, centered list). */
@media (prefers-reduced-motion: reduce) {
  .partners__track { width: auto; display: block; }
  .partners__list { flex-wrap: wrap; justify-content: center; padding-right: 0; }
  .partners__list[aria-hidden="true"] { display: none; }
  .faq-item summary::after { transition: none; }
}
