/*
  Purpose: layout and visual system for the Services page only.
  Inputs: HTML marked with body.services-page (hero, service cards, ticker, timeline, form chips).
  Outputs: a dark-studio look with more whitespace, glass cards, and clickable form chips.
  Data flow: this file styles markup in services/index.html. It does not change header/footer.
  Beginner note: every rule is scoped to body.services-page so other pages stay unchanged.
*/

/* ============================================================
   PAGE RHYTHM
   Keep sections close together. Adjacent .section blocks each
   add top + bottom padding, so these numbers stay small on
   purpose (otherwise the page looks full of empty gaps).
   ============================================================ */
body.services-page .section {
  padding: clamp(22px, 3.2vw, 32px) 0;
}

body.services-page .section-head {
  margin-bottom: clamp(12px, 1.8vw, 18px);
  max-width: 42rem;
}

body.services-page .section-subtitle {
  line-height: 1.6;
  max-width: 48ch;
}

/* Show this line break only on phones (keeps the hero subtitle on two even lines). */
br.only-mobile {
  display: none;
}

/* Jump-link target: leave room under the sticky header. */
body.services-page #project-inquiry {
  scroll-margin-top: calc(76px + env(safe-area-inset-top, 0px));
}

/* ============================================================
   HERO COPY + CHIPS
   The photo/overlay lives in the page <style> block (cache-safe).
   These rules only style the text, button, and feature chips.
   ============================================================ */
body.services-page .services-hero {
  padding-top: clamp(48px, 8vw, 80px);
  padding-bottom: clamp(28px, 4.5vw, 40px);
}

body.services-page .services-hero .container {
  max-width: 52rem;
}

body.services-page .services-hero h1 {
  font-size: clamp(2.55rem, 5.2vw + 1rem, 3.85rem);
  max-width: 14ch;
}

.services-hero-eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.services-hero-sub {
  margin: 12px 0 0;
  max-width: 36ch;
  font-size: clamp(17px, 2.2vw + 12px, 21px);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}

/* Row of small "proof" pills under the main button. */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

/*
  PURPOSE: one feature badge (for example "Mobile & PC").
  INPUTS: short label text inside a span.
  OUTPUTS: a pill-shaped chip that sits on the hero photo.
*/
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

body.services-page .services-hero .hero-actions {
  margin-top: 22px;
}

body.services-page .services-hero .hero-actions .btn {
  min-height: 48px;
  padding-left: 22px;
  padding-right: 22px;
}

/* ============================================================
   4-CARD SERVICES GRID
   Mobile = 1 column, tablet = 2, desktop = 4.
   ============================================================ */
.svc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/*
  PURPOSE: one service offer as a card instead of a long paragraph.
  INPUTS: icon, short title, 1-2 sentence blurb, up to 3 bullets.
  OUTPUTS: a glass card with hover lift.
*/
body.services-page .svc-card.panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  padding: 24px 22px 22px;
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

body.services-page .svc-card.panel:hover {
  transform: translateY(-4px);
  border-color: var(--feature-hover-border);
  box-shadow:
    0 0 0 1px var(--feature-hover-inner) inset,
    0 24px 70px var(--feature-hover-glow);
}

.svc-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 14px;
  color: var(--text);
  background: var(--feature-badge-grad);
  border: 1px solid var(--feature-badge-border);
}

.svc-card__icon svg {
  display: block;
}

.svc-card__title {
  margin: 0 0 8px;
  font-size: clamp(18px, 1.6vw + 12px, 20px);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.svc-card__text {
  margin: 0 0 16px;
  color: var(--feature-text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.6;
}

.svc-card__list {
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.svc-card__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}

/* Small gradient dot before each deliverable. */
.svc-card__list li::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.5em;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neonA), var(--neonB));
}

