/* Tech404 — Services page (services.html). Figma "Tech404 · 1.0 Chosen" › 03 · SERVICES › S11 expanding card.
   Desktop spec 1600 (1vw = 16px). Tiles are 720×400 design units scaled with container units (100cqw = tile width).
   Colours: #131313 page, #181818 card, #242424 raised/border, #FAFAFA text, #70E844 accent. */

/* ---------- Top: header + hero + marquee ---------- */
.sv-top {
  height: auto;            /* .hs1 is a fixed 60vw on Home */
  justify-content: flex-start;
}
.sv-hero {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2vw;
  padding: 11vw 4vw 14vw;
}
.sv-h1 .sv-line {
  display: block;
}
.sv-line,
.sv-sub {
  opacity: 0;
  transform: translate3d(0, 30%, 0);
  animation: svUp .9s cubic-bezier(.25, .46, .45, .94) forwards;
}
.sv-line + .sv-line { animation-delay: .1s; }
.sv-sub { animation-delay: .22s; transform: translate3d(0, 60%, 0); }
@keyframes svUp {
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* TECH 404 marquee: same motion as Home's IX2 "Loop Anim 01" (0 → -50 %, 10 s, linear, loop) */
.sv-marquee {
  flex: none;
  animation: svMarquee 10s linear infinite;
}
@keyframes svMarquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* ---------- Services block ---------- */
.sv {
  padding: 4vw 4vw 4vw;
}
.sv-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2vw;
}
/* cards make no stacking context: every background sits under every tile, so during a swap
   no 404 tile is hidden behind another card's growing/shrinking background */
.sv-card {
  position: relative;
  min-width: 0;
}
.sv-card.is-open {
  order: -1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 45vw minmax(0, 1fr);
  column-gap: 3vw;
  align-items: center;
  min-height: 33.75vw;
}
.sv-bg {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: #181818;
  border-radius: 2vw;
}
@media (hover: hover) {
  .sv-card:not(.is-open) {
    transition: translate .4s cubic-bezier(.25, .46, .45, .94);
  }
  .sv-card:not(.is-open):hover {
    translate: 0 -.4vw;
  }
}

