:root {
  color-scheme: light;
  --bg: #f6f1ea;
  --ink: #0b1b2b;
  --muted: #4a5a6b;
  --accent: #0f766e;
  --accent-2: #f2b95a;
  --accent-3: #e76f51;
  --surface: #ffffff;
  --surface-2: #f0ece4;
  --stroke: #d7cfc4;
  --shadow: 0 20px 60px rgba(15, 26, 32, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-sans: "Sora", "Helvetica", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: radial-gradient(circle at 15% 20%, #fff7e1 0%, transparent 45%),
    radial-gradient(circle at 80% 10%, #e0f2f1 0%, transparent 45%),
    radial-gradient(circle at 70% 80%, #ffe9d6 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.4;
  z-index: -1;
}

.orb-a {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.5), transparent 70%);
  top: -120px;
  right: -60px;
}

.orb-b {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(231, 111, 81, 0.4), transparent 70%);
  bottom: -160px;
  left: -120px;
}

.orb-c {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(242, 185, 90, 0.5), transparent 70%);
  top: 45%;
  right: 15%;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  position: relative;
}

.hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.7));
  border: 1px solid var(--stroke);
  border-radius: 32px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.pill.light {
  background: rgba(242, 185, 90, 0.2);
  color: #8a5b0a;
}

.pill.small {
  font-size: 0.72rem;
  padding: 4px 10px;
}

.nav-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ghost {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 12px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.authors {
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 20px;
}

.lead {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 22px;
  max-width: 520px;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

button {
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(11, 27, 43, 0.12);
}

.primary {
  background: var(--ink);
  color: #fff;
}

.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--stroke);
}

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

.highlight-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--stroke);
  box-shadow: 0 10px 30px rgba(11, 27, 43, 0.05);
}

.highlight-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.highlight-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.hero-visual {
  display: grid;
  gap: 18px;
  align-content: start;
}

.metric-card {
  background: linear-gradient(135deg, #0f1b2d 0%, #14324a 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(242, 185, 90, 0.25);
  right: -40px;
  top: -40px;
}

.metric-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.8;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 3rem;
  margin: 12px 0 6px;
}

.metric-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  margin: 14px 0 10px;
}

.metric-bar span {
  display: block;
  height: 100%;
  width: 72%;
  background: linear-gradient(90deg, #f2b95a, #e76f51);
  border-radius: 999px;
}

.metric-note {
  font-size: 0.9rem;
  opacity: 0.8;
}

.stacked {
  display: grid;
  gap: 12px;
}

.stack-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  border: 1px solid var(--stroke);
  box-shadow: 0 8px 22px rgba(11, 27, 43, 0.05);
}

.stack-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.section {
  margin-top: 56px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
}

.section-sub {
  color: var(--muted);
  max-width: 520px;
}

.legend {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(242, 185, 90, 0.12));
}

.table-block {
  margin-top: 24px;
}

.table-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.table-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.demo-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0 14px;
}

.demo-table thead th {
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  position: sticky;
  top: 0;
  background: #f7f1e9;
  border-bottom: 1px solid var(--stroke);
  z-index: 1;
}

.demo-table th:first-child {
  width: 22%;
}

.demo-table th:not(:first-child),
.demo-table td:not(:first-child) {
  min-width: 180px;
}

.demo-table th:first-child,
.demo-table td:first-child {
  min-width: 220px;
}

.demo-table td {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 14px;
  vertical-align: top;
  box-shadow: 0 10px 24px rgba(11, 27, 43, 0.04);
}

