:root {
  --ink: #17211c;
  --muted: #617066;
  --paper: #fbf7ed;
  --card: #fffdf7;
  --line: #dfd6c2;
  --sage: #7d9b7b;
  --sage-dark: #41614b;
  --clay: #c26b4c;
  --blue: #4b7192;
  --gold: #d9a441;
  --shadow: 0 22px 70px rgba(58, 44, 24, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 164, 65, 0.24), transparent 34rem),
    radial-gradient(circle at top right, rgba(75, 113, 146, 0.18), transparent 32rem),
    linear-gradient(135deg, #fbf7ed 0%, #f2ead9 100%);
  font-family: Charter, "Iowan Old Style", Georgia, serif;
}

button,
input,
select {
  font: inherit;
}

.hero {
  display: block;
  max-width: 1500px;
  margin: 0 auto;
  padding: 3.5rem 2rem 2rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--sage-dark);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
}

h1 {
  max-width: none;
  font-size: clamp(3rem, 7vw, 6.7rem);
  letter-spacing: -0.07em;
}

h2 {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.subtitle {
  max-width: none;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
}

.page-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

.overview-card {
  margin-bottom: 1rem;
  padding: 1.4rem;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.95), rgba(246, 239, 224, 0.92)),
    radial-gradient(circle at top left, rgba(75, 113, 146, 0.14), transparent 26rem);
  box-shadow: var(--shadow);
}

.overview-copy {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.2rem;
}

.overview-copy p {
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.98rem;
  line-height: 1.75;
}

.overview-text {
  display: grid;
  gap: 0;
  max-width: none;
}

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

.architecture-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(223, 214, 194, 0.9);
  border-radius: 24px;
  background: var(--card);
}

.architecture-card-wide {
  padding: 1rem;
}

.architecture-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.architecture-panel + .architecture-panel {
  border-left: 1px solid rgba(223, 214, 194, 0.9);
  padding-left: 1rem;
}

.architecture-text {
  padding: 0.2rem 0.2rem 0.8rem;
}

.architecture-text h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.architecture-text p:last-child {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.68;
}

.architecture-card img {
  display: block;
  width: 100%;
  height: auto;
  padding: 0.35rem 0.2rem 0.2rem;
}

.progress-card {
  margin-bottom: 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.95), rgba(246, 239, 224, 0.92)),
    radial-gradient(circle at top right, rgba(75, 113, 146, 0.12), transparent 24rem);
  box-shadow: var(--shadow);
}

.progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: end;
  padding: 0.35rem 0.2rem 1rem;
}

.progress-heading p:last-child {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.65;
  text-align: right;
}

.progress-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.progress-column-wide {
  grid-column: 1 / -1;
}

.progress-column-narrow {
  grid-column: span 1;
}

.progress-column {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 24px;
  background: var(--card);
}

.progress-column h3 {
  margin: 0 0 0.8rem;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.progress-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.75;
}

.progress-list a {
  color: var(--sage-dark);
  text-decoration: none;
}

.progress-list a:hover {
  text-decoration: underline;
}

.featured-card {
  margin-bottom: 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.94), rgba(246, 239, 224, 0.9)),
    radial-gradient(circle at top right, rgba(194, 107, 76, 0.16), transparent 25rem);
  box-shadow: var(--shadow);
}

.control-card {
  margin-bottom: 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.94), rgba(246, 239, 224, 0.9)),
    radial-gradient(circle at top left, rgba(125, 155, 123, 0.16), transparent 25rem);
  box-shadow: var(--shadow);
}

.emotion-card {
  margin-bottom: 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.94), rgba(246, 239, 224, 0.9)),
    radial-gradient(circle at top right, rgba(75, 113, 146, 0.14), transparent 24rem);
  box-shadow: var(--shadow);
}

.control-heading {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: end;
  padding: 0.35rem 0.2rem 1.1rem;
}

.control-heading p:last-child {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.65;
  text-align: right;
}

