:root {
  color-scheme: light;
  --ink: #16201d;
  --muted: #58615e;
  --paper: #f8f4ec;
  --panel: #fffdf8;
  --line: #d7ccba;
  --accent: #12625d;
  --accent-dark: #0d4742;
  --gold: #aa6a2a;
  --violet: #4c426c;
  --shadow: 0 20px 60px rgba(22, 32, 29, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #d9913d;
  outline-offset: 4px;
}

.hero {
  min-height: 88vh;
  color: #fffdf8;
  background:
    linear-gradient(90deg, rgba(9, 22, 19, 0.92), rgba(9, 22, 19, 0.72) 38%, rgba(9, 22, 19, 0.18)),
    url("assets/manuscript-desk.png") center right / cover;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem clamp(1rem, 3vw, 3rem);
}

.brand,
.navlinks a {
  color: #fffdf8;
  text-decoration: none;
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
}

.navlinks {
  display: flex;
  gap: clamp(0.8rem, 2vw, 1.5rem);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.navlinks a {
  color: rgba(255, 253, 248, 0.86);
}

.hero-copy {
  align-self: center;
  width: min(760px, 100%);
  max-width: 760px;
  padding: clamp(2rem, 5vw, 5rem);
}

.eyebrow,
.theme-label {
  margin: 0 0 0.7rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0c68f;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  width: min(690px, 100%);
  max-width: 690px;
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 610px;
  margin: 1.3rem 0 1.8rem;
  color: rgba(255, 253, 248, 0.88);
  font-size: 1.13rem;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}

.primary-link {
  background: #fffdf8;
  color: #12201d;
}

.secondary-link {
  background: var(--accent);
  color: #fffdf8;
}

main {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(1rem, 3vw, 3rem);
}

.intro,
.method,
.corpus-lab {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.intro,
.method {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.4rem, 5vw, 4rem);
  align-items: start;
}

.intro {
  padding-top: 1.5rem;
}

.intro p:last-child,
.method p {
  margin-top: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.toolbar {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
}

.corpus-lab {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.corpus-head,
.pair-meta,
.pair-columns {
  display: grid;
  gap: 1rem;
}

.corpus-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.corpus-controls {
  display: grid;
  gap: 0.4rem;
}

.corpus-controls label {
  color: var(--muted);
  font-weight: 750;
}

.corpus-controls select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.pair-focus {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 244, 236, 0.65);
}

.pair-meta {
  grid-template-columns: repeat(3, max-content);
  gap: 0.5rem;
}

.pair-meta span,
.corpus-card span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  border-radius: 999px;
  background: rgba(18, 98, 93, 0.12);
  color: var(--accent-dark);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.pair-columns {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.current-english {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.15rem);
  font-weight: 850;
  line-height: 1.15;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.path-field {
  min-width: 0;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.path-field legend {
  padding: 0 0.35rem;
  font-weight: 850;
}

.path-field legend span {
  font-family:
    "Noto Serif", "New Athena Unicode", "Times New Roman", Georgia, serif;
}

.path-field small {
  color: var(--muted);
}

.path-choice {
  display: flex;
  gap: 0.45rem;
  align-items: start;
  margin-top: 0.4rem;
  color: var(--muted);
}

.path-choice input {
  margin-top: 0.3rem;
}

.translation-preview {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
}

.path-summary {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.selected-output {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.corpus-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.corpus-card {
  min-height: 140px;
  display: grid;
  gap: 0.55rem;
  align-content: start;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  padding: 0.8rem;
  font: inherit;
  cursor: pointer;
}

.corpus-card strong {
  line-height: 1.25;
}

.corpus-card small {
  color: var(--muted);
}

.filter-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.filter-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffdf8;
}

.examples {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.example {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.example[hidden] {
  display: none;
}

.example-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.english-first {
  border-left: 4px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1rem;
}

.english-first p {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.18;
  font-weight: 800;
}

.source-grid,
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.method-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.source-grid > section,
.method-grid > section,
.tilt,
.renderings {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 244, 236, 0.62);
}

blockquote {
  margin: 0;
  color: #1f2b28;
  font-family:
    "Noto Serif", "New Athena Unicode", "Times New Roman", Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.source-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.evidence-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.evidence-list li + li {
  margin-top: 0.55rem;
}

.evidence-list strong,
.tilt span {
  color: var(--violet);
  font-family:
    "Noto Serif", "New Athena Unicode", "Times New Roman", Georgia, serif;
}

.renderings {
  margin: 0;
  padding-left: 2.4rem;
}

.renderings li + li {
  margin-top: 0.55rem;
}

.tilt p {
  margin: 0;
  color: var(--muted);
}

.method {
  padding: clamp(1rem, 3vw, 2rem);
  border-top: 2px solid var(--line);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem clamp(1rem, 3vw, 3rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .hero {
    min-height: 82vh;
    background:
      linear-gradient(180deg, rgba(9, 22, 19, 0.94), rgba(9, 22, 19, 0.74) 58%, rgba(9, 22, 19, 0.52)),
      url("assets/manuscript-desk.png") center / cover;
  }

  .topbar,
  .example-heading,
  .intro,
  .method,
  .source-grid,
  .method-grid,
  .corpus-head,
  .pair-columns,
  .path-grid,
  .corpus-list {
    grid-template-columns: 1fr;
  }

  .topbar,
  .example-heading {
    display: grid;
  }

  .navlinks {
    justify-content: start;
  }

  .hero-copy {
    width: min(100%, 360px);
    max-width: calc(100vw - 1rem);
    padding: 2rem 1rem;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(1.95rem, 8vw, 2.7rem);
    line-height: 1.04;
  }

  h2 {
    font-size: clamp(1.55rem, 8vw, 2.35rem);
  }

  .hero-copy p:not(.eyebrow) {
    max-width: 100%;
    font-size: 1rem;
  }

  .pair-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .toolbar,
  .filter-button {
    width: 100%;
  }

  .filter-button {
    justify-content: center;
  }
}

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