:root {
  color-scheme: light;
  --ink: #1d211f;
  --muted: #636b64;
  --paper: #f2eee2;
  --paper-light: #fbf8ef;
  --paper-deep: #e9e2d2;
  --teal: #0e7471;
  --teal-dark: #095c59;
  --clay: #b65a37;
  --moss: #68764a;
  --sun: #e8b64b;
  --line: rgba(29, 33, 31, 0.16);
  --shadow: 0 18px 48px rgba(42, 47, 43, 0.09);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 7%, rgba(232, 182, 75, 0.19), transparent 22rem),
    linear-gradient(180deg, var(--paper-light) 0, var(--paper) 34rem, var(--paper) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(14, 116, 113, 0.28);
  outline-offset: 3px;
}

.topbar,
main,
.footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 720;
  text-decoration: none;
}

.brand-mark {
  width: 19px;
  height: 19px;
  border: 2px solid var(--ink);
  border-right-color: var(--teal);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.topnav a,
.footer a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.topnav a:hover,
.footer a:hover,
.source-row a:hover { color: var(--teal-dark); }

.hero {
  display: grid;
  min-height: 620px;
  align-items: center;
  gap: clamp(46px, 8vw, 110px);
  padding: 70px 0 82px;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  max-width: 680px;
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(3.2rem, 6.4vw, 6.1rem);
  font-weight: 560;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.hero-intro {
  max-width: 590px;
  margin: 28px 0 30px;
  color: var(--muted);
  font-size: 1.06rem;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.category-filter button {
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(251, 248, 239, 0.58);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 680;
}

.category-filter button:hover,
.category-filter button.is-active {
  border-color: var(--ink);
  color: var(--paper-light);
  background: var(--ink);
}

.daily-card {
  position: relative;
  overflow: hidden;
  min-height: 455px;
  padding: clamp(28px, 4.2vw, 52px);
  border: 1px solid rgba(29, 33, 31, 0.13);
  border-radius: 34px 34px 112px 34px;
  background: var(--paper-light);
  box-shadow: var(--shadow);
}

.daily-card::after {
  position: absolute;
  right: -56px;
  bottom: -80px;
  width: 210px;
  height: 210px;
  border: 34px solid rgba(14, 116, 113, 0.12);
  border-radius: 50%;
  content: "";
}

.daily-card-topline,
.section-heading,
.daily-actions,
.footer,
.summary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.daily-label,
.daily-number,
.motto-card > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.daily-card-body {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 270px;
  flex-direction: column;
  justify-content: center;
  padding: 28px 0;
}

.category-tag {
  align-self: flex-start;
  padding: 5px 10px;
  border: 1px solid rgba(14, 116, 113, 0.22);
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(14, 116, 113, 0.07);
  font-size: 0.78rem;
  font-weight: 760;
}

.daily-card h2 {
  max-width: 650px;
  margin: 20px 0 12px;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 560;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.daily-card-body p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.daily-actions {
  position: relative;
  z-index: 1;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.button,
.text-button {
  min-height: 44px;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 720;
}

.button {
  padding: 10px 17px;
  border: 1px solid transparent;
}

.button-primary { color: #fff; background: var(--teal); }
.button-primary:hover { background: var(--teal-dark); }

.button-secondary {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.button-secondary:hover { border-color: var(--teal); color: var(--teal-dark); }

.text-button {
  padding: 8px 5px;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(99, 107, 100, 0.36);
  text-underline-offset: 4px;
}

.text-button:hover { color: var(--teal-dark); }

.action-status {
  position: relative;
  z-index: 1;
  min-height: 24px;
  margin: 12px 0 -16px;
  color: var(--teal-dark);
  font-size: 0.84rem;
}

.today-section,
.motto-section,
.guidelines-section,
.method-section {
  border-top: 1px solid var(--line);
  padding: 82px 0;
}

.section-heading { margin-bottom: 32px; }

.section-heading h2,
.motto-lead h2,
.method-section > div:first-child h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(2.15rem, 4vw, 3.8rem);
  font-weight: 560;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.section-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.today-layout {
  display: grid;
  overflow: hidden;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(251, 248, 239, 0.72);
  grid-template-columns: minmax(0, 1fr) 300px;
}

.today-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.today-list:empty { display: none; }

.today-item {
  display: grid;
  align-items: center;
  gap: 18px;
  min-height: 92px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.today-item:last-child { border-bottom: 0; }

.today-check {
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  appearance: none;
  cursor: pointer;
  place-items: center;
}

.today-check::after {
  width: 8px;
  height: 14px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(45deg) scale(0.5);
  transition: 150ms ease;
}

.today-check:checked { border-color: var(--teal); background: var(--teal); }
.today-check:checked::after { opacity: 1; transform: translateY(-1px) rotate(45deg) scale(1); }

.today-item-copy span {
  display: block;
  margin-bottom: 2px;
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 760;
}

.today-item-copy strong { display: block; font-size: 1rem; line-height: 1.45; }

.today-item.is-completed .today-item-copy {
  opacity: 0.48;
  text-decoration: line-through;
}

.remove-today {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.35rem;
}

.today-empty {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: 36px;
}

.today-empty strong { font-family: Georgia, "Songti SC", "STSong", serif; font-size: 1.7rem; }
.today-empty p { margin: 8px 0 22px; color: var(--muted); }

.today-summary {
  padding: 32px;
  border-left: 1px solid var(--line);
  background: var(--paper-deep);
}

.today-date { margin: 0 0 54px; color: var(--muted); font-size: 0.85rem; }
.today-progress { margin: 0 0 30px; font-family: Georgia, "Songti SC", "STSong", serif; font-size: 1.4rem; }

.today-progress strong {
  color: var(--teal-dark);
  font-size: 3.6rem;
  font-weight: 560;
  line-height: 1;
}

.summary-actions { align-items: flex-start; flex-direction: column; }

.privacy-note {
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.copy-fallback {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(182, 90, 55, 0.28);
  border-radius: 18px;
  background: rgba(251, 248, 239, 0.72);
}

.copy-fallback label { display: block; margin-bottom: 8px; font-weight: 720; }

.copy-fallback textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}

.motto-section {
  display: grid;
  gap: 46px;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
}

.motto-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.motto-card {
  min-height: 180px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(251, 248, 239, 0.56);
}

.motto-card-main {
  min-height: 220px;
  border-color: transparent;
  color: #fff;
  background: var(--teal-dark);
  grid-column: 1 / -1;
}

.motto-card-main > span { color: rgba(255, 255, 255, 0.68); }

.motto-card blockquote {
  margin: 26px 0 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(1.35rem, 2.5vw, 2.15rem);
  font-weight: 560;
  line-height: 1.42;
}

.guidelines-heading { align-items: flex-end; }

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

.guideline-card {
  display: flex;
  min-height: 265px;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(251, 248, 239, 0.58);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.guideline-card:hover {
  border-color: rgba(14, 116, 113, 0.46);
  background: var(--paper-light);
  transform: translateY(-3px);
}

.guideline-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guideline-card-number {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
}

.guideline-card h3 {
  margin: 24px 0 10px;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 1.5rem;
  font-weight: 560;
  line-height: 1.32;
}

.guideline-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.guideline-card .text-button { align-self: flex-start; margin-top: auto; }
.guideline-empty { color: var(--muted); }

.method-section {
  display: grid;
  gap: 50px;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.22fr);
}

.method-grid { display: grid; gap: 0; }

.method-grid article {
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.method-grid h3 { margin: 0 0 8px; font-size: 1rem; }
.method-grid p { margin: 0; color: var(--muted); }

.source-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 16px;
  grid-column: 2;
  color: var(--muted);
  font-size: 0.82rem;
}

.source-row a { color: var(--teal-dark); text-underline-offset: 3px; }

.footer {
  min-height: 118px;
  border-top: 1px solid var(--line);
}

.footer p { color: var(--muted); font-family: Georgia, "Songti SC", "STSong", serif; font-size: 1.08rem; }
.footer div { display: flex; gap: 22px; }

@media (max-width: 920px) {
  .hero { gap: 46px; grid-template-columns: 1fr; }
  .daily-card { min-height: 430px; }
  .today-layout { grid-template-columns: 1fr; }
  .today-summary { border-top: 1px solid var(--line); border-left: 0; }
  .today-date { margin-bottom: 22px; }
  .motto-section, .method-section { grid-template-columns: 1fr; }
  .source-row { grid-column: 1; }
  .guideline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .topbar, main, .footer { width: min(100% - 30px, 1180px); }
  .topbar { min-height: 70px; }
  .topnav a:not(:last-child) { display: none; }
  .hero { min-height: auto; padding: 50px 0 62px; }
  h1 { font-size: clamp(3rem, 16vw, 4.5rem); }
  .hero-intro { font-size: 1rem; }
  .category-filter {
    flex-wrap: nowrap;
    margin-right: -15px;
    padding-right: 15px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .category-filter::-webkit-scrollbar { display: none; }
  .category-filter button { flex: 0 0 auto; }
  .daily-card { min-height: 450px; padding: 26px 24px 32px; border-radius: 24px 24px 78px 24px; }
  .daily-card-body { min-height: 280px; }
  .daily-actions .button { flex: 1 1 120px; }
  .today-section, .motto-section, .guidelines-section, .method-section { padding: 64px 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .today-item { padding: 18px; }
  .today-empty, .today-summary { padding: 26px 22px; }
  .motto-grid, .guideline-grid { grid-template-columns: 1fr; }
  .motto-card-main { grid-column: 1; }
  .guideline-card { min-height: 230px; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 28px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

@media print {
  .topbar, .hero, .motto-section, .guidelines-section, .method-section, .footer,
  .summary-actions, .remove-today { display: none !important; }
  .today-section { border: 0; padding: 0; }
  .today-layout { border-color: #777; }
}
