/* ---------- 法Q · design tokens (mirrors iOS Theme.swift) ---------- */
:root {
  /* Brand */
  --teal: #0F4C5C;
  --teal-700: #0a3a47;
  --teal-900: #062731;
  --teal-tint: rgba(15, 76, 92, 0.06);
  --gold: #E8C464;
  --gold-deep: #b88a2a;
  --gold-tint: rgba(232, 196, 100, 0.14);

  /* Surfaces */
  --cream: #FAF8F3;
  --cream-deep: #f3eee0;
  --card: #FFFFFF;
  --hairline: #ECE5D2;
  --hairline-strong: #ddd2b3;

  /* Text */
  --text: #1F2937;
  --text-2: #6B7280;
  --text-3: #9CA3AF;

  /* Categories (mirrors iOS) — reserved for future case-category UI */
  --cat-civil: #1A56DB;
  --cat-criminal: #DC2626;
  --cat-admin: #059669;
  --cat-disc: #7C3AED;
  --cat-const: #EA580C;

  /* Type */
  --serif: "Noto Serif TC", "Songti TC", "Songti SC", "STSong", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", -apple-system, BlinkMacSystemFont,
          "Helvetica Neue", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --max-width: 760px;     /* legal pages (privacy / terms / support) */
  --landing-width: 1080px;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--cream);
  background-image:
    radial-gradient(1200px 600px at -10% -10%, rgba(15, 76, 92, 0.045), transparent 55%),
    radial-gradient(900px 600px at 110% 110%, rgba(232, 196, 100, 0.08), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "palt" 1;
}

/* Subtle paper grain — fixed so it doesn't scroll, kept very faint */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.10 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 0.07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

main { position: relative; z-index: 1; }

/* ---------- a11y ---------- */
:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}
.app-cta:focus-visible { outline-offset: 4px; }

/* ---------- typography (legacy: privacy / terms / support) ---------- */
h1, h2, h3 { font-family: var(--serif); letter-spacing: -0.2px; }
h1 {
  font-size: 34px;
  font-weight: 700;
  color: var(--teal);
  margin: 0 0 10px;
  line-height: 1.25;
}
h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--teal);
  margin: 44px 0 12px;
}
h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 28px 0 8px;
  color: var(--text);
  font-family: var(--sans);
}
p { margin: 0 0 16px; }
ul { padding-left: 22px; margin: 0 0 16px; }
li { margin-bottom: 6px; }
a { color: var(--teal); text-decoration: none; text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--gold-tint);
  color: var(--teal);
  padding: 1px 6px;
  border-radius: 4px;
}

table { width: 100%; border-collapse: collapse; margin: 12px 0 24px; font-size: 15px; }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
th { background: var(--gold-tint); font-weight: 700; color: var(--teal); font-family: var(--serif); }

.meta { color: var(--text-2); font-size: 14px; margin-bottom: 32px; }
.lede { color: var(--text-2); font-size: 18px; margin-bottom: 32px; }

/* ---------- shared header ---------- */
header.site {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(20px, 4vw, 40px);
  border-bottom: 1px solid var(--hairline);
  background: rgba(250, 248, 243, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand:hover { opacity: 0.85; text-decoration: none; }
.brand-glyph {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--gold);
  color: var(--teal);
  border-radius: 50%;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -1px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 2px 6px rgba(184, 138, 42, 0.35);
  transform: translateY(-0.5px);
}
.brand-mark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--teal);
}

.site-nav {
  display: inline-flex;
  gap: 22px;
  align-items: center;
  font-size: 14.5px;
}
.site-nav a { color: var(--text-2); font-weight: 500; }
.site-nav a:hover { color: var(--teal); text-decoration: none; }
.site-nav .nav-cta {
  color: var(--teal);
  font-weight: 700;
  background: var(--gold-tint);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 196, 100, 0.45);
}
.site-nav .nav-cta:hover { background: var(--gold); color: var(--teal-900); }

/* ---------- main layout ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px clamp(20px, 4vw, 32px) 96px;
}
body.landing main { max-width: var(--landing-width); padding-top: 64px; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 13.5px;
  background: linear-gradient(to bottom, transparent, rgba(15, 76, 92, 0.03));
  position: relative;
  z-index: 1;
}
footer nav { margin-bottom: 14px; }
footer nav a {
  margin: 0 12px;
  color: var(--text-2);
  font-weight: 500;
}
footer nav a:hover { color: var(--teal); }

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 72px;
  align-items: start;
  margin-bottom: 96px;
}
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 44px; margin-bottom: 64px; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--teal);
  background: var(--gold-tint);
  padding: 7px 14px;
  border-radius: 999px;
  letter-spacing: 1.4px;
  margin-bottom: 28px;
  border: 1px solid rgba(184, 138, 42, 0.25);
  text-transform: uppercase;
}
.hero-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--gold-deep);
  border-radius: 50%;
  display: inline-block;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1.18;
  letter-spacing: -0.6px;
  color: var(--teal);
  margin: 0 0 28px;
}
.hero h1 em {
  font-style: normal;
  color: var(--teal);
  position: relative;
  white-space: nowrap;
}
.hero h1 em::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px;
  bottom: 4px;
  height: 0.36em;
  background: var(--gold);
  opacity: 0.45;
  z-index: -1;
  border-radius: 2px;
}

.hero .lede {
  line-height: 1.8;
  max-width: 36em;
  margin: 0 0 36px;
}

.hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

.app-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 28px;
  background: var(--teal);
  color: var(--cream);
  border-radius: 12px;
  text-decoration: none;
  line-height: 1.2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 0 var(--teal-700),
    0 12px 28px -14px rgba(15, 76, 92, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  position: relative;
}
.app-cta:hover {
  transform: translateY(-1px);
  background: var(--teal-700);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 0 var(--teal-900),
    0 16px 32px -14px rgba(15, 76, 92, 0.7);
  text-decoration: none;
}
.app-cta-line1 { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.app-cta-line2 { font-size: 13px; opacity: 0.78; margin-top: 4px; }

.hero-note { font-size: 13px; color: var(--text-3); margin: 6px 0 0; letter-spacing: 0.3px; }

/* ---------- hero visual: mock chat + citation card ---------- */
.hero-mock {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(15, 76, 92, 0.05),
    0 24px 60px -28px rgba(15, 76, 92, 0.28),
    0 6px 14px -10px rgba(15, 76, 92, 0.12);
  transform: rotate(-0.4deg);
}
.hero-mock::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 24px;
  background: linear-gradient(140deg, rgba(232, 196, 100, 0.35), transparent 35%, transparent 70%, rgba(15, 76, 92, 0.18));
  filter: blur(20px);
  z-index: -1;
  opacity: 0.7;
}

.mock-user {
  align-self: flex-end;
  max-width: 84%;
  background: var(--teal);
  color: var(--cream);
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  font-size: 14.5px;
  line-height: 1.55;
}
.mock-user p { margin: 0; }

.mock-assistant {
  padding: 14px 16px;
  background: var(--cream);
  border: 1px solid var(--hairline);
  border-radius: 4px 16px 16px 16px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
}
.mock-assistant p { margin: 0 0 10px; }
.mock-assistant p:last-child { margin-bottom: 0; }

.mock-card {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold);
  border-radius: 4px 12px 12px 4px;
  padding: 12px 14px;
  background: var(--card);
}
.mock-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.mock-pill {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  background: var(--gold);
  color: var(--teal-900);
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.mock-jid {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}
.mock-card-title {
  font-family: var(--serif);
  font-size: 14.5px;
  color: var(--teal);
  margin: 2px 0 4px;
  font-weight: 700;
  line-height: 1.4;
}
.mock-card-meta { font-size: 11.5px; color: var(--text-3); margin: 0; letter-spacing: 0.2px; }

.mock-caret {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--mono);
  letter-spacing: 0.4px;
  padding-top: 4px;
}
.mock-caret-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); animation: pulse 1.6s ease-in-out infinite;
}
.mock-note {
  margin: 6px 2px 0;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.3px;
  text-align: center;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ---------- stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
  margin: 0 0 104px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.stat {
  background: var(--card);
  padding: 32px 24px;
  text-align: center;
  position: relative;
}
.stat-n {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(30px, 3.6vw, 42px);
  color: var(--teal);
  line-height: 1;
  letter-spacing: -1px;
}
.stat-n small {
  font-size: 0.52em;
  margin-left: 4px;
  color: var(--gold-deep);
  font-weight: 700;
  letter-spacing: 0;
}
.stat-l {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 12px;
  letter-spacing: 0.6px;
}
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; margin-bottom: 64px; }
}

/* ---------- section heads ---------- */
.section-head {
  text-align: center;
  margin: 0 0 64px;
}
.section-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 1.6px;
  color: var(--gold-deep);
  margin-bottom: 14px;
  text-transform: uppercase;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 40px);
  color: var(--teal);
  margin: 0;
  letter-spacing: -0.4px;
  line-height: 1.25;
}
.section-head::after {
  content: "❖";
  display: block;
  color: var(--gold);
  font-size: 14px;
  margin-top: 18px;
  letter-spacing: 16px;
  padding-left: 16px;
}

/* ---------- features ---------- */
.features { margin-bottom: 96px; }

.feature {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 36px;
  padding: 48px 0;
  border-top: 1px solid var(--hairline);
  align-items: start;
}
.feature:last-child { border-bottom: 1px solid var(--hairline); }

.feature-num {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 64px;
  color: var(--gold);
  line-height: 0.9;
  letter-spacing: -3px;
  text-align: left;
  position: relative;
}
.feature-num::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--teal);
  margin-top: 14px;
}

.feature h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 700;
  color: var(--teal);
  margin: 0 0 18px;
  line-height: 1.32;
  letter-spacing: -0.3px;
}
.feature-body > p {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text);
  margin: 0 0 16px;
  max-width: 38em;
}

@media (max-width: 720px) {
  .feature { grid-template-columns: 1fr; gap: 16px; padding: 36px 0; }
  .feature-num { font-size: 44px; }
  .feature-num::after { display: none; }
}

/* ---------- use cases ---------- */
.use-cases-disclaimer {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-3);
  font-style: normal;
}

.use-cases {
  margin-top: 28px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 720px) { .use-cases { grid-template-columns: 1fr; } }

.use-case {
  margin: 0;
  padding: 20px 22px 18px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold);
  border-radius: 2px 12px 12px 2px;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text);
}
.use-case p { margin: 0 0 10px; }
.use-case p:last-child { margin-bottom: 0; }
.use-case-tag {
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  margin: 0 0 8px;
}

/* ---------- other features ---------- */
.other-features {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 40px clamp(24px, 4vw, 44px);
  margin-bottom: 72px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 1px 2px rgba(15, 76, 92, 0.04);
}
.other-features h2 {
  font-family: var(--serif);
  color: var(--teal);
  font-size: 24px;
  margin: 0 0 22px;
}
.other-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px 28px;
  grid-template-columns: 1fr 1fr;
}
.other-list li {
  position: relative;
  padding-left: 26px;
  font-size: 15.5px;
  color: var(--text);
  line-height: 1.65;
}
.other-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-size: 14px;
  line-height: 1.65;
}
@media (max-width: 720px) { .other-list { grid-template-columns: 1fr; } }

/* ---------- latest articles (links into the article station) ---------- */
.latest-articles { margin-bottom: 72px; }
.latest-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  border-top: 1px solid var(--hairline);
}
.latest-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.latest-list li a {
  font-family: var(--serif);
  color: var(--teal);
  font-size: 17px;
  text-decoration: none;
  line-height: 1.5;
}
.latest-list li a:hover { text-decoration: underline; }
.latest-meta { font-size: 13px; color: var(--text-2); }
.latest-all { margin: 0; }
.latest-all a { color: var(--gold-deep); font-weight: 600; text-decoration: none; }
.latest-all a:hover { text-decoration: underline; }

/* ---------- download band ---------- */
.download {
  text-align: center;
  background: linear-gradient(160deg, var(--teal) 0%, var(--teal-700) 60%, var(--teal-900) 100%);
  color: var(--cream);
  padding: 64px 32px 56px;
  border-radius: 24px;
  margin-bottom: 64px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 60px -28px rgba(15, 76, 92, 0.55);
}
.download::before {
  content: "Q";
  position: absolute;
  font-family: var(--serif);
  font-weight: 900;
  color: rgba(232, 196, 100, 0.07);
  font-size: 360px;
  top: -100px;
  right: -60px;
  line-height: 1;
  pointer-events: none;
}
.download::after {
  content: "❖";
  position: absolute;
  color: rgba(232, 196, 100, 0.15);
  font-size: 18px;
  top: 24px;
  left: 32px;
}
.download h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 36px);
  margin: 0 0 14px;
  color: var(--cream);
  position: relative;
}
.download-lede {
  color: rgba(250, 248, 243, 0.78);
  margin: 0 auto 32px;
  font-size: 17px;
  max-width: 32em;
  position: relative;
}
.download .app-cta {
  background: var(--gold);
  color: var(--teal-900);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 0 var(--gold-deep),
    0 14px 32px -14px rgba(0, 0, 0, 0.45);
}
.download .app-cta:hover {
  background: #f0d27a;
  color: var(--teal-900);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 0 var(--gold-deep),
    0 18px 36px -14px rgba(0, 0, 0, 0.55);
}

/* ---------- disclaimer ---------- */
.disclaimer-section {
  padding: 32px 4px 0;
  border-top: 1px dashed var(--hairline-strong);
}
.disclaimer-section h2 {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--text-2);
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.disclaimer-section p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 8px;
}

/* ---------- entrance motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .hero .hero-eyebrow,
  .hero .lede,
  .hero .hero-actions,
  .hero-mock,
  .stats,
  .section-head,
  .feature {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero .hero-eyebrow { animation-delay: 0.02s; }
  .hero h1            { animation-delay: 0.08s; }
  .hero .lede         { animation-delay: 0.18s; }
  .hero .hero-actions { animation-delay: 0.26s; }
  .hero-mock          { animation-delay: 0.32s; }
  .stats              { animation-delay: 0.40s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- responsive polish ---------- */
@media (max-width: 600px) {
  body { font-size: 16.5px; }
  body.landing main { padding: 32px 18px 56px; }
  header.site { padding: 12px 18px; }
  .brand-mark { font-size: 20px; }
  .brand-glyph { width: 30px; height: 30px; font-size: 17px; }
  .site-nav { gap: 14px; font-size: 13.5px; }
  .site-nav .nav-cta { padding: 6px 12px; }
  .hero h1 { font-size: 36px; }
  .download { padding: 48px 22px 44px; border-radius: 18px; }
  .other-features { padding: 28px 22px; }
}

/* ---------- print (legal pages get saved / printed) ---------- */
@media print {
  body { background: #fff; background-image: none; color: #000; }
  body::before { display: none; }
  header.site {
    position: static;
    background: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  footer { background: none; border: none; }
  .download { background: none; color: #000; box-shadow: none; }
  .download h2, .download .download-lede { color: #000; }
  .download .app-cta { background: none; color: #000; box-shadow: none; }
  a { color: #000; text-decoration: underline; }
}
