@font-face {
  font-family: "Daynest Sans";
  src: url("../assets/fonts/daynest-dm-sans.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Daynest Script";
  src: url("../assets/fonts/daynest-caveat.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fff0eb;
  --paper-deep: #f9e4dd;
  --card: #fffdfa;
  --ink: #603a30;
  --muted: #936d62;
  --rose: #bd8072;
  --rose-deep: #a65466;
  --pink: #fac8d5;
  --yellow: #f8e58e;
  --line: #e7c9c0;
  --shadow: #e2cfc5;
  --sans: "Daynest Sans", ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
  --script: "Daynest Script", "Bradley Hand", "Segoe Print", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(255, 240, 235, 0.86), rgba(255, 240, 235, 0.94)),
    url("../assets/paper.webp");
  background-size: 520px auto;
  background-attachment: fixed;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 0%, rgba(250, 200, 213, 0.2), transparent 30%),
    radial-gradient(circle at 92% 20%, rgba(248, 229, 142, 0.16), transparent 26%);
  z-index: -1;
}
::selection { background: var(--pink); color: var(--ink); }
a { color: var(--ink); text-decoration-color: var(--rose); text-underline-offset: 3px; }
a:hover { color: var(--rose-deep); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 10;
}
.skip-link:focus { left: 16px; }

.shell { width: min(1040px, calc(100% - 40px)); max-width: 100%; margin: 0 auto; padding: 22px 0 56px; }
.hero > *, .legal-grid > *, .legal-layout > * { min-width: 0; }
h1, h2, h3, p, li, a { overflow-wrap: anywhere; }

/* Masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0 26px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1.1px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--shadow);
  transform: rotate(-3deg);
}
.brand-mark img { width: 20px; height: 20px; object-fit: contain; }
.brand small {
  font-size: 8.5px;
  letter-spacing: 2.2px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.6);
  border-radius: 999px;
  padding: 4px 7px;
  align-self: center;
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.1px;
  text-decoration: none;
  color: var(--muted);
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.nav a:hover { color: var(--ink); background: rgba(255, 253, 250, 0.62); border-color: var(--line); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--card); border-color: var(--line); box-shadow: 0 2px 0 var(--shadow); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 28px;
  align-items: end;
  padding: 18px 0 30px;
}
.kicker {
  margin: 0 0 10px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: var(--muted);
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.04;
  letter-spacing: -2.2px;
  font-weight: 800;
}
.hero h1 em { font-family: var(--script); font-style: normal; color: var(--rose); letter-spacing: 0; font-size: 1.08em; }
.hero p { margin: 0; max-width: 55ch; color: var(--muted); font-size: 15px; line-height: 1.85; }
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--muted);
  background: rgba(255, 253, 250, 0.66);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}
.hero-card {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  padding: 20px 20px 18px;
  box-shadow: 0 4px 0 var(--shadow);
  transform: rotate(1.2deg);
}
.hero-card .tape {
  position: absolute;
  top: -12px;
  right: 38px;
  width: 82px;
  height: 23px;
  background: var(--pink);
  opacity: 0.8;
  transform: rotate(4deg);
  border: 1px solid rgba(96, 58, 48, 0.08);
}
.hero-card h2 { margin: 0 0 8px; font-size: 17px; letter-spacing: -0.4px; }
.hero-card p { margin: 0 0 11px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.hero-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.hero-list li { position: relative; padding-left: 17px; font-size: 12px; color: var(--ink); }
.hero-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
}
.hero-note {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--muted);
}

/* Legal cards */
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -0.5px; }
.section-heading span { font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.legal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.legal-card {
  display: flex;
  flex-direction: column;
  min-height: 214px;
  padding: 18px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 3px 0 var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.legal-card:hover { transform: translateY(-3px) rotate(-0.3deg); border-color: var(--ink); box-shadow: 0 5px 0 var(--shadow); color: var(--ink); }
.card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(250, 200, 213, 0.28);
  border: 1px solid var(--line);
  margin-bottom: 13px;
}
.card-icon img { width: 22px; height: 22px; object-fit: contain; }
.legal-card h3 { margin: 0 0 5px; font-size: 17px; letter-spacing: -0.35px; }
.legal-card p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.legal-card .read {
  margin-top: auto;
  padding-top: 14px;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.8px;
  color: var(--rose-deep);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legal-card .read::after { content: "→"; font-size: 13px; transition: transform 160ms ease; }
.legal-card:hover .read::after { transform: translateX(3px); }

/* Note strip */
.note-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(248, 229, 142, 0.22);
  border: 1.5px solid var(--line);
  border-radius: 17px;
  transform: rotate(-0.35deg);
  box-shadow: 0 2px 0 rgba(226, 207, 197, 0.7);
}
.note-card .dot { flex: 0 0 9px; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--rose); }
.note-card p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.note-card strong { color: var(--ink); }

