:root {
  color-scheme: dark;
  --night: #090d10;
  --night-2: #10161b;
  --night-3: #172027;
  --ice: #dce4e9;
  --mist: #9fb0bc;
  --muted: #748591;
  --mint: #6fe3c4;
  --sand: #c8a27a;
  --sand-soft: #a5896d;
  --line: rgba(220, 228, 233, .16);
  --line-strong: rgba(220, 228, 233, .28);
  --page: #eef1f3;
  --page-ink: #273640;
  --focus: #80b6ff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Noto Sans TC", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--night); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ice);
  background: #0b1014;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--mint); color: #07110e; }
a { color: inherit; text-underline-offset: .3em; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #07110e;
  background: var(--mint);
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

/* Header */
.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 clamp(22px, 5vw, 76px);
  border-bottom: 1px solid rgba(220, 228, 233, .13);
  background: rgba(9, 13, 16, .92);
  backdrop-filter: blur(18px) saturate(.8);
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ice);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  text-decoration: none;
}
.site-brand-mark {
  width: 22px;
  height: 22px;
  border: 1px solid var(--mint);
  transform: rotate(45deg);
}
.site-header nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 28px); }
.site-header nav a {
  color: var(--mist);
  font-size: 12px;
  letter-spacing: .08em;
  text-decoration: none;
}
.site-header nav a:hover { color: var(--ice); }
.site-header .nav-contact {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(111, 227, 196, .55);
  color: var(--mint);
}

/* Hero */
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
  gap: clamp(50px, 8vw, 120px);
  padding: clamp(64px, 9vw, 120px) clamp(22px, 5vw, 76px);
  background:
    radial-gradient(circle at 10% 10%, rgba(111, 227, 196, .06), transparent 27rem),
    linear-gradient(130deg, #0b1014, #10171c 58%, #0b1014);
}
.breadcrumb {
  margin-bottom: 30px;
  color: var(--sand);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
}
.breadcrumb a { color: var(--sand); text-decoration: none; }
.breadcrumb a:hover { color: var(--mint); }
.hero-answer h1 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 620;
  line-height: 1.1;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.hero-answer > p {
  max-width: 58ch;
  margin: 30px 0 0;
  color: var(--mist);
  font-size: 17px;
  line-height: 1.85;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 36px; }
.hero-actions a,
.page-close > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--mint);
  color: var(--ice);
  font-size: 13px;
  letter-spacing: .06em;
  text-decoration: none;
}
.hero-actions a.is-primary,
.page-close > a {
  color: #06110e;
  background: var(--mint);
}
.hero-actions a.is-secondary { border-color: transparent; border-bottom-color: rgba(220, 228, 233, .34); }

.decision-ledger { align-self: center; border-top: 1px solid rgba(220, 228, 233, .26); }
.decision-ledger > div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(220, 228, 233, .13);
}
.decision-ledger span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
}
.decision-ledger p { margin: 0; color: var(--ice); font-size: 13px; line-height: 1.7; }
.decision-ledger .boundary p { color: #c9b39d; }

/* Method */
.method-section {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: clamp(60px, 10vw, 150px);
  padding: clamp(76px, 11vw, 150px) clamp(22px, 5vw, 76px);
  background: #e8ecee;
  color: var(--page-ink);
}
.method-title h2 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(30px, 4.2vw, 54px);
  font-weight: 620;
  line-height: 1.14;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.method-title p {
  max-width: 52ch;
  margin: 24px 0 0;
  color: #5a6b78;
  font-size: 15px;
  line-height: 1.85;
}
.method-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(39,54,64,.25); }
.method-steps li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 26px;
  padding: 26px 0;
  border-bottom: 1px solid rgba(39,54,64,.18);
}
.method-steps span { color: #566671; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }
.method-steps strong { display: block; margin-bottom: 4px; font-size: 15px; font-weight: 590; line-height: 1.5; }
.method-steps p { margin: 0; color: #5a6b78; font-size: 13px; line-height: 1.65; }

/* Proof */
.proof-section {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, .88fr);
  background: #11181d;
}
.proof-media {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  margin: 0;
  background: #182126;
}
.proof-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent 55%, rgba(17,24,29,.78));
  pointer-events: none;
}
.proof-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; filter: saturate(.6) contrast(.94); }
.proof-copy { align-self: center; padding: clamp(48px, 7vw, 92px) clamp(22px, 5vw, 76px) clamp(48px, 7vw, 92px) clamp(36px, 6vw, 78px); }
.proof-copy h2 { max-width: 12ch; margin: 0; font-size: clamp(28px, 4vw, 48px); font-weight: 620; line-height: 1.16; letter-spacing: -.03em; text-wrap: balance; }
.proof-copy > p { max-width: 48ch; margin: 26px 0 0; color: var(--mist); font-size: 15px; line-height: 1.85; }
.proof-copy dl { margin: 32px 0 0; border-top: 1px solid var(--line); }
.proof-copy dl > div { display: grid; grid-template-columns: 88px 1fr; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.proof-copy dt { color: var(--sand); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }
.proof-copy dd { margin: 0; color: var(--ice); font-size: 12px; line-height: 1.6; }
.proof-copy .proof-link { display: inline-block; margin-top: 28px; color: var(--mint); font-size: 12px; letter-spacing: .06em; }

/* FAQ */
.faq-section {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(60px, 10vw, 160px);
  padding: clamp(76px, 11vw, 150px) clamp(22px, 5vw, 76px);
  background: #d8dee1;
  color: var(--page-ink);
}
.faq-section .method-title p { max-width: 52ch; }
.faq-list { border-top: 1px solid rgba(39,54,64,.28); }
.faq-list details { border-bottom: 1px solid rgba(39,54,64,.2); }
.faq-list summary {
  padding: 22px 34px 22px 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 570;
  line-height: 1.5;
}
.faq-list p { max-width: 60ch; margin: -4px 0 24px; color: #4a5d68; font-size: 14px; line-height: 1.75; }

/* Related links */
.related-links {
  padding: clamp(64px, 9vw, 110px) clamp(22px, 5vw, 76px);
  background: #0b1014;
  border-top: 1px solid var(--line);
}
.related-links h2 {
  margin: 0 0 30px;
  max-width: 16ch;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 590;
  letter-spacing: -.02em;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.related-grid a {
  display: block;
  padding: 22px 24px;
  background: #0b1014;
  color: var(--ice);
  text-decoration: none;
}
.related-grid a:hover { background: #10171c; }
.related-grid a small { display: block; margin-bottom: 8px; color: var(--sand); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }
.related-grid a span { font-size: 14px; line-height: 1.55; }

/* Close + footer */
.page-close {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 46px;
  padding: clamp(72px, 9vw, 120px) clamp(22px, 5vw, 76px);
  background: #10161b;
}
.page-close h2 { max-width: 15ch; margin: 0; font-size: clamp(26px, 3.6vw, 44px); font-weight: 620; line-height: 1.16; letter-spacing: -.03em; text-wrap: balance; }
.page-close p { max-width: 50ch; margin: 20px 0 0; color: var(--mist); font-size: 14px; line-height: 1.75; }
.page-close > a { flex: 0 0 auto; }

.page-meta {
  margin: 0;
  padding: 18px clamp(22px, 5vw, 76px);
  color: var(--muted);
  background: #0b1014;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  border-top: 1px solid var(--line);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(22px, 5vw, 76px) 34px;
  color: var(--muted);
  background: #0b1014;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--mint); }

/* Template variants */
body.template-case .page-hero { background: linear-gradient(115deg, #0b1014 0%, #142028 68%, #0b1014 100%); }
body.template-case .breadcrumb,
body.template-case .proof-copy dt { color: var(--mint); }
body.template-case .method-section { background: #dfe5e8; }

body.template-guide .page-hero { background: linear-gradient(126deg, #11181d 0%, #20282d 62%, #10161a 100%); }
body.template-guide .method-section { background: #e4ded7; }

@media (max-width: 900px) {
  .page-hero { grid-template-columns: 1fr; }
  .decision-ledger { max-width: 680px; }
  .method-section,
  .faq-section { grid-template-columns: 1fr; }
  .proof-section { grid-template-columns: 1fr; }
  .proof-media { min-height: 460px; max-height: 620px; }
  .proof-media::after { background: linear-gradient(0deg, rgba(17,24,29,.82), transparent 45%); }
}

@media (max-width: 680px) {
  .site-header { min-height: 62px; padding: 0 20px; }
  .site-header nav { gap: 0; }
  .site-header nav a:not(.nav-contact) { display: none; }
  .site-header .nav-contact { min-height: 36px; padding: 0 12px; }

  .page-hero { gap: 46px; padding: 56px 20px 64px; }
  .breadcrumb { margin-bottom: 22px; font-size: 9px; }
  .hero-answer h1 { font-size: 36px; max-width: 11ch; }
  .hero-answer > p { margin-top: 22px; font-size: 15px; }
  .hero-actions { display: grid; gap: 12px; }
  .hero-actions a { width: 100%; }
  .decision-ledger > div { grid-template-columns: 68px 1fr; gap: 12px; }

  .method-section,
  .faq-section { gap: 48px; padding: 64px 20px; }
  .method-title h2,
  .proof-copy h2,
  .page-close h2 { font-size: 32px; }
  .method-steps li { grid-template-columns: 56px 1fr; gap: 12px; padding-block: 20px; }
  .method-steps strong { font-size: 14px; }

  .proof-section { grid-template-columns: 1fr; }
  .proof-media { min-height: 320px; max-height: 380px; }
  .proof-media::after { background: linear-gradient(0deg, rgba(17,24,29,.82), transparent 50%); }
  .proof-copy { padding: 48px 20px 60px; }

  .faq-list summary { font-size: 14.5px; }

  .related-links { padding: 56px 20px; }
  .related-grid { grid-template-columns: 1fr; }

  .page-close { display: grid; padding: 64px 20px; gap: 22px; }
  .page-close > a { width: 100%; }

  .site-footer { display: grid; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
