/* ── SERVICES (homepage) ──
   Three dark cards, each with a looping graphic for its service:
   a page building itself, a brand mark with rings and orbiting colours,
   and a stack of posters fanning out. Pure CSS animation. */

#services { background: var(--bg); position: relative; }

.services-intro {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 2rem; flex-wrap: wrap; margin-bottom: 4rem;
}
.services-intro-right { font-size: 0.9rem; color: var(--text-muted); max-width: 300px; line-height: 1.7; }

.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px); }

/* ── Card ── */
.service-card {
  position: relative;
  padding: 12px 12px 28px;
  border-radius: 28px;
  background: linear-gradient(180deg, #121113 0%, #0c0b0d 100%);
  border: 1px solid rgba(240, 237, 230, 0.07);
  box-shadow: 0 0 70px -28px var(--accent-glow), inset 0 1px 0 rgba(240, 237, 230, 0.04);
  /* `translate` for the hover lift, so it never fights the reveal's transform */
  transition: translate 0.5s cubic-bezier(0.2, 0.9, 0.2, 1), box-shadow 0.5s ease, border-color 0.5s ease;
}
@media (hover: hover) {
  .service-card:hover {
    translate: 0 -6px;
    border-color: rgba(139, 95, 163, 0.45);
    box-shadow: 0 0 90px -18px rgba(139, 95, 163, 0.6), inset 0 1px 0 rgba(240, 237, 230, 0.06);
  }
}

.service-visual {
  position: relative; overflow: hidden;
  aspect-ratio: 1 / 1.08;
  border-radius: 20px;
  background:
    radial-gradient(90% 70% at 50% 108%, rgba(139, 95, 163, 0.32), transparent 70%),
    #161517;
  border: 1px solid rgba(240, 237, 230, 0.05);
  margin-bottom: 1.6rem;
}

.service-title {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(1.25rem, 1.7vw, 1.6rem); letter-spacing: -0.03em; line-height: 1.1;
  color: var(--text); padding: 0 12px; margin-bottom: 0.6rem;
}
.service-desc { font-size: 0.92rem; line-height: 1.65; color: var(--text-muted); padding: 0 12px; max-width: 34ch; }

/* ── 1. Web Development ── */
.sv-browser {
  position: absolute; left: 11%; right: 11%; top: 12%; bottom: 12%;
  display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden;
  background: #0d0c0e; border: 1px solid rgba(240, 237, 230, 0.1);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.8);
}
.sv-browser-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid rgba(240, 237, 230, 0.08);
}
.sv-browser-dots { display: inline-flex; gap: 5px; }
.sv-browser-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(240, 237, 230, 0.22); }
.sv-browser-dots i:first-child { background: var(--accent); }
.sv-browser-url {
  flex: 1; padding: 4px 10px; border-radius: 999px;
  background: rgba(240, 237, 230, 0.06);
  font-family: 'Geist', 'Inter', sans-serif; font-size: 0.62rem; letter-spacing: 0.04em;
  color: var(--text-muted); white-space: nowrap; overflow: hidden;
}
.sv-browser-body { flex: 1; display: flex; flex-direction: column; gap: 9px; padding: 12px; min-height: 0; }

/* Page pieces drop in one after another, hold, then clear for the next loop */
.sv-block {
  display: block; border-radius: 8px; background: rgba(240, 237, 230, 0.1);
  opacity: 0; animation: svBuild 6.5s cubic-bezier(0.2, 0.9, 0.2, 1) infinite;
}
.sv-block-hero { flex: 1; min-height: 0; background: linear-gradient(120deg, var(--accent), #5b3a70); }
.sv-block-line { height: 8px; border-radius: 4px; width: 82%; animation-delay: 0.35s; }
.sv-block-short { width: 54%; animation-delay: 0.6s; }
.sv-block-row { display: flex; gap: 8px; height: 17%; }
.sv-block-tile { flex: 1; }
.sv-block-tile:nth-child(1) { animation-delay: 0.9s; }
.sv-block-tile:nth-child(2) { animation-delay: 1.05s; }
.sv-block-tile:nth-child(3) { animation-delay: 1.2s; }
.sv-block-cta {
  align-self: flex-start; position: relative;
  width: 46%; height: 22px; border-radius: 999px;
  background: var(--text); animation-delay: 1.5s;
}
.sv-block-cta i {
  position: absolute; right: 3px; top: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent);
}
/* Pointer glides to the button and presses it */
.sv-cursor {
  position: absolute; left: 70%; top: 46%;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text); border: 2px solid var(--bg);
  box-shadow: 0 0 0 0 rgba(240, 237, 230, 0.5);
  opacity: 0; animation: svCursor 6.5s ease-in-out infinite;
}

/* ── 2. Branding ── */
.sv-ring, .sv-ripple, .sv-orbit, .sv-mark {
  position: absolute; left: 50%; top: 50%; border-radius: 50%;
  translate: -50% -50%;
}
.sv-ring { border: 1px solid rgba(240, 237, 230, 0.09); aspect-ratio: 1; }
.sv-ring-1 { width: 48%; }
.sv-ring-2 { width: 78%; }
.sv-ring-3 { width: 110%; }

