:root {
  color-scheme: light dark;
  --site-max: 72rem;
  --site-radius: 0.65rem;
  --g: var(--thadam-graphite);
  --w: var(--thadam-warm-white);
  --site-fg: light-dark(var(--g), var(--w));
  --site-bg: light-dark(var(--w), var(--g));
  --site-muted: light-dark(color-mix(in srgb, var(--g) 74%, var(--w)), color-mix(in srgb, var(--w) 76%, var(--g)));
  --site-line: light-dark(color-mix(in srgb, var(--g) 15%, var(--w)), color-mix(in srgb, var(--w) 16%, var(--g)));
  --site-line-strong: light-dark(color-mix(in srgb, var(--g) 36%, var(--w)), color-mix(in srgb, var(--w) 40%, var(--g)));
  --site-surface: light-dark(color-mix(in srgb, var(--g) 4%, var(--w)), color-mix(in srgb, var(--w) 5%, var(--g)));
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--site-bg);
  color: var(--site-fg);
  font-family: var(--thadam-font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: var(--thadam-signal-orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 3px;
}

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

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

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.2rem, 4.4vw + 0.5rem, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

p {
  margin: 0 0 0.95rem;
  max-width: 68ch;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 30;
  padding: 0.5rem 1rem;
  background: var(--site-fg);
  color: var(--site-bg);
}

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

main,
.site-footer {
  width: min(100% - 2.5rem, var(--site-max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem max(1.25rem, calc((100% - var(--site-max)) / 2));
  border-bottom: 1px solid var(--site-line);
  background: color-mix(in srgb, var(--site-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
}

.brand img {
  display: block;
  height: auto;
  max-width: 100%;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
}

.site-header nav a {
  padding: 0.35rem 0.65rem;
  border-radius: 0.4rem;
  color: var(--site-muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-header nav a:hover {
  background: var(--site-surface);
  color: var(--site-fg);
}

.hero {
  display: grid;
  gap: 2.25rem;
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4.25rem) 2.75rem;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 1rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--site-line-strong);
  border-radius: 999px;
  background: var(--site-surface);
  color: var(--site-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.verbs {
  margin-bottom: 1rem;
  color: var(--site-muted);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  font-weight: 600;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--site-muted);
  font-size: 1.125rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--site-line-strong);
  border-radius: 0.5rem;
  color: var(--site-fg);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  border-color: var(--site-fg);
  background: var(--site-surface);
}

.button-primary,
.button-primary:hover {
  border-color: var(--thadam-signal-orange);
  background: var(--thadam-signal-orange);
  color: var(--thadam-graphite);
  font-weight: 600;
}

.button-primary:hover {
  background: color-mix(in srgb, var(--thadam-signal-orange) 82%, var(--thadam-warm-white));
}

.hero-art img,
.how-intro img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
}

.how-intro {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .hero:has(.hero-art) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .how-intro {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.features {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
}

.features li {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  background: var(--site-surface);
  font-size: 0.925rem;
  font-weight: 500;
  line-height: 1.4;
}

.features li:last-child {
  grid-column: 1 / -1;
}

@media (min-width: 52rem) {
  .features {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .features li:last-child {
    grid-column: auto;
  }
}

.features svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--thadam-signal-orange);
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section {
  scroll-margin-top: 4.5rem;
  padding-block: 2.5rem;
  border-top: 1px solid var(--site-line);
}

.section p {
  color: var(--site-muted);
}

.flow {
  margin: 1.5rem 0 0;
  padding: 1.35rem;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  background-color: var(--site-surface);
  background-image: radial-gradient(var(--site-line) 1px, transparent 1px);
  background-size: 20px 20px;
}

.flow-grid {
  display: grid;
  gap: 0.6rem;
  align-items: center;
}

.flow-col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.flow .flow-eyebrow {
  margin: 0.2rem 0 0;
  color: var(--site-muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.flow-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-node {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.55rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--site-line);
  border-radius: 0.5rem;
  background: var(--site-bg);
}

.flow-node strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.flow-node .flow-detail {
  flex-basis: 100%;
  color: var(--site-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.flow-node .pill {
  margin-left: auto;
}

.flow-node-accent {
  border: 2px solid var(--thadam-signal-orange);
}

.flow-node-dashed {
  border-style: dashed;
}

.flow-node-dotted {
  border-style: dotted;
}

.flow-tier {
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--site-line);
  border-radius: 0.3rem;
  background: var(--site-surface);
  color: var(--site-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.flow-link {
  position: relative;
  justify-self: center;
  width: 2px;
  height: 1.75rem;
}

.flow-link::before,
.flow-link::after {
  content: "";
  position: absolute;
}

.flow-link::before {
  inset: 0;
  background: var(--site-line-strong);
}

.flow-link::after {
  bottom: -2px;
  left: -4px;
  border: 5px solid transparent;
  border-top: 8px solid var(--site-line-strong);
  border-bottom: 0;
}

@media (min-width: 60rem) {
  .flow-grid {
    grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 0.9fr) 2.5rem minmax(0, 1fr);
  }

  .flow-link {
    width: 2.5rem;
    height: 2px;
    justify-self: stretch;
  }

  .flow-link::after {
    top: -4px;
    bottom: auto;
    left: auto;
    right: -2px;
    border: 5px solid transparent;
    border-left: 8px solid var(--site-line-strong);
    border-right: 0;
  }
}

.flow figcaption {
  margin-top: 1rem;
  color: var(--site-muted);
  font-size: 0.88rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.6rem 0.12rem 0.45rem;
  border: 1px solid var(--site-line-strong);
  border-radius: 999px;
  color: var(--site-fg);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.pill-progress {
  border-style: dashed;
}

.pill-progress::before,
.pill-planned::before {
  background: transparent;
  border: 1.5px solid currentColor;
}

.pill-planned,
.pill-planned::before {
  border-style: dotted;
}

.pill-planned,
.status-note {
  color: var(--site-muted);
}

.status-note {
  font-size: 0.88rem;
}

.table-wrap {
  margin-top: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  background: var(--site-bg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

caption {
  caption-side: bottom;
  padding: 0.65rem 0.9rem;
  color: var(--site-muted);
  font-size: 0.85rem;
  text-align: left;
}

th,
td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--site-line);
  text-align: left;
  vertical-align: top;
}

tbody tr:hover td {
  background: var(--site-surface);
}

thead th {
  border-bottom: 2px solid var(--thadam-signal-orange);
  background: var(--site-surface);
  font-size: 0.85rem;
  font-weight: 600;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

code {
  padding: 0.15em 0.35em;
  border: 1px solid var(--site-line);
  border-radius: 0.3rem;
  background: var(--site-surface);
  color: var(--site-fg);
}

pre {
  overflow-x: auto;
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  background: var(--site-surface);
  line-height: 1.55;
}

pre code {
  padding: 0;
  border: 0;
  background: none;
}

.site-footer {
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--site-line);
  color: var(--site-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0 0 0.5rem;
}

img.on-dark,
:root[data-theme="dark"] img.on-light {
  display: none;
}

:root[data-theme="dark"] img.on-dark {
  display: block;
}

:root[data-theme="dark"] :is(.hero-art, .how-intro) img {
  filter: brightness(0.88);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) img.on-light {
    display: none;
  }

  :root:not([data-theme]) img.on-dark {
    display: block;
  }

  :root:not([data-theme]) :is(.hero-art, .how-intro) img {
    filter: brightness(0.88);
  }
}

.theme-toggle {
  position: relative;
  flex: none;
  width: 3.75rem;
  height: 2rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 9%, transparent);
  color: var(--site-fg);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: currentColor;
  transition: transform 0.2s ease;
}

.theme-toggle svg {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 0.95rem;
  height: 0.95rem;
  transform: translateY(-50%);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

.theme-toggle .icon-sun {
  left: 0.5rem;
}

.theme-toggle .icon-moon {
  right: 0.5rem;
}

.theme-toggle:hover {
  border-color: currentColor;
}

.theme-toggle[hidden] {
  display: none;
}

:root:not([data-theme="dark"]) .theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
  color: var(--site-bg);
}

:root[data-theme="dark"] .theme-toggle::after {
  transform: translateX(1.75rem);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
