/* Skyout Paragliding — /tools hub
   Signature: the flight-cycle rail. One continuous hairline runs down the
   three tools with a waypoint marker at each, because the tools are a real
   sequence — plan the day, fly the glide, review the climbs.
   Uses only tokens from design-tokens.css.
*/

@keyframes toolsFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero ────────────────────────────────────────────────── */
/* Sits on the theme's shared .page-hero gradient (global.css). */

.tools-hero {
  padding: var(--space-24) 0 var(--space-20);
}

.tools-hero__inner {
  position: relative;
  z-index: 1;
}

.tools-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: var(--space-6);
  animation: toolsFadeUp 0.5s ease both;
}

.tools-hero__meta-sep {
  color: var(--color-accent-light);
  opacity: 0.75;
}

.tools-hero .tools-hero__headline {
  font-size: clamp(2.125rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: #fff;
  max-width: 16ch;
  margin-bottom: var(--space-6);
  animation: toolsFadeUp 0.5s 0.08s ease both;
}

.tools-hero__headline em {
  display: block;
  font-style: italic;
  color: var(--color-sky-light);
}

.tools-hero__sub {
  font-size: var(--text-lg);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  max-width: 56ch;
  margin-bottom: 0;
  animation: toolsFadeUp 0.5s 0.18s ease both;
}

/* ── Tool stack ──────────────────────────────────────────── */

.tools-stack {
  padding: var(--space-24) 0;
  background: var(--color-bg);
}

.tools-stack__header {
  margin-bottom: var(--space-12);
}

.tools-stack__header h2 {
  margin: var(--space-2) 0 0;
  max-width: 20ch;
  line-height: 1.1;
  text-wrap: balance;
}

/* The cycle: reset the global list styling entirely. */
.tools-cycle {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  margin: 0;
  position: relative;
}

/* ── Rail ────────────────────────────────────────────────── */

.tool-row__rail {
  position: relative;
  padding: var(--space-10) var(--space-8) var(--space-10) 0;
}

/* Waypoint marker — the rail's right edge is exactly the hairline,
   so the marker sits on the line without a magic offset. */
.tool-row__rail::after {
  content: '';
  position: absolute;
  right: 0;
  top: calc(var(--space-10) + 0.86rem);
  width: 9px;
  height: 9px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border-dark);
  transform: translate(50%, -50%) rotate(45deg);
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base);
}

.tool-row__phase {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}

/* ── Body — carries the hairline so it runs unbroken ─────── */

/* Two columns: the prose, and a spec column that fills what would
   otherwise be dead space on the right of every row. */
.tool-row__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  column-gap: var(--space-12);
  align-content: start;
  border-left: 1px solid var(--color-border);
  padding: var(--space-10) var(--space-8) var(--space-10) var(--space-10);
  transition: background var(--transition-base);
}

.tool-row__title {
  grid-column: 1;
  grid-row: 1;
  font-size: var(--text-2xl);
  color: var(--color-primary);
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  transition: color var(--transition-base);
}

.tool-row__desc {
  grid-column: 1;
  grid-row: 2;
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 56ch;
  margin: 0 0 var(--space-6);
}

/* ── Spec column — instrument vernacular, real facts only ── */

.tool-row__specs {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: start;
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.tool-row__specs li {
  margin: 0;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-border);
}

.tool-row__specs li:first-child {
  border-top: 1.5px solid var(--color-accent);
  padding-top: var(--space-3);
}

/* ── Row link ────────────────────────────────────────────── */

.tool-row__link {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-decoration: none;
}

/* Stretched link — one link per row, covering the whole row (including the
   rail), so the clickable area matches the area the hover state highlights.
   Positions against .tool-row, the nearest positioned ancestor. */
.tool-row__link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tool-row__arrow {
  display: inline-block;
  transition: transform var(--transition-base);
}

/* ── Row states ──────────────────────────────────────────── */