.sv-ripple {
  width: 30%; aspect-ratio: 1;
  border: 1.5px solid var(--accent);
  opacity: 0; animation: svRipple 4s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}
.sv-ripple-late { animation-delay: 2s; }

/* Each orbit is a ring-sized box that spins, carrying one colour dot on its rim */
.sv-orbit { aspect-ratio: 1; animation: svSpin 14s linear infinite; }
.sv-orbit i { position: absolute; left: 50%; top: 0; border-radius: 50%; translate: -50% -50%; }
.sv-orbit-1 { width: 48%; }
.sv-orbit-1 i { width: 12px; height: 12px; background: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.sv-orbit-2 { width: 78%; animation-duration: 22s; animation-direction: reverse; }
.sv-orbit-2 i { width: 16px; height: 16px; background: var(--text); }
.sv-orbit-3 { width: 78%; animation-duration: 22s; animation-direction: reverse; animation-delay: -11s; }
.sv-orbit-3 i { width: 10px; height: 10px; background: #161517; border: 2px solid var(--accent); }

.sv-mark {
  width: 30%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--text);
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.7), 0 0 40px -6px var(--accent-glow);
  animation: svBreathe 4s ease-in-out infinite;
}
.sv-mark i {
  width: 66%; aspect-ratio: 1082.17 / 384.37; background: var(--bg);
  -webkit-mask: url('../images/logos/w-logo.svg') no-repeat center / contain;
  mask: url('../images/logos/w-logo.svg') no-repeat center / contain;
}

/* ── 3. Promotional Assets ── */
.sv-poster {
  position: absolute; left: 50%; top: 50%;
  width: 44%; aspect-ratio: 3 / 4;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 7%;
  padding: 9%; border-radius: 12px; overflow: hidden;
  translate: -50% -50%;
  box-shadow: 0 22px 40px -18px rgba(0, 0, 0, 0.85);
}
.sv-poster-left  { background: #232126; border: 1px solid rgba(240, 237, 230, 0.1); animation: svFanLeft 5s cubic-bezier(0.6, 0, 0.3, 1) infinite; }
.sv-poster-right { background: linear-gradient(160deg, var(--accent), #57376c); animation: svFanRight 5s cubic-bezier(0.6, 0, 0.3, 1) infinite; }
.sv-poster-front { background: var(--text); animation: svFloat 5s ease-in-out infinite; }

.sv-poster-bar { display: block; height: 7%; border-radius: 3px; background: rgba(240, 237, 230, 0.28); flex-shrink: 0; }
.sv-poster-bar-short { width: 55%; }
.sv-poster-front .sv-poster-bar { background: var(--bg); }
.sv-poster-right .sv-poster-bar { background: rgba(240, 237, 230, 0.85); }

.sv-poster-ring { position: absolute; right: -18%; top: -12%; width: 70%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(240, 237, 230, 0.5); }
.sv-poster-disc { position: absolute; left: 50%; top: 14%; width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--accent); translate: -50% 0; }
.sv-poster-tag { position: absolute; left: 9%; top: 7%; width: 30%; height: 5%; border-radius: 999px; background: var(--bg); }
.sv-poster-shine {
  position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: translateX(-180%) skewX(-18deg);
  animation: svShine 5s ease-in-out infinite;
}

/* ── Keyframes ── */
@keyframes svBuild {
  0%        { opacity: 0; transform: translateY(12px) scale(0.96); }
  9%, 80%   { opacity: 1; transform: none; }
  88%, 100% { opacity: 0; transform: translateY(-6px); }
}
@keyframes svCursor {
  0%, 28%   { opacity: 0; left: 70%; top: 46%; box-shadow: 0 0 0 0 rgba(240, 237, 230, 0.5); }
  36%       { opacity: 1; left: 70%; top: 46%; }
  52%, 56%  { opacity: 1; left: 34%; top: 86%; box-shadow: 0 0 0 0 rgba(240, 237, 230, 0.5); }
  66%       { opacity: 1; left: 34%; top: 86%; box-shadow: 0 0 0 14px rgba(240, 237, 230, 0); }
  80%, 100% { opacity: 0; left: 34%; top: 86%; box-shadow: 0 0 0 14px rgba(240, 237, 230, 0); }
}
@keyframes svRipple {
  0%   { opacity: 0.9; scale: 1; }
  100% { opacity: 0; scale: 3.8; }
}
@keyframes svSpin { to { rotate: 360deg; } }
@keyframes svBreathe { 0%, 100% { scale: 1; } 50% { scale: 1.07; } }
@keyframes svFanLeft {
  0%, 12%, 100% { transform: rotate(-3deg) translateX(-4%); }
  45%, 70%      { transform: rotate(-15deg) translate(-46%, 4%); }
}
@keyframes svFanRight {
  0%, 12%, 100% { transform: rotate(3deg) translateX(4%); }
  45%, 70%      { transform: rotate(15deg) translate(46%, 4%); }
}
@keyframes svFloat {
  0%, 12%, 100% { transform: translateY(0) scale(1); }
  45%, 70%      { transform: translateY(-5%) scale(1.04); }
}
@keyframes svShine {
  0%, 48%   { transform: translateX(-180%) skewX(-18deg); }
  72%, 100% { transform: translateX(340%) skewX(-18deg); }
}

/* ── Smaller screens ── */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; gap: 18px; }
  .services-intro { margin-bottom: 2.5rem; }
}