.svc-extras {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.svc-extras__label {
  margin-right: 4px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.svc-extras__chip {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 13px;
  font-weight: 750;
}

/* ============================================================
   TECH TICKER (MARQUEE)
   Two identical tracks sit side by side. The row slides left
   by 50% and loops, so the logos appear endless.
   ============================================================ */
.tech-ticker-wrap {
  margin-top: 0;
}

.tech-ticker {
  overflow: hidden;
  padding: 8px 0;
  /* Fade the left and right edges so logos do not "hit" a hard cut. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.tech-ticker__track {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  /* Keep scrolling even when the mouse is over the row. */
  animation: services-tech-scroll 36s linear infinite;
}

@keyframes services-tech-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.tech-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--panel-block-border);
  background: var(--panel-block);
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.tech-logo svg {
  flex-shrink: 0;
  opacity: 0.92;
}

/* ============================================================
   4-STEP PROCESS TIMELINE
   Phones: stacked cards with a vertical line.
   Desktop: one horizontal row with a connector behind the numbers.
   ============================================================ */
.how-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
}

.how-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
  padding: 0 0 22px;
  position: relative;
}

.how-step:last-child {
  padding-bottom: 0;
}

/* Vertical line from this step's number down to the next step (mobile only). */
.how-step::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 52px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--neonA), var(--neonB));
  opacity: 0.35;
}

.how-step:last-child::before {
  display: none;
}

.how-step__num {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--feature-badge-grad);
  border: 1px solid var(--feature-badge-border);
}

.how-step__body {
  width: 100%;
  min-height: 96px;
  padding: 16px 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--step-border);
  background: var(--step-bg);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.how-step:hover .how-step__body {
  transform: translateY(-2px);
  border-color: var(--feature-hover-border);
  box-shadow:
    0 0 0 1px var(--feature-hover-inner) inset,
    0 18px 50px var(--feature-hover-glow);
}

.how-step__body h3 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.how-step__body p {
  margin: 0;
  color: var(--step-text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

/* ============================================================
   SLIM PACKAGES
   Two short offer cards. Long feature lists were removed.
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

body.services-page .pricing-card.panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 24px 22px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

body.services-page .pricing-card.panel:hover {
  transform: translateY(-3px);
  border-color: var(--feature-hover-border);
  box-shadow:
    0 0 0 1px var(--feature-hover-inner) inset,
    0 26px 80px var(--feature-hover-glow);
}

.pricing-card--popular {
  border-color: var(--btn-primary-border);
  box-shadow:
    0 0 0 1px var(--feature-hover-inner) inset,
    0 22px 70px var(--feature-hover-glow);
}

.pricing-card__title {
  margin: 0 0 6px;
  font-size: clamp(18px, 2vw + 12px, 22px);
  letter-spacing: -0.02em;
}

.pricing-card__subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 800;
  color: var(--neonA);
}

.pricing-card__list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  flex: 1;
  display: grid;
  gap: 8px;
}

.pricing-card__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  color: var(--feature-text);
}

.pricing-card__list li::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.5em;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neonA), var(--neonB));
}

.pricing-card__cta {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

/* ============================================================
   ESTIMATE FORM
   Dropdowns/checkboxes become clickable chip buttons.
   Hidden radios/checkboxes still submit the same field names
   so scripts/main.js does not need to change.
   ============================================================ */
body.services-page .estimate-panel.panel {
  padding: clamp(22px, 4vw, 32px);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form-grid .field--full,
.form-grid .chip-fieldset,
.form-grid > .btn,
.form-grid > .help,
.form-grid > #projectStatus {
  grid-column: 1 / -1;
}

body.services-page .field {
  gap: 8px;
}

body.services-page input,
body.services-page textarea {
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 13px 14px;
  line-height: 1.4;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.services-page input:hover,
body.services-page textarea:hover {
  border-color: var(--input-focus-border);
}

body.services-page input:focus,
body.services-page textarea:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow:
    0 0 0 4px var(--ring),
    0 0 24px rgba(91, 124, 250, 0.16);
}

.chip-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.chip-fieldset legend {
  font-weight: 850;
  color: var(--label);
  font-size: 14px;
  margin-bottom: 2px;
  padding: 0;
}

.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/*
  PURPOSE: turn a radio or checkbox into a filter-style button.
  INPUTS: a native input (visually hidden) + a visible label span.
  OUTPUTS: the chip looks selected when the hidden input is checked.
  BEGINNER NOTE: :has() styles the parent label based on the child input.
*/
.choice-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--feature-text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.choice-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-chip:hover {
  border-color: var(--input-focus-border);
  transform: translateY(-1px);
}

.choice-chip:has(input:checked) {
  color: var(--text);
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-grad);
  box-shadow:
    0 0 0 1px var(--feature-hover-inner) inset,
    0 10px 28px var(--feature-hover-glow);
}

.choice-chip:has(input:focus-visible) {
  box-shadow: 0 0 0 4px var(--ring);
}

body.services-page .form-grid > .btn {
  min-height: 48px;
  justify-content: center;
}

#projectStatus.project-status--success {
  color: var(--neonA);
  font-weight: 750;
  font-size: 15px;
  margin-top: 4px;
  white-space: pre-line;
}

