@import url("https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400&family=Spline+Sans:wght@400;500;600;700&display=swap");

:root {
  --thd-atmosphere: #c4c0b8;
  --thd-paper: #eef1ef;
  --thd-lead: #16181a;
  --thd-note: #4a5054;
  --thd-edge: #b5b8b4;
  --thd-spot: #1a5f6e;
  --thd-spot-deep: #0f3f4a;
  --thd-fill: #e0e4e2;
  --thd-tab: #d8d4cc;
  --thd-head: "Spline Sans", "Segoe UI", sans-serif;
  --thd-body: "PT Serif", "Times New Roman", serif;
  --thd-ui: "Spline Sans", "Segoe UI", sans-serif;
  --thd-em: 1.0625rem;
  --thd-lh: 1.62;
  --thd-max: 72rem;
  --thd-measure: 38rem;
  --thd-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html.thd {
  overflow-x: clip;
  color-scheme: light;
  background-color: var(--thd-atmosphere);
  background-image:
    linear-gradient(180deg, rgba(238, 241, 239, 0.55) 0%, transparent 42%),
    radial-gradient(ellipse 90% 55% at 12% -8%, rgba(26, 95, 110, 0.12), transparent 52%),
    radial-gradient(ellipse 70% 40% at 92% 8%, rgba(196, 192, 184, 0.9), transparent 48%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(22, 24, 26, 0.045) 27px,
      rgba(22, 24, 26, 0.045) 28px
    );
  background-attachment: fixed;
}

html.thd body {
  overflow-x: clip;
  margin: 0;
  min-height: 100vh;
  color: var(--thd-lead);
  font-family: var(--thd-body);
  font-size: var(--thd-em);
  line-height: var(--thd-lh);
  box-sizing: border-box;
}

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

.thd-frame {
  width: min(100% - 1.5rem, var(--thd-max));
  margin-inline: auto;
  padding: 1.25rem 0 3rem;
}

.thd-hop {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.thd-hop:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  z-index: 20;
  padding: 0.55rem 0.85rem;
  background: var(--thd-paper);
  color: var(--thd-spot-deep);
  font-family: var(--thd-ui);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--thd-spot);
}

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

a {
  color: var(--thd-spot);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--thd-spot-deep);
}

h1,
h2,
h3 {
  font-family: var(--thd-head);
  font-weight: 650;
  font-style: normal;
  overflow-wrap: anywhere;
  min-width: 0;
  line-height: 1.18;
  color: var(--thd-lead);
}

h1 {
  font-size: clamp(1.55rem, 2.4vw + 1rem, 2.15rem);
  margin: 0 0 0.7rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
  padding: 0;
  background: none;
  border-bottom: 1px solid var(--thd-edge);
  padding-bottom: 0.35rem;
  font-weight: 600;
}

h3 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.45rem;
}

p,
li,
small,
td,
th {
  overflow-wrap: anywhere;
}

/* ——— Masthead ——— */
.thd-mast {
  position: relative;
  padding: 1.35rem 0 1.1rem;
  animation: thd-rise 0.7s var(--thd-ease) both;
}

.thd-mast::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 1.15rem;
  background: linear-gradient(
    90deg,
    var(--thd-spot) 0%,
    var(--thd-spot) 4.5rem,
    var(--thd-edge) 4.5rem,
    var(--thd-edge) 100%
  );
}

.thd-brand {
  margin: 0;
  font-family: var(--thd-head);
  font-size: clamp(2.15rem, 5.5vw + 0.6rem, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.thd-brand a {
  color: var(--thd-lead);
  text-decoration: none;
}

.thd-brand a:hover {
  color: var(--thd-spot-deep);
}

.thd-deck {
  margin: 0.55rem 0 0;
  max-width: 34rem;
  font-family: var(--thd-ui);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--thd-note);
  line-height: 1.45;
}

/* ——— Nav: folder tabs ——— */
.thd-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1.5rem;
  animation: thd-rise 0.7s var(--thd-ease) 0.08s both;
}

.thd-menu {
  margin: 0;
}

.thd-menu ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.15rem;
  align-items: flex-end;
}

.thd-menu a {
  display: inline-block;
  padding: 0.55rem 0.85rem 0.5rem;
  font-family: var(--thd-ui);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--thd-lead);
  text-decoration: none;
  background: var(--thd-tab);
  border: 1px solid var(--thd-edge);
  border-bottom: none;
  border-radius: 0.35rem 0.35rem 0 0;
  transition: transform 0.2s var(--thd-ease), background 0.2s ease, color 0.2s ease;
}

.thd-menu a:hover {
  background: var(--thd-paper);
  color: var(--thd-spot-deep);
  transform: translateY(-2px);
}

.thd-menu a[aria-current="page"] {
  background: var(--thd-paper);
  color: var(--thd-spot-deep);
  box-shadow: inset 0 3px 0 var(--thd-spot);
}

.thd-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  padding: 0.35rem 0 0.15rem;
  border-top: 1px solid var(--thd-edge);
  font-family: var(--thd-ui);
  font-size: 0.86rem;
  font-weight: 500;
}

