/* app-governance-kit portfolio site — shared styles */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --fg: #1a212b;
  --muted: #4d5762;
  --border: #dde1e6;
  --accent: #1f4c5e;
  --accent-fg: #ffffff;
  --focus: #1f4c5e;
  --code-bg: #eef1f4;
  --chip-bg: #eef3f5;
  --control-border: #767f89;
  --glow: rgba(31, 76, 94, 0.10);
  --shadow: 0 0 0 1px rgba(26, 33, 43, 0.07), 0 1px 2px rgba(26, 33, 43, 0.05), 0 4px 12px rgba(26, 33, 43, 0.05);
  --shadow-hover: 0 0 0 1px rgba(26, 33, 43, 0.09), 0 2px 4px rgba(26, 33, 43, 0.06), 0 10px 24px rgba(26, 33, 43, 0.09);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10151b;
    --surface: #1a212b;
    --fg: #e7ebef;
    --muted: #a7b1bb;
    --border: #2c3641;
    --accent: #7fc2dd;
    --accent-fg: #0c1720;
    --focus: #9fd4e8;
    --code-bg: #131a22;
    --chip-bg: #1e2a33;
    --control-border: #6b7886;
    --glow: rgba(127, 194, 221, 0.10);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.13), 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --bg: #10151b;
  --surface: #1a212b;
  --fg: #e7ebef;
  --muted: #a7b1bb;
  --border: #2c3641;
  --accent: #7fc2dd;
  --accent-fg: #0c1720;
  --focus: #9fd4e8;
  --code-bg: #131a22;
  --chip-bg: #1e2a33;
  --control-border: #6b7886;
  --glow: rgba(127, 194, 221, 0.10);
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.13), 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(60rem 22rem at 50% -8rem, var(--glow), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-width: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  text-wrap: balance;
}

p, li {
  text-wrap: pretty;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.6rem 1rem;
  border-radius: 0.25rem;
  z-index: 10;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.5rem;
}

a {
  color: var(--accent);
}

a:not(.button) {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(0, 0, 0, 0.04);
}

.site-header__inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  color: var(--accent);
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.8rem;
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
  transition-property: background-color, color, scale;
  transition-duration: 0.15s;
  transition-timing-function: var(--ease);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  background: var(--chip-bg);
}

.site-nav a:active {
  scale: 0.96;
}

.site-nav a[aria-current="page"] {
  color: var(--accent-fg);
  background: var(--accent);
  font-weight: 600;
}

main {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  padding: 1.5rem 0 2rem;
}

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.hero p.positioning {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 46rem;
  margin: 0;
}

.prose.prose-wide,
.hero p.positioning.prose-wide {
  max-width: 55rem;
}

.prose {
  max-width: 46rem;
}

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
}

main section + section {
  margin-top: 2.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 1.25rem;
}

.card:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.card h2, .card h3 {
  margin-top: 0;
}

.card ul {
  padding-left: 1.1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  transition-property: box-shadow, filter, scale;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease);
}

.button:hover,
.button:focus-visible {
  filter: brightness(1.08);
  box-shadow: var(--shadow-hover);
}

.button:active {
  scale: 0.96;
}

.button--ghost {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
}

/* Visual actions — download / print for tables & diagrams */

.visual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
  margin: 0.85rem 0;
}

.visual-actions__link {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  transition-property: filter, scale;
  transition-duration: 0.15s;
  transition-timing-function: var(--ease);
}

.visual-actions__link:hover,
.visual-actions__link:focus-visible {
  filter: brightness(1.08);
}

.visual-actions__link:active {
  scale: 0.96;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.link-list li {
  margin: 0.3rem 0;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.table-scroll {
  overflow-x: auto;
}

.table-scroll table {
  min-width: 34rem;
  width: 100%;
  table-layout: fixed;
}

.table-scroll th,
.table-scroll td {
  overflow-wrap: break-word;
  word-break: break-word;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: var(--chip-bg);
}

td, th {
  font-variant-numeric: tabular-nums;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

code {
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.install code {
  overflow-wrap: anywhere;
}

/* Crosswalk explorer */

.xw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

@media (min-width: 46rem) {
  .xw-layout {
    grid-template-columns: 20rem minmax(0, 1fr);
    align-items: start;
  }
}

.xw-filter {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--control-border);
  border-radius: 0.3rem;
  background: var(--surface);
  color: var(--fg);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

#xw-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 32rem;
  overflow-y: auto;
  box-shadow: var(--shadow);
  border-radius: 12px;
  background: var(--surface);
}

#xw-list li {
  border-bottom: 1px solid var(--border);
}

#xw-list li:last-child {
  border-bottom: none;
}

#xw-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--fg);
  padding: 0.65rem 0.85rem;
  font: inherit;
  cursor: pointer;
}