/* ============================================================
   FINAL CTA
   Photo layers stay in the HTML <style> block.
   ============================================================ */
.services-final-cta {
  padding-bottom: 28px;
}

.services-cta-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
  padding: clamp(36px, 6vw, 56px) clamp(20px, 4vw, 36px);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.services-cta-panel > * {
  position: relative;
  z-index: 2;
}

.services-cta-panel__title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3.5vw + 0.8rem, 2rem);
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.services-cta-panel__text {
  margin: 0 auto 20px;
  max-width: 40ch;
  color: rgba(233, 236, 255, 0.94);
  font-weight: 650;
  line-height: 1.6;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.38);
}

/* ============================================================
   LIGHT THEME
   Same layout, ink text, indigo accent.
   ============================================================ */
html[data-theme="light"] .svc-card__title,
html[data-theme="light"] .how-step__body h3,
html[data-theme="light"] .pricing-card__title {
  color: var(--heading);
}

html[data-theme="light"] .pricing-card__subtitle {
  color: var(--accent);
}

html[data-theme="light"] .svc-card__list li::before,
html[data-theme="light"] .pricing-card__list li::before {
  background: var(--accent);
}

html[data-theme="light"] #projectStatus.project-status--success {
  color: var(--accent);
}

html[data-theme="light"] body.services-page input:focus,
html[data-theme="light"] body.services-page textarea:focus {
  box-shadow:
    0 0 0 4px var(--ring),
    0 0 20px rgba(79, 70, 229, 0.12);
}

/* ============================================================
   REDUCED MOTION
   If the visitor asked the OS to limit motion, stop the ticker
   and do not lift cards on hover.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .tech-ticker__track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
    max-width: 100%;
  }

  .tech-ticker__track .tech-logo:nth-child(n + 8) {
    display: none;
  }

  .tech-ticker {
    -webkit-mask-image: none;
    mask-image: none;
  }

  body.services-page .svc-card.panel:hover,
  body.services-page .pricing-card.panel:hover,
  .how-step:hover .how-step__body,
  .choice-chip:hover {
    transform: none;
  }
}

/* ============================================================
   TABLET (720px+)
   ============================================================ */
@media (min-width: 720px) {
  .svc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  body.services-page .services-hero .hero-actions {
    flex-direction: row;
    align-items: center;
  }

  body.services-page .services-hero .hero-actions .btn {
    width: auto;
  }
}

/* ============================================================
   DESKTOP (1024px+): 4 service cards + horizontal process
   ============================================================ */
@media (min-width: 1024px) {
  .svc-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }

  .how-timeline {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }

  .how-step {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 0;
  }

  .how-step::before {
    display: none;
  }

  .how-step__num {
    margin-bottom: 2px;
  }

  /* Horizontal connector between step numbers (not after the last). */
  .how-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 25px;
    left: 60px;
    right: -10px;
    height: 2px;
    background: linear-gradient(90deg, var(--neonA), var(--neonB));
    opacity: 0.35;
    pointer-events: none;
  }
}

