/* ==========================================================================
   SERVICES SECTION
   Full-bleed services band replicating the live Webflow section.
   Uses tokens from tokens.css — never hardcode values.
   Class prefix: svc- (cannot collide with ns- / explorer- / listing-).
   ========================================================================== */

.svc-section {
  background: var(--bg-shell); /* off-white — matches the app shell / footer so there are no stripes */
  padding: var(--space-20) 0;
}

.svc-section__inner {
  max-width: 1200px; /* mirrors .container in layout.css */
  margin: 0 auto;
  padding: 0 var(--space-10);
}

.svc-section__eyebrow {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  text-align: center;
}

.svc-section__title {
  margin: 0 0 var(--space-16);
  font-family: var(--font-display);
  font-weight: 400; /* display serifs breathe at regular weight */
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  line-height: 1.15;
  color: var(--text-primary);
  text-align: center;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3); /* 8px — matches live card gaps */
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.svc-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm); /* 4px */
  aspect-ratio: 1200 / 546; /* native asset ratio */
  color: var(--text-inverse);
  text-decoration: none;
  isolation: isolate; /* keep scrims + arrow inside the card's stacking context */
}

.svc-card:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Reset applies `a:hover { color: var(--text-primary) }` — hold white here.
   (Card title/desc set their own color, but this keeps the anchor explicit.) */
.svc-card:hover {
  color: var(--text-inverse);
}

.svc-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Permanent bottom scrim — simplification of the live section's hover-only
   readability treatment; text stays legible without hovering. */
.svc-card__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.18) 42%,
    transparent 68%
  );
}

/* Full-card dark gradient — fades in on hover / keyboard focus. */
.svc-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.7));
  transition: opacity 0.35s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.svc-card:hover .svc-card__overlay,
.svc-card:focus-visible .svc-card__overlay {
  opacity: 1;
}

/* ── Card content (bottom-left over the image) ──────────────────────────── */
.svc-card__content {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: var(--space-5); /* 12px */
  max-width: 100%;
}

.svc-card__title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl); /* 18px — closest token to the live ~20px */
  line-height: 1.2;
  color: var(--text-inverse);
}

.svc-card__desc {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md); /* 14px */
  line-height: 1.2;
  color: var(--text-inverse);
  opacity: 0.92; /* near-white — lets the scrim breathe through */
}

/* ── Arrow — the signature hover detail ─────────────────────────────────── */
.svc-card__arrow {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 2;
  display: flex;
  width: 24px;
  height: 24px;
  color: var(--text-inverse);
  opacity: 0;
  /* Live Webflow: starts tucked in toward the card's center, flies to
     rest at top-right. Both properties transition on the same curve. */
  transform: translate(-15px, 15px);
  transition: opacity 0.35s cubic-bezier(0.455, 0.03, 0.515, 0.955),
    transform 0.35s cubic-bezier(0.455, 0.03, 0.515, 0.955);
  pointer-events: none;
}

.svc-card:hover .svc-card__arrow,
.svc-card:focus-visible .svc-card__arrow {
  opacity: 1;
  transform: translate(0, 0);
}

.svc-card__arrow svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .svc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .svc-section {
    padding: var(--space-12) 0 var(--space-16);
  }

  .svc-section__inner {
    padding: 0 var(--space-6);
  }

  .svc-section__title {
    margin-bottom: var(--space-12);
  }

  .svc-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .svc-card__arrow,
  .svc-card__overlay {
    transition: none;
  }
}

/* Design tokens for DevLink code components (footer + legal drawer).
 *
 * The app gets these from src/styles/tokens.css via :root. A Shadow DOM has no
 * :root — and custom properties only inherit INTO a shadow root if the host
 * defines them — so we define the subset these components use on :host. An
 * undefined var() makes its whole declaration invalid, so the list must cover
 * every token the footer + drawer reference.
 * Harmless when loaded in the app (the app already defines every token). */

:host {
  --text-primary: #171717;
  --text-secondary: #525252;
  --text-muted: #737373;
  --text-inverse: #ffffff;

  --text-xs: 0.6875rem;
  --text-sm: 0.75rem;
  --text-md: 0.875rem;
  --text-lg: 0.9375rem;
  --text-xl: 1rem;
  --text-2xl: 1.125rem;
  --text-3xl: 1.375rem;

  --font-body: "Compass Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --font-heading: "Compass Display", serif;
  --font-display: "Italiana", "Compass Display", serif;
  --font-mono: "GT Pressura Mono", "SF Mono", "Fira Code", monospace;

  --space-1: 0.25rem;
  --space-2: 0.375rem;
  --space-3: 0.5rem;
  --space-4: 0.625rem;
  --space-5: 0.75rem;
  --space-6: 1rem;
  --space-8: 1.25rem;
  --space-10: 1.5rem;
  --space-12: 2rem;
  --space-16: 3rem;
  --space-20: 4rem;

  --duration-fast: 0.15s;
  --duration-normal: 0.2s;
  --duration-slow: 0.3s;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-circle: 50%;

  --border-subtle: #e5e5e5;
  --border-focus: #2d62ff;
  --border-hover: #d4d4d4;

  --bg-base: #ffffff;
  --bg-surface: #fafafa;
  --bg-elevated: #f5f5f5;
  --bg-shell: #f3f3f3;

  --accent-hover: #262626;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

  --z-modal: 1000;
}
