/* ------------------------------------------------------------------
   Datong Apps — site stylesheet
   Palette: warm paper, deep ink, sage accent, soft clay highlight
------------------------------------------------------------------- */

:root {
  --paper: #f7f4ee;
  --paper-2: #efeae0;
  --ink: #1b1a17;
  --ink-2: #3f3c36;
  --muted: #76716a;
  --line: #ddd6c9;
  --sage: #4f6b5b;
  --sage-2: #6f8a7b;
  --sage-soft: #e3eae4;
  --clay: #c0765b;
  --clay-soft: #f3e3dc;
  --white: #fffdf9;

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max: 1120px;
  --radius: 18px;
  --shadow: 0 20px 60px -30px rgba(27, 26, 23, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--sage); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.55rem; }
h4 { font-size: 1.2rem; font-family: var(--font-body); font-weight: 600; }

p { margin: 0 0 1.1em; }
p.lead { font-size: 1.2rem; color: var(--ink-2); }
.muted { color: var(--muted); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 1rem;
}

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(760px, calc(100% - 40px)); margin: 0 auto; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: var(--white); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; z-index: 100; }

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 244, 238, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 600;
  color: var(--ink); letter-spacing: 0.01em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600;
}
.menu { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.menu a { color: var(--ink-2); font-size: 0.95rem; font-weight: 500; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.menu a[aria-current="page"] { border-bottom: 1.5px solid var(--clay); padding-bottom: 2px; }
.menu a.btn { padding: 10px 18px; font-size: 0.9rem; color: var(--paper); }
.menu a.btn:hover { color: var(--paper); }

.burger {
  display: none; background: none; border: 1px solid var(--line); border-radius: 10px;
  width: 42px; height: 42px; cursor: pointer; color: var(--ink);
}
.burger span { display: block; width: 18px; height: 1.5px; background: currentColor; margin: 4px auto; }

@media (max-width: 820px) {
  .burger { display: block; }
  .menu {
    display: none; position: absolute; left: 0; right: 0; top: 72px;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 10px 20px 20px;
  }
  .menu.open { display: flex; }
  .menu li { width: 100%; }
  .menu a { display: block; padding: 12px 0; font-size: 1.05rem; }
  .menu a[aria-current="page"] { border-bottom: none; color: var(--clay); }
  .menu .btn { margin-top: 10px; display: inline-block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 500; font-size: 0.98rem; border: 1px solid var(--ink);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; background: #2c2a26; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.sage { background: var(--sage); border-color: var(--sage); color: #fff; }
.btn.sage:hover { background: #425b4d; }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
section.tight { padding: 64px 0; }
section.alt { background: var(--paper-2); }
section.dark { background: var(--ink); color: #e8e3d8; }
section.dark h2, section.dark h3 { color: var(--paper); }
section.dark .eyebrow { color: #a9c0b2; }
section.dark a { color: #cfe0d5; }

.section-head { max-width: 640px; margin-bottom: 48px; }

/* ---------- Hero ---------- */
.hero { padding: 110px 0 90px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -120px; top: -80px;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--sage-soft), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 14ch; }
.hero h1 em { font-style: italic; color: var(--sage); }
.hero p.lead { max-width: 54ch; margin-bottom: 2rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 32px; color: var(--muted); font-size: 0.92rem;
}
.hero-note strong { color: var(--ink); font-weight: 600; }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 24px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px;
}
.card .num {
  font-family: var(--font-display); font-size: 2rem; color: var(--clay); line-height: 1;
  margin-bottom: 18px;
}
.card h3 { font-size: 1.4rem; margin-bottom: 0.4em; }
.card p { color: var(--ink-2); margin: 0; font-size: 0.98rem; }

.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- Phone mock (Miku) ---------- */
.phone {
  width: 280px; margin: 0 auto; aspect-ratio: 9 / 18.5;
  border-radius: 44px; background: #15211b; padding: 12px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.phone .screen {
  width: 100%; height: 100%; border-radius: 34px; overflow: hidden;
  background: linear-gradient(170deg, #f6f2ea 0%, #e6ece6 60%, #dce7df 100%);
  padding: 34px 22px 22px; display: flex; flex-direction: column; gap: 14px; color: var(--ink);
}
.phone .time { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; }
.phone .greet { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.15; }
.phone .moods { display: flex; justify-content: space-between; margin: 6px 0 2px; }
.phone .moods span {
  width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 0.9rem;
}
.phone .moods span.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.phone .tile {
  background: #fff; border-radius: 16px; padding: 14px; font-size: 0.78rem; border: 1px solid var(--line);
}
.phone .tile b { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 3px; }
.phone .ring {
  margin: auto; width: 110px; height: 110px; border-radius: 50%;
  border: 10px solid var(--sage-soft); border-top-color: var(--sage);
  display: grid; place-items: center; font-size: 0.72rem; color: var(--sage); text-align: center;
}

/* ---------- Feature list ---------- */
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.features li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start; }
.features .dot {
  width: 28px; height: 28px; border-radius: 50%; background: var(--sage-soft); color: var(--sage);
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; margin-top: 2px;
}
.features b { display: block; font-weight: 600; }
.features span.d { color: var(--ink-2); font-size: 0.97rem; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: var(--clay-soft); color: var(--clay); letter-spacing: 0.04em; text-transform: uppercase;
}

/* ---------- Support / contact block (deliberately prominent) ---------- */
.support-band {
  background: var(--sage); color: #f2f6f3; border-radius: 26px;
  padding: 56px 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.support-band h2 { color: #fff; margin-bottom: 0.3em; }
.support-band p { color: #dfe8e2; margin: 0; }
.contact-list { display: grid; gap: 16px; }
.contact-list a.email {
  display: block; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 14px; padding: 18px 22px; color: #fff;
}
.contact-list a.email:hover { background: rgba(255,255,255,0.18); text-decoration: none; }
.contact-list .label { display: block; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: #cfe0d5; margin-bottom: 4px; }
.contact-list .addr { font-size: 1.15rem; font-weight: 600; word-break: break-all; }
@media (max-width: 820px) { .support-band { grid-template-columns: 1fr; padding: 40px 28px; } }

/* ---------- Contact cards (light) ---------- */
.contact-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px;
}
.contact-card .label { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.contact-card a.big { font-size: 1.25rem; font-weight: 600; color: var(--ink); word-break: break-all; }
.contact-card a.big:hover { color: var(--sage); }
.contact-card p { margin: 10px 0 0; font-size: 0.95rem; color: var(--ink-2); }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 80px 0 48px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); max-width: 18ch; }
.page-head p.lead { max-width: 60ch; margin: 0; }
.page-head .meta { color: var(--muted); font-size: 0.9rem; margin-top: 16px; }

/* ---------- Legal / long-form ---------- */
.legal { padding: 56px 0 96px; }
.legal .narrow { display: grid; grid-template-columns: 220px 1fr; gap: 56px; width: min(1000px, calc(100% - 40px)); }
.toc { position: sticky; top: 96px; align-self: start; font-size: 0.9rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 6px 0 6px 16px; color: var(--muted); margin-left: -1px; border-left: 1px solid transparent; }
.toc li a:hover { color: var(--ink); text-decoration: none; border-left-color: var(--clay); }
.prose h2 { font-size: 1.7rem; margin-top: 2.2em; scroll-margin-top: 96px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--ink-2); font-size: 1rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 1em 0 1.5em; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; color: var(--ink); background: var(--paper-2); }
.callout {
  background: var(--sage-soft); border: 1px solid #cfdcd3; border-radius: 14px; padding: 20px 22px; margin: 1.5em 0;
}
.callout.clay { background: var(--clay-soft); border-color: #e8cdc2; }
.callout p { margin: 0; color: var(--ink); }
.callout p + p { margin-top: 0.6em; }
@media (max-width: 860px) {
  .legal .narrow { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; }
}

/* ---------- FAQ ---------- */
details.faq { border-bottom: 1px solid var(--line); padding: 20px 0; }
details.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-family: var(--font-display); font-size: 1.6rem; color: var(--clay); line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 12px 0 0; color: var(--ink-2); }

/* ---------- Steps ---------- */
.steps { counter-reset: s; display: grid; gap: 0; }
.steps .step { display: grid; grid-template-columns: 64px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.steps .step:last-child { border-bottom: 1px solid var(--line); }
.steps .step::before {
  counter-increment: s; content: "0" counter(s);
  font-family: var(--font-display); font-size: 2rem; color: var(--clay); line-height: 1;
}
.steps h3 { margin-bottom: 0.3em; }
.steps p { margin: 0; color: var(--ink-2); }

/* ---------- Values ---------- */
.values .card { background: transparent; border: none; border-top: 1px solid var(--line); border-radius: 0; padding: 28px 0 0; }

/* ---------- Footer ---------- */
footer.site {
  background: var(--ink); color: #b9b3a7; padding: 72px 0 36px; font-size: 0.93rem;
}
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 40px; }
footer h4 { color: var(--paper); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 16px; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
footer a { color: #d6d0c4; }
footer a:hover { color: #fff; }
footer .brand { color: var(--paper); margin-bottom: 14px; }
footer .brand .mark { background: var(--paper); color: var(--ink); }
footer .legal-line {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.12);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.85rem; color: #8f897d;
}
footer .emails a { display: block; color: #fff; font-weight: 500; word-break: break-all; }
footer .emails small { display: block; color: #8f897d; margin-bottom: 2px; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
footer .emails div + div { margin-top: 14px; }
@media (max-width: 860px) { footer .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { footer .cols { grid-template-columns: 1fr; } }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.center { text-align: center; }
.inline-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.inline-list li { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.88rem; background: var(--white); color: var(--ink-2); }