/* ============================================================
   PHONES
   Goal: even rows, no leftover chips, no text cut off.
   Cards become compact "icon + text" rows instead of tall stacks.
   ============================================================ */
@media (max-width: 719px) {
  body.services-page .section {
    padding: 18px 0;
  }

  body.services-page .section-head {
    margin-bottom: 12px;
    max-width: none;
  }

  br.only-mobile {
    display: block;
  }

  /* Do not break words in the middle (global.css uses overflow-wrap: anywhere). */
  body.services-page .section .section-subtitle {
    display: block;
    width: 100%;
    max-width: none;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    white-space: normal;
  }

  body.services-page .services-hero {
    padding-top: 32px;
    padding-bottom: 20px;
  }

  body.services-page .services-hero .container {
    max-width: none;
  }

  body.services-page .services-hero h1 {
    max-width: none;
    font-size: clamp(1.85rem, calc(6.4vw + 0.55rem), 2.25rem);
    line-height: 1.12;
  }

  .services-hero-eyebrow {
    font-size: 11px;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
  }

  body.services-page .services-hero .services-hero-sub {
    max-width: none;
    width: 100%;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: break-word;
    white-space: normal;
  }

  body.services-page .services-hero .hero-actions {
    width: 100%;
    margin-top: 14px;
  }

  body.services-page .services-hero .hero-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }

  /* Compact pills that wrap. Not full-width bars. */
  body.services-page .hero-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
  }

  body.services-page .hero-chip {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: auto;
    min-height: 0;
    padding: 5px 9px;
    font-size: 11px;
    letter-spacing: 0;
    gap: 4px;
  }

  body.services-page .hero-chip svg {
    display: block;
    width: 12px;
    height: 12px;
  }

  .svc-grid {
    gap: 10px;
  }

  /*
    Compact card: icon on the left, title + text on the right,
    bullets under the whole row. Reads like a clean list.
  */
  body.services-page .svc-card.panel {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 6px;
    padding: 14px 14px;
    height: auto;
  }

  .svc-card__icon {
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    margin-bottom: 0;
    border-radius: 12px;
  }

  .svc-card__title {
    grid-column: 2;
    margin: 0;
    font-size: 16px;
    align-self: end;
  }

  .svc-card__text {
    grid-column: 2;
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
  }

  .svc-card__list {
    grid-column: 1 / -1;
    margin: 6px 0 0;
    gap: 5px;
  }

  .svc-card__list li {
    font-size: 13px;
  }

  /* Label on its own row; chips stay content-sized so text is not clipped. */
  .svc-extras {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
  }

  .svc-extras__label {
    flex: 1 0 100%;
    margin-right: 0;
  }

  .svc-extras__chip {
    width: auto;
  }

  .tech-ticker {
    padding: 4px 0;
  }

  .tech-logo {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .how-step {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 12px;
  }

  .how-step::before {
    left: 19px;
    top: 40px;
  }

  .how-step__num {
    width: 40px;
    height: 40px;
    font-size: 12px;
    border-radius: 12px;
  }

  .how-step__body {
    min-height: 0;
    padding: 10px 12px;
  }

  .how-step__body h3 {
    font-size: 15px;
  }

  .how-step__body p {
    font-size: 13px;
  }

  .pricing-grid {
    gap: 10px;
  }

  body.services-page .pricing-card.panel,
  body.services-page .estimate-panel.panel {
    padding: 16px 14px;
  }

  .pricing-card__title {
    font-size: 17px;
  }

  .pricing-card__list {
    margin-bottom: 14px;
  }

  /* Even 2-column chip rows in the form (no ragged wrap). */
  body.services-page .choice-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.services-page .choice-chip {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    justify-content: center;
    min-height: 42px;
    padding: 8px 6px;
    font-size: 11px;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
  }

  .form-grid {
    gap: 12px;
  }

  .services-cta-panel {
    padding: 22px 16px;
  }

  .services-cta-panel .btn,
  body.services-page .form-grid > .btn,
  body.services-page .pricing-card__cta {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .services-final-cta {
    padding-bottom: 18px;
  }
}
