:root {
  color-scheme: light;
  --bg: #f7f4ea;
  --panel: #fffdf7;
  --soft: #fbf3df;
  --border: #d5c6a0;
  --text: #2e2618;
  --muted: #746650;
  --accent: #8a3b12;
  --shadow: 0 18px 40px rgba(54, 36, 12, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  background: linear-gradient(180deg, #fcfaf4 0%, var(--bg) 100%);
  color: var(--text);
}

main#quarto-document-content > header#title-block-header {
  display: none !important;
}

.page {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.hero,
.demo-shell,
.doc-section {
  margin: 0 0 1.25rem;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.language-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.language-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.language-switcher {
  display: inline-flex;
  border: 1px solid #dbc9a5;
  border-radius: 999px;
  background: #f8f2e4;
  padding: 0.2rem;
}

.language-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.language-button:hover,
.language-button:focus-visible {
  outline: 2px solid #d2bc8b;
  outline-offset: 2px;
}

.language-button.is-active {
  background: var(--accent);
  color: #fff8eb;
}

.hero-section,
.demo-shell,
.doc-section,
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-section,
.demo-shell,
.doc-section {
  padding: 1.2rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1,
.hero h2,
.demo-shell h2,
.doc-section h2 {
  margin-top: 0;
}

.hero h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1;
}

.intro,
.section-heading p,
.doc-section p,
.notes-list {
  line-height: 1.58;
}

.intro,
.section-heading p,
.doc-section p {
  max-width: 74rem;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.design-note {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid #e2d4b7;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbf7ee, #f3ecdc);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.hero-table-wrap {
  margin-top: 1rem;
}

.mapping-table {
  width: 100%;
  border-collapse: collapse;
  background: #fffaf0;
}

.mapping-table th,
.mapping-table td {
  padding: 0.7rem 0.8rem;
  border: 1px solid #e3d3ad;
  text-align: left;
  vertical-align: top;
}

.mapping-table th {
  color: var(--accent);
  white-space: nowrap;
}

.demo-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.demo-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  padding: 1rem;
}

.embed-card {
  background: linear-gradient(180deg, #fffdf7 0%, var(--soft) 100%);
}

.muwords-ime-embed {
  width: 100%;
  height: 920px;
  min-height: 920px;
  border: 0;
  display: block;
  background: var(--bg);
  border-radius: 8px;
}

.notes-list {
  margin-bottom: 0;
}

code {
  color: #75300f;
}

a {
  color: var(--accent);
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
  }

  .language-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .language-switcher {
    max-width: 100%;
    overflow-x: auto;
  }

  .hero-section,
  .demo-shell,
  .doc-section,
  .card {
    padding: 0.9rem;
  }

  .muwords-ime-embed {
    height: 1120px;
    min-height: 1120px;
  }
}
