/* V3 Safety Signal — Chuan Works Tools (adapted from the chuanworks.com V3 prototype) */
:root {
  --concrete: #f2f2ef;
  --concrete-2: #e7e7e2;
  --paper: #fbfbf9;
  --ink: #111110;
  --ink-2: #3d3d39;
  --line: #c9c9c2;
  --yellow: #facc15;
  --yellow-deep: #eab308;
  --signal-red: #b91c1c;
  --cond: "Helvetica Neue", "Arial Narrow", "Roboto Condensed", "Nimbus Sans Narrow", "Liberation Sans Narrow", Arial, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --cjk: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 16px;
  --max: 1240px;
  --hazard: repeating-linear-gradient(-45deg, var(--yellow) 0 18px, var(--ink) 18px 36px);
  color-scheme: light;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--concrete);
  color: var(--ink);
  font: 400 16px/1.6 var(--body);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
body:lang(zh) { font-family: var(--cjk); line-height: 1.8; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--yellow-deep); }
a:hover { background: var(--yellow); text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--yellow); }
h1, h2, h3 { font-family: var(--cond); font-stretch: condensed; line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-2); }

/* ---------- Hazard stripes ---------- */
.stripe { background: var(--hazard); background-size: 50.91px 50.91px; animation: hazard-sweep 6s linear infinite; }
.stripe--thin { height: 8px; }
.stripe--div { height: 18px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
@keyframes hazard-sweep { to { background-position: 50.91px 0; } }

/* ---------- Header ---------- */
.site-head { background: var(--concrete); border-bottom: 2px solid var(--ink); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; min-height: 64px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.logo { display: inline-flex; align-items: stretch; font-family: var(--cond); font-stretch: condensed; font-weight: 900; font-size: 24px; text-transform: uppercase; letter-spacing: 0.02em; text-decoration: none; border: 2px solid var(--ink); line-height: 1; }
.logo:hover { background: none; }
.logo-a { background: var(--ink); color: var(--concrete); padding: 7px 8px 6px; }
.logo-b { background: var(--yellow); color: var(--ink); padding: 7px 8px 6px; }
.logo-c { display: inline-flex; align-items: center; background: var(--paper); color: var(--ink); border-left: 2px solid var(--ink); font: 700 12px/1 var(--mono); letter-spacing: .1em; padding: 0 8px; }
.logo:hover .logo-c { background: var(--yellow); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; font-weight: 600; }
.nav a { text-decoration: none; padding: 6px 9px; }
.nav a:hover { background: var(--yellow); }
.nav .lang-switch { border: 2px solid var(--ink); padding: 4px 10px; font-weight: 700; }

/* ---------- Page head (hero) ---------- */
.hero { position: relative; padding: 44px 0 40px; border-bottom: 2px solid var(--ink); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(17,17,16,.06) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(17,17,16,.06) 39px 40px);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
          mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.hero .wrap { position: relative; }
@media (min-width: 980px) { .hero { padding: 72px 0 64px; } }
.sign-label { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: var(--paper); font: 700 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px; margin-bottom: 20px; }
.sign-label b { background: var(--yellow); color: var(--ink); padding: 1px 6px; }
.hero h1 { font-size: clamp(44px, 8vw, 96px); font-weight: 900; text-transform: uppercase; line-height: .94; letter-spacing: -0.015em; margin-bottom: 24px; overflow-wrap: anywhere; }
.rise { display: block; animation: rise-in .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise-in { from { transform: translateY(30%); } to { transform: none; } }
h1 small { display: table; margin-top: 16px; font: 800 15px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); padding: 6px 10px; }
.lead { font-size: clamp(17px, 2.1vw, 20px); line-height: 1.6; color: var(--ink-2); max-width: 46em; margin: 0; }
.lead b { color: var(--ink); background: var(--yellow); padding: 1px 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- CJK headings ---------- */
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, h1 small:lang(zh) {
  font-family: var(--cjk); font-stretch: normal; font-weight: 900; text-transform: none; letter-spacing: .02em; line-height: 1.7;
}
.hero h1:lang(zh) { font-size: clamp(36px, 6.4vw, 72px); line-height: 1.7; }
h1 small:lang(zh) { font-weight: 800; font-size: 16px; line-height: 1.7; padding: 2px 10px; }
h1 small:lang(en) { font-family: var(--mono); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.3; }
:lang(zh) .lead { line-height: 1.9; }

/* ---------- Content ---------- */
.page { padding-top: 40px; padding-bottom: 64px; }
@media (min-width: 980px) { .page { padding-top: 56px; padding-bottom: 88px; } }

/* Tool cards as site signage */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.tool { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 2px solid var(--ink); color: var(--ink); text-decoration: none; padding: 0 0 22px; transition: transform .25s, box-shadow .25s; }
.tool:hover { background: var(--paper); transform: translate(-4px, -4px); box-shadow: 8px 8px 0 var(--ink); }
.tool-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--ink); padding: 10px 20px; margin-bottom: 20px; }
.tool-no { font: 700 13px/1 var(--mono); color: var(--paper); letter-spacing: .08em; }
.tool .tag { font: 700 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 6px 8px; background: var(--yellow); color: var(--ink); }
.tool h2 { font-size: 32px; font-weight: 900; text-transform: uppercase; padding: 0 20px; margin-bottom: 12px; }
.tool h2:lang(zh) { font-size: 26px; }
.tool p { padding: 0 20px; margin: 0 0 20px; color: var(--ink-2); }
.tool-go { align-self: flex-start; margin: auto 20px 0; width: 44px; height: 32px; background: var(--ink); position: relative; transition: transform .25s; }
.tool-go::after { content: ""; position: absolute; inset: 8px 12px; background: var(--yellow); clip-path: polygon(0 30%, 55% 30%, 55% 0, 100% 50%, 55% 100%, 55% 70%, 0 70%); }
.tool:hover .tool-go { transform: translateX(6px); }

/* ---------- 404 ---------- */
.nf-code { display: inline-block; font: 900 clamp(88px, 18vw, 160px)/.9 var(--cond); font-stretch: condensed; letter-spacing: -.02em; background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); padding: 8px 18px 4px; margin: 0 0 24px; box-shadow: 8px 8px 0 var(--ink); }
.nf-links { font-size: 17px; font-weight: 600; margin: 0; }

/* ---------- Footer ---------- */
.site-foot { background: var(--ink); color: #e6e6e0; font-size: 13.5px; padding: 28px 0 36px; line-height: 1.6; }
.site-foot a { color: #fbfbf9; text-decoration-color: var(--yellow); }
.site-foot a:hover { background: var(--yellow); color: var(--ink); }
.site-foot :focus-visible { outline-color: var(--yellow); box-shadow: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 標題與黃標籤之間留白（驗收回饋 2026-10-08） */
.hero h1 small { margin-top: 22px; }