.emotion-heading {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: end;
  padding: 0.35rem 0.2rem 1.1rem;
}

.emotion-heading p:last-child {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.65;
  text-align: right;
}

.control-table-wrap {
  overflow-x: auto;
}

.emotion-table-wrap {
  overflow-x: auto;
}

.control-table {
  width: 100%;
  min-width: 1380px;
  border-collapse: separate;
  border-spacing: 0.8rem;
}

.control-table th {
  position: static;
  padding: 0 0.25rem 0.45rem;
  color: var(--sage-dark);
  background: transparent;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}

.control-table td {
  padding: 0;
  border-bottom: none;
  background: transparent;
  vertical-align: top;
}

.emotion-table {
  width: 100%;
  min-width: 1380px;
  border-collapse: separate;
  border-spacing: 0.8rem;
}

.emotion-table th {
  position: static;
  padding: 0 0.25rem 0.45rem;
  color: var(--sage-dark);
  background: transparent;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}

.emotion-table td {
  padding: 0;
  border-bottom: none;
  background: transparent;
  vertical-align: top;
}

.control-default-col {
  width: 33%;
}

.control-variable-col {
  width: 16%;
}

.control-audio-col {
  width: 12.75%;
}

.emotion-category-col {
  width: 16%;
}

.emotion-cell {
  width: 28%;
}

.control-default,
.control-variable-card,
.control-audio-card {
  height: 100%;
  min-height: 170px;
  padding: 1rem;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 22px;
  background: var(--card);
}

.emotion-category-card,
.emotion-entry {
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 22px;
  background: var(--card);
}

.emotion-category-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  height: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.emotion-stack {
  display: grid;
  gap: 0.8rem;
}

.emotion-entry {
  display: grid;
  gap: 0.65rem;
  min-height: 170px;
  padding: 0.95rem 1rem;
}

.emotion-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.emotion-eval {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
}

.emotion-text-entry p {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.96rem;
  line-height: 1.62;
}

.emotion-summary-entry pre {
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.control-default {
  display: grid;
  gap: 0.8rem;
}

.control-default .case-id,
.control-default .case-meta {
  margin: 0;
}

.control-cot-row pre {
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.control-variable-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 100%;
}

.control-variable-en {
  font-size: 1.03rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.control-variable-note {
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.93rem;
  line-height: 1.62;
}

.control-audio-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
}

.control-setting {
  color: var(--sage-dark);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.35;
}

.featured-heading {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: end;
  padding: 0.35rem 0.2rem 1.1rem;
}

.featured-heading .eyebrow {
  margin-bottom: 0.45rem;
}

.featured-heading p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.65;
  text-align: right;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.featured-demo {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 1.15rem;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 24px;
  background: var(--card);
}

.featured-demo::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(var(--sage), var(--gold), var(--clay));
}

.featured-number {
  color: rgba(65, 97, 75, 0.28);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.85;
}

.featured-demo h3 {
  margin: -0.35rem 0 1rem;
  padding-left: 0.15rem;
  min-height: 2.8em;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.featured-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  flex: 1;
}

.featured-step {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem;
  border-radius: 16px;
  background: #f6efe0;
}

.featured-step span,
.text-label {
  color: var(--sage-dark);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-text-block {
  padding: 0.85rem;
  border: 1px solid rgba(223, 214, 194, 0.85);
  border-radius: 16px;
  background: rgba(251, 247, 237, 0.78);
}

.featured-text-block p {
  max-height: 185px;
  overflow: auto;
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.featured-text-block.cot-full p {
  max-height: none;
  overflow: visible;
}

.featured-flow > *:nth-child(2) {
  min-height: 120px;
}

.featured-flow > *:nth-child(4) {
  min-height: 176px;
}

.featured-flow > *:nth-child(5) {
  min-height: 280px;
}

.empty-featured {
  grid-column: 1 / -1;
  padding: 2rem;
  color: var(--clay);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 850;
  text-align: center;
}

.table-card {
  overflow: hidden;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 30px;
  background: rgba(255, 253, 247, 0.86);
  box-shadow: var(--shadow);
}

.table-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--line);
}