#xw-list button:hover {
  background: var(--chip-bg);
}

#xw-list button[aria-current="true"] {
  background: var(--chip-bg);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

#xw-list .xw-id {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

#xw-empty {
  padding: 0.85rem;
  color: var(--muted);
}

.xw-detail {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  min-height: 12rem;
}

.xw-detail .placeholder {
  color: var(--muted);
}

.xw-clauses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.xw-clause {
  position: relative;
  background: var(--chip-bg);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.xw-clause dt {
  margin: 0 0 0.15rem;
}

.xw-clause dd {
  margin: 0;
  font-weight: 600;
}

.xw-info {
  font: inherit;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: none;
  border: 0;
  border-bottom: 1px dotted var(--muted);
  padding: 0;
  cursor: pointer;
}

.xw-info::after {
  content: " \24D8";
  font-size: 0.85em;
}

.xw-info:hover,
.xw-info[aria-expanded="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.xw-info-pop {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  margin-top: 0.35rem;
  width: max-content;
  max-width: min(18rem, calc(100vw - 3rem));
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  color: var(--fg);
  font-size: 0.85rem;
  line-height: 1.4;
}

.xw-info:hover + .xw-info-pop,
.xw-info:focus-visible + .xw-info-pop {
  display: block;
}

.xw-parts dt {
  font-weight: 600;
  margin-top: 0.85rem;
}

.xw-parts dd {
  margin: 0.15rem 0 0;
  color: var(--fg);
}

.xw-gap-note {
  margin: 0.5rem 0 1rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: var(--chip-bg);
  font-weight: 600;
}

.xw-stages dt {
  font-weight: 600;
  margin-top: 0.85rem;
}

.xw-stages dd {
  margin: 0.15rem 0 0;
}

.xw-stages dd ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}

.muted-link {
  color: var(--muted);
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 1.25rem;
}

@media (max-width: 22.5rem) {
  main {
    padding: 1.25rem 1rem 3rem;
  }

  .lc-handoff-btn,
  .lc-rule-xw,
  .lc-link-anchor,
  .lc-overlay-toggle,
  .lc-back-link-anchor,
  .visual-actions__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Lifecycle wheel */

.lc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  margin: 1.5rem 0;
}

@media (min-width: 46rem) {
  .lc-layout {
    grid-template-columns: 20rem minmax(0, 1fr);
  }
}

.lc-wheel-wrap {
  display: flex;
  justify-content: center;
}

.lc-wheel {
  width: 100%;
  max-width: 20rem;
  height: auto;
}

.lc-wheel-ring {
  stroke: var(--border);
  stroke-width: 1;
}

.lc-segment {
  fill: var(--chip-bg);
  stroke: var(--bg);
  stroke-width: 2;
  cursor: pointer;
}

.lc-segment:hover {
  fill: var(--border);
}

.lc-segment[aria-current="true"] {
  fill: var(--accent);
}

.lc-segment:focus-visible {
  outline: none;
  stroke: var(--focus);
  stroke-width: 4;
  filter: drop-shadow(0 0 3px var(--focus));
}

.lc-segment[aria-current="true"]:focus-visible {
  stroke: var(--accent-fg);
  filter: drop-shadow(0 0 3px var(--accent-fg));
}

.lc-segment-label {
  fill: var(--fg);
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
}

.lc-segment[aria-current="true"] + .lc-segment-label {
  fill: var(--accent-fg);
}

.lc-segment--linked + .lc-segment-label {
  fill: var(--accent-fg);
}

.lc-hub-label {
  fill: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.lc-arrow-arc {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.lc-arrow-head {
  fill: var(--muted);
}

.lc-arrow-label {
  fill: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
  pointer-events: none;
}

.lc-together {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 46rem;
  margin: 0 0 1.5rem;
}

.lc-panel {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  min-height: 12rem;
}

.lc-panel h2 {
  margin-top: 0;
}

.lc-questions-heading {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

.lc-stage-info {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.lc-stage-subhead {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
}

.lc-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.lc-fact {
  background: var(--chip-bg);
  border-radius: 0.4rem;
  padding: 0.65rem 0.85rem;
}

.lc-fact dt {
  margin: 0 0 0.3rem;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.lc-fact dd {
  margin: 0;
}

.lc-fact-note {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.lc-handoff-btn {
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  margin: 0 0.4rem 0.4rem 0;
  cursor: pointer;
}

.lc-handoff-btn:hover,
.lc-handoff-btn:focus-visible {
  filter: brightness(1.08);
}

.lc-rule-chips {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lc-rule-chip {
  background: var(--chip-bg);
  border-radius: 0.4rem;
  padding: 0.55rem 0.75rem;
}

.lc-rule-xw {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.lc-rule-xw:hover,
.lc-rule-xw:focus-visible {
  filter: brightness(1.08);
}

.lc-question-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lc-question {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.lc-question:last-child {
  border-bottom: none;
}

.lc-question-text {
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.lc-question-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lc-back-link {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.lc-back-link-anchor {
  display: inline-block;
}

.lc-overlay-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.lc-overlay-toggle {
  min-height: 40px;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  cursor: pointer;
}

.lc-overlay-toggle[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-fg);
}

.lc-overlay-toggle:hover,
.lc-overlay-toggle:focus-visible {
  filter: brightness(1.08);
}

.lc-overlay-legend {
  background: var(--chip-bg);
  border-radius: 0.4rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  max-width: 32rem;
}

.lc-overlay-legend p {
  margin: 0 0 0.3rem;
}

.lc-overlay-legend p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.lc-link-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.lc-link-list li {
  margin: 0.3rem 0;
}

.lc-link-anchor {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.15rem 0;
  font-size: 0.9rem;
}

.lc-flash {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  background: var(--chip-bg);
  border-radius: 0.3rem;
}

.lc-question:focus,
.lc-rule-chip:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.lc-segment--dim {
  opacity: 0.3;
}

.lc-segment--linked {
  fill: var(--focus);
}

/* Impact map */

.im-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.im-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.im-legend-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.im-legend-glyph--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.im-legend-glyph--secondary {
  background: var(--chip-bg);
  color: var(--fg);
}

.im-legend-glyph--none {
  background: transparent;
  color: var(--muted);
}

.im-table-wrap {
  display: none;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.im-table th,
.im-table td {
  text-align: center;
  white-space: nowrap;
}

.im-table th[scope="row"] {
  text-align: left;
  white-space: normal;
}

.im-cell {
  border-radius: 0.3rem;
}

.im-cell--primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.im-cell--secondary {
  background: var(--chip-bg);
}

.im-glyph {
  font-size: 1rem;
}

#im-cards {
  display: grid;
}

@media (min-width: 46rem) {
  .im-table-wrap {
    display: block;
  }

  #im-cards {
    display: none;
  }
}

/* Home page hero wheel preview */

.hero-flex {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 46rem) {
  .hero-flex {
    grid-template-columns: minmax(0, 1fr) 11rem;
  }
}

.hero-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  justify-self: center;
  text-decoration: none;
  color: inherit;
  border-radius: 0.5rem;
  transition: filter 0.15s ease;
}

.hero-wheel-wrap:hover,
.hero-wheel-wrap:focus-visible {
  filter: brightness(1.08);
}

.hero-wheel {
  width: 100%;
  max-width: 11rem;
  height: auto;
}

.hero-wheel-segment {
  fill: var(--chip-bg);
  stroke: var(--bg);
  stroke-width: 2;
}

.hero-wheel-segment--accent {
  fill: var(--accent);
}

.hero-wheel-num {
  fill: var(--fg);
  font-size: 11px;
  font-weight: 600;
}

.hero-wheel-num--accent {
  fill: var(--accent-fg);
}

.hero-wheel-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

/* Field guide — certification jump nav */

.fg-jumpnav {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  scroll-margin-top: 1rem;
}

.fg-jumpnav__label {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.fg-jumpnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
}


.fg-jumpnav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  font-size: 0.92rem;
}

.fg-jumpnav a:hover,
.fg-jumpnav a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.table-scroll,
.cert-anchor {
  scroll-margin-top: 1rem;
}

.table-scroll:target {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.4rem;
}

.cert-anchor:target {
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--chip-bg);
}

.fg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 46rem) {
  .fg-layout {
    grid-template-columns: 11rem minmax(0, 1fr);
  }

  .fg-layout .fg-jumpnav {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }

  .fg-layout .fg-jumpnav ul {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .fg-layout .fg-jumpnav a {
    display: flex;
  }
}

/* Practicum */

.pr-exercise {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 0 0 1.5rem;
  scroll-margin-top: 1rem;
}

.pr-exercise:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.pr-exercise h2 {
  margin-top: 0;
}

.pr-files h3,
.pr-handin h3 {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 1rem 0 0.4rem;
}

.pr-files-list {
  padding-left: 1.1rem;
  margin: 0.4rem 0 0;
}

.pr-field {
  margin: 0 0 1rem;
}

.pr-field label {
  display: block;
  margin: 0 0 0.3rem;
}

.pr-checkbox-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.pr-checkbox-list li {
  margin: 0.35rem 0;
}

.pr-inline-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  cursor: pointer;
}

.pr-inline-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
}

.pr-select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--control-border);
  border-radius: 0.3rem;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  max-width: 100%;
}

.pr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0.25rem;
}

.pr-message {
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.3rem;
  margin: 0.25rem 0;
}

.pr-result {
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.85rem 1rem;
  margin: 0.25rem 0 1rem;
}

.pr-result--pass {
  border-color: #2f7d4f;
}

.pr-result--fail {
  border-color: #a3432b;
}

.pr-result h4 {
  margin: 0 0 0.4rem;
}

.pr-result ul {
  margin: 0.3rem 0;
  padding-left: 1.2rem;
}

.pr-copy-fallback:not([hidden]) {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: 8rem;
  padding: 0.5rem;
  margin: 0.5rem 0;
  border: 1px solid var(--control-border);
  border-radius: 0.3rem;
  background: var(--code-bg);
  color: var(--fg);
  font-family: monospace;
  white-space: pre;
}

.pr-more {
  margin: 0.75rem 0;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.pr-more summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.4rem 0;
}

.pr-dup-controls {
  margin: 0.5rem 0;
}

.pr-pairs {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.pr-pairs li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.5rem;
  background: var(--chip-bg);
  border-radius: 0.3rem;
  margin: 0.3rem 0;
}

.pr-pair-remove {
  border: 1px solid var(--control-border);
  background: var(--surface);
  color: var(--fg);
  border-radius: 0.3rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.pr-pair-remove:hover,
.pr-pair-remove:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.pr-source-links {
  margin-top: 0.75rem;
}

/* Page entrance: the hero and first sections fade up once; skipped when motion is reduced */

@keyframes rise {
  from { opacity: 0; translate: 0 8px; filter: blur(4px); }
  to { opacity: 1; translate: 0 0; filter: blur(0); }
}

@media (prefers-reduced-motion: no-preference) {
  main > section:nth-child(-n+4) {
    animation: rise 0.5s var(--ease) both;
  }

  main > section:nth-child(2) { animation-delay: 0.08s; }
  main > section:nth-child(3) { animation-delay: 0.16s; }
  main > section:nth-child(4) { animation-delay: 0.24s; }
}

/* Support link: a small bar above the header */

.support-bar {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 0;
  display: flex;
  justify-content: flex-end;
}

.coffee-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0 0.9rem 0 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition-property: box-shadow, scale;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease);
}

.coffee-link:hover,
.coffee-link:focus-visible {
  box-shadow: var(--shadow-hover);
}

.coffee-link:active {
  scale: 0.96;
}

.coffee-icon {
  flex: none;
}

/* Navigation tooltips: shown on hover and keyboard focus, Escape hides them (see nav.js) */

.site-header {
  position: relative;
  z-index: 30;
}

.site-nav li {
  position: relative;
}

.nav-tip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
  width: max-content;
  max-width: min(16rem, calc(100vw - 2.5rem));
  margin-top: 0.4rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  color: var(--fg);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* keeps the tip open while the pointer travels from the link to the tip */
.nav-tip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.5rem;
  height: 0.5rem;
}

.site-nav li:nth-last-child(-n+3) .nav-tip {
  left: auto;
  right: 0;
}

.site-nav li:hover:not([data-tip-hidden]) .nav-tip,
.site-nav li:focus-within:not([data-tip-hidden]) .nav-tip {
  display: block;
}

/* Document pages (generated from the Markdown and CSV sources) */

.doc-page .doc-back {
  margin: 0 0 0.5rem;
}

.doc-page h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.doc-body table.checklist {
  min-width: 34rem;
  table-layout: auto;
}

.checklist td.checklist-write {
  min-width: 8rem;
  height: 2.75rem;
}

.checklist-choices {
  white-space: nowrap;
}

.checklist-choice {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 28px;
  cursor: pointer;
}

.checklist-choice input,
.checklist-items input {
  width: 1.05rem;
  height: 1.05rem;
}

.checklist-items {
  list-style: none;
  padding-left: 0.5rem;
}

button.visual-actions__link {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.tier-bar {
  position: sticky;
  top: 0.5rem;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0.75rem 0 1rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  background: var(--chip-bg);
  box-shadow: var(--shadow-hover);
}

.tier-bar p {
  margin: 0;
}

@media print {
  .support-bar,
  .site-header,
  .site-footer,
  .skip-link,
  .doc-back,
  .doc-actions,
  #tier-clear {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .tier-bar {
    position: static;
    box-shadow: none;
    border: 1px solid #000;
  }

  .doc-body table.checklist {
    min-width: 0;
    font-size: 0.85rem;
  }

  .checklist th,
  .checklist td {
    border: 1px solid #777;
  }

  .checklist tr,
  .checklist-choices {
    break-inside: avoid;
  }
}

.checklist td:first-child,
.checklist th:first-child {
  white-space: nowrap;
}

/* The caption repeats the heading above the table, so keep it for screen readers only */
.doc-body table.checklist caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Document tables: let columns size to their content and scroll sideways rather than breaking words */

.doc-body .table-scroll table {
  table-layout: auto;
  width: auto;
  min-width: 100%;
}

.doc-body .table-scroll th,
.doc-body .table-scroll td {
  word-break: normal;
  overflow-wrap: normal;
}

.doc-body table.wide th {
  white-space: nowrap;
}

.column-list {
  columns: 14rem;
  column-gap: 1.5rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.column-list li {
  break-inside: avoid;
  padding: 0.2rem 0;
}

/* Document pages: keep text at a comfortable reading width, but let tables use the full page */

.doc-body.prose {
  max-width: none;
}

.doc-body > p,
.doc-body > ul,
.doc-body > ol,
.doc-body > h2,
.doc-body > h3,
.doc-body > h4 {
  max-width: 46rem;
}

.doc-body .table-scroll td {
  min-width: 7rem;
}

.doc-body .table-scroll td.long-text {
  min-width: 18rem;
}

/* Fields the reader fills in on the page */

.checklist td.checklist-write textarea,
.checklist td.checklist-write input[type="text"] {
  display: block;
  width: 100%;
  min-width: 9rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.checklist td.checklist-tick {
  text-align: center;
}

.checklist td.checklist-tick input {
  width: 1.4rem;
  height: 1.4rem;
  cursor: pointer;
}

@media print {
  .checklist td.checklist-write textarea,
  .checklist td.checklist-write input[type="text"] {
    border: 0;
    resize: none;
    padding: 0;
  }
}

/* A pre-filled CSV shown as one card per row, with the blank columns as fields */

.record-form {
  display: grid;
  gap: 1rem;
}

.record-summary {
  margin: 0;
  font-weight: 600;
}

.record {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.record h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.record-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.record-facts div {
  display: flex;
  gap: 0.4rem;
}

.record-facts dt {
  font-weight: 600;
}

.record-facts dd {
  margin: 0;
}

.record-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
}

.record-field.record-wide {
  grid-column: 1 / -1;
}

.record-field label {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.record-field input,
.record-field select,
.record-field textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
}

.record-field textarea {
  resize: vertical;
}

@media print {
  .record {
    box-shadow: none;
    border: 1px solid #777;
    break-inside: avoid;
  }
}

/* Print icon at the top and bottom right of a document page */

.doc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.5rem;
}

.doc-top .doc-back {
  margin: 0;
}

.doc-bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
}

.print-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--accent);
  cursor: pointer;
  transition-property: box-shadow, scale;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease);
}

.print-icon:hover,
.print-icon:focus-visible {
  box-shadow: var(--shadow-hover);
}

.print-icon:active {
  scale: 0.96;
}

@media print {
  .print-icon,
  .doc-top,
  .doc-bottom {
    display: none !important;
  }
}

.site-version {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}

.site-version a {
  color: var(--muted);
}