/* Tablets: full-width cards laid out sideways — graphic left, text right */
@media (min-width: 601px) and (max-width: 900px) {
  .service-card {
    display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto 1fr; column-gap: 1.25rem;
    padding: 12px;
  }
  .service-visual { grid-row: 1 / -1; margin-bottom: 0; }
  .service-title { grid-column: 2; grid-row: 2; font-size: 1.6rem; }
  .service-desc { grid-column: 2; grid-row: 3; }
}

/* Phones: one swipeable row instead of a tall stack. The row bleeds to the
   screen edges; the vertical padding leaves room for the cards' glow, which
   a scroll container would otherwise clip. The purple bar underneath is
   added by js/animations.js (same control as under the Branding panels). */
@media (max-width: 600px) {
  .services-grid {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    margin: -30px -5vw; padding: 30px 5vw; scroll-padding-inline: 5vw;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .services-grid::-webkit-scrollbar { display: none; }
  .service-card { flex: 0 0 78vw; scroll-snap-align: start; padding-bottom: 22px; }
  .service-visual { aspect-ratio: 1 / 0.8; margin-bottom: 1.25rem; }
  .service-desc { font-size: 0.88rem; }
  #services .he-scrollbar { margin-top: calc(30px + 0.75rem); }
}

@media (prefers-reduced-motion: reduce) {
  .service-visual *, .service-visual *::before { animation: none !important; }
  .sv-block { opacity: 1; }
}

/* ── FAQ (homepage) ──
   Same dark card + purple glow as the service cards. Native <details>
   accordion; the open/close slide is a progressive enhancement
   (::details-content), browsers without it simply snap open. */
#faq { background: var(--bg); position: relative; }

.faq-intro { text-align: center; margin-bottom: 3.5rem; }
.faq-intro-text { margin-top: 1.25rem; font-size: 1rem; color: var(--text-muted); line-height: 1.7; }

.faq-list { max-width: 860px; margin-inline: auto; display: flex; flex-direction: column; gap: 14px; }

.faq-item {
  border-radius: 22px;
  background: linear-gradient(180deg, #121113 0%, #0c0b0d 100%);
  border: 1px solid rgba(240, 237, 230, 0.07);
  box-shadow: 0 16px 46px -18px rgba(139, 95, 163, 0), inset 0 -34px 40px -34px rgba(139, 95, 163, 0);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
  interpolate-size: allow-keywords;
}
.faq-item[open] { border-color: rgba(139, 95, 163, 0.45); }

/* Glow only on hover: cast below the row, plus purple light rising inside its
   bottom edge. Touch screens have no hover, so there the open row gets it. */
@media (hover: hover) {
  .faq-item:hover {
    border-color: rgba(139, 95, 163, 0.45);
    box-shadow: 0 16px 46px -18px rgba(139, 95, 163, 0.6), inset 0 -34px 40px -34px rgba(139, 95, 163, 0.5);
  }
}
@media (hover: none) {
  .faq-item[open] {
    box-shadow: 0 16px 46px -18px rgba(139, 95, 163, 0.6), inset 0 -34px 40px -34px rgba(139, 95, 163, 0.5);
  }
}

.faq-question {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  padding: 1.15rem 1.15rem 1.15rem 1.6rem;
  font-family: 'Syne', sans-serif; font-weight: 600;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem); letter-spacing: -0.02em; line-height: 1.25;
  color: var(--text);
  list-style: none; cursor: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 22px; }

/* Round plus button; turns purple and rotates into a cross when open */
.faq-icon {
  position: relative; flex-shrink: 0;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--text);
  transition: background-color 0.4s ease, transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}
.faq-icon::before, .faq-icon::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 13px; height: 1.5px; margin: -0.75px 0 0 -6.5px;
  background: var(--bg); border-radius: 2px;
  transition: background-color 0.4s ease;
}
.faq-icon::after { transform: rotate(90deg); }
.faq-item[open] .faq-icon { background: var(--accent); transform: rotate(45deg); }
.faq-item[open] .faq-icon::before, .faq-item[open] .faq-icon::after { background: var(--text); }

.faq-answer {
  padding: 0 4.5rem 1.5rem 1.6rem;
  font-size: 0.98rem; line-height: 1.75; color: var(--text-muted);
}

.faq-item::details-content {
  block-size: 0; overflow: clip;
  transition: block-size 0.45s cubic-bezier(0.76, 0, 0.24, 1), content-visibility 0.45s allow-discrete;
}
.faq-item[open]::details-content { block-size: auto; }

@media (max-width: 600px) {
  .faq-intro { margin-bottom: 2.5rem; }
  .faq-question { padding: 1rem 1rem 1rem 1.25rem; }
  .faq-answer { padding: 0 1.25rem 1.25rem; }
}