.tool-row:hover .tool-row__body,
.tool-row:focus-within .tool-row__body {
  background: linear-gradient(to right, rgba(200, 82, 26, 0.05), rgba(200, 82, 26, 0) 65%);
}

.tool-row:hover .tool-row__rail::after,
.tool-row:focus-within .tool-row__rail::after {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: translate(50%, -50%) rotate(45deg) scale(1.25);
}

.tool-row:hover .tool-row__phase,
.tool-row:focus-within .tool-row__phase {
  color: var(--color-accent);
}

.tool-row:hover .tool-row__title,
.tool-row:focus-within .tool-row__title {
  color: var(--color-accent);
}

.tool-row:hover .tool-row__arrow,
.tool-row:focus-within .tool-row__arrow {
  transform: translateX(4px);
}

.tool-row__link:hover {
  color: var(--color-accent-light);
  text-decoration: none;
}

/* Keep the keyboard ring on the row, not the invisible overlay */
.tool-row__link:focus-visible {
  outline: none;
}

.tool-row:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* ── CTA ─────────────────────────────────────────────────── */

.tools-cta {
  padding: var(--space-20) 0 var(--space-24);
  background: var(--color-bg-alt);
}

.tools-cta__inner {
  text-align: center;
  max-width: 560px;
}

.tools-cta__inner h2 {
  max-width: 14ch;
  margin: 0 auto var(--space-3);
  text-wrap: balance;
}

.tools-cta__inner p {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  margin: 0 auto var(--space-8);
  max-width: 46ch;
}

.tools-cta__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
  .tool-row {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Rail label moves above the title; the hairline stays continuous
     because both the rail and the body carry it. */
  .tool-row__rail {
    grid-row: 1;
    border-left: 1px solid var(--color-border);
    padding: var(--space-8) 0 0 var(--space-6);
  }

  .tool-row__rail::after {
    right: auto;
    left: 0;
    top: calc(var(--space-8) + 0.5rem);
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .tool-row:hover .tool-row__rail::after,
  .tool-row:focus-within .tool-row__rail::after {
    transform: translate(-50%, -50%) rotate(45deg) scale(1.25);
  }

  /* Single column: prose, then specs as a horizontal strip, then the link. */
  .tool-row__body {
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    padding: var(--space-2) 0 var(--space-8) var(--space-6);
  }

  .tool-row__desc {
    /* Still capped — the rail no longer constrains the measure here. */
    max-width: 62ch;
    margin-bottom: var(--space-5);
  }

  .tool-row__specs {
    grid-column: 1;
    grid-row: 3;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-6);
  }

  .tool-row__specs li,
  .tool-row__specs li:first-child {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    border-top: none;
    padding: 0;
  }

  .tool-row__specs li + li::before {
    content: '';
    width: 3px;
    height: 3px;
    background: var(--color-accent);
    transform: translateY(-0.25em);
  }

  .tool-row__link {
    grid-row: 4;
  }
}

@media (max-width: 768px) {
  .tools-hero {
    padding: var(--space-20) 0 var(--space-16);
  }

  .tools-stack {
    padding: var(--space-16) 0;
  }

  .tools-stack__header {
    margin-bottom: var(--space-8);
  }

  .tool-row__title {
    font-size: var(--text-xl);
  }

  .tools-cta {
    padding: var(--space-16) 0 var(--space-20);
  }
}

/* ── Motion preferences ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .tools-hero__meta,
  .tools-hero__headline,
  .tools-hero__sub {
    animation: none;
  }

  .tool-row__body,
  .tool-row__rail::after,
  .tool-row__phase,
  .tool-row__title,
  .tool-row__arrow {
    transition: none;
  }

  /* The marker still changes colour on hover — only the movement is dropped.
     Its transform is direction-dependent per breakpoint, so it is left alone. */
  .tool-row:hover .tool-row__arrow,
  .tool-row:focus-within .tool-row__arrow {
    transform: none;
  }
}
