/* rewrite.tw — 假想社塗鴉貼紙風（2026-11-19 重寫）。
   暖色紙底、粗墨線、圓角貼紙卡片、各公司代表色當亮點、圓體大字。字級下限 14px。
   色票與每一組文字／底色的對比在 tools/contrast_tokens.py，改顏色先改那裡並跑一次。 */
:root {
  --paper: #fff6e3; --card: #fffdf7; --tint: #fbe9c6; --ink: #1f1611; --muted: #54463a; --line: #e2cfa9;
  --plate: #fff1d2; --plate-ink: #2a1a14; --plate-muted: #5a4a3a;
  --hl: #ffd95a; --grid: rgba(120, 84, 40, .09);
  --rw: #e0453a; --du: #5a5d73; --co: #f08a2a; --ch: #3b7bea; --st: #3aa04a; --gr: #8a4bd8; --sh: #ff5fae;
  --t: var(--rw); --t-soft: #ffd9d2; --t-deep: #a8231b;
  --round: "Chiron GoRound TC", "jf-openhuninn-2.0", "Huninn", "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --bw: 2.5px; --wrap: 1160px;
  color-scheme: light;
}
[data-team="RW"], [data-team="NEO"] { --t: var(--rw); --t-soft: #ffd9d2; --t-deep: #a8231b; }
[data-team="DU"] { --t: var(--du); --t-soft: #dedfe8; --t-deep: #3c3e52; }
[data-team="CO"] { --t: var(--co); --t-soft: #ffe0b8; --t-deep: #8f4400; }
[data-team="CH"] { --t: var(--ch); --t-soft: #d5e4ff; --t-deep: #1c4ba8; }
[data-team="ST"] { --t: var(--st); --t-soft: #d3efd3; --t-deep: #1e6b2b; }
[data-team="GR"] { --t: var(--gr); --t-soft: #e6d8fa; --t-deep: #5e2ba6; }
[data-team="SH"] { --t: var(--sh); --t-soft: #ffd9ea; --t-deep: #a51a60; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1510; --card: #261d16; --tint: #33271c; --ink: #fff3dc; --muted: #d2c2a6; --line: #4a3b2d;
    --plate: #f4e7cb; --hl: #6b5200; --grid: rgba(255, 243, 220, .05);
    --t-soft: #5a211c; --t-deep: #ff9c92;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) :is([data-team="RW"], [data-team="NEO"]) { --t-soft: #5a211c; --t-deep: #ff9c92; }
  :root:not([data-theme="light"]) [data-team="DU"] { --t-soft: #34364a; --t-deep: #c3c5da; }
  :root:not([data-theme="light"]) [data-team="CO"] { --t-soft: #5c3408; --t-deep: #ffb866; }
  :root:not([data-theme="light"]) [data-team="CH"] { --t-soft: #1d3566; --t-deep: #9cc0ff; }
  :root:not([data-theme="light"]) [data-team="ST"] { --t-soft: #1d4424; --t-deep: #8edb98; }
  :root:not([data-theme="light"]) [data-team="GR"] { --t-soft: #3c2466; --t-deep: #c9a6ff; }
  :root:not([data-theme="light"]) [data-team="SH"] { --t-soft: #5e1e40; --t-deep: #ff9ccb; }
}
:root[data-theme="dark"] {
  --paper: #1b1510; --card: #261d16; --tint: #33271c; --ink: #fff3dc; --muted: #d2c2a6; --line: #4a3b2d;
  --plate: #f4e7cb; --hl: #6b5200; --grid: rgba(255, 243, 220, .05);
  --t-soft: #5a211c; --t-deep: #ff9c92;
  color-scheme: dark;
}
:root[data-theme="dark"] :is([data-team="RW"], [data-team="NEO"]) { --t-soft: #5a211c; --t-deep: #ff9c92; }
:root[data-theme="dark"] [data-team="DU"] { --t-soft: #34364a; --t-deep: #c3c5da; }
:root[data-theme="dark"] [data-team="CO"] { --t-soft: #5c3408; --t-deep: #ffb866; }
:root[data-theme="dark"] [data-team="CH"] { --t-soft: #1d3566; --t-deep: #9cc0ff; }
:root[data-theme="dark"] [data-team="ST"] { --t-soft: #1d4424; --t-deep: #8edb98; }
:root[data-theme="dark"] [data-team="GR"] { --t-soft: #3c2466; --t-deep: #c9a6ff; }
:root[data-theme="dark"] [data-team="SH"] { --t-soft: #5e1e40; --t-deep: #ff9ccb; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background-color: var(--paper); color: var(--ink);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font: 500 17px/1.75 var(--sans); font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .22em; text-decoration-color: var(--t); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, h4, .round { font-family: var(--round); font-weight: 900; letter-spacing: .02em; line-height: 1.25; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; z-index: 10; font-weight: 800; }
.skip:focus { left: 16px; }
/* 貼紙標籤 */
.kicker { display: inline-block; font-family: var(--round); font-weight: 700; font-size: 15px; line-height: 1.5; padding: 2px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--t-soft); color: var(--ink); transform: rotate(-1.5deg); }
.kicker a { text-decoration: none; }

/* ── 頁首 ── */
.mast { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 18px; padding-bottom: 14px; }
.mast-title { font-family: var(--round); font-weight: 900; font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: .01em; line-height: 1; text-decoration: none; padding: 8px 16px 10px; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--rw); transform: rotate(-1.2deg); }
.mast-title .dot { color: var(--t-deep); }
.mast-sub { font-family: var(--round); font-weight: 700; font-size: 15px; color: var(--muted); }
.mast-nav { margin-left: auto; }
.mast-nav ul { display: flex; flex-wrap: wrap; gap: 8px; }
.mast-nav a { display: block; padding: 7px 16px; min-height: 40px; border: 2px solid transparent; border-radius: 999px; text-decoration: none; font-family: var(--round); font-weight: 700; font-size: 17px; }
.mast-nav a:hover { background: var(--tint); }
.mast-nav a[aria-current="page"] { background: var(--card); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.theme-btn { font: 700 15px/1 var(--round); color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 0 14px; min-height: 40px; cursor: pointer; }
.theme-btn:hover { background: var(--tint); }

/* ── 按鈕 ── */
.btn { display: inline-flex; align-items: center; gap: .5em; min-height: 50px; padding: 0 24px; border-radius: 999px; border: var(--bw) solid var(--ink); background: var(--card); color: var(--ink); text-decoration: none; font-family: var(--round); font-weight: 900; font-size: 17px; box-shadow: 0 5px 0 var(--ink); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); box-shadow: 0 5px 0 var(--t); }
.btn.primary:hover { box-shadow: 0 7px 0 var(--t); }
.btn.primary:active { box-shadow: 0 1px 0 var(--t); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }

/* ── 開場 ── */
.lead { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 60px); align-items: end; padding: clamp(30px, 6vw, 64px) 0 clamp(30px, 5vw, 52px); }
.lead h1 { font-size: clamp(2.5rem, 7.2vw, 5.4rem); line-height: 1.18; margin-top: 16px; }
.lead h1 span { display: block; width: fit-content; }
.lead h1 span:last-child { background: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 92%, transparent 92%); padding: 0 .08em; }
.lead-side p { font-size: 19px; line-height: 1.8; }

/* ── 區塊標題 ── */
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-top: 26px; padding-top: 26px; border-top: var(--bw) dashed var(--ink); }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }

/* ── 辦公室：選一間公司 ── */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tab { font: inherit; color: var(--ink); background: var(--card); border: var(--bw) solid var(--ink); border-radius: 16px; padding: 8px 16px 9px; min-height: 58px; cursor: pointer; text-align: left; transition: transform .12s, box-shadow .12s; }
.tab small { display: block; font-size: 14px; color: var(--muted); line-height: 1.3; }
.tab b { display: flex; align-items: center; gap: 8px; font-family: var(--round); font-weight: 900; font-size: 19px; white-space: nowrap; }
.tab b::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--t); border: 2px solid var(--ink); flex: none; }
.tab:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--ink); }
.tab[aria-selected="true"] { background: var(--t-soft); transform: translateY(-3px); box-shadow: 0 6px 0 var(--ink); }

.desk { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(22px, 3.5vw, 44px); padding: 28px 0 34px; }
.desks.is-tabbed .desk[hidden] { display: none; }
.desks:not(.is-tabbed) .desk + .desk { border-top: var(--bw) dashed var(--ink); padding-top: 34px; }
.plate { background-color: var(--plate); border: var(--bw) solid var(--ink); border-radius: 24px; overflow: hidden; color: var(--plate-ink); box-shadow: 7px 7px 0 var(--t); }
.stage { position: relative; aspect-ratio: 1000 / 320; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage .hit { position: absolute; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 16px; }
.stage .hit:focus-visible { outline: 3px solid var(--plate-ink); outline-offset: -4px; }
.cast-fallback { display: flex; justify-content: center; align-items: flex-end; height: 100%; padding: 0 2%; }
.cast-fallback li { flex: 0 1 19%; min-width: 0; }
.cast-fallback img { width: 100%; }
.cast-fallback span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.stage.is-live .cast-fallback { display: none; }
.caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; border-top: 2px dashed var(--plate-ink); padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--plate-muted); }
/* 對話框：真的有尾巴 */
.bubble { position: relative; min-height: 5.4em; margin-top: 22px; padding: 14px 20px 16px; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 22px; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: baseline; }
.bubble::before { content: ""; position: absolute; left: 46px; top: -15px; width: 24px; height: 24px; background: var(--card); border-left: var(--bw) solid var(--ink); border-top: var(--bw) solid var(--ink); transform: rotate(45deg); border-top-left-radius: 5px; }
.bubble .who { font-family: var(--round); font-weight: 900; font-size: 20px; background: linear-gradient(transparent 55%, var(--t-soft) 55%); padding: 0 .15em; white-space: nowrap; }
.bubble .role { font-size: 15px; color: var(--muted); }
.bubble .says { grid-column: 1 / -1; font-family: var(--round); font-weight: 700; font-size: clamp(20px, 2.3vw, 25px); line-height: 1.5; }
.bubble .hint { grid-column: 1 / -1; align-self: center; font-family: var(--round); font-weight: 700; font-size: 19px; color: var(--muted); }
.desk-info .name { font-size: clamp(2.1rem, 4vw, 3rem); margin-top: 10px; }
.desk-info .domain { display: inline-block; margin-top: 8px; font-family: var(--round); font-weight: 700; font-size: 16px; color: var(--t-deep); }
.desk-info .blurb { margin-top: 12px; font-size: 18px; }
.desk-info .btn { margin-top: 20px; }
.desk-info h4 { font-size: 17px; margin: 28px 0 8px; color: var(--muted); }
.desk-works li + li { margin-top: 8px; }
.desk-works a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; transition: transform .12s, box-shadow .12s; }
.desk-works a:hover { background: var(--t-soft); transform: translateY(-2px); box-shadow: 0 4px 0 var(--ink); }
.desk-works b { font-family: var(--round); font-weight: 700; font-size: 17px; }
.desk-works small { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ── 作品清單 ── */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(22px, 3.5vw, 44px); padding: 22px 0 40px; }
.cols h3 { font-size: 1.35rem; margin-bottom: 14px; }
.work { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; padding: 16px 18px; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 20px; box-shadow: 5px 5px 0 var(--t); }
.work + .work { margin-top: 16px; }
.work .no { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--t-soft); border: 2px solid var(--ink); font-family: var(--round); font-weight: 900; font-size: 16px; }
.work h4 { font-size: 1.35rem; line-height: 1.35; }
.work h4 a { text-decoration: none; }
.work h4 a:hover { text-decoration: underline; }
.work .meta { font-size: 14px; color: var(--muted); }
.work .text { margin-top: 6px; font-size: 16.5px; }
.work .more { margin-top: 6px; font-size: 16px; font-weight: 700; }
.guide { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.3; text-decoration: none; }
.guide:hover .avatar { transform: rotate(-6deg) scale(1.06); }
.avatar { display: block; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--plate); border: var(--bw) solid var(--ink); position: relative; flex: none; transition: transform .15s; }
.avatar img { position: absolute; width: 210%; max-width: none; left: -55%; top: -48%; }

/* ── 設計案例 ── */
.cases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 26px); padding: 22px 0 48px; }
.case-card { display: flex; flex-direction: column; align-items: flex-start; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 22px; padding: 14px 14px 18px; box-shadow: 5px 5px 0 var(--t); transition: transform .15s; }
.case-card:hover { transform: translateY(-4px) rotate(-.6deg); }
.shot { display: block; width: 100%; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--tint); }
.shot img { width: 100%; }
.case-card .kicker { margin-top: 14px; font-size: 14px; }
.case-card h3 { font-size: 1.3rem; margin-top: 10px; }
.case-card h3 a { text-decoration: none; }
.case-card h3 a:hover { text-decoration: underline; }
.case-card .text { font-size: 16px; margin-top: 8px; }
.case-card .more { font-size: 15px; margin-top: 10px; }

/* ── 內頁 ── */
.page-head { padding: clamp(28px, 5vw, 56px) 0 24px; }
.page-head h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); margin-top: 14px; }
.page-head .deck { font-size: 19px; margin-top: 16px; max-width: 42em; }
.notice { background: var(--tint); border: 2px solid var(--ink); border-radius: 16px; padding: 12px 18px; font-size: 16px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; grid-column: 1 / -1; }
.roster > div { padding: 14px 16px; background: var(--card); border: 2px solid var(--ink); border-radius: 16px; scroll-margin-top: 20px; }
.roster > div:target { background: var(--t-soft); box-shadow: 0 5px 0 var(--ink); }
.roster dt { font-family: var(--round); font-weight: 900; font-size: 19px; }
.roster dt small { font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--t-deep); margin-left: .5em; }
.roster dd { font-size: 16px; }
.roster dd.role { color: var(--muted); font-size: 15px; }
.prose { max-width: 42em; padding-bottom: 48px; font-size: 18px; }
.prose h2 { font-size: 1.6rem; margin: 44px 0 12px; width: fit-content; background: linear-gradient(transparent 58%, var(--t-soft) 58%); padding: 0 .12em; }
.prose h3 { font-size: 1.2rem; margin: 22px 0 4px; }
.prose p + p { margin-top: 14px; }
.prose ol.steps { counter-reset: s; }
.prose ol.steps li { counter-increment: s; padding: 12px 0 12px 3.2em; position: relative; }
.prose ol.steps li + li { border-top: 2px dashed var(--line); }
.prose ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 12px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--t-soft); border: 2px solid var(--ink); font-family: var(--round); font-weight: 900; }
.prose ul.src li { padding: 10px 0; }
.prose ul.src li + li { border-top: 2px dashed var(--line); }
.prose ul.src small { display: block; color: var(--muted); font-size: 15px; }
.prose figure { margin: 26px 0; }
.prose figcaption { font-size: 15px; color: var(--muted); margin-top: 10px; }
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: clamp(24px, 5vw, 60px); align-items: start; }
.aside { position: sticky; top: 20px; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 22px; padding: 18px; box-shadow: 6px 6px 0 var(--t); font-size: 16px; }
.aside .avatar { width: 92px; height: 92px; }
.aside .q { font-family: var(--round); font-weight: 700; font-size: 20px; line-height: 1.55; margin-top: 10px; }
.aside .btn { margin-top: 18px; }

/* ── 頁尾 ── */
.foot { margin-top: 26px; border-top: var(--bw) dashed var(--ink); padding-top: 24px; padding-bottom: 48px; font-size: 16px; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; }
.foot p + p { margin-top: 6px; }
.foot nav ul { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: flex-end; }
.foot nav a { display: inline-block; padding: 6px 0; font-weight: 700; }

@media (max-width: 1100px) { .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .lead, .desk, .cols, .foot-grid, .case-layout { grid-template-columns: minmax(0, 1fr); }
  .mast-nav { margin-left: 0; width: 100%; }
  .stage { aspect-ratio: 1000 / 510; }
  .foot nav ul { justify-content: flex-start; }
  .aside { position: static; }
}
@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 16px; }
  .cases { grid-template-columns: minmax(0, 1fr); }
  .work { grid-template-columns: minmax(0, 1fr) auto; }
  .work .no { display: none; }
  .tab { padding: 7px 12px 8px; }
  .tab b { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