.sample-context-row td {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.context-grid .meta-block {
  height: 100%;
}

.context-grid .meta-block:nth-child(odd) {
  background: #fffdf7;
}

.sample-cell {
  vertical-align: top;
}

.sample-cell .meta-block + .meta-block {
  margin-top: 12px;
}

.meta-block {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid rgba(215, 207, 196, 0.7);
}

.meta-label {
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.target-text {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.6;
}

.personas {
  display: grid;
  gap: 8px;
}

.persona-card {
  padding: 8px 10px;
  border-radius: 10px;
  background: #fffaf3;
  border: 1px solid rgba(242, 185, 90, 0.4);
}

.persona-card strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  background: #f7f7f7;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid #eee;
  display: grid;
  gap: 6px;
}

.history-item span {
  font-size: 0.88rem;
  color: var(--ink);
}

.history-cell .meta-block {
  background: var(--surface);
}

.method-cell > * + * {
  margin-top: 8px;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  width: fit-content;
}

.method-badge.strong {
  background: rgba(231, 111, 81, 0.15);
  color: #b3432f;
}

.audio-player {
  width: 100%;
}

.empty-note {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.legend.card {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(242, 185, 90, 0.12));
  border: 1px solid rgba(215, 207, 196, 0.6);
}

.card h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.card p {
  color: var(--muted);
  line-height: 1.65;
}

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

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

.formula {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 16px 0;
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  color: #0d2c3b;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.flow {
  display: grid;
  grid-template-columns: repeat(7, auto);
  gap: 6px;
  align-items: center;
  justify-content: start;
  margin-top: 20px;
  font-weight: 600;
}

.arrow {
  color: var(--accent-3);
}

.callout {
  margin-top: 18px;
  background: rgba(242, 185, 90, 0.2);
  border: 1px solid rgba(242, 185, 90, 0.4);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  color: #6b4a08;
}

.results-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.bars {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.bar span {
  font-size: 0.9rem;
  color: var(--muted);
}

.bar-track {
  background: #e9e4db;
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
  margin-top: 6px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #9dc5b5, #0f766e);
}

.bar-fill.strong {
  background: linear-gradient(90deg, #f2b95a, #e76f51);
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
}

.rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 10px;
}

.rating {
  display: flex;
  gap: 4px;
}

.rating i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.rating i.off {
  background: #e0d6c9;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.demo-header-banner {
  background-color: #e3f2fd;
  border: 2px solid #2196f3;
  color: #0d47a1;
  padding: 12px;
  margin-bottom: 20px;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
}

.demo-gt-reveal {
  background-color: #ffebee;
  border: 2px solid #f44336;
  color: #b71c1c;
  padding: 15px;
  margin-top: 20px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 10px;
}

.roleplay-info h3 {
  margin-top: 16px;
  margin-bottom: 8px;
}

.roleplay-info h3:first-of-type {
  margin-top: 0;
}

.roleplay-pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 10px 14px;
  background: #faf7f1;
  border-left: 3px solid #4caf50;
  line-height: 1.6;
  font-family: "Courier New", monospace;
  font-size: 0.92rem;
  color: #333;
  border-radius: 6px;
}

.roleplay-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roleplay-history-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
}

.roleplay-history-utt {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  color: #333;
}

.roleplay-tip {
  margin: 0 0 12px 0;
  padding: 12px 14px;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 8px;
  color: #7a5b00;
  line-height: 1.5;
}

.audio-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 14px;
}

.play {
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent-3);
}

.slider-value {
  min-width: 42px;
  text-align: right;
  font-weight: 700;
  color: var(--ink);
}

.cta-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px 30px;
  background: linear-gradient(135deg, #0f766e, #144d44);
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.cta-card h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 8px;
}

.footer {
  text-align: center;
  padding: 32px 16px 48px;
  color: var(--muted);
}

.footer-note {
  font-size: 0.85rem;
  margin-top: 8px;
}

.reveal {
  opacity: 1;
  transform: none;
}

.reveal.reveal-ready {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.reveal-ready.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .hero-grid,
  .grid-2,
  .grid-3,
  .results-grid,
  .demo-grid {
    grid-template-columns: 1fr;
  }

  .hero-highlights {
    grid-template-columns: 1fr;
  }

  .demo-table {
    min-width: 1100px;
  }

  .flow {
    grid-template-columns: repeat(4, auto);
    row-gap: 10px;
  }

  .cta-card {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 32px 16px 64px;
  }

  .hero {
    padding: 24px;
  }

  .rating-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .roleplay-history-row {
    grid-template-columns: 1fr;
  }

  .demo-table {
    min-width: 960px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal.reveal-ready {
    transition: none;
  }

  button:hover {
    transform: none;
    box-shadow: none;
  }
}
