:root {
  --ink: #11110f;
  --muted: #5e5b53;
  --paper: #f4f1e8;
  --paper-soft: #fbfaf5;
  --card: #e7ded0;
  --line: #cec4b5;
  --black: #11110f;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(17, 17, 15, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: 76px;
  padding: 0 clamp(24px, 4vw, 80px);
  border-bottom: 1px solid rgba(17, 17, 15, 0.08);
  background: rgba(244, 241, 232, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: baseline;
  text-decoration: none;
}

.brand strong {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 1rem;
}

nav {
  display: flex;
  gap: clamp(18px, 3vw, 42px);
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.hero {
  display: grid;
  min-height: 420px;
  place-items: center;
  padding: clamp(70px, 10vw, 150px) clamp(24px, 4vw, 80px);
  background: var(--black);
  color: var(--paper);
}

.hero-content {
  display: grid;
  justify-items: center;
  width: min(100%, 1180px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #cfc6b9;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  line-height: 0.96;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 940px;
  font-size: clamp(4rem, 10vw, 9.8rem);
  font-weight: 900;
}

.hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 28px 0 0;
  color: #d9d1c5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.4vw, 2.15rem);
  line-height: 1.22;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 36px;
}

.primary-button,
.secondary-button,
.tool-card a,
button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: var(--paper);
  color: var(--black);
}

.secondary-button {
  border: 1px solid rgba(244, 241, 232, 0.3);
  background: transparent;
  color: var(--paper);
}

.primary-button.dark {
  background: var(--black);
  color: var(--white);
}

.secondary-button.light {
  border-color: var(--line);
  color: var(--black);
}

.primary-button:hover,
.secondary-button:hover,
.tool-card a:hover,
button:hover {
  transform: translateY(-1px);
}

.section {
  padding: clamp(72px, 10vw, 150px) clamp(24px, 4vw, 80px);
}

.band {
  background: var(--paper);
}

.section-heading,
.tool-controls,
.tool-grid {
  width: min(100%, 1480px);
  margin-inline: auto;
}

.codex-hero h1 {
  max-width: 1120px;
}

.codex-intro {
  background: var(--paper-soft);
}

.codex-split,
.workshop-grid {
  width: min(100%, 1480px);
  margin-inline: auto;
}

.codex-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 36px);
}

.codex-split.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.codex-panel,
.workshop-card {
  display: grid;
  align-content: start;
  padding: clamp(24px, 3vw, 38px);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.codex-panel h3,
.workshop-card h3,
.timeline h3 {
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.codex-panel p,
.workshop-card p,
.timeline p {
  margin: 18px 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 1.45vw, 1.35rem);
  line-height: 1.28;
}

.workshop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 36px);
}

.workshop-card {
  min-height: 360px;
}

.timeline {
  width: min(100%, 1180px);
  margin-inline: auto;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.timeline article {
  display: grid;
  grid-template-columns: 90px minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(18px, 3vw, 44px);
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.timeline span {
  color: var(--muted);
  font-weight: 850;
  letter-spacing: 0.08em;
}

.timeline p {
  margin: 0;
}

.codex-cta {
  background: var(--paper-soft);
}

.hero-actions.left {
  justify-content: flex-start;
}

.sources {
  padding-top: clamp(46px, 6vw, 84px);
  padding-bottom: clamp(46px, 6vw, 84px);
}

.source-list {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.source-list a {
  color: var(--ink);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.section-heading {
  margin-bottom: clamp(28px, 4vw, 54px);
}

.section-heading h2 {
  max-width: 880px;
  font-size: clamp(2.35rem, 5vw, 5rem);
  font-weight: 900;
}

.section-intro {
  max-width: 850px;
  margin: 22px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  line-height: 1.3;
}

.tool-controls {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(26px, 4vw, 50px);
}

.tool-controls input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
}

.category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
}

.category-tab[aria-pressed="true"] {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 36px);
}

.tool-card {
  display: grid;
  min-height: 420px;
  padding: clamp(24px, 3vw, 38px);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.tool-card h3 {
  margin: 0;
  font-size: clamp(1.6rem, 2.5vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.tool-card p {
  margin: 18px 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  line-height: 1.26;
}

.tool-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 22px;
  align-self: end;
  margin: 48px 0 0;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tool-details dt,
.tool-details dd {
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.tool-details dt {
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-details dd {
  justify-self: end;
  color: var(--ink);
  font-weight: 650;
}

.tool-card a {
  justify-self: start;
  margin-top: 28px;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: var(--paper-soft);
  font-weight: 750;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(24px, 4vw, 80px);
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
}

.site-footer a {
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
    align-items: start;
    padding-block: 18px;
  }

  nav {
    justify-content: flex-start;
  }

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

  .workshop-grid,
  .codex-split,
  .codex-split.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline article {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .timeline p {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 0;
  }

  .hero h1 {
    font-size: clamp(3rem, 17vw, 4.8rem);
  }

  .hero-actions,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

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

  .workshop-grid,
  .codex-split,
  .codex-split.three,
  .timeline article {
    grid-template-columns: 1fr;
  }

  .timeline p {
    grid-column: auto;
  }

  .tool-card {
    min-height: 0;
  }

  .site-footer {
    flex-direction: column;
  }
}