.thd-subnav a {
  color: var(--thd-note);
  text-decoration: none;
}

.thd-subnav a:hover,
.thd-subnav a[aria-current="page"] {
  color: var(--thd-spot);
  text-decoration: underline;
}

/* ——— Main panel ——— */
.thd-bench {
  background: var(--thd-paper);
  border: 1px solid var(--thd-edge);
  border-top: none;
  padding: clamp(1.15rem, 2.5vw, 1.85rem) clamp(1rem, 3vw, 2rem) 2rem;
  min-width: 0;
  animation: thd-rise 0.75s var(--thd-ease) 0.14s both;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 18px 40px -28px rgba(22, 24, 26, 0.35);
}

.thd-bench > :first-child {
  margin-top: 0;
}

/* ——— Home hierarchy ——— */
.thd-hero-note {
  margin: 0 0 1.5rem;
  font-family: var(--thd-ui);
  font-size: 0.9rem;
  color: var(--thd-note);
}

.thd-rails {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 0 0 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--thd-edge);
}

@media (min-width: 40rem) {
  .thd-rails {
    grid-template-columns: 1fr 1px 1fr;
    gap: 0 1.5rem;
    align-items: start;
  }

  .thd-rail-rule {
    width: 1px;
    height: 100%;
    min-height: 4.5rem;
    background: var(--thd-edge);
    justify-self: center;
  }
}

.thd-rail-label {
  margin: 0 0 0.35rem;
  font-family: var(--thd-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--thd-spot);
}

.thd-rail-title {
  margin: 0;
  font-family: var(--thd-head);
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.25;
}

.thd-rail-title a {
  color: var(--thd-lead);
  text-decoration: none;
}

.thd-rail-title a:hover {
  color: var(--thd-spot);
  text-decoration: underline;
}

.thd-rail-meta {
  margin: 0.35rem 0 0;
  font-family: var(--thd-ui);
  font-size: 0.88rem;
  color: var(--thd-note);
}

.thd-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin: 0 0 0.85rem;
}

.thd-section-head h2 {
  margin: 0;
  border: none;
  padding: 0;
}

.thd-section-head a {
  font-family: var(--thd-ui);
  font-size: 0.88rem;
  font-weight: 600;
}

/* Scan rows */
.thd-scan {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  border-top: 1px solid var(--thd-edge);
}

.thd-scan li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--thd-edge);
  font-family: var(--thd-ui);
}

.thd-scan a {
  color: var(--thd-lead);
  font-weight: 600;
  text-decoration: none;
}

.thd-scan a:hover {
  color: var(--thd-spot);
  text-decoration: underline;
}

.thd-scan-meta {
  color: var(--thd-note);
  font-size: 0.88rem;
  white-space: nowrap;
}

.thd-scan-topic {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--thd-spot);
  margin: 0;
}

@media (min-width: 36rem) {
  .thd-scan li {
    grid-template-columns: 7.5rem minmax(0, 1fr) 4rem;
  }

  .thd-scan-topic {
    grid-column: auto;
  }
}

/* Column hub — desk slots, not cards */
.thd-slots {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0;
}

.thd-slots li {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0 0.85rem 0.95rem;
  border-left: 3px solid var(--thd-spot);
  border-bottom: 1px solid var(--thd-edge);
}

.thd-slots a {
  font-family: var(--thd-head);
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--thd-lead);
  text-decoration: none;
}

.thd-slots a:hover {
  color: var(--thd-spot);
  text-decoration: underline;
}

.thd-slots span {
  font-family: var(--thd-ui);
  font-size: 0.9rem;
  color: var(--thd-note);
}

/* ——— Article ——— */
.thd-manual {
  max-width: calc(var(--thd-measure) + 2rem);
}

.thd-kicker {
  margin: 0 0 0.4rem;
  font-family: var(--thd-ui);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--thd-spot);
}

.thd-meta-line {
  margin: 0 0 1rem;
  font-family: var(--thd-ui);
  font-size: 0.9rem;
  color: var(--thd-note);
}

.thd-byline {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin: 0.85rem 0 1.35rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--thd-edge);
  border-bottom: 1px solid var(--thd-edge);
  font-family: var(--thd-ui);
  font-size: 0.95rem;
  animation: thd-rise 0.55s var(--thd-ease) 0.2s both;
}

.thd-byline-lead {
  margin-bottom: 1.5rem;
  max-width: none;
  border: none;
  padding: 0;
}

.thd-byline p {
  margin: 0.15rem 0;
}

.thd-avatar {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--thd-edge);
  background: var(--thd-fill);
  border-radius: 0;
}

.thd-avatar-lg {
  width: 7.5rem;
  height: 7.5rem;
}

.thd-role {
  display: block;
  color: var(--thd-note);
  font-size: 0.92em;
}

.thd-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  margin-top: 0.35rem !important;
}

.thd-tag {
  white-space: nowrap;
  font-size: 0.9em;
}

.thd-work {
  max-width: var(--thd-measure);
}

.thd-work p,
.thd-work li {
  margin: 0.65rem 0;
}

.thd-work ul,
.thd-work ol {
  padding-inline-start: 1.25rem;
}

.thd-work h2 {
  margin-top: 1.75rem;
}

.thd-back {
  margin-top: 2rem;
  font-family: var(--thd-ui);
  font-size: 0.92rem;
  font-weight: 600;
}

/* ——— Generic lists (indexes) ——— */
.thd-jobs {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

ul.thd-jobs > li,
ol.thd-jobs > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--thd-edge);
  font-family: var(--thd-ui);
  align-items: baseline;
}

ul.thd-jobs > li > a,
ol.thd-jobs > li > a {
  color: var(--thd-lead);
  font-weight: 600;
  text-decoration: none;
}

ul.thd-jobs > li > a:hover,
ol.thd-jobs > li > a:hover {
  color: var(--thd-spot);
  text-decoration: underline;
}

ul.thd-jobs > li > span,
ol.thd-jobs > li > span {
  color: var(--thd-note);
  font-size: 0.9rem;
}

table.thd-jobs {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--thd-ui);
}

table.thd-jobs th,
table.thd-jobs td {
  text-align: start;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--thd-edge);
  vertical-align: top;
  font-weight: 400;
}

table.thd-jobs th {
  font-weight: 650;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--thd-note);
}

@media (max-width: 40rem) {
  table.thd-jobs thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  table.thd-jobs,
  table.thd-jobs tbody,
  table.thd-jobs tr,
  table.thd-jobs td {
    display: block;
    width: auto;
  }
}

.thd-span {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.7rem;
}

.thd-empty {
  color: var(--thd-note);
  font-family: var(--thd-ui);
}

.thd-author-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.5rem;
}

.thd-author-list > li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--thd-edge);
}

.thd-masthead {
  font-style: normal;
  margin: 0.75rem 0 1.1rem;
  font-family: var(--thd-ui);
  padding: 0.85rem 1rem;
  background: var(--thd-fill);
  border-left: 3px solid var(--thd-spot);
}

.thd-masthead p {
  margin: 0.12rem 0;
}

/* ——— Forms / checklist ——— */
input,
textarea,
button {
  font: inherit;
  color: inherit;
}

textarea,
input[type="text"] {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--thd-edge);
  padding: 0.5rem 0.6rem;
  font-family: var(--thd-ui);
  border-radius: 0;
}

button,
.thd-run,
.thd-btn {
  background: var(--thd-spot);
  color: #f4f8f8;
  border: 1px solid var(--thd-spot-deep);
  padding: 0.5rem 0.95rem;
  font-family: var(--thd-ui);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s var(--thd-ease);
}

button:hover,
.thd-run:hover,
.thd-btn:hover {
  background: var(--thd-spot-deep);
}

button:active,
.thd-btn:active {
  transform: translateY(1px);
}

fieldset {
  border: 1px solid var(--thd-edge);
  min-width: 0;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem 0.95rem;
  background: rgba(255, 255, 255, 0.45);
}

fieldset legend {
  font-family: var(--thd-ui);
  font-weight: 650;
  font-size: 0.92rem;
  padding: 0 0.35rem;
}

label {
  display: block;
  margin: 0.4rem 0;
  font-family: var(--thd-ui);
  font-size: 0.95rem;
}

.thd-check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.45rem 0;
  font-family: var(--thd-ui);
}

.thd-check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex: none;
  accent-color: var(--thd-spot);
}

.thd-tool {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--thd-edge);
}

.thd-tool pre {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  background: var(--thd-fill);
  border: 1px solid var(--thd-edge);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

hr {
  border: 0;
  border-top: 1px solid var(--thd-edge);
}

/* ——— Footer ——— */
.thd-base {
  width: min(100% - 1.5rem, var(--thd-max));
  margin: 1.75rem auto 0;
  padding: 1.25rem 0 0.5rem;
  color: var(--thd-note);
  font-family: var(--thd-ui);
  font-size: 0.9rem;
  border-top: 1px solid rgba(22, 24, 26, 0.12);
}

.thd-base p {
  margin: 0.35rem 0;
}

.thd-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.95rem;
  margin: 0.65rem 0 !important;
}

.thd-foot-links a {
  color: var(--thd-spot-deep);
  font-weight: 500;
}

@keyframes thd-rise {
  from {
    opacity: 0;
    transform: translateY(0.55rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .thd-mast,
  .thd-nav,
  .thd-bench,
  .thd-byline {
    animation: none;
  }

  .thd-menu a {
    transition: none;
  }
}

@media print {
  .thd-menu,
  .thd-subnav,
  .thd-hop,
  .thd-run,
  .thd-btn,
  .thd-nav {
    display: none !important;
  }

  html.thd {
    background: #fff;
  }

  html.thd body,
  .thd-frame {
    max-width: none;
    width: auto;
  }

  .thd-bench {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .thd-mast::after {
    display: none;
  }
}
