:root {
  --page-width: 1040px;
  --bg: #f2f0e9;
  --ink: #171a17;
  --muted: #686e67;
  --line: #c9cec5;
  --card: #fbfaf6;
  --accent: #2e5639;
  --accent-soft: #dce6dc;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: 'Frutiger', Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.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;
}

.site-header,
.page {
  width: min(var(--page-width), calc(100% - 48px));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--line);
}

.kicker,
.section-kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 4.7rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.site-header h1 a {
  text-decoration: none;
}

.page {
  padding: 24px 0 76px;
}

body.category-active .site-header {
  display: none;
}

body.category-active .page {
  padding-top: 28px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2,
.toolbox h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

/* Glossary */
.glossary {
  max-width: 930px;
  margin: 0 auto 34px;
}

.glossary-heading-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 7px;
}

.glossary h2 {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.glossary-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 174px;
  height: 184px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.glossary-card-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px 14px 35px;
}

.glossary-question {
  display: flex;
  flex-direction: column;
  margin-bottom: 9px;
}

.glossary-term-label {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.glossary-prompt {
  margin-top: 2px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
}

.glossary-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
}

.glossary-choice {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 88px;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #343a34;
  font-size: 0.7rem;
  line-height: 1.3;
  text-align: left;
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.glossary-choice:hover {
  border-color: var(--accent);
  background: #fff;
}

.glossary-choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 600;
}

.glossary-result {
  flex: 1;
  min-height: 0;
  padding: 9px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  background: #fff;
}

.glossary-result.is-incorrect {
  border-left-color: #9a4237;
}

.glossary-result > strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.glossary-result.is-incorrect > strong {
  color: #9a4237;
}

.glossary-result > p {
  margin: 0;
  color: #343a34;
  font-size: 0.78rem;
  line-height: 1.35;
}

.glossary-choice:focus-visible,
.term-nav-button:focus-visible,
.back-link:focus-visible,
.glossary-popout:focus-visible,
.glossary-close:focus-visible,
.glossary-drawer input:focus-visible,
.glossary-filters button:focus-visible,
.glossary-list-item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.glossary-actions {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  height: 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.term-nav-button {
  padding: 3px 0;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  background: transparent;
  cursor: pointer;
}

.term-nav-button:disabled,
.glossary-popout:disabled {
  cursor: default;
  opacity: 0.55;
}

.glossary-popout {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: 16px 18px;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--card);
  text-align: left;
  background: var(--accent);
  cursor: pointer;
  transition: background 160ms ease;
}

.glossary-popout:hover:not(:disabled) {
  background: #24472f;
}

.glossary-popout-kicker {
  margin-bottom: 4px;
  color: rgba(251, 250, 246, 0.72);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glossary-popout strong {
  max-width: 118px;
  font-size: 0.92rem;
  line-height: 1.18;
}

.glossary-popout-arrow {
  position: absolute;
  right: 16px;
  bottom: 11px;
  font-size: 1rem;
  transition: transform 160ms ease;
}

.glossary-popout:hover:not(:disabled) .glossary-popout-arrow {
  transform: translateX(4px);
}

/* Full glossary */
.glossary-drawer {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100%);
  padding: 24px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--card);
  box-shadow: none;
}

.glossary-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.glossary-drawer-header .section-kicker {
  margin-bottom: 4px;
}

.glossary-drawer-header h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.glossary-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  background: transparent;
  cursor: pointer;
}

.glossary-drawer-controls label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.glossary-drawer-controls input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

.glossary-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.glossary-filters button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
}

.glossary-filters button.is-active {
  border-color: var(--accent);
  color: var(--card);
  background: var(--accent);
}

.glossary-results-count {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.glossary-list-item {
  border-top: 1px solid var(--line);
}

.glossary-list-item:last-child {
  border-bottom: 1px solid var(--line);
}

.glossary-list-item summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  gap: 9px;
  align-items: center;
  padding: 16px 2px;
  list-style: none;
  cursor: pointer;
}

.glossary-list-item summary::-webkit-details-marker {
  display: none;
}

.glossary-list-item summary::after {
  content: '›';
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 150ms ease;
}

.glossary-list-item[open] summary::after {
  transform: rotate(90deg);
}

.glossary-list-term {
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.25;
}

.glossary-category-tag {
  padding: 3px 7px;
  border-radius: 3px;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  background: var(--accent-soft);
}

.glossary-list-item > p {
  margin: -2px 20px 17px 2px;
  color: #343a34;
  font-size: 0.86rem;
  line-height: 1.45;
}

.glossary-empty {
  margin: 24px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.glossary-scrim {
  display: none;
}

/* Category navigation */
.categories {
  max-width: 930px;
  margin: 0 auto;
}

.projects {
  width: 100%;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(280px, 38%) 1fr;
  gap: 42px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto 18px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.project-row:hover,
.project-row:focus-visible {
  border-color: var(--line);
  background: var(--card);
  outline: none;
}

.preview-wrap {
  position: relative;
  width: 100%;
  height: 142px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--card);
  box-shadow: none;
}

.preview-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-copy {
  min-width: 0;
}

.project-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin: 0 0 9px;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.project-copy h2 {
  margin: 0 0 7px;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.project-copy p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.45;
}

/* Category views */
.category-view {
  max-width: 930px;
  margin: 0 auto;
}

.category-view > .portal-back {
  margin-bottom: 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--card);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(20, 30, 20, 0.1);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.back-link:hover {
  transform: translateY(-1px);
  background: #24472f;
  box-shadow: 0 8px 18px rgba(20, 30, 20, 0.15);
}

.category-header {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 1fr);
  column-gap: 42px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.category-header .section-kicker {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.category-header h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5.5vw, 3.8rem);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.category-header > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.launch-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.launch-card:hover,
.launch-card:focus-visible {
  border-color: var(--accent);
  background: #fff;
  outline: none;
}

.launch-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.launch-copy {
  align-self: center;
}

.launch-copy small,
.launch-copy strong,
.launch-copy > span {
  display: block;
}

.launch-copy small {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.launch-copy strong {
  margin-bottom: 6px;
  font-size: 1.16rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.launch-copy > span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.launch-arrow {
  color: var(--accent);
  font-size: 1.08rem;
}

/* Toolbox */
.toolbox {
  max-width: 930px;
  margin: 34px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.tool-group {
  margin-top: 22px;
}

.tool-group > h3 {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.tool-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 11px;
  min-height: 72px;
  padding: 10px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--accent);
  background: #fff;
  outline: none;
}

.tool-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 3px;
  background: var(--accent-soft);
}

.tool-image img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.tool-copy strong,
.tool-copy small {
  display: block;
}

.tool-copy strong {
  margin-bottom: 2px;
  font-size: 0.84rem;
  line-height: 1.25;
}

.tool-copy small {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.3;
}

.toolbox-status {
  margin: 26px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 760px) {
  .site-header,
  .page {
    width: min(100% - 28px, var(--page-width));
  }

  .header-inner {
    padding-top: 22px;
  }

  .glossary-card {
    grid-template-columns: minmax(0, 1fr) 148px;
    height: 236px;
    padding: 0;
  }

  .glossary-card-main {
    padding: 12px 14px 35px;
  }

  .glossary-options {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .glossary-choice {
    min-height: 70px;
  }

  .glossary-drawer {
    top: auto;
    right: 8px;
    bottom: 0;
    left: 8px;
    width: auto;
    max-height: 84dvh;
    padding: 20px 18px 28px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    box-shadow: none;
  }

  .glossary-scrim:not([hidden]) {
    position: fixed;
    z-index: 29;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(23, 26, 23, 0.28);
    cursor: default;
  }

  body.glossary-drawer-open {
    overflow: hidden;
  }

  .launch-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 620px;
    margin-bottom: 28px;
  }

  .preview-wrap {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .project-copy p:last-child {
    max-width: none;
  }

  .category-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .category-header h2 {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
  }

  .back-link {
    margin-bottom: 16px;
  }
}

@media (max-width: 460px) {
  .page {
    padding-top: 20px;
  }

  .glossary {
    margin-bottom: 30px;
  }

  .glossary-card {
    grid-template-columns: minmax(0, 1fr) 96px;
    height: 260px;
  }

  .glossary-card-main {
    padding-right: 12px;
    padding-left: 12px;
  }

  .glossary-actions {
    right: 10px;
    left: 12px;
    gap: 8px;
  }

  .glossary-popout {
    padding: 12px;
  }

  .glossary-popout-kicker {
    display: none;
  }

  .glossary-popout strong {
    font-size: 0.75rem;
  }

  .glossary-popout-arrow {
    right: 12px;
  }

  .launch-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 16px 14px;
  }

  .tool-card {
    grid-template-columns: 40px 1fr;
  }

  .tool-image {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
