/* みやび古文 — アプリと同じ和色パレット */
:root {
  color-scheme: light dark;
  --paper: #f6f1e7;
  --surface: #fffdf8;
  --surface-muted: #eee7d9;
  --ink: #1f1b16;
  --ink-secondary: #6a6256;
  --hairline: #e0d7c6;
  --shu: #c8442f;
  --shu-ink: #a93624;
  --kin: #a9812f;
  --matcha: #5b7c38;
  --ai: #2f4b7c;
  --asagi: #2a7a78;
  --screen: #173b3a;
  --on-accent: #fffdf8;
  --shadow: 0 24px 60px rgba(60, 44, 20, 0.14);
  --mincho: "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --gothic: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15130f;
    --surface: #1f1c17;
    --surface-muted: #2a2620;
    --ink: #f2ecdf;
    --ink-secondary: #aba293;
    --hairline: #3a342b;
    --shu: #e86a52;
    --shu-ink: #f08a74;
    --kin: #d9b86c;
    --matcha: #97bc6c;
    --ai: #86a3d8;
    --asagi: #6cc3bd;
    --screen: #0f2726;
    --on-accent: #15130f;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--gothic);
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  line-break: strict;
  overflow-wrap: anywhere;
}

a {
  color: var(--shu-ink);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

/* ヘッダー */
.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--mincho);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 18px;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-links a {
  color: var(--ink-secondary);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--shu-ink);
}

/* レイアウト */
.hero,
.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 64px 22px;
}

.page {
  max-width: 820px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 40px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--shu-ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
}

h1,
h2,
h3 {
  font-family: var(--mincho);
  color: var(--ink);
  letter-spacing: 0.02em;
}

h1 {
  margin: 14px 0 18px;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.25;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  line-height: 1.4;
}

h3 {
  margin: 20px 0 6px;
  font-size: 1.05rem;
}

p,
li {
  color: var(--ink-secondary);
  line-height: 1.85;
}

ul {
  padding-left: 1.3em;
}

strong {
  color: var(--ink);
}

.lead {
  max-width: 640px;
  font-size: 1.08rem;
}

.lead.en {
  font-size: 0.98rem;
}

.actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  font-weight: 700;
  text-decoration: none;
}

.button.primary {
  background: var(--shu);
  border-color: var(--shu);
  color: var(--on-accent);
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
}

/* アプリのプレビュー */
.phone-panel {
  border-radius: 34px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}

.screen {
  min-height: 460px;
  border-radius: 26px;
  padding: 22px;
  background:
    radial-gradient(circle at 85% 8%, rgba(217, 184, 108, 0.28), transparent 38%),
    var(--screen);
  color: #fffdf8;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.screen .label {
  color: #d9b86c;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.flashcard {
  position: relative;
  border-radius: 20px;
  padding: 22px 20px;
  background: #fffdf8;
  color: #1f1b16;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.flashcard .word {
  display: block;
  margin: 4px 0 2px;
  font-family: var(--mincho);
  font-size: 2rem;
  font-weight: 700;
}

.flashcard .reading {
  color: #6a6256;
  font-size: 0.85rem;
}

.flashcard ol {
  margin: 14px 0 0;
  padding-left: 1.3em;
}

.flashcard li {
  color: #1f1b16;
  line-height: 1.6;
}

.flashcard .example {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px dashed #e0d7c6;
  color: #45403a;
  font-family: var(--mincho);
  font-size: 0.9rem;
  line-height: 1.6;
}

.flashcard .example mark {
  background: none;
  color: #c8442f;
  font-weight: 700;
}

.hanko {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid #c8442f;
  border-radius: 8px;
  color: #c8442f;
  font-family: var(--mincho);
  font-size: 1.05rem;
  font-weight: 700;
  transform: rotate(-8deg);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: auto;
}

.metric {
  border: 1px solid rgba(255, 253, 248, 0.18);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.metric strong {
  display: block;
  color: #fffdf8;
  font-size: 1.35rem;
}

.metric span {
  color: rgba(255, 253, 248, 0.72);
  font-size: 0.76rem;
}

/* 特長 */
.section-title {
  margin-top: 64px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.feature,
.notice,
.doc-section {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 20px 22px;
}

.feature .count {
  display: block;
  color: var(--shu-ink);
  font-family: var(--mincho);
  font-size: 1.6rem;
  font-weight: 700;
}

.feature strong {
  display: block;
  margin: 2px 0 6px;
  font-family: var(--mincho);
  font-size: 1.08rem;
}

.feature p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.75;
}

.feature.accent-kin .count { color: var(--kin); }
.feature.accent-matcha .count { color: var(--matcha); }
.feature.accent-ai .count { color: var(--ai); }
.feature.accent-asagi .count { color: var(--asagi); }

.notice {
  margin-top: 18px;
  border-left: 5px solid var(--kin);
}

.notice.warning {
  border-left-color: var(--shu);
}

.notice p {
  margin: 0;
}

.notice p + p {
  margin-top: 10px;
}

.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.source-list li {
  line-height: 1.6;
}

.source-list small {
  display: block;
  color: var(--ink-secondary);
}

/* 規約・方針 */
.doc-section {
  margin: 16px 0;
}

.doc-section h2 {
  font-size: 1.2rem;
}

.doc-section p:last-child,
.doc-section ul:last-child {
  margin-bottom: 0;
}

.legal-meta {
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

.lang-divider {
  margin: 56px 0 8px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th,
table.data td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-secondary);
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
}

table.data th {
  width: 30%;
  color: var(--ink);
  font-weight: 700;
}

/* フッター */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 22px 36px;
  color: var(--ink-secondary);
  text-align: center;
  font-size: 0.92rem;
}

.site-footer p {
  margin: 6px 0;
}

@media (max-width: 800px) {
  .hero-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .screen {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero,
  .page {
    padding: 40px 16px;
  }

  .feature,
  .notice,
  .doc-section {
    padding: 18px;
  }

  table.data th,
  table.data td {
    display: block;
    width: 100%;
    padding: 4px 0;
    border: 0;
  }

  table.data tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--hairline);
  }
}
