@import url("/assets/brand/wood-mark.css");
:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-soft: #f7f9fa;
  --ink: #17211f;
  --muted: #66706d;
  --faint: #8b9491;
  --line: #e2e7e5;
  --line-strong: #cbd3d0;
  --accent: #214f77;
  --accent-soft: #edf4f8;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Noto Sans JP", sans-serif;
  --serif: "Noto Serif TC", "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111716;
  --paper-soft: #171f1d;
  --ink: #e8efec;
  --muted: #aab5b1;
  --faint: #7f8c87;
  --line: #2b3633;
  --line-strong: #3b4844;
  --accent: #8abbdc;
  --accent-soft: #172936;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button { font: inherit; }
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: #111;
  color: #fff;
  padding: 10px 14px;
}
.skip:focus { top: 12px; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px);
}
.head-in { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.mark-wrap { position: relative; width: 40px; height: 40px; flex: 0 0 auto; }
.mark-shadow { position: absolute; inset: 4px -4px -4px 4px; background: #d9e8f3; }
.mark-shadow i { display: none; }
.mark {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #174b74;
  background: linear-gradient(145deg, #2f73a8, #245d8c);
  color: #fff;
  font: 700 22px/1 var(--serif);
}
.brand-copy strong { display: block; font: 600 17px/1.25 var(--serif); }
.brand-copy small { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; line-height: 1.3; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 20px; font-size: 13px; font-weight: 700; }
.nav a { position: relative; padding: 8px 1px; color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; right: 0; bottom: 2px; left: 0; height: 2px; background: currentColor; }
.theme-toggle {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.daily-page { width: min(820px, calc(100% - 40px)); margin-inline: auto; padding: 58px 0 88px; }
.page-head { position: relative; padding-bottom: 38px; border-bottom: 1px solid var(--line-strong); }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.page-head h1 { margin: 0; font: 700 clamp(44px, 8vw, 76px)/1.08 var(--serif); letter-spacing: -.045em; }
.page-lead { max-width: 680px; margin: 24px 0 0; color: var(--ink); font: 500 clamp(18px, 2.5vw, 24px)/1.7 var(--serif); }
.page-note { max-width: 650px; margin: 12px 0 0; color: var(--muted); }
.page-meta-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-top: 24px; }
.page-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--faint); font-size: 12px; }
.n2-voice-setting { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.n2-voice-select {
  width: min(310px, 38vw);
  min-width: 250px;
  min-height: 42px;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 600 13px/1.35 var(--sans);
}
.n2-voice-select:disabled { color: var(--faint); opacity: .75; }

.list-count {
  position: absolute;
  right: 0;
  bottom: 0;
  padding-left: 14px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  transform: translateY(50%);
}
.list-section { padding-top: 22px; }
.daily-list { border-bottom: 1px solid var(--line-strong); }
.daily-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 24px;
  gap: 22px;
  align-items: center;
  width: calc(100% + 32px);
  min-height: 148px;
  margin: 0 -16px;
  padding: 28px 16px;
  text-decoration: none;
  transition: background-color .18s ease, box-shadow .18s ease;
}
.daily-row:hover .daily-title, .daily-row:focus-visible .daily-title { color: var(--accent); }
.daily-row:focus-visible, .theme-toggle:focus-visible, .action-btn:focus-visible, .n2-voice-select:focus-visible, .nav a:focus-visible, .footer a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 4px; }
.day-label { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.daily-title { display: block; margin-bottom: 8px; font: 700 23px/1.4 var(--serif); transition: color .18s ease; }
.daily-preview { display: block; color: var(--muted); line-height: 1.7; }
.daily-tags { display: flex; gap: 12px; margin-top: 12px; color: var(--faint); font-size: 12px; }
.daily-arrow { color: var(--accent); font-size: 22px; transition: transform .18s ease; }

@media (hover: hover) {
  .daily-row:hover {
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .daily-row:hover .daily-arrow { transform: translateX(4px); }
}
.daily-row:focus-visible {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.daily-row:focus-visible .daily-arrow { transform: translateX(4px); }
.daily-row:active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.study-section { padding: 48px 0; border-bottom: 1px solid var(--line); }
.voice-preview-section { scroll-margin-top: 96px; }
.study-section h2, .grammar-summary h2 { margin: 0 0 22px; font: 700 clamp(27px, 4vw, 36px)/1.35 var(--serif); }
.prose { font: 500 clamp(18px, 2.6vw, 21px)/2 var(--serif); }
.prose p { margin: 0 0 1.45em; }
.prompt { margin: 28px 0 16px; color: var(--muted); font-size: 14px; }
.action-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.action-btn {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.action-btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.action-btn:hover { background: var(--paper-soft); }
.action-btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.action-btn:disabled { cursor: not-allowed; opacity: .42; }
.japanese-tools { justify-content: flex-end; margin: 0 0 26px; }
.japanese-text { font-family: var(--serif); }
ruby rt { display: none; color: var(--muted); font-family: var(--sans); font-size: .53em; font-weight: 500; }
.show-readings ruby rt { display: ruby-text; }
.grammar-point {
  display: inline;
  padding: 0 .06em;
  background: linear-gradient(transparent 67%, color-mix(in srgb, var(--accent) 18%, transparent) 67%);
  color: var(--accent);
  font-weight: 700;
}
.grammar-note { margin-left: .35em; color: var(--muted); font-family: var(--sans); font-size: .68em; font-weight: 500; }
.grammar-summary { padding: 44px 0; }
.grammar-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.grammar-list li { display: grid; grid-template-columns: minmax(180px, .8fr) 1.2fr; gap: 28px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.grammar-list strong { color: var(--accent); font-family: var(--serif); font-size: 18px; }
.grammar-list span { color: var(--muted); }
.page-nav { display: flex; justify-content: space-between; gap: 18px; padding-top: 28px; border-top: 1px solid var(--line-strong); }
.page-nav a, .page-nav span { color: var(--muted); font-size: 14px; text-decoration: none; }

.footer { border-top: 1px solid var(--line); background: var(--paper-soft); }
.footer-in { min-height: 130px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a { color: var(--muted); font-size: 13px; text-decoration: none; }
.footer p { color: var(--faint); font-size: 12px; }

@media (max-width: 720px) {
  .shell, .daily-page { width: min(100% - 28px, 820px); }
  .head-in { min-height: 62px; }
  .brand-copy small { display: none; }
  .nav a:not([aria-current="page"]) { display: none; }
  .nav { gap: 10px; }
  .daily-page { padding-top: 38px; padding-bottom: 68px; }
  .page-head h1 { font-size: clamp(40px, 14vw, 58px); }
  .page-meta-row { align-items: stretch; flex-direction: column; }
  .n2-voice-setting { align-items: stretch; flex-direction: column; gap: 7px; white-space: normal; }
  .n2-voice-select { width: 100%; min-width: 0; }
  .daily-row { grid-template-columns: 1fr 20px; gap: 8px 14px; width: calc(100% + 16px); margin: 0 -8px; padding: 24px 8px; }
  .day-label { grid-column: 1; }
  .daily-row > div { grid-column: 1; }
  .daily-arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .study-section { padding: 38px 0; }
  .prose { font-size: 18px; line-height: 2; }
  .grammar-note { display: block; margin: .35em 0 .2em; line-height: 1.65; }
  .japanese-tools { justify-content: flex-start; }
  .grammar-list li { grid-template-columns: 1fr; gap: 6px; }
  .footer-in { padding: 28px 0; align-items: flex-start; flex-direction: column; }
}