/* ---------- 404 tile ---------- */
.sv-card.is-open .sv-bg { z-index: 1; }
.sv-card.is-open .sv-tile { z-index: 3; }
.sv-tile {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  aspect-ratio: 720 / 400;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 2vw;
  color: #fafafa;
  text-align: left;
  container-type: inline-size;
  transform-origin: 0 0;
}
.sv-card.is-open .sv-tile {
  cursor: default;
}
.sv-tile:focus { outline: none; }
.sv-tile:focus-visible {
  outline: 1px solid #70e844;
  outline-offset: 4px;
}
.sv-dots {
  position: absolute;
  top: 4.236cqw;
  bottom: 4.236cqw;
  left: 4.236cqw;
  right: 4.236cqw;
  background-image: radial-gradient(circle at center, #fafafa29 0, #fafafa29 max(.21cqw, .8px), transparent calc(max(.21cqw, .8px) + .5px));
  background-size: 4.444cqw 4.444cqw;
  background-repeat: space;
  pointer-events: none;
  transition: top .45s cubic-bezier(.65, 0, .35, 1), bottom .45s cubic-bezier(.65, 0, .35, 1), left .45s cubic-bezier(.65, 0, .35, 1), right .45s cubic-bezier(.65, 0, .35, 1);
}
/* open on desktop: the dot grid covers the full card height */
.sv-card.is-open .sv-dots {
  top: -5.764cqw;
  bottom: -5.764cqw;
  left: 5.347cqw;
  right: 5.347cqw;
}
.sv-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.sv-tile-text {
  position: absolute;
  left: 4.444cqw;
  bottom: 4.444cqw;
  width: 38.889cqw;
  display: flex;
  flex-direction: column;
  gap: 2.222cqw;
}
.sv-tile-title {
  font-family: Badrock, Arial, sans-serif;
  font-size: 9cqw;
  font-weight: 400;
  line-height: .84;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fafafa;
}
.sv-tile-desc {
  font-family: Poppins, sans-serif;
  font-size: 2.222cqw;
  font-weight: 300;
  line-height: 1.2;
  color: #fafafa80;
}
.sv-plus {
  display: none;
}

/* ---------- Art: Closed → Open ---------- */
.sv-art .a-w { fill: #fafafa; }

/* Hardware: resistor — leads grow out of the body, dots pop, bands turn green */
.hw-lead {
  fill: none;
  stroke: #70e844;
  stroke-width: 6;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .25s ease-in-out;
}
.hw-dot {
  fill: #fafafa;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform .2s ease-in-out;
}
.hw-band {
  fill: #242424;
  fill-opacity: .16;
  transition: fill .3s ease-in-out, fill-opacity .3s ease-in-out;
}
.art-open .hw-lead {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .4s cubic-bezier(.65, 0, .35, 1) .05s;
}
.art-open .hw-dot {
  transform: scale(1);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1) calc(var(--d) + .2s);
}
.art-open .hw-band {
  fill: #70e844;
  fill-opacity: 1;
  transition-delay: var(--d);
}
.art-open .hw-band.hw-band-4 {
  fill: #242424;
}

/* Software: text cursor turns green, outline draws in */
.sw-ring {
  fill: none;
  stroke: #70e844;
  stroke-width: 6;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .3s ease-in-out;
}
.sw-i {
  fill: #242424;
  fill-opacity: .16;
  transition: fill .3s ease-in-out, fill-opacity .3s ease-in-out;
}
.art-open .sw-ring {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .6s cubic-bezier(.65, 0, .35, 1) .1s;
}
.art-open .sw-i {
  fill: #70e844;
  fill-opacity: 1;
}

/* Design: selection appears, cursor drags the top handle, the 0 stretches up */
.de-slot { fill: #242424; }
.de-up,
.de-fill,
.de-sfill,
.de-bsides,
.de-osides {
  transform-box: view-box;
  transition: transform .3s cubic-bezier(.65, 0, .35, 1);
}
.de-fill,
.de-osides { transform-origin: 0 335.4px; }
.de-sfill { transform-origin: 0 312.6px; }
.de-bsides { transform-origin: 0 371.9px; }
.de-ui {
  opacity: 0;
  transition: opacity .2s ease-in-out;
}
.de-box {
  fill: none;
  stroke: #70e844;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.de-ol {
  fill: none;
  stroke: #70e844;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.de-h,
.de-a {
  fill: #fafafa;
  stroke: #70e844;
  stroke-width: 2;
}
.de-h.de-hg { fill: #70e844; }
.de-lab { fill: #70e844; }
.de-txt {
  font-family: Poppins, sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  fill: #181818;
}
.de-cur {
  fill: #fafafa;
  stroke: #181818;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.art-open .de-ui {
  opacity: 1;
  transition: opacity .15s ease-out;
}
.art-open .de-up,
.art-open .de-fill,
.art-open .de-sfill,
.art-open .de-bsides,
.art-open .de-osides {
  transition: transform .45s cubic-bezier(.65, 0, .35, 1) .15s;
}
.art-open .de-up { transform: translateY(-34px); }
.art-open .de-fill,
.art-open .de-osides { transform: scaleY(1.15977); }
.art-open .de-sfill { transform: scaleY(1.20335); }
.art-open .de-bsides { transform: scaleY(1.11896); }

/* Strategy: the line fills up, the checks pop in one by one */
.st-track {
  fill: none;
  stroke: #242424;
  stroke-opacity: .16;
  stroke-width: 8.36;
  stroke-linecap: round;
}
.st-line {
  fill: none;
  stroke: #70e844;
  stroke-width: 8.36;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .25s ease-in-out;
}
.st-ring {
  fill: #fafafa;
  stroke: #242424;
  stroke-opacity: .16;
  stroke-width: 3;
}
.st-chk {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform .2s ease-in-out;
}
.st-chk circle { fill: #70e844; }
.st-chk path {
  fill: none;
  stroke: #242424;
  stroke-width: 6.08;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .15s ease-in-out;
}
.art-open .st-line {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .5s cubic-bezier(.65, 0, .35, 1);
}
.art-open .st-chk {
  transform: scale(1);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1) calc(var(--i) * .12s + .05s);
}
.art-open .st-chk path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .25s ease-out calc(var(--i) * .12s + .2s);
}

/* ---------- Services list (panel) ---------- */
.sv-panel {
  display: none;
}
.sv-card.is-open .sv-panel,
.sv-ghost {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  padding: 2.5vw 3vw 2.5vw 0;
}
.sv-ghost {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}
.sv-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2vw;
  row-gap: 1.375vw;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sv-item {
  padding-top: 1.25vw;
  border-top: 1px solid #242424;
}
.sv-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1vw;
}
.sv-item-name {
  margin: 0;
  font-family: Poppins, sans-serif;
  font-size: 1.2vw;
  font-weight: 400;
  line-height: 1.2;
  color: #fafafa;
}
.sv-item-price {
  flex: none;
  font-family: Poppins, sans-serif;
  font-size: 1vw;
  font-weight: 400;
  line-height: 1;
  color: #fafafa80;
  white-space: nowrap;
}
.sv-item-price b {
  font-weight: 400;
  color: #fafafa;
}
.sv-item-desc {
  margin: .8vw 0 0;
  font-family: Poppins, sans-serif;
  font-size: 1.2vw;
  font-weight: 300;
  line-height: 1.2;
  color: #fafafa80;
}
.sv-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2vw;
  padding-top: 2.4vw;
}
.sv-from {
  font-family: Badrock, Arial, sans-serif;
  font-size: 3vw;
  font-weight: 400;
  line-height: .84;
  text-transform: uppercase;
  color: #70e844;
  white-space: nowrap;
}
.sv-btn {
  display: inline-flex;
  align-items: center;
  gap: 1.25vw;
  height: 4.5vw;
  padding: .5vw .5vw .5vw 2vw;
  background-color: #fafafa;
  border-radius: 999px;
  text-decoration: none;
  transition: translate .4s cubic-bezier(.25, .46, .45, .94);
}
.sv-btn-t {
  position: relative;
  top: .1vw;
  font-family: Badrock, Arial, sans-serif;
  font-size: 2.5vw;
  font-weight: 400;
  line-height: .84;
  text-transform: uppercase;
  color: #181818;
  white-space: nowrap;
}
.sv-btn-c {
  display: flex;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 3.5vw;
  height: 3.5vw;
  background-color: #181818;
  border-radius: 100%;
  transition: background-color .4s ease;
}
.sv-btn-i {
  width: 1.75vw;
  transition: transform .4s ease;
}
.sv-btn:hover .sv-btn-c { background-color: #70e844; }
.sv-btn:hover .sv-btn-i { transform: translateX(.2vw); }
.sv-btn:focus-visible {
  outline: 1px solid #70e844;
  outline-offset: 3px;
}

/* ---------- Widescreen ≥1920: list in 3 columns, shorter card ---------- */
@media screen and (min-width: 1920px) {
  .sv-hero { gap: 1.5vw; padding: 7vw 4vw 9vw; }
  .sv-grid { gap: 1.667vw; }
  .sv-bg, .sv-tile { border-radius: 1.667vw; }
  .sv-card.is-open {
    grid-template-columns: 37.5vw minmax(0, 1fr);
    column-gap: 2.5vw;
    min-height: 21.6vw;
  }
  .sv-card.is-open .sv-dots {
    top: 4.236cqw;
    bottom: 4.236cqw;
    left: 4.236cqw;
    right: 4.236cqw;
  }
  .sv-card.is-open .sv-panel,
  .sv-ghost { padding: 1.5vw 1.875vw 1.5vw 0; }
  .sv-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 1.25vw;
    row-gap: 1.2vw;
  }
  .sv-item { padding-top: 1.04vw; }
  .sv-item-name { font-size: 1vw; }
  .sv-item-price { font-size: .833vw; }
  .sv-item-desc { margin-top: .7vw; font-size: 1vw; }
  .sv-foot { padding-top: 1.6vw; }
  .sv-from { font-size: 2.5vw; }
  .sv-btn { gap: 1vw; height: 3.75vw; padding: .42vw .42vw .42vw 1.67vw; }
  .sv-btn-t { font-size: 2.08vw; }
  .sv-btn-c { width: 2.92vw; height: 2.92vw; }
  .sv-btn-i { width: 1.46vw; }
}

/* ---------- Tablet (Figma 1024): the 404 tile on top, the list under it ---------- */
@media screen and (max-width: 1199px) {
  .sv { padding: 2vw 3.125vw 4vw; }
  .sv-grid { gap: 2.344vw; }
  .sv-bg, .sv-tile { border-radius: 3.125vw; }
  .sv-card.is-open {
    display: block;
    min-height: 0;
  }
  .sv-card.is-open .sv-dots {
    top: 4.236cqw;
    bottom: 4.236cqw;
    left: 4.236cqw;
    right: 4.236cqw;
  }
  .sv-card.is-open .sv-panel,
  .sv-ghost { padding: 3.125vw; }
  .sv-list { column-gap: 2.344vw; row-gap: 2.64vw; }
  .sv-item { padding-top: 1.5625vw; }
  .sv-item-name { font-size: max(1.758vw, 14px); font-weight: 500; line-height: 1.5; }
  .sv-item-price { font-size: max(1.5625vw, 12px); }
  .sv-item-desc { margin-top: .6vw; font-size: max(1.367vw, 12px); line-height: 1.4; }
  .sv-foot { padding-top: 5.3vw; }
  .sv-from { font-size: 4.69vw; }
  .sv-btn { gap: 1.95vw; height: 7.03vw; padding: .78vw .78vw .78vw 3.125vw; }
  .sv-btn-t { top: .15vw; font-size: 3.9vw; }
  .sv-btn-c { width: 5.47vw; height: 5.47vw; }
  .sv-btn-i { width: 2.73vw; }
  @media (hover: hover) {
    .sv-card:not(.is-open):hover { translate: 0 -.6vw; }
  }
}
@media screen and (max-width: 991px) {
  .sv-h1 { font-size: 16vw; }
  .sv-sub { font-size: max(1.367vw, 11px); }
  .sv-hero { padding: 11.5vw 4vw 7vw; gap: 2vw; }
}

/* ---------- Phone: accordion ---------- */
@media screen and (max-width: 767px) {
  .sv-hero { padding: 13vw 4vw 8vw; gap: 5.1vw; }
  .sv-h1 { font-size: 21vw; }
  .sv-sub { font-size: 2.82vw; text-align: center; }
  .sv { padding: 2vw 4.1vw 8vw; }
  .sv-grid {
    display: flex;
    flex-direction: column;
    gap: 3.08vw;
  }
  .sv-card.is-open { order: 0; }
  .sv-bg, .sv-tile { border-radius: 6.15vw; }
  .sv-plus {
    display: block;
    position: absolute;
    top: 4.1vw;
    right: 4.6vw;
    width: 4.6vw;
    height: 4.6vw;
    transition: transform .45s cubic-bezier(.65, 0, .35, 1);
  }
  .sv-plus::before,
  .sv-plus::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1.5px;
    margin-top: -.75px;
    background-color: #fafafa;
  }
  .sv-plus::after { transform: rotate(90deg); }
  .sv-card.is-open .sv-plus { transform: rotate(45deg); }
  .sv-card.is-open .sv-panel,
  .sv-ghost { padding: 4.1vw 5.13vw 5.13vw; }
  .sv-list {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8.46vw;
  }
  .sv-item { padding-top: 4.1vw; }
  .sv-item-top { gap: 3vw; }
  .sv-item-name { font-size: 4.1vw; font-weight: 400; line-height: 1.2; }
  .sv-item-price { font-size: 3.28vw; }
  .sv-item-desc { margin-top: 2.82vw; font-size: 3.08vw; line-height: 1.4; }
  .sv-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 3.85vw;
    padding-top: 13.6vw;
  }
  .sv-from { font-size: 9.5vw; }
  .sv-btn { gap: 3.85vw; height: 14.87vw; padding: 1.54vw 1.54vw 1.54vw 6.67vw; }
  .sv-btn-t { top: .3vw; font-size: 8vw; }
  .sv-btn-c { width: 11.54vw; height: 11.54vw; }
  .sv-btn-i { width: 5.64vw; }
  .sv-card.is-open .sv-tile { cursor: pointer; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .sv-line,
  .sv-sub {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .sv-marquee { animation: none; }
  .sv *,
  .sv *::before,
  .sv *::after {
    transition: none !important;
  }
}
