/* ── 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). Each card turns
   over to a back with more about the service. */

#diensten { 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.875rem; color: var(--text-muted); max-width: 300px; line-height: 1.7; }
.services-intro-link { color: var(--text); text-decoration: underline; text-underline-offset: 0.25em; text-decoration-color: var(--accent); transition: color 0.3s ease; }
.services-intro-link:hover { color: #d9b3ee; }

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

/* ── Card ──
   Click (or Enter / Space) turns a card over to its back, which holds more about the
   service. The faces share one grid cell, so a card is as tall as its taller side.
   The turn itself is a GSAP timeline in js/animations.js. */
.service-card {
  position: relative;
  perspective: 1600px;
  outline: none;
  /* `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);
}
.service-card-inner {
  display: grid; grid-template-columns: minmax(0, 1fr); height: 100%;
  transform-style: preserve-3d;
}
.service-face {
  grid-area: 1 / 1; min-width: 0;
  position: relative;
  padding: 12px 12px 72px;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid rgba(236, 235, 225, 0.07);
  box-shadow: 0 0 70px -28px var(--accent-glow), inset 0 1px 0 rgba(236, 235, 225, 0.04);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: box-shadow 0.5s ease, border-color 0.5s ease;
}
.service-back {
  transform: rotateY(180deg);
  display: flex; flex-direction: column;
  padding: 26px 24px 72px;
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(139, 95, 163, 0.28), transparent 60%),
    linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
}
@media (hover: hover) {
  .service-card:hover { translate: 0 -6px; }
  .service-card:hover .service-face {
    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(236, 235, 225, 0.06);
  }
}
.service-card:focus-visible .service-face { border-color: var(--accent); }
/* While turned the card glows a little stronger */
.service-card.is-flipped .service-face {
  border-color: rgba(139, 95, 163, 0.45);
  box-shadow: 0 0 110px -16px rgba(139, 95, 163, 0.7), inset 0 1px 0 rgba(236, 235, 225, 0.06);
}
/* Light that sweeps across the card as it turns (driven by --flip-sheen, 0–1) */
.service-face::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(236, 235, 225, 0.16) 50%, transparent 65%);
  background-size: 250% 100%;
  background-position: calc(120% - var(--flip-sheen, 0) * 140%) 0;
  opacity: calc(var(--flip-sheen, 0) * (1 - var(--flip-sheen, 0)) * 4);
}

/* "Meer info" / "Terug": bottom right of each face, so the card reads as clickable */
.service-flip-hint {
  position: absolute; right: 16px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 0.875rem; letter-spacing: -0.02em;
  text-transform: uppercase; color: var(--text);
}
.service-flip-hint i {
  position: relative; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent);
  transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1);
}
.service-flip-hint svg {
  width: 17px; height: 17px; fill: none; stroke: var(--text);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* a soft ring that keeps pulsing out of the button */
.service-front .service-flip-hint i::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--accent);
  animation: svHintPulse 2.4s ease-out infinite;
}
@keyframes svHintPulse {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}
@media (hover: hover) {
  .service-card:hover .service-flip-hint i { transform: rotate(180deg); }
}

.service-back-label {
  font-family: var(--font-display); font-size: 0.875rem; letter-spacing: -0.02em;
  text-transform: uppercase; color: var(--accent); padding: 0 12px; margin-bottom: 0.75rem;
}
.service-back .service-title { font-size: 1.5rem; }
/* Topics with what each covers: label in purple, the items below it */
.service-back-list { display: flex; flex-direction: column; gap: 0.8rem; padding: 0 12px; margin-top: 0.5rem; }
.service-back-list > div { padding-top: 0.8rem; border-top: 1px solid rgba(236, 235, 225, 0.08); }
.service-back-list dt {
  font-family: var(--font-display); font-size: 0.875rem; letter-spacing: -0.02em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.2rem;
}
.service-back-list dd { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--text-muted); }

.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%),
    var(--card-inner);
  border: 1px solid rgba(236, 235, 225, 0.05);
  margin-bottom: 1.6rem;
}

.service-title {
  font-family: var(--font-title); font-weight: 800;
  font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.2;
  color: var(--text); padding: 0 12px; margin-bottom: 0.6rem;
  text-transform: uppercase;
}
.service-desc { font-size: 0.9375rem; 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(236, 235, 225, 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(236, 235, 225, 0.08);
}
.sv-browser-dots { display: inline-flex; gap: 5px; }
.sv-browser-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(236, 235, 225, 0.22); }
.sv-browser-dots i:first-child { background: var(--accent); }
.sv-browser-url {
  flex: 1; padding: 4px 10px; border-radius: 999px;
  background: rgba(236, 235, 225, 0.06);
  font-family: var(--font-body); font-size: 0.875rem; letter-spacing: -0.02em;
  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(236, 235, 225, 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(236, 235, 225, 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(236, 235, 225, 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: var(--card-inner); 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(236, 235, 225, 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(236, 235, 225, 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(236, 235, 225, 0.85); }

.sv-poster-ring { position: absolute; right: -18%; top: -12%; width: 70%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(236, 235, 225, 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(236, 235, 225, 0.5); }
  36%       { opacity: 1; left: 70%; top: 46%; }
  52%, 56%  { opacity: 1; left: 34%; top: 86%; box-shadow: 0 0 0 0 rgba(236, 235, 225, 0.5); }
  66%       { opacity: 1; left: 34%; top: 86%; box-shadow: 0 0 0 14px rgba(236, 235, 225, 0); }
  80%, 100% { opacity: 0; left: 34%; top: 86%; box-shadow: 0 0 0 14px rgba(236, 235, 225, 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-front {
    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-back { padding: 26px 32px 72px; }
  /* wide back: the topics side by side in two columns, so it stays as tall as the front */
  .service-back-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 2rem; }
  .service-visual { grid-row: 1 / -1; margin-bottom: 0; }
  .service-title { grid-column: 2; grid-row: 2; font-size: 1.5rem; }
  .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; }
  /* the back (more text) sets the card height here; the graphic takes up the extra room */
  .service-front { padding-bottom: 68px; display: flex; flex-direction: column; }
  .service-front .service-visual { flex: 1 0 auto; }
  .service-visual { aspect-ratio: 1 / 0.8; margin-bottom: 1.25rem; }
  .service-desc { font-size: 0.875rem; }
  #diensten .he-scrollbar { margin-top: calc(30px + 0.75rem); }
}

@media (prefers-reduced-motion: reduce) {
  .service-visual *, .service-visual *::before, .service-flip-hint i::after { 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; }
/* even line lengths at every width, so no word is left on its own */
.faq-intro .section-heading { text-wrap: balance; max-width: 22ch; margin-inline: auto; }

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

.faq-item {
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid rgba(236, 235, 225, 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: var(--font-display); font-weight: 400;
  font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1;
  color: var(--text);
  list-style: none;
  text-transform: uppercase;
}
.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: 1rem; 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; }
}
