/* Navigation-chart design layer shared by the public pages:
   chart texture, bearing tags, the course line, card panels and the
   footer coordinates. Page-specific pieces live in home.css. */

/* The chart texture reaches past the content column; clip it at the
   viewport without creating a scroll container (sticky still works). */
html:has(> body.course-site),
.course-site {
  overflow-x: clip;
}
.course-site main {
  position: relative;
}

/* ------------------------------------------------------- chart texture */

.chart-texture {
  position: relative;
  isolation: isolate;
}
.chart-texture::before {
  content: "";
  position: absolute;
  inset: 0 -20vw;
  z-index: -1;
  background-image:
    url("/assets/chart-contours.svg"),
    linear-gradient(color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
  background-size: 1200px 800px, 96px 96px, 96px 96px;
  background-position: right -80px top -60px, center, center;
  background-repeat: no-repeat, repeat, repeat;
  opacity: 0.55;
  pointer-events: none;
  /* Painted once on its own layer, so it is not redrawn while scrolling. */
  will-change: transform;
  contain: strict;
}
/* Quieter version for text-first pages: grid plus a smaller contour. */
.chart-texture.is-quiet::before {
  background-size: 760px 507px, 96px 96px, 96px 96px;
  background-position: right -260px top -170px, center, center;
  opacity: 0.4;
}
/* Article headings sit close to the text, so they keep only the grid. */
.release-heading.chart-texture::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px;
  background-position: center, center;
  background-repeat: repeat, repeat;
  mask-image: linear-gradient(#000 40%, transparent);
}
/* Long text pages keep the texture behind the heading only. */
.about-hero.chart-texture::before {
  bottom: auto;
  height: 600px;
  mask-image: linear-gradient(#000 45%, transparent);
}
.legal.chart-texture::before {
  bottom: auto;
  height: 520px;
  mask-image: linear-gradient(#000 35%, transparent);
}
html[data-theme="dark"] .chart-texture::before {
  opacity: 0.3;
}
html[data-theme="dark"] .chart-texture.is-quiet::before {
  opacity: 0.22;
}

.coords {
  color: var(--accent);
}
html[data-theme="dark"] .coords {
  color: var(--copper);
}

/* Bearings in front of section labels. */
.bearing {
  display: inline-block;
  margin-right: 14px;
  padding: 1px 7px;
  border: 1px solid currentColor;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
  vertical-align: 1px;
}
.process .bearing,
html[data-theme="dark"] .bearing {
  color: var(--copper);
}

/* ---------------------------------------------------------- course line */

.course {
  position: absolute;
  left: calc(max(0px, (100% - 1380px) / 2) + 30px);
  width: 1px;
  z-index: 5;
  pointer-events: none;
}
.course-track {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--muted) 45%, transparent) 50%,
    transparent 50%
  );
  background-size: 1px 8px;
}
.course-fill {
  position: absolute;
  inset: 0;
  width: 2px;
  left: -0.5px;
  background: var(--copper);
  transform: scaleY(0);
  transform-origin: top;
  will-change: transform;
}
.waypoint {
  position: absolute;
  left: 0;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  color: var(--muted);
  font: 700 9px/1 var(--mono);
  transition: color 0.3s ease;
}
/* The diamond is drawn behind the label so the digits stay upright. */
.waypoint::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  transform: rotate(45deg);
  border: 1px solid color-mix(in srgb, var(--muted) 60%, transparent);
  background: var(--paper);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.waypoint.reached {
  color: #14202a;
}
.waypoint.reached::before {
  background: var(--copper);
  border-color: var(--copper);
}
/* Reading pages use small unlabeled diamonds. */
.course.is-quiet .waypoint {
  width: 14px;
  height: 14px;
  font-size: 0;
}
.course.is-quiet .waypoint::before {
  inset: 2px;
}

/* --------------------------------------------------------- card panels */

.perspective-grid {
  gap: 20px;
  margin-top: 8px;
}
.perspective-card {
  position: relative;
  padding: 30px 32px 28px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 55%, white);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.perspective-card:hover,
.perspective-card:focus-within {
  border-color: var(--line);
  border-top-color: var(--copper);
  transform: translateY(-2px);
}
.perspective-card h3 {
  margin: 14px 0 12px;
}
.perspective-card .release-author {
  margin-bottom: 0;
}
html[data-theme="dark"] .perspective-card {
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
}

.legal-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  border-top: 0;
}
.legal-links > a {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 55%, white);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.legal-links > a:hover,
.legal-links > a:focus-visible {
  border-color: var(--line);
  border-top-color: var(--copper);
  transform: translateY(-2px);
}
html[data-theme="dark"] .legal-links > a {
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
}

/* ------------------------------------------------------ footer position */

.footer-coords {
  font: 12px/1.6 var(--mono);
  letter-spacing: 0.08em;
  color: var(--accent);
}
html[data-theme="dark"] .footer-coords {
  color: var(--copper);
}
.footer-base {
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: center;
}

/* -------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  .waypoint,
  .waypoint::before,
  .perspective-card,
  .legal-links > a {
    transition: none;
  }
  .perspective-card:hover,
  .perspective-card:focus-within,
  .legal-links > a:hover,
  .legal-links > a:focus-visible {
    transform: none;
  }
}

/* -------------------------------------------------------------- layout */

/* Tablets and phones: the line moves into the side margin and the
   waypoints become small diamonds without numbers. */
@media (max-width: 1100px) {
  .course {
    left: 12px;
  }
  .waypoint {
    width: 14px;
    height: 14px;
    font-size: 0;
  }
  .waypoint::before {
    inset: 2px;
  }
}
@media (max-width: 720px) {
  .course {
    left: 9px;
  }
  .bearing {
    margin-right: 10px;
  }
  .coords {
    font-size: 12px;
  }
  .chart-texture::before {
    inset: 0 -23px;
    background-size: 700px 467px, 64px 64px, 64px 64px;
    background-position: right -260px top -40px, center, center;
    opacity: 0.4;
  }
  .release-heading.chart-texture::before {
    background-size: 64px 64px, 64px 64px;
  }
  .chart-texture.is-quiet:not(.release-heading)::before {
    background-size: 520px 347px, 64px 64px, 64px 64px;
    background-position: right -240px top -120px, center, center;
    opacity: 0.3;
  }
  .perspective-grid,
  .legal-links {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .perspective-card,
  .legal-links > a {
    padding: 22px 20px;
  }
}

/* ---------------------------------------------- final review, Nov 2026
   Shared refinements: one emphasis rule for headings, a 12px floor for
   labels, larger tap targets, a quieter client link and one footer on
   every page. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The emphasized half of a heading is copper everywhere, never gray. */
.course-site h2 span {
  color: var(--accent);
}

/* Header: taller link targets; the client link reads as a utility. */
.header nav > a:not(.button) {
  padding: 10px 0;
}
.header nav > a[href="/portal/"] {
  padding-left: 22px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.header nav > a[href="/portal/"]:hover {
  color: var(--accent);
}

/* About: principles are not a sequence, so they carry a mark, not a number. */
.principles article::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 9px;
  transform: rotate(45deg);
  background: var(--copper);
}

/* Footer, identical on every public page. */
.site-footer .footer-main {
  padding: 52px 0 44px;
}
.footer-about p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}
.footer-email {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 45%, var(--paper));
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0 22px;
  padding: 6px 0;
  font: 12px/1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-email:hover,
.footer-social:hover,
.site-footer nav a:hover,
.footer-base a:hover {
  color: var(--accent);
}
.site-footer .footer-main nav {
  gap: 2px 36px;
}
.site-footer .footer-main nav a,
.footer-base a {
  display: inline-block;
  padding: 7px 0;
}
.footer-base {
  font-size: 13px;
}

@media (max-width: 720px) {
  .course-site .eyebrow {
    font-size: 12px;
  }
  .header nav > a[href="/portal/"] {
    padding-left: 0;
    border-left: 0;
    font-size: 14px;
  }
  .header nav > a:not(.button) {
    padding: 12px 0;
  }
  .site-footer .footer-main {
    padding: 40px 0 32px;
  }
  .site-footer .footer-main nav {
    gap: 4px 24px;
  }
  .site-footer .footer-main nav a,
  .footer-base a {
    padding: 11px 0;
  }
}
html[data-theme="dark"] .course-site h2 span {
  color: var(--copper);
}

/* The most recent release leads the collection and carries a badge.
   Move the is-newest class and the badge when a new piece is published. */
.perspective-card.is-newest {
  grid-column: 1 / -1;
  border-top-color: var(--copper);
}
.badge-new {
  display: inline-block;
  margin-right: 12px;
  padding: 1px 8px;
  background: var(--accent);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.1em;
  vertical-align: 1px;
}
html[data-theme="dark"] .badge-new {
  background: var(--copper);
  color: #14202a;
}

/* ------------------------------------------------- header navigation */
/* Chart labels: the section tags' mono type, a copper rule that draws in on
   hover, and a copper diamond (the course-line waypoint) on the current page.
   No numbers: the page already carries section numbers and bearings. */
.header nav > a:not(.button) {
  position: relative;
  font: 12px/1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.header nav > a:not(.button)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}
.header nav > a:not(.button):hover::after,
.header nav > a:not(.button):focus-visible::after,
.header nav > a[aria-current="page"]::after {
  transform: scaleX(1);
}
.header nav > a[aria-current="page"] {
  color: var(--accent);
}
.header nav > a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  background: var(--accent);
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  .header nav > a:not(.button)::after {
    transition: none;
  }
}
@media (max-width: 720px) {
  /* The open menu sits above the course line. */
  .header nav {
    z-index: 10;
    gap: 0;
  }
  .header nav > a:not(.button) {
    padding: 16px 0 16px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }
  .header nav > a:not(.button)::after {
    display: none;
  }
  .header nav > a[aria-current="page"]::before {
    left: 2px;
    top: 50%;
    margin: -3px 0 0;
  }
  .header nav a.button {
    margin-top: 18px;
  }
}

/* ------------------------------------------------- refinements 2026-12 */
/* Headlines: slightly looser tracking so large letters no longer touch. */
h1,
.about-hero h1,
.collection-heading h1,
.release-heading h1 {
  letter-spacing: -0.035em;
}
h2 {
  letter-spacing: -0.03em;
}
/* Text links keep their look but get a 44 px tap area. */
.text-link {
  position: relative;
}
.text-link::before {
  content: "";
  position: absolute;
  inset: -8px -4px;
}
