/* Responsive refinements discovered by the automated visual-review matrix. */

/* Decorative corner rings must not enlarge the scroll box of linked cards. */
.contact-route-grid a::after,
.route-link-grid a::after {
  content: none;
}

/* Keep the four homepage role cards while preserving a readable measure. */
.home-page .capability-grid {
  gap: .75rem;
  align-items: stretch;
}

.home-page .capability-card {
  min-height: 13.5rem;
  padding: .9rem;
  align-content: start;
}

/* Keep the role cards aligned. Visual variety comes from accent treatment,
   not from a stagger that reads as a layout defect. */
.home-page .capability-card:nth-child(even) {
  transform: none;
}

.home-page .capability-card:nth-child(even):hover {
  transform: translateY(-5px);
}

/* The flagship evidence card now uses a verified, original systems diagram
   rather than decorative empty space. */
.home-page .evidence-focus-grid article:first-child {
  min-height: 0;
  padding: 0;
  align-content: start;
  background:
    radial-gradient(circle at 92% 8%, rgba(217, 70, 239, .11), transparent 14rem),
    linear-gradient(145deg, rgba(17, 30, 50, .94), rgba(7, 16, 31, .98));
}

.home-page .evidence-system-card::before {
  content: none;
}

.evidence-system-visual {
  margin: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--page-accent) 24%, var(--line));
  background: #07101f;
}

.evidence-system-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center;
}

.evidence-system-visual figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .8rem;
  align-items: baseline;
  padding: .75rem 1rem;
  background: linear-gradient(90deg, rgba(56, 189, 248, .07), rgba(217, 70, 239, .06));
}

.evidence-system-visual figcaption span {
  color: var(--cyan);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.evidence-system-visual figcaption strong {
  color: var(--muted-strong);
  font-size: .82rem;
}

.evidence-system-copy {
  display: grid;
  gap: .8rem;
  padding: clamp(1.15rem, 3vw, 1.7rem);
}

.evidence-system-copy h3,
.evidence-system-copy p {
  margin: 0;
}

.evidence-system-copy .evidence-link {
  margin-top: .1rem;
}

/* Give the primary contact route enough width to read as a deliberate CTA. */
.contact-page .contact-route-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-page .contact-route-grid a {
  min-height: 10.5rem;
}

.contact-page .contact-route-grid a:nth-child(1) {
  grid-column: 1 / -1;
  grid-row: auto;
  min-height: 15rem;
  align-content: end;
}

.contact-page .contact-route-grid a:nth-child(1) strong {
  max-width: 100%;
  font-size: clamp(1.35rem, 3vw, 2.5rem);
  overflow-wrap: anywhere;
}

/* Site-wide alignment rail. Section introductions and component copy now
   begin on the same horizontal rhythm instead of alternating between the
   outer container edge and unrelated component padding values. */
:root {
  --page-text-rail: clamp(.95rem, 1.45vw, 1.25rem);
}

:where(
  .hero-copy,
  .page-hero > .section-head,
  .page-hero-grid > :first-child,
  .section > .section-head,
  .section > .split-layout > :first-child > .section-head,
  .section > .split-layout > div > .section-head
) {
  padding-inline-start: var(--page-text-rail);
}

.page-hero > .actions {
  padding-inline-start: var(--page-text-rail);
}

:where(
  .project-panel,
  .proof-chip,
  .metric,
  .dashboard-grid article,
  .signal-matrix article,
  .lab-state-grid article,
  .resume-focus-grid article,
  .credentials-grid article,
  .route-link-grid a,
  .contact-route-grid a,
  .capability-card,
  .scope-note-card,
  .artifact-card,
  .chart-panel
) {
  padding-inline-start: var(--page-text-rail);
}

.evidence-table caption,
.evidence-table th,
.evidence-table td {
  padding-inline-start: var(--page-text-rail);
}

/* Multi-column cards must share row baselines. The original visual layer
   translated selected cards downward, which made equal grid rows appear
   misaligned. Keep the visual distinction in borders and accents instead. */
.projects-page .project-supporting-grid,
.contact-page .route-link-grid {
  align-items: stretch;
}

.projects-page .project-supporting-grid .project-panel,
.contact-page .route-link-grid a {
  height: 100%;
  transform: none;
}

.projects-page .project-supporting-grid .project-panel {
  display: flex;
  flex-direction: column;
}

.projects-page .project-supporting-grid .project-panel .proof-links {
  margin-top: auto;
  padding-top: 1rem;
}

.projects-page .project-supporting-grid .project-panel:hover,
.contact-page .route-link-grid a:hover {
  transform: translateY(-5px);
}

@media (max-width: 1100px) {
  .contact-page .contact-route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-page .contact-route-grid a:nth-child(1) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  :root {
    --page-text-rail: .75rem;
  }

  .home-page .capability-card {
    min-height: 0;
  }

  .evidence-system-visual img {
    aspect-ratio: 4 / 3;
    object-position: center;
  }

  .evidence-system-visual figcaption {
    align-items: flex-start;
  }

  .contact-page .contact-route-grid {
    grid-template-columns: 1fr;
  }

  .contact-page .contact-route-grid a,
  .contact-page .contact-route-grid a:nth-child(1) {
    grid-column: auto;
    min-height: 10rem;
  }

  .contact-page .contact-route-grid a:nth-child(1) strong {
    font-size: clamp(1.25rem, 7vw, 1.8rem);
  }
}

@media (max-width: 420px) {
  :root {
    --page-text-rail: .6rem;
  }

  .resume-page #summary-title {
    max-width: 100%;
    font-size: clamp(1.45rem, 7vw, 1.7rem);
    line-height: 1.1;
    text-wrap: pretty;
  }
}

/* Match the source stagger selectors exactly so the desktop overrides win
   without relying on !important. */
.projects-page .project-supporting-grid .project-panel:nth-child(2),
.projects-page .project-supporting-grid .project-panel:nth-child(3),
.contact-page .route-link-grid a:nth-child(even) {
  transform: none;
}

.projects-page .project-supporting-grid .project-panel:nth-child(2):hover,
.projects-page .project-supporting-grid .project-panel:nth-child(3):hover,
.contact-page .route-link-grid a:nth-child(even):hover {
  transform: translateY(-5px);
}

