/* Shared chrome for every service detail page.
   Page shell, hero, sticky sub-nav, the structure-explainer tabs, the diagram
   frame and the pricing/next-steps blocks all live here so a new service page
   starts out looking like the ones already shipped. Per-page files add only
   what is unique to that page. Everything inherits from theme.css: no new
   palette, no new fonts. Prefix: .sv- */

.sv { padding-top: 110px; }

/* ---------- Shared section rhythm ---------- */

.sv-section {
  padding: 96px 0;
  /* main navbar (64) + sub-nav (48) + breathing room */
  scroll-margin-top: 124px;
}
.sv-section-alt { background: var(--bg-alt); }

.sv-kicker {
  margin: 0 0 12px;
  color: var(--accent-1);
  font-family: var(--font-nav);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sv-h2 {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  text-transform: uppercase;
}

.sv-intro {
  max-width: 620px;
  margin: 0 0 48px;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ---------- Hero ---------- */

.sv-hero { padding: 40px 0 56px; }

.sv-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  color: var(--text-muted);
  font-family: var(--font-nav);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.3s ease;
}
.sv-back:hover { color: var(--accent-1); }

.sv-eyebrow {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-family: var(--font-nav);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sv-h1 {
  max-width: 20ch;
  margin: 0 0 24px;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.sv-lead {
  max-width: 600px;
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* ---------- Sticky section nav ---------- */

/* Sits directly beneath the main navbar rather than behind it. .navbar is
   position:fixed at z-index 1000, so a sub-nav stuck at top:0 slides under it
   and vanishes. 64px is .navbar.scrolled: a 40px logo plus 12px padding each
   side; the page is always scrolled by the time this becomes sticky. */
.sv-nav {
  position: sticky;
  top: 64px;
  z-index: 900;
  background: rgba(10, 10, 10, 0.92);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.sv-nav-inner {
  display: flex;
  gap: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sv-nav-inner::-webkit-scrollbar { display: none; }
/* For pages with enough sections that the default gap pushes the last few
   off the end of the bar. */
.sv-nav-inner.is-dense { gap: 18px; }

.sv-nav a {
  position: relative;
  padding: 16px 0;
  color: var(--text-muted);
  font-family: var(--font-nav);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}
.sv-nav a:hover { color: var(--text); }

.sv-nav a.is-current { color: var(--text); }
.sv-nav a.is-current::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent-gradient);
}

/* ---------- Structure explainer ---------- */

.sv-struct {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}

.sv-struct-list { display: flex; flex-direction: column; gap: 12px; }

.sv-struct-btn {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 16px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.sv-struct-btn:hover { border-color: #444; }
.sv-struct-btn.is-active { border-color: var(--accent-1); background: #1F1420; }

.sv-struct-art { grid-row: 1 / 3; align-self: center; }
.sv-struct-art svg { width: 100%; height: auto; }
.sv-struct-art .pg { fill: none; stroke: var(--text-muted); stroke-width: 1.6; }
.sv-struct-art .ln { stroke: var(--text-muted); stroke-width: 1.6; }
.sv-struct-btn.is-active .pg,
.sv-struct-btn.is-active .ln { stroke: var(--accent-1); }

.sv-struct-name {
  font-family: var(--font-nav);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.sv-struct-tag { color: var(--text-muted); font-size: 0.82rem; line-height: 1.45; }

/* Panels */
.sv-struct-panel { display: none; padding: 36px; background: var(--bg-card); border: 1px solid var(--border); }
.sv-struct-panel.is-active { display: block; }
.sv-struct-panel h3 { margin: 0 0 16px; font-size: 1.8rem; }

.sv-struct-why { margin: 0 0 28px; color: var(--text-muted); line-height: 1.85; }

.sv-struct-label {
  margin: 0 0 12px;
  color: var(--accent-1);
  font-family: var(--font-nav);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sv-struct-for { margin: 0 0 28px; padding: 0; list-style: none; }
.sv-struct-for li {
  position: relative;
  padding: 9px 0 9px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.sv-struct-for li::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--accent-gradient);
}

.sv-struct-limit {
  margin: 0;
  padding: 18px 20px;
  background: var(--bg);
  border-left: 2px solid var(--accent-2);
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}
.sv-struct-limit i { margin-right: 8px; color: var(--accent-2); }
.sv-struct-limit strong { color: var(--text); }

/* ---------- Diagram frame ---------- */

.sv-diagram-wrap {
  margin: 0 0 28px;
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  /* Faint blueprint grid: these sections are about the shape of a thing, so the
     drafting-paper reference is doing work rather than decorating. */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 22px 22px;
}

.sv-diagram { display: block; width: 100%; height: auto; }

/* ---------- Pricing ---------- */

.sv-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

.sv-tier { display: flex; flex-direction: column; padding: 28px; background: var(--bg-card); border: 1px solid var(--border); }
.sv-tier h3 { margin: 0 0 16px; font-size: 1.2rem; }
.sv-tier-price { margin: 0 0 4px; font-family: var(--font-display); font-size: 2.6rem; line-height: 1; }
.sv-tier-price small { font-size: 0.9rem; color: var(--text-muted); }
.sv-tier-time { margin: 0 0 20px; color: var(--text-muted); font-size: 0.82rem; }
.sv-tier ul { flex: 1; margin: 0; padding: 0; list-style: none; }
.sv-tier li {
  padding: 9px 0 9px 18px;
  position: relative;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
.sv-tier li::before { content: ""; position: absolute; top: 17px; left: 0; width: 6px; height: 6px; background: var(--accent-gradient); }
.sv-tier-not { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.78rem; }

.sv-tech-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
}
.sv-tech-cta h3 { margin: 0 0 8px; font-size: 1.3rem; }
.sv-tech-cta p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Where next ---------- */

.sv-next { text-align: center; }
.sv-next-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 40px 0; text-align: left; }

.sv-next-card {
  display: block;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.sv-next-card:hover { border-color: var(--accent-1); transform: translateY(-3px); }
.sv-next-card > i { color: var(--accent-1); font-size: 1.5rem; }
.sv-next-card h3 { margin: 16px 0 10px; font-size: 1.25rem; }
.sv-next-card p { margin: 0 0 16px; color: var(--text-muted); font-size: 0.88rem; line-height: 1.65; }
.sv-next-card span {
  color: var(--accent-1);
  font-family: var(--font-nav);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sv-final-cta { margin-top: 8px; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .sv-struct { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sv { padding-top: 92px; }
  .sv-nav { top: 58px; }
  .sv-section { scroll-margin-top: 108px; padding: 64px 0; }
  .sv-next-grid { grid-template-columns: 1fr; }
}

/* Quality floor */
.sv a:focus-visible,
.sv button:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .sv *, .sv *::before, .sv *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Diagram primitives ---------- */

.dg-frame { fill: #141414; stroke: #3A3A3A; stroke-width: 1.2; }
.dg-accent-frame { stroke: var(--accent-1); }
.dg-bar { fill: #232323; }
.dg-dot { fill: #4A4A4A; }
.dg-block { fill: #262626; }
.dg-accent { fill: rgba(238, 62, 201, 0.28); }

.dg-lead { stroke: #3A3A3A; stroke-width: 1; stroke-dasharray: 3 3; }
.dg-link { fill: none; stroke: #3A3A3A; stroke-width: 1.2; }

.dg-label {
  fill: var(--text-muted);
  font-family: var(--font-nav);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dg-caption {
  fill: #6A6A6A;
  font-family: var(--font-nav);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Screenshot gallery ---------- */

/* Flex rather than grid so a last row that does not fill sits centred instead
   of hanging off the left — the shop page shows five, the website page
   eighteen, and neither divides evenly into the column count. */
.sv-gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.sv-gallery > .sv-shot { flex: 1 1 300px; max-width: 400px; }

.sv-shot {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease;
}
.sv-shot:hover { transform: translateY(-4px); border-color: var(--accent-1); }

.sv-shot-body { display: flex; flex-direction: column; flex: 1; padding: 22px; }
.sv-shot-body h3 { margin: 0 0 10px; font-size: 1.15rem; }
.sv-shot-body p {
  flex: 1;
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}
.sv-shot-body a {
  color: var(--accent-1);
  font-family: var(--font-nav);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}
.sv-shot-body a:hover { color: var(--accent-2); }

.sv-shot-frame {
  position: relative;
  height: 190px;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.sv-shot-chrome {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  background: #1E1E1E;
  border-bottom: 1px solid var(--border);
}
.sv-shot-chrome span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3A3A3A;
}

.sv-shot-frame img {
  display: block;
  width: 100%;
  height: calc(100% - 21px);
  object-fit: cover;
  object-position: top center;
  transition: transform 4s ease;
}
.sv-shot:hover .sv-shot-frame img { transform: translateY(-14%); }

/* Fallback when a site could not be captured: centre the logo instead. */
.sv-shot-frame.is-logo { display: flex; align-items: center; justify-content: center; padding: 24px; }
.sv-shot-frame.is-logo img { width: auto; max-width: 100%; height: auto; max-height: 100%; object-fit: contain; transform: none; }
