/* Tokens come from the brand photo: cream paper, charcoal card, terracotta table */
:root {
  --paper: #f4efe7; --paper-2: #ebe4d8; --ink: #1d1b18; --muted: #7d766b; --line: #dcd3c4;
  --clay: #c2603a; --clay-ink: #fff8f2; --char: #2b2a28; --char-ink: #efe9df;
  --serif: "Noto Serif TC", "PMingLiU", serif; --latin: "Cormorant Garamond", Georgia, serif;
  --sans: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --maxw: 1160px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #181715; --paper-2: #22201d; --ink: #efe9df; --muted: #a39b8e; --line: #37332e;
    --clay: #dd7a52; --clay-ink: #1d1b18; --char: #0f0e0d; --char-ink: #efe9df; color-scheme: dark; }
}
:root[data-theme="dark"] { --paper: #181715; --paper-2: #22201d; --ink: #efe9df; --muted: #a39b8e; --line: #37332e;
  --clay: #dd7a52; --clay-ink: #1d1b18; --char: #0f0e0d; --char-ink: #efe9df; color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
[hidden] { display: none !important; }

/* Announcement bar */
.announce { background: var(--char); color: var(--char-ink); font-size: 13px; letter-spacing: .06em; }
.announce .wrap { display: flex; align-items: center; gap: 12px; min-height: 38px; }
.announce p { margin: 0; flex: 1; text-align: center; padding: 8px 0; }
.announce a { text-decoration: underline; text-underline-offset: 3px; }
.announce button { background: none; border: 0; color: inherit; opacity: .7; font-size: 18px; width: 32px; height: 32px; }

/* Header */
.head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.head .wrap { display: flex; align-items: center; min-height: 72px; gap: 34px; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand img { height: 34px; width: auto; }
.brand b { font-family: var(--serif); font-size: 22px; letter-spacing: .32em; font-weight: 700; }
.brand span { font-family: var(--latin); font-size: 13px; letter-spacing: .3em; color: var(--muted); display: block; margin-top: -4px; }
.nav { display: flex; gap: 26px; font-size: 14px; letter-spacing: .12em; }
.nav a { padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--ink); }
.tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid transparent; background: none; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--line); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { display: none; }
:root[data-theme="dark"] .brand img, :root[data-theme="dark"] .foot img { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img, :root:not([data-theme="light"]) .foot img { filter: invert(1); } }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 40; background: var(--paper); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.drawer a { font-family: var(--serif); font-size: 22px; letter-spacing: .14em; padding: 16px 4px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.drawer a small { font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: .08em; align-self: center; }
.drawer .close { align-self: flex-end; }

/* Carousel */
.hero { position: relative; overflow: hidden; background: var(--char); color: var(--char-ink); }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; }
.track::-webkit-scrollbar { display: none; }
.track { -webkit-user-select: none; user-select: none; }
.track img, .track svg { -webkit-user-drag: none; pointer-events: none; }
.track.dragging, .track.sliding { scroll-snap-type: none; }
.track.dragging { cursor: grabbing; }
.slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; min-height: min(72vh, 620px); display: grid; grid-template-columns: 1.05fr 1fr; position: relative; }
.slide .copy { display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 56px clamp(24px, 6vw, 88px); z-index: 1; }
.slide .eyebrow { font-family: var(--latin); font-style: italic; font-size: 20px; letter-spacing: .04em; opacity: .85; }
.slide h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 5.2vw, 64px); line-height: 1.2; letter-spacing: .12em; margin: 0; text-wrap: balance; }
.slide p { margin: 0; max-width: 30em; opacity: .85; font-size: 16px; }
.cta { align-self: flex-start; margin-top: 8px; padding: 13px 28px; border: 1px solid currentColor; letter-spacing: .2em; font-size: 14px; transition: background .2s, color .2s; }
.cta:hover { background: var(--char-ink); color: var(--char); }
.slide .art { position: relative; overflow: hidden; }
.slide .art img, .slide .art svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.t-clay { background: #b9552f; color: #fff8f2; } .t-clay .cta:hover { background: #fff8f2; color: #b9552f; }
.t-night { background: #0a1c21; color: #e9f1ec; } .t-night .cta:hover { background: #e9f1ec; color: #0a1c21; }
.t-moss { background: #33402f; color: #f1eee2; } .t-moss .cta:hover { background: #f1eee2; color: #33402f; }
.t-char { background: #2b2a28; color: #efe9df; } .t-char .cta:hover { background: #efe9df; color: #2b2a28; }
.arrows button { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); background: rgba(0,0,0,.18); color: #fff; font-size: 20px; }
.arrows .prev { left: 16px; } .arrows .next { right: 16px; }
/* Scroll bar under the carousel: the thumb follows the slides as they scroll */
.scrollbar { position: absolute; left: clamp(24px, 6vw, 88px); right: clamp(24px, 6vw, 88px); bottom: 22px; z-index: 3; display: flex; align-items: center; gap: 14px; color: #fff; }
.scrollbar .rail { flex: 1; height: 3px; background: rgba(255,255,255,.28); border-radius: 3px; position: relative; cursor: pointer; }
.scrollbar .rail::before { content: ""; position: absolute; inset: -12px 0; }
.scrollbar .thumb { position: absolute; top: 0; bottom: 0; left: 0; background: #fff; border-radius: 3px; will-change: transform; }
.scrollbar .count { font-family: var(--latin); font-size: 16px; letter-spacing: .12em; min-width: 3.6em; text-align: right; font-variant-numeric: tabular-nums; }


@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.glow { animation: blink 1.6s ease-in-out infinite; }

/* Sections */
section { padding: 72px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 30px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.sec-head h3 { font-family: var(--serif); font-size: 26px; letter-spacing: .3em; margin: 0; font-weight: 700; }
.sec-head span { font-family: var(--latin); font-style: italic; color: var(--muted); font-size: 18px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card { display: flex; flex-direction: column; background: var(--paper); }
.card .pic { aspect-ratio: 4 / 5; position: relative; overflow: hidden; background: var(--paper-2); }
.card .pic img, .card .pic svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .pic img, .card:hover .pic svg { transform: scale(1.04); }
.card .tag { position: absolute; left: 12px; top: 12px; background: var(--paper); color: var(--ink); font-size: 11px; letter-spacing: .2em; padding: 4px 10px; z-index: 1; }
.card h4 { font-family: var(--serif); font-size: 19px; letter-spacing: .14em; margin: 16px 0 4px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.card .go { margin-top: 12px; font-size: 13px; letter-spacing: .2em; color: var(--clay); }

.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 110px 84px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.news time { font-family: var(--latin); font-size: 17px; color: var(--muted); letter-spacing: .06em; }
.news .kind { font-size: 11px; letter-spacing: .18em; border: 1px solid var(--line); padding: 2px 8px; text-align: center; }
.news .kind.hot { border-color: var(--clay); color: var(--clay); }

.links { background: var(--paper-2); }
.link-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.link-row a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); letter-spacing: .1em; transition: border-color .2s; }
.link-row a:hover { border-color: var(--ink); }
.link-row small { display: block; color: var(--muted); font-size: 12px; letter-spacing: .04em; }

.foot { background: var(--char); color: var(--char-ink); padding: 56px 0 34px; }
.foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot img { height: 44px; filter: invert(1) !important; }
.foot .motto { font-family: var(--latin); font-style: italic; font-size: 24px; margin: 14px 0 0; }
.foot h5 { margin: 0 0 12px; font-size: 13px; letter-spacing: .24em; opacity: .7; font-weight: 400; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.foot .copy { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.14); padding-top: 18px; font-size: 12px; letter-spacing: .08em; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; margin: 0; }
.foot .copy > span { opacity: .6; }
.foot .copy nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot .copy nav a { opacity: .75; text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 3px; }
.foot .copy nav a:hover { opacity: 1; }

.foot .copy .visits { margin-left: auto; opacity: .6; font-variant-numeric: tabular-nums; }
.foot .copy .visits b { font-weight: 400; font-family: var(--latin); font-size: 15px; letter-spacing: .08em; margin-left: 6px; opacity: 1; }

/* The little miner in the footer, under the logo and motto: same pixel sprite as on the 挖礦遊戲 page, opens the mini game */
.miner { display: flex; align-items: center; gap: 12px; width: max-content; margin: 20px 0 0 -12px; padding: 8px 14px 8px 12px; border-radius: 12px; font-size: 12px; letter-spacing: .2em; color: var(--char-ink); opacity: .8; transition: background .2s, opacity .2s; }
.miner[hidden] { display: none; }
.miner:hover, .miner:active { background: rgba(255,255,255,.1); opacity: 1; }
.miner .ck-pebble { display: block; flex: none; }
@keyframes mineSwing { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-8deg); } 55% { transform: rotate(10deg); } 75% { transform: rotate(-3deg); } }

/* Policy pages (policy.html) */
.policy { max-width: 720px; margin: 0 auto; padding: 64px 20px 96px; }
.policy h1 { font-family: var(--serif); font-size: clamp(30px, 5vw, 44px); letter-spacing: .2em; text-align: center; margin: 0 0 44px; font-weight: 700; }
.policy h2 { font-family: var(--serif); font-size: 20px; letter-spacing: .12em; margin: 40px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.policy p, .policy li { font-size: 16px; line-height: 1.95; }
.policy p { margin: 0 0 16px; }
.policy ul { margin: 0 0 16px; padding-left: 1.3em; }
.policy li { margin-bottom: 4px; }
.policy a { color: var(--clay); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.policy .others { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.policy .others a[aria-current="page"] { color: var(--ink); text-decoration: none; font-weight: 700; }
.policy .updated { text-align: center; color: var(--muted); font-size: 13px; margin: -30px 0 40px; }



@media (max-width: 760px) {
  .nav { display: none; } .menu-btn { display: grid; } .head .wrap { gap: 12px; }
  .head .wrap { min-height: 62px; } .brand b { font-size: 19px; } .brand img { height: 28px; }
  .slide { grid-template-columns: 1fr; min-height: 78vh; }
  .slide .art { position: absolute; inset: 0; }
  .slide .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.25) 55%, rgba(0,0,0,.1) 100%); }
  .slide .copy { justify-content: flex-end; padding: 32px 24px 72px; color: #fff; }
  .arrows { display: none; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .link-row { grid-template-columns: 1fr 1fr; }
  .news li { grid-template-columns: 1fr; gap: 4px; } .news .kind { justify-self: start; }
  .foot .wrap { grid-template-columns: 1fr; }
  section { padding: 52px 0; }
}
@media (prefers-reduced-motion: reduce) { .glow { animation: none; } html { scroll-behavior: auto; } }

/* 列表打開時像捲軸一樣由上往下展開，項目依序出現 */
@keyframes ck-unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ck-item { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.unroll { animation: ck-unroll .55s cubic-bezier(.3, .7, .2, 1) both; }
.unroll > * { animation: ck-item .35s ease both; animation-delay: .62s; }
.unroll > :nth-child(1) { animation-delay: 0.080s; }
.unroll > :nth-child(2) { animation-delay: 0.125s; }
.unroll > :nth-child(3) { animation-delay: 0.170s; }
.unroll > :nth-child(4) { animation-delay: 0.215s; }
.unroll > :nth-child(5) { animation-delay: 0.260s; }
.unroll > :nth-child(6) { animation-delay: 0.305s; }
.unroll > :nth-child(7) { animation-delay: 0.350s; }
.unroll > :nth-child(8) { animation-delay: 0.395s; }
.unroll > :nth-child(9) { animation-delay: 0.440s; }
.unroll > :nth-child(10) { animation-delay: 0.485s; }
.unroll > :nth-child(11) { animation-delay: 0.530s; }
.unroll > :nth-child(12) { animation-delay: 0.575s; }
.drawer:not([hidden]) { animation: ck-unroll .55s cubic-bezier(.3, .7, .2, 1) both; }
.drawer:not([hidden]) a { animation: ck-item .35s ease both; }
.drawer:not([hidden]) a:nth-child(1) { animation-delay: 0.12s; }
.drawer:not([hidden]) a:nth-child(2) { animation-delay: 0.17s; }
.drawer:not([hidden]) a:nth-child(3) { animation-delay: 0.22s; }
.drawer:not([hidden]) a:nth-child(4) { animation-delay: 0.27s; }
.drawer:not([hidden]) a:nth-child(5) { animation-delay: 0.32s; }
.drawer:not([hidden]) a:nth-child(6) { animation-delay: 0.37s; }
.drawer:not([hidden]) a:nth-child(7) { animation-delay: 0.42s; }
.drawer:not([hidden]) a:nth-child(8) { animation-delay: 0.47s; }
.drawer:not([hidden]) a:nth-child(9) { animation-delay: 0.52s; }
.drawer:not([hidden]) a:nth-child(10) { animation-delay: 0.57s; }