/* Article pages */
.page-hero { padding: 14px 0 22px; }
.page-hero h1 { margin: 0 0 10px; font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -1.8px; }
.page-hero .lede { margin: 0; max-width: 64ch; color: var(--muted); font-size: 14.5px; line-height: 1.85; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
}
.back-link::before { content: "←"; font-size: 14px; color: var(--rose); }
.back-link:hover { color: var(--ink); }

.legal-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 26px; align-items: start; }
.toc {
  position: sticky;
  top: 18px;
  padding: 14px;
  background: rgba(255, 253, 250, 0.62);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(3px);
}
.toc strong { display: block; font-size: 9px; letter-spacing: 1.7px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.toc a { display: block; padding: 5px 7px; margin: 1px -4px; border-radius: 8px; font-size: 11.5px; line-height: 1.4; color: var(--muted); text-decoration: none; }
.toc a:hover { background: rgba(250, 200, 213, 0.25); color: var(--ink); }
.legal-article {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  padding: clamp(22px, 4vw, 38px);
  box-shadow: 0 4px 0 var(--shadow);
}
.legal-article > .tape {
  position: absolute;
  top: -12px;
  left: 34px;
  width: 74px;
  height: 22px;
  background: rgba(250, 200, 213, 0.72);
  transform: rotate(-3deg);
}
.article-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; }
.summary {
  margin: 0 0 26px;
  padding: 15px 16px;
  background: rgba(248, 229, 142, 0.2);
  border-left: 3px solid var(--yellow);
  border-radius: 0 12px 12px 0;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.8;
}
.summary strong { color: var(--rose-deep); }
.prose { font-size: 14px; line-height: 1.85; color: var(--ink); }
.prose h2 {
  margin: 30px 0 9px;
  scroll-margin-top: 20px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.4px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 18px 0 6px; font-size: 14.5px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 19px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--rose); }
.prose strong { color: var(--ink); font-weight: 750; }
.prose a { font-weight: 650; }
.prose code { font-size: 12px; background: rgba(250, 200, 213, 0.22); border-radius: 5px; padding: 1px 5px; }
.callout {
  margin: 18px 0;
  padding: 14px 15px;
  background: rgba(250, 200, 213, 0.18);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.75;
}
.callout strong { color: var(--ink); }
.article-footer { margin-top: 30px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); }
.article-footer a { font-weight: 650; }

/* Footer */
.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-size: 10.5px;
  color: var(--muted);
}
.site-footer .footer-brand { font-weight: 750; color: var(--ink); letter-spacing: -0.2px; }
.site-footer .footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration-color: var(--line); }
.site-footer a:hover { color: var(--ink); }
.heart-line { color: var(--rose); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-card { transform: rotate(0.6deg); max-width: 520px; }
  .legal-grid { grid-template-columns: 1fr 1fr; }
  .legal-layout { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 3px; padding: 10px; }
  .toc strong { flex: 1 0 100%; margin: 0 0 3px; }
  .toc a { padding: 5px 8px; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); padding-top: 14px; }
  .masthead { align-items: flex-start; flex-direction: column; gap: 12px; padding-bottom: 18px; }
  .nav { justify-content: flex-start; }
  .brand { font-size: 24px; }
  .hero { padding-top: 8px; }
  .hero h1 { letter-spacing: -1.6px; }
  .legal-grid { grid-template-columns: 1fr; }
  .legal-card { min-height: 0; }
  .page-hero h1 { letter-spacing: -1.3px; }
  .legal-article { border-radius: 18px; padding: 22px 18px; }
  .legal-article > .tape { left: 24px; }
  .site-footer { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .legal-card, .legal-card .read::after { transition: none; }
}