.table-title p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.92rem;
}

.hint {
  max-width: 420px;
  text-align: right;
}

.table-wrap {
  overflow: auto;
  overflow-y: visible;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1240px;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1rem;
  color: #fdf9ef;
  background: var(--sage-dark);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}

th:nth-child(1),
th:nth-child(2) {
  text-align: center;
}

td {
  vertical-align: top;
  padding: 1.1rem;
  border-bottom: 1px solid var(--line);
}

tr:nth-child(even) td {
  background: rgba(247, 241, 226, 0.52);
}

.history-col {
  width: 240px;
  min-width: 240px;
}

.target-col {
  width: 240px;
  min-width: 240px;
}

.target-col p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info-item {
  display: flex;
  flex-direction: column;
  width: 220px;
  height: 188px;
  min-height: 188px;
}

.models-col {
  min-width: 980px;
}

.case-id {
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 850;
}

.case-meta {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: var(--sage-dark);
  background: rgba(125, 155, 123, 0.17);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

audio {
  width: 100%;
  max-width: 320px;
  height: 38px;
}

.models-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.8rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.model-item {
  flex: 0 0 220px;
  padding: 0.8rem;
  border: 1px solid rgba(223, 214, 194, 0.92);
  border-radius: 20px;
  background: var(--card);
}

.model-item.gt {
  border-color: rgba(217, 164, 65, 0.58);
  background: rgba(255, 248, 229, 0.9);
}

.model-item.final {
  border-color: rgba(125, 155, 123, 0.55);
}

.model-item.three {
  border-color: rgba(75, 113, 146, 0.46);
}

.model-item.two {
  border-color: rgba(194, 107, 76, 0.42);
}

.model-head {
  display: block;
  margin-bottom: 0.7rem;
}

.model-name {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 850;
  font-size: 0.92rem;
}

.model-key {
  margin-top: 0.15rem;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.72rem;
}

.family-pill {
  display: inline-block;
  margin-top: 0.45rem;
  flex: 0 0 auto;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  color: var(--ink);
  background: #f1e4c8;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.output-row {
  display: block;
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.output-row span {
  display: block;
  margin-bottom: 0.45rem;
}

.output-row-single audio {
  max-width: none;
}

.text-row {
  flex: 1;
  color: var(--ink);
}

.text-row p {
  flex: 1;
  overflow: visible;
}

.target-col .info-item {
  height: auto;
  min-height: 188px;
}

.missing,
.empty-state {
  color: var(--clay);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 800;
}

.empty-state {
  padding: 3rem;
  text-align: center;
}

@media (max-width: 900px) {
  .hero {
    padding: 2rem 1rem 1rem;
  }

  .page-shell {
    padding: 0 1rem 2rem;
  }

  .featured-heading,
  .featured-grid {
    display: block;
  }

  .control-heading {
    display: block;
  }

  .overview-copy,
  .architecture-grid,
  .progress-grid {
    grid-template-columns: 1fr;
  }

  .featured-heading p:last-child,
  .control-heading p:last-child,
  .progress-heading p:last-child {
    margin-top: 0.75rem;
    text-align: left;
  }

  .architecture-card + .architecture-card {
    margin-top: 1rem;
  }

  .architecture-card-wide {
    padding: 0.9rem;
  }

  .architecture-panel + .architecture-panel {
    border-left: none;
    border-top: 1px solid rgba(223, 214, 194, 0.9);
    padding-left: 0;
    padding-top: 1rem;
  }

  .featured-demo + .featured-demo {
    margin-top: 1rem;
  }

  .featured-step {
    grid-template-columns: 1fr;
  }

  .table-title {
    display: block;
  }

  .hint {
    text-align: left;
  }
}
