/* Services page — built from the "Services · final" design.
   Sits inside the shared header/footer from style.css. */

.svc-page {
  --accent: #3b9eff;
  --accent-ink: #06101c;
  --s-line: #1c2836;
  --s-line-2: #2a3a4e;
  --s-board: #0b1219;
  --s-raise: #0f1620;
  --s-deep: #0c131b;
  --s-text: #e8edf1;
  --s-muted: #95a3b3;
  --s-dim: #7d8b9b;
  --s-head: #8cc8ff;
}

.svc-page main {
  position: relative;
  z-index: 1;
}

.svc-eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

/* ---------- layer 1: heading ---------- */
.svc-hero {
  padding-bottom: 36px;
}

.svc-hero .wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.svc-hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 860px;
}

.svc-lede {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--s-muted);
  max-width: 640px;
}

.svc-hint {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--s-dim);
  letter-spacing: 0.06em;
}

/* ---------- layer 1: PCB trace roadmap ---------- */
.roadmap-section {
  position: relative;
  z-index: 1;
  padding-bottom: 56px;
}

.roadmap {
  border: 1px solid var(--s-line);
  border-radius: 10px;
  background-color: var(--s-board);
  background-image: radial-gradient(#17222e 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 0 8px;
}

/* canvas keeps the design's 1176 × 690 proportions; stops are placed in % */
.roadmap-canvas {
  position: relative;
  width: 100%;
  max-width: 1176px;
  aspect-ratio: 1176 / 690;
  margin: 0 auto;
}

.roadmap-trace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.roadmap-dash {
  stroke: var(--accent);
}

.roadmap-end {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  box-shadow: 0 0 0 6px var(--s-board);
}

.roadmap-end--start {
  left: calc(68 / 1176 * 100%);
  top: calc(120 / 690 * 100%);
  width: 88px;
  height: 88px;
  font-size: 15px;
}

.roadmap-end--field {
  left: calc(1100 / 1176 * 100%);
  top: calc(540 / 690 * 100%);
  width: 108px;
  height: 108px;
  font-size: 13px;
  line-height: 1.25;
}

.stage {
  position: absolute;
  left: var(--x);
  top: calc(var(--y) - 32px);
  transform: translateX(-50%);
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  color: var(--s-text);
}

.stage-pad {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent);
  background: var(--s-raise);
  color: var(--accent);
  box-shadow: 0 0 0 6px var(--s-board);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.stage-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--s-dim);
  margin-top: 6px;
}

.stage-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--s-text);
  transition: color .18s ease;
}

.stage-desc {
  font-size: 13px;
  color: var(--s-muted);
  line-height: 1.4;
}

.stage:hover .stage-pad,
.stage:focus-visible .stage-pad {
  transform: scale(1.18);
  filter: brightness(1.4) saturate(1.15);
}

.stage:hover .stage-title,
.stage:focus-visible .stage-title {
  color: #ffffff;
}

.stage:focus-visible {
  outline: 2px solid var(--s-head);
  outline-offset: 4px;
  border-radius: 8px;
}

.stage[aria-current="step"] .stage-pad {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 6px var(--s-board), 0 0 24px var(--accent);
}

.stage[aria-current="step"] .stage-title {
  color: var(--accent);
}

/* Tablet: shrink stop labels so they fit the scaled canvas */
@media (max-width: 1100px) {
  .stage { width: 140px; }
  .stage-desc { display: none; }
  .roadmap-end--start { width: 70px; height: 70px; font-size: 12px; }
  .roadmap-end--field { width: 84px; height: 84px; font-size: 11px; }
}

/* Phone / small tablet: the trace becomes a numbered grid */
@media (max-width: 820px) {
  .roadmap {
    padding: 20px 16px;
  }

  .roadmap-canvas {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 22px 12px;
  }

  .roadmap-trace,
  .roadmap-end {
    display: none;
  }

  .stage {
    position: static;
    transform: none;
    width: auto;
  }

  .stage-desc {
    display: block;
  }
}

/* ---------- section headings ---------- */
.svc-heading {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--s-line);
  padding: 56px 0 24px;
  scroll-margin-top: 72px;
}

.svc-heading .wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.svc-heading h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.125rem);
  line-height: 1.15;
}

.svc-heading--all {
  padding-bottom: 12px;
}

/* ---------- layer 2: stage panel ---------- */
.panel-section {
  position: relative;
  z-index: 1;
  padding-bottom: 72px;
}

.panel {
  border: 1px solid var(--s-line);
  border-radius: 10px;
  background: var(--s-raise);
  display: flex;
  flex-wrap: wrap;
}

.panel-overview {
  flex: 1 1 340px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--s-line);
}

.panel-fig {
  height: 260px;
  border-radius: 8px;
  border: 1px solid var(--s-line);
  overflow: hidden;
  position: relative;
  background: var(--s-board);
}

.panel-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-chip {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #c4d2e0;
  background: rgba(6, 16, 28, 0.72);
  padding: 3px 7px;
  border-radius: 3px;
}

.panel-chip--br { right: 12px; bottom: 10px; }

.panel-pos {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.panel-overview h3 {
  font-size: clamp(1.7rem, 3vw, 2.125rem);
  letter-spacing: -0.01em;
}

.panel-overview p {
  margin: 0;
  font-size: 15px;
  color: var(--s-muted);
  line-height: 1.6;
}

.panel-controls {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.panel-btn {
  flex: 1;
  min-height: 44px;
  border-radius: 4px;
  border: 1px solid var(--s-line-2);
  background: var(--s-board);
  color: var(--s-text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.panel-btn:hover {
  border-color: var(--accent);
}

.panel-btn--primary {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.panel-btn--primary:hover {
  filter: brightness(1.1);
}

.panel-btn:disabled,
.panel-btn:disabled:hover {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
  border-color: var(--s-line-2);
}

.panel-services {
  flex: 999 1 560px;
  min-width: 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-item {
  position: relative;  /* holds the heading link's full-card click area */
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--s-line);
  background: var(--s-deep);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.panel-item:hover,
.panel-item:focus-within {
  border-color: var(--accent);
}

.panel-item.is-active {
  border-color: var(--accent);
  background: #122033;
}

.panel-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-item h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.panel-item-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color .15s ease, text-decoration-color .15s ease;
}

.panel-item-link {
  outline: none;
}

/* stretch the heading link over the whole card so the card is clickable */
.panel-item-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
}

.panel-item-link:focus-visible::before {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.panel-item-link::after {
  content: " ↓";
  color: var(--accent);
  opacity: 0;
  transition: opacity .15s ease;
}

.panel-item:hover .panel-item-link,
.panel-item-link:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.panel-item:hover .panel-item-link::after,
.panel-item-link:focus-visible::after {
  opacity: 1;
}

.panel-item p {
  margin: 0;
  font-size: 15px;
  color: var(--s-muted);
  line-height: 1.6;
}

.panel-badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 3px;
}

@media (max-width: 720px) {
  .panel-overview {
    border-right: 0;
    border-bottom: 1px solid var(--s-line);
    padding: 22px;
  }

  .panel-services {
    padding: 22px;
  }

  .panel-fig {
    height: 200px;
  }
}

/* ---------- layer 3: full descriptions ---------- */
.svc-section {
  position: relative;
  z-index: 1;
  padding: 20px 0;
  scroll-margin-top: 72px;
}

.svc-card {
  border: 1px solid var(--s-line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  gap: 1px;
  background: var(--s-line);
}

.svc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--s-raise);
}

.svc-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--s-line-2);
  background: #121c28;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.svc-head h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.625rem);
  flex: 1 1 auto;
  color: var(--accent);
}

.svc-count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--s-dim);
}

/* outlined link button, used in a section header and under the stage panel list */
.svc-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 21px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(59, 158, 255, 0.08);
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

.svc-link:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.panel-link-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.svc-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  padding: 22px 24px;
  background: var(--s-deep);
  scroll-margin-top: 88px;
}

.svc-item:target {
  background: #122033;
}

/* "Enquire about this" — opens Contact with subject + service pre-filled */
.svc-enquire {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--s-line-2);
  color: var(--s-text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.svc-enquire:hover,
.svc-enquire:focus-visible {
  border-color: var(--accent);
  background: rgba(59, 158, 255, 0.1);
  color: var(--accent);
}

.svc-code {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--s-dim);
  padding-top: 4px;
}

.svc-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.svc-body h3 {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.svc-body p {
  margin: 0;
  font-size: 15px;
  color: var(--s-muted);
  line-height: 1.6;
  max-width: 820px;
}

@media (max-width: 640px) {
  .svc-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 18px;
  }

  .svc-enquire {
    justify-self: start;
    margin-top: 8px;
  }

  .svc-head {
    padding: 16px 18px;
  }
}
