:root {
  color-scheme: light;
  --ink: #18201f;
  --muted: #5d6964;
  --paper: #f7f4ee;
  --line: #d9d2c4;
  --accent: #0f766e;
  --accent-strong: #0b4f49;
  --warm: #b45309;
  --rose: #9f1239;
  --white: #ffffff;
  --shadow: 0 22px 60px rgba(26, 31, 29, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(180, 83, 9, 0.10), transparent 32%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
  border-bottom: 1px solid rgba(24, 32, 31, 0.10);
}

.nav {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 760;
  text-decoration: none;
}

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

.hero {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 54px 0 34px;
}

.hero-copy {
  max-width: 760px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 860px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.lead {
  margin: 24px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.62;
}

.workbench {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto 48px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.input-panel,
.result-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  min-height: 58px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0;
  font-size: 0.95rem;
}

.counter,
.status {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 360px;
  padding: 18px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 1.02rem/1.64 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.actions {
  padding: 14px 18px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-weight: 760;
  cursor: pointer;
}

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

#analyze-button {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

#analyze-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.summary {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.summary.visible {
  display: grid;
}

.metric {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.76);
}

.metric strong {
  display: block;
  font-size: 1.45rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.results {
  min-height: 398px;
  max-height: 640px;
  overflow: auto;
  padding: 18px;
}

.results.empty {
  color: var(--muted);
}

.verse {
  padding: 14px 0 16px;
  border-bottom: 1px solid rgba(24, 32, 31, 0.12);
}

.verse:first-child {
  padding-top: 0;
}

.verse-head {
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 9px;
  align-items: baseline;
}

.mot {
  display: inline-flex;
  gap: 3px;
  align-items: baseline;
}

.syllabe {
  position: relative;
  padding: 2px 3px;
  border-radius: 5px;
  background: rgba(15, 118, 110, 0.08);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
}

.syllabe.tonique {
  background: rgba(15, 118, 110, 0.18);
  color: var(--accent-strong);
  font-weight: 760;
}

.syllabe.feminine,
.syllabe.silent {
  color: var(--rose);
}

.syllabe.rese {
  box-shadow: inset 0 -2px 0 var(--warm);
}

.liaison {
  margin-right: 2px;
  color: var(--warm);
  font: 700 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  vertical-align: super;
}

.error {
  color: var(--rose);
  font-weight: 740;
}

.site-footer {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 0 0 36px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .hero {
    padding-top: 36px;
  }

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

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