/* 簡報作品 slides — 投影片本身才是設計，介面只用細線與留白。零建置。 */

:root {
  --bg: #f4f2ee;
  --fg: #1a1917;
  --muted: #6d6862;
  --rule: #d9d4cb;
  --accent: #8a2b1d;
  --shade: #e9e5de;
  --sans: "Noto Sans TC", system-ui, -apple-system, "Segoe UI", "PingFang TC",
    "Microsoft JhengHei", sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "Source Han Serif TC", Georgia, serif;
  --mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --pad: 24px;
  --col: 1120px;
  --viewer-bg: #0e0f0d;
  --viewer-fg: #e8e5de;
  --viewer-muted: #8d8880;
  --viewer-accent: #d98b6a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131311;
    --fg: #ebe7e0;
    --muted: #9a948b;
    --rule: #2b2b28;
    --accent: #d98b6a;
    --shade: #1c1c19;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.serif { font-family: var(--serif); font-weight: 700; }

a { color: inherit; }

img { display: block; max-width: 100%; }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- layout ---------- */

.site-head,
.col,
.site-foot {
  max-width: var(--col);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.brand:hover { color: var(--fg); }

.site-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.col > section { padding-block: 56px; }

.col > section + section { border-top: 1px solid var(--rule); }

.sec-h {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 32px;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.sec-h .sec-n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.sec-h::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--rule);
}

/* ---------- hero ---------- */

.col > section.hero { padding-top: 24px; padding-bottom: 56px; }

.lede {
  margin: 0;
  font-size: clamp(28px, 5.6vw, 44px);
  line-height: 1.4;
  letter-spacing: 0.01em;
  max-width: 16em;
}

.meta {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 16px;
  margin: 48px 0 0;
}

.total {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

.label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.num {
  margin: 8px 0 0;
  font-size: clamp(26px, 4.8vw, 52px);
  line-height: 1;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.num .span-sep {
  padding: 0 0.12em;
  color: var(--muted);
  font-weight: 400;
}

/* ---------- 講座與課程 ---------- */

.talk {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}

.talk:last-child { border-bottom: 1px solid var(--rule); }

.talk .y {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}

.talk-body { min-width: 0; }

.talk .t {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.45;
}

.talk .v,
.talk .n {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.talk .go { margin: 6px 0 0; }

/* ---------- 作品 ---------- */

.deck {
  display: grid;
  grid-template-columns: 46% minmax(0, 1fr);
  gap: 28px 32px;
  align-items: start;
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}

.deck:first-child { padding-top: 0; border-top: 0; }

.deck:last-child { border-bottom: 1px solid var(--rule); }

.cover {
  display: block;
  width: 100%;
  background: var(--shade);
}

.cover img { width: 100%; height: auto; }

.deck-body { min-width: 0; }

.deck-body .y {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.deck-body .t {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(22px, 3.2vw, 28px);
  line-height: 1.4;
}

.deck-body .v {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.deck-body .l {
  margin: 16px 0 0;
  font-size: 15px;
  max-width: 30em;
}

.deck-body .go { margin: 20px 0 0; }

.strip {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar { display: none; }

.strip a {
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: start;
  background: var(--shade);
}

.strip img {
  width: 220px;
  height: auto;
  opacity: 0.92;
}

.strip a:hover img,
.strip a:focus-visible img { opacity: 1; }

/* ---------- 改造前後 ---------- */

.pair {
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}

.pair:first-child { padding-top: 0; border-top: 0; }

.pair:last-child { border-bottom: 1px solid var(--rule); }

.pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.pair-side .k {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.pair-side img { width: 100%; height: auto; background: var(--shade); }

.pair .t {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
}

.pair .n {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 文章 ---------- */

.posts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.posts li {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 4px 24px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}

.posts li:last-child { border-bottom: 1px solid var(--rule); }

.posts .d {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.posts a {
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}

.posts a:hover { border-bottom-color: var(--accent); }

/* ---------- 方法 ---------- */

.method {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 28em;
}

.method li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(17px, 2.6vw, 20px);
  line-height: 1.5;
}

.method li:last-child { border-bottom: 1px solid var(--rule); }

.method .n {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 12px;
  color: var(--accent);
  padding-top: 6px;
}

/* ---------- 文字連結 ---------- */

.linkish {
  display: inline-block;
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 5px;
  cursor: pointer;
}

.linkish:hover { text-decoration-color: var(--accent); }

/* ---------- 頁尾 ---------- */

.site-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 56px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
}

.site-foot p { margin: 0; }

/* ---------- 瀏覽器 ---------- */

@keyframes fade-in { from { opacity: 0; } }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--viewer-bg);
  color: var(--viewer-fg);
}

.viewer.fade { animation: fade-in 150ms linear; }

.v-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 40px;
  padding: 0 16px;
}

.v-title {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--viewer-muted);
}

.v-count {
  padding-left: 14px;
  font-family: var(--mono);
  color: var(--viewer-accent);
}

.v-close {
  flex: none;
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--viewer-fg);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-decoration: underline;
  text-underline-offset: 5px;
  cursor: pointer;
}

.v-close:focus-visible { outline: 1px solid var(--viewer-accent); outline-offset: 3px; }

.v-stage {
  position: absolute;
  top: 40px;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
  touch-action: pan-y;
}

.v-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.v-stage img.fade { animation: fade-in 120ms linear; }

/* ---------- 寬 ---------- */

@media (min-width: 720px) {
  :root { --pad: 48px; }
  .col > section { padding-block: 80px; }
  .col > section.hero { padding-top: 32px; padding-bottom: 80px; }
  .sec-h { margin-bottom: 40px; }
}

/* ---------- 窄 ---------- */

@media (max-width: 720px) {
  .deck {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 32px 0;
  }

  .pair-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }

  .talk { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; }

  .posts li { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .site-foot { flex-direction: column; gap: 8px; }

  .strip a, .strip img { width: 180px; }

  .v-stage { padding: 16px; }
}

@media (max-width: 560px) {
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .total:nth-child(3) { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
