/* ===== 先查車 — foundation (direction-agnostic premium layer) ===== */
:root {
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-6: 24px;  --space-8: 32px;  --space-12: 48px; --space-16: 64px;
  --space-24: 96px; --space-32: 128px;
  --section-y: clamp(64px, 10vw, 128px);
  --section-sm: clamp(48px, 7vw, 96px);
  --container: 1120px;
  --page-pad: clamp(20px, 5vw, 64px);
  --measure: 68ch;
  --radius-xs: 6px;   --radius-sm: 8px;   --radius-md: 12px;
  --radius-lg: 16px;  --radius-pill: 999px;
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 280ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out-soft: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-inout: cubic-bezier(0.645, 0.045, 0.355, 1);
  --focus-w: 2px; --focus-offset: 2px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-weight: 600; line-height: 1.15; cursor: pointer; border: 1px solid transparent;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
@media (hover: hover) and (pointer: fine) {
  .card--interactive { transition: transform var(--dur-base) var(--ease-out),
                                   border-color var(--dur-base) var(--ease-out),
                                   box-shadow var(--dur-base) var(--ease-out); }
  .card--interactive:hover { transform: translateY(-2px); }
}
:focus-visible { outline: var(--focus-w) solid var(--focus, currentColor); outline-offset: var(--focus-offset); }
:focus:not(:focus-visible) { outline: none; }
.btn, a[role="button"], [data-touch] { touch-action: manipulation; min-height: 44px; }
input, textarea, select { font-size: 16px; }

.reveal { opacity: 0; transform: translateY(12px);
          transition: opacity var(--dur-slow) var(--ease-out),
                      transform var(--dur-slow) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
@media (scripting: none) { .reveal { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms; animation-iteration-count: 1;
    transition-duration: 0.01ms; scroll-behavior: auto;
  }
  .reveal { transform: none; }
}

body { font-family: var(--font-body, system-ui, sans-serif);
       font-size: var(--fs-body, 1rem); line-height: 1.75; letter-spacing: 0; }
.display { font-family: var(--font-display, var(--font-body));
           font-size: var(--fs-display); font-weight: 700;
           line-height: 1.16; letter-spacing: -0.01em;
           text-wrap: balance; max-width: 16ch; }
.nowrap { white-space: nowrap; }
@media (max-width: 1180px) and (min-width: 901px) {
  :root { --fs-display: clamp(2.5rem, 1rem + 5.6vw, 4.5rem); }
}
.h1 { font-family: var(--font-display, var(--font-body));
      font-size: var(--fs-h1); font-weight: 700;
      line-height: 1.18; letter-spacing: -0.008em; text-wrap: balance; }
.h2 { font-family: var(--font-display, var(--font-body));
      font-size: var(--fs-h2); font-weight: 700;
      line-height: 1.22; letter-spacing: -0.006em; text-wrap: balance; }
.h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; letter-spacing: -0.004em; }
.lead { font-size: var(--fs-lead); font-weight: 400; line-height: 1.65; max-width: 34ch; }
.body { font-size: var(--fs-body); font-weight: 400; line-height: 1.75; max-width: var(--measure); text-wrap: pretty; }
.ui { font-weight: 500; }
.eyebrow { font-size: var(--fs-caption, 0.8125rem); font-weight: 500;
           letter-spacing: 0.12em; text-transform: uppercase; }
.tabular { font-variant-numeric: tabular-nums; }

/* ===== DIRECTION: Broadsheet — 編輯報告紙感（查核報告的 register） ===== */
:root {
  --bg:        #f7f4ed;
  --surface:   #fdfbf6;
  --border:    #e4e1d8;
  --muted:     #57554f;
  --text:      #2b2926;
  --ink:       #1c1c1c;
  --primary:   #1c1c1c;
  --on-primary:#fcfbf8;
  --accent:    #9a3b28;
  --accent-soft: rgba(154,59,40,0.10);
  --ok:        #2e6b3f;
  --ok-soft:   rgba(46,107,63,0.10);
  --grad-hero:  radial-gradient(700px circle at 20% 0%, rgba(154,59,40,0.06), transparent 60%);
  --shadow-1:   0 1px 2px rgba(28,28,28,0.05);
  --shadow-2:   0 4px 14px rgba(28,28,28,0.08);
  --radius-card: 12px;
  --sep-shadow: none; --sep-border: 1px solid var(--border);

  --font-display: "Fraunces", "Noto Serif TC", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", "Noto Sans TC", ui-sans-serif, system-ui, sans-serif;

  --fs-caption: 0.875rem;
  --fs-small:   0.9375rem;
  --fs-body:    1.125rem;
  --fs-lead:    1.375rem;
  --fs-h4:      1.375rem;
  --fs-h3:      1.625rem;
  --fs-h2:      clamp(2rem, 1.3rem + 3.4vw, 3rem);
  --fs-h1:      clamp(2.5rem, 1.4rem + 5.4vw, 4.25rem);
  --fs-display: clamp(2.75rem, 1.2rem + 7.6vw, 5.5rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #17150f;
    --surface:   #201d16;
    --border:    rgba(255,250,235,0.12);
    --muted:     #a8a196;
    --text:      #ece7dc;
    --ink:       #faf6ec;
    --primary:   #f7f4ed;  --on-primary:#1c1c1c;
    --accent:    #e0895f;
    --accent-soft: rgba(224,137,95,0.14);
    --ok:        #7fbf92;
    --ok-soft:   rgba(127,191,146,0.14);
    --shadow-1:  0 1px 2px rgba(0,0,0,0.4);
    --shadow-2:  0 6px 20px rgba(0,0,0,0.45);
  }
}

/* ===== shared components ===== */
body { background: var(--bg); color: var(--text); }
.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--page-pad); }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
h1, h2, h3, p, figure, blockquote { margin: 0; }
.hero .eyebrow { margin-bottom: var(--space-4); }
.hero .lead { margin-top: var(--space-6); }
h3 + .body { margin-top: var(--space-2); }

.nav { display:flex; align-items:center; justify-content:space-between;
       height:64px; border-bottom:1px solid var(--border); }
.nav .brand { font-weight:700; letter-spacing:-0.01em; font-size:1.125rem;
              font-family: var(--font-display); display:flex; align-items:center; gap:var(--space-2); }
.nav .brand svg { width:22px; height:22px; color:var(--accent); }
.nav .links { display:flex; gap:var(--space-8); align-items:center; }
.nav .links a { font-size:var(--fs-small); }
.nav .links a:not(.btn) { color:var(--muted); }
@media (hover:hover){ .nav .links a:not(.btn):hover { color:var(--text); } }
@media (max-width: 720px){ .nav .links a:not(.btn){ display:none; } }

.btn-primary { background:var(--primary,#111); color:var(--on-primary,#fff); }
@media (hover:hover){ .btn-primary:hover { filter:brightness(1.08); } }
.btn-quiet { color:var(--muted); }
@media (hover:hover){ .btn-quiet:hover { color:var(--text); } }
.actions { display:flex; align-items:center; gap:var(--space-6); flex-wrap:wrap; }

.lead-index { list-style:none; margin:0; padding:0; }
.lead-index li { display:flex; align-items:center; gap:var(--space-3);
                 padding:var(--space-3) 0; border-bottom:1px solid var(--border);
                 font-size:var(--fs-small); color:var(--muted); }
.lead-index li:first-child { padding-top:0; }
.lead-index li:last-child { border-bottom:0; }
.lead-index li::before { content:""; flex:none; width:14px; height:2px;
                         border-radius:2px; background:var(--accent); }

.proof { display:flex; gap:var(--space-8); flex-wrap:wrap;
         padding-block:var(--space-12); border-top:1px solid var(--border);
         border-bottom:1px solid var(--border); }
.proof .stat { flex:1 1 180px; min-width:0; }
.proof .stat .n { font-size:var(--fs-h3); font-weight:600; font-family:var(--font-display); }
.proof .stat .l { font-size:var(--fs-small); color:var(--muted); }

.cta { text-align:left; padding-block:clamp(64px,10vw,140px); }
.cta .box { box-shadow: var(--sep-shadow, none);
            border: var(--sep-border, none);
            border-radius:var(--radius-card); background:var(--surface);
            padding:clamp(32px,5vw,64px); display:flex; align-items:center;
            justify-content:space-between; gap:var(--space-8); flex-wrap:wrap; }
.cta h2 { margin:0; }

footer { border-top:1px solid var(--border); padding-block:var(--space-8);
         color:var(--muted); font-size:var(--fs-small);
         display:flex; justify-content:space-between; flex-wrap:wrap; gap:var(--space-4); }

/* ===== page: hero ===== */
.hero { padding-block: var(--section-y); background: var(--grad-hero); }
.hero-grid { display:grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px,5vw,72px); align-items:center; }
@media (max-width: 900px){ .hero-grid { grid-template-columns: 1fr; } }
.hero .actions { margin-top: var(--space-8); }

/* 查核任務單 document panel（hero 範例與 #result 共用） */
.doc { background: var(--surface); border: 1px solid var(--border);
       border-radius: var(--radius-card); box-shadow: var(--shadow-2); overflow:hidden; }
.doc-head { display:flex; justify-content:space-between; align-items:baseline; gap:var(--space-4);
            padding: var(--space-6) var(--space-8); border-bottom: 2px solid var(--ink); flex-wrap:wrap; }
.doc-head .t { font-family: var(--font-display); font-weight:700; font-size: var(--fs-h4); color: var(--ink); }
.doc-head .m { font-size: var(--fs-caption); color: var(--muted); }
.doc-body { padding: var(--space-6) var(--space-8) var(--space-8); }
.doc-row { display:flex; gap: var(--space-3); align-items:flex-start;
           padding-block: var(--space-4); border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: 0; padding-bottom: 0; }
.doc-row svg { flex:none; width: 20px; height: 20px; margin-top: 2px; }
.doc-row .k { font-size: var(--fs-small); color: var(--muted); }
.doc-row .v { font-size: var(--fs-small); color: var(--text); font-weight: 500; }
.flag { color: var(--accent); }
.flag-pill { display:inline-flex; align-items:center; gap:6px; background: var(--accent-soft);
             color: var(--accent); border-radius: var(--radius-pill);
             padding: 2px 10px; font-size: var(--fs-caption); font-weight: 600; }
.ok-pill { display:inline-flex; align-items:center; gap:6px; background: var(--ok-soft);
           color: var(--ok); border-radius: var(--radius-pill);
           padding: 2px 10px; font-size: var(--fs-caption); font-weight: 600; }
.doc-note { font-size: var(--fs-caption); color: var(--muted); padding: var(--space-3) var(--space-8);
            border-top: 1px dashed var(--border); background: var(--bg); }

/* ===== page: tool ===== */
.section { padding-block: var(--section-y); }
.section-sm { padding-block: var(--section-sm); }
.section-head { max-width: 62ch; margin-bottom: var(--space-12); }
.section-head .eyebrow { color: var(--accent); margin-bottom: var(--space-3); display:block; }
.section-head p { margin-top: var(--space-4); }

.tool-card { background: var(--surface); border: 1px solid var(--border);
             border-radius: var(--radius-card); box-shadow: var(--shadow-1);
             padding: clamp(24px, 4vw, 48px); }
.form-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-6); }
@media (max-width: 720px){ .form-grid { grid-template-columns: 1fr; } }
.field { display:flex; flex-direction:column; gap: var(--space-2); min-width: 0; }
.field label { font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
.field .hint { font-size: var(--fs-caption); color: var(--muted); }
.field input, .field select {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.field input:focus, .field select:focus { border-color: var(--ink); outline: none; }
.field-row { display:flex; gap: var(--space-3); min-width:0; }
.field-row > * { flex:1; min-width:0; }
.tool-actions { margin-top: var(--space-8); display:flex; gap: var(--space-6); align-items:center; flex-wrap:wrap; }
.form-err { color: var(--accent); font-size: var(--fs-small); font-weight:500; display:none; }
.form-err.show { display:block; }
.privacy-line { display:flex; align-items:center; gap: var(--space-2);
                font-size: var(--fs-caption); color: var(--muted); margin-top: var(--space-6); }
.privacy-line svg { width:16px; height:16px; flex:none; color: var(--ok); }

/* 任務單 steps */
#result { margin-top: var(--space-12); }
.step { display:grid; grid-template-columns: 44px 1fr; gap: var(--space-4);
        padding-block: var(--space-8); border-bottom: 1px solid var(--border); }
.step:last-of-type { border-bottom: 0; }
.step-check { padding-top: 2px; }
.step-check input[type=checkbox]{ width: 22px; height: 22px; accent-color: var(--accent); cursor:pointer; }
.step h3 { display:flex; align-items:center; gap: var(--space-3); flex-wrap:wrap; }
.step .why { margin-top: var(--space-2); }
.step .how { margin-top: var(--space-3); padding: var(--space-4);
             background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border);
             font-size: var(--fs-small); }
.step .how b { color: var(--ink); }
.step .how a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.step .redflag { margin-top: var(--space-3); display:flex; gap: var(--space-2); align-items:flex-start;
                 font-size: var(--fs-small); color: var(--accent); font-weight: 500; }
.step .redflag svg { flex:none; width: 18px; height: 18px; margin-top: 2px; }
.result-actions { display:flex; gap: var(--space-4); margin-top: var(--space-8); flex-wrap:wrap; }

/* ===== page: traps ===== */
.traps-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-6); }
@media (max-width: 860px){ .traps-grid { grid-template-columns: 1fr; } }
.trap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
        padding: var(--space-8); box-shadow: var(--shadow-1); }
.trap svg { width: 24px; height: 24px; color: var(--accent); margin-bottom: var(--space-4); }
.trap h3 { font-size: var(--fs-h4); }
.trap p { margin-top: var(--space-3); font-size: var(--fs-small); color: var(--muted); line-height: 1.75; }
.trap p b { color: var(--text); }

/* ===== waitlist ===== */
.wl-form { display:flex; gap: var(--space-3); flex-wrap:wrap; min-width: 0; }
.wl-form input[type=email] { flex: 1 1 240px; min-width: 0; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.wl-form input[type=email]:focus { border-color: var(--ink); outline:none; }
.wl-msg { font-size: var(--fs-small); margin-top: var(--space-3); display:none; }
.wl-msg.ok { color: var(--ok); display:block; }
.wl-msg.err { color: var(--accent); display:block; }
.hp { position:absolute; left:-9999px; width:1px; height:1px; opacity:0; }

/* ===== print：只印任務單 ===== */
@media print {
  body * { visibility: hidden; }
  #result, #result * { visibility: visible; }
  #result { position: absolute; left: 0; top: 0; width: 100%; margin: 0; }
  .result-actions, .step-check input { display: none !important; }
  .doc { box-shadow: none; }
}
