:root {
  --ink: #183247;
  --muted: #5c7286;
  --paper: #f5f7f9;
  --panel: #ffffff;
  --line: #d6e0e8;
  --accent: #4c6ef5;
  --accent-soft: rgba(76, 110, 245, 0.1);
  --japanese: #7b61ff;
  --math: #e9a03a;
  --english: #2a9d8f;
  --shadow: 0 12px 30px rgba(24, 50, 71, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(76, 110, 245, 0.08), transparent 30%),
    radial-gradient(circle at top right, rgba(42, 157, 143, 0.1), transparent 24%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ol,
pre {
  margin: 0;
}

.app-shell {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero,
.setup-grid,
.scenario-grid,
.origin-grid,
.benchmark-grid {
  display: grid;
  gap: 18px;
}

.hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  align-items: center;
  padding: 10px 0 18px;
}

.hero-copy-column,
.panel-section,
.origin-card,
.details-panel {
  background: var(--panel);
  border: 1px solid rgba(24, 50, 71, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy-column,
.panel-section,
.origin-card {
  padding: 20px;
}

.hero-copy-column {
  display: grid;
  gap: 14px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.02;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.2;
}

.hero-copy,
.hero-origin-line,
.hero-sample-note,
.section-copy,
.details-note,
.chart-alt,
.origin-card p,
.details-list,
.benchmark-note {
  color: var(--muted);
  line-height: 1.6;
}

.hero-action-row,
.hero-language-row,
.language-switch,
.plan-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-sample-note-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.hero-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.primary-button,
.ghost-button,
.lang-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 15px;
  font-weight: 700;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ghost-button,
.lang-button {
  background: #fff;
  color: var(--ink);
}

.ghost-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
}

.hero-source-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.lang-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.badge,
.summary-chip,
.scenario-pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(24, 50, 71, 0.04);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.hero-art-column {
  display: grid;
}

.hero-art {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(24, 50, 71, 0.1);
  background: #fff;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field span,
.chip-label,
.card-label,
.records-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

input[type="date"],
input[type="number"],
input[type="text"],
input[type="file"],
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.plan-summary {
  margin-top: 16px;
}

.summary-chip strong {
  margin-left: 8px;
  color: var(--ink);
  font-size: 0.98rem;
}

.live-message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.baseline-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.benchmark-topbar {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.benchmark-note-group {
  display: grid;
  gap: 6px;
}

.benchmark-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.benchmark-card,
.scenario-card {
  display: grid;
  gap: 14px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 249, 0.98));
}

.benchmark-card header,
.scenario-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.benchmark-title,
.scenario-title {
  font-size: 1.02rem;
  font-weight: 800;
}

.benchmark-subtitle,
.scenario-copy {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.55;
}

.benchmark-target {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  align-items: center;
}

.target-label {
  display: grid;
  gap: 2px;
}

.target-code {
  font-weight: 800;
}

.status-projected {
  background: rgba(42, 157, 143, 0.14);
  color: #1f7167;
}

.status-close {
  background: rgba(233, 160, 58, 0.16);
  color: #8d5d0f;
}

.status-not {
  background: rgba(123, 97, 255, 0.12);
  color: #5940cb;
}

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

.scenario-results {
  display: grid;
  gap: 10px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.result-row strong {
  font-size: 1rem;
  line-height: 1.3;
  text-align: right;
}

.progress-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 50, 71, 0.08);
}

.progress-meter__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2a9d8f);
}

.japanese-tone {
  color: var(--japanese);
}

.math-tone {
  color: var(--math);
}

.english-tone {
  color: var(--english);
}

.chart-wrap {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 249, 0.98));
  overflow: hidden;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

.origin-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
}

.origin-story-stack,
.body-stack {
  display: grid;
  gap: 12px;
}

.origin-card {
  display: grid;
  gap: 14px;
}

.card-title {
  font-size: 1.02rem;
  line-height: 1.35;
}

.origin-disclaimer {
  font-weight: 700;
}

.origin-emphasis {
  font-weight: 800;
  color: var(--ink);
}

.details-stack {
  display: grid;
  gap: 12px;
}

.source-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.details-panel {
  overflow: hidden;
}

.details-panel summary {
  padding: 16px 18px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.details-panel summary::-webkit-details-marker {
  display: none;
}

.details-content,
.details-list {
  padding: 0 18px 18px;
}

.details-list {
  margin: 0;
  padding-left: 36px;
}

.details-list--numbered {
  display: grid;
  gap: 10px;
  padding-left: 24px;
}

.prompt-grid {
  display: grid;
  gap: 14px;
}

.prompt-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.prompt-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.prompt-copy-button {
  white-space: nowrap;
}

.prompt-block {
  overflow-x: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 50, 71, 0.04);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-status {
  min-height: 20px;
  margin-top: 10px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
}

.records-table th,
.records-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.site-footer {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto 40px;
  padding: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.site-footer__meta {
  color: var(--muted);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

@media (max-width: 980px) {
  .hero,
  .setup-grid,
  .benchmark-topbar,
  .benchmark-grid,
  .scenario-grid,
  .origin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100%, calc(100% - 16px));
    padding-top: 16px;
  }

  .section-heading,
  .result-row,
  .benchmark-target,
  .prompt-card__header {
    flex-direction: column;
    align-items: start;
  }

  .hero-copy-column,
  .panel-section,
  .origin-card {
    padding: 16px;
  }

  .site-footer {
    width: min(100%, calc(100% - 16px));
    margin-bottom: 28px;
  }
}

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