@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;500;600;700&display=swap');

:root {
  --ink: #1f1f1f;
  --ink-soft: #4d4d4d;
  --haze: #f5f5f5;
  --line: #e3e3e3;
  --rad: 6px;
  --serif: "Noto Serif TC", "Songti SC", Georgia, serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --pad: clamp(18px, 5vw, 56px);
  --maxw: 1220px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  letter-spacing: .01em;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- top bar ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.top__row {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px var(--pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.top__brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: .14em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  padding: 10px 4px;
  justify-self: center;
}

.top__nav {
  display: flex;
  align-items: center;
  min-width: 0;
}

.top__nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 9px;
  font-size: .81rem;
  letter-spacing: .03em;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--rad);
  white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}

.top__nav a:hover { color: var(--ink); background: var(--haze); }

.top__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.top__contact {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: .81rem;
  letter-spacing: .06em;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: var(--rad);
  transition: background .2s ease, color .2s ease;
}

.top__contact:hover { background: var(--ink); color: #fff; }

.top__burger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--rad);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: .77rem;
  letter-spacing: .16em;
  cursor: pointer;
  transition: transform .2s ease;
}

.top__burger:hover { transform: translateY(-1px); }

.top__burger-ico {
  display: block;
  width: 15px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

/* ---------- full screen menu ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 72px var(--pad) 40px;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.veil.on { opacity: 1; visibility: visible; }

.veil__close {
  position: absolute;
  top: 14px;
  right: var(--pad);
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: var(--rad);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .78rem;
  letter-spacing: .16em;
  cursor: pointer;
}

.veil__close:hover { background: var(--ink); color: #fff; }

.veil__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: v;
  text-align: center;
}

.veil__list li { margin: 0; }

.veil__list a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding: 6px 10px;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 3.4vw, 1.7rem);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: letter-spacing .25s ease;
}

.veil__list a::before {
  counter-increment: v;
  content: counter(v, decimal-leading-zero);
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .14em;
  color: #9c9c9c;
}

.veil__list a:hover { letter-spacing: .08em; }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: right;
  padding: clamp(30px, 8vw, 86px) var(--pad) clamp(48px, 9vw, 116px);
  background:
    radial-gradient(circle at 1px 1px, #d8d8d8 1px, transparent 1.7px) 0 0 / 20px 20px,
    linear-gradient(180deg, #ffffff 0%, #ffffff 58%, #f5f5f5 100%);
  border-bottom: 2px solid var(--ink);
}

.hero__title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2.1rem, 7.4vw, 5.2rem);
  line-height: 1.07;
  letter-spacing: .005em;
  text-wrap: balance;
}

.hero__lede {
  margin: clamp(16px, 3vw, 28px) 0 0 auto;
  max-width: 50ch;
  font-size: clamp(.95rem, 1.4vw, 1.06rem);
  line-height: 1.85;
  color: var(--ink-soft);
}

/* ---------- content frame ---------- */
.sheet {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 76px) var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.prose {
  min-width: 0;
  font-size: 1.0625rem;
  line-height: 1.95;
  color: #2a2a2a;
}

.prose > *:first-child { margin-top: 0; }
.prose div { padding-bottom: clamp(26px, 4vw, 50px); margin-bottom: clamp(26px, 4vw, 50px); border-bottom: 1px solid var(--line); }
.prose div:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.prose div[id] { scroll-margin-top: 92px; }

.prose p { margin: 0 0 1.4em; }

.prose h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.82rem);
  line-height: 1.45;
  font-weight: 700;
  color: var(--ink);
  margin: 2.1em 0 .5em;
}

.prose h3 {
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ink);
  margin: 1.7em 0 .4em;
}

.prose h2 + hr,
.prose h3 + hr {
  border: 0;
  border-top: 2px solid var(--ink);
  width: 58px;
  margin: .7em 0 1.5em;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.6em 0;
}

.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: #a5a5a5; }

.prose a {
  color: var(--ink);
  text-underline-offset: 3px;
  text-decoration-color: #bcbcbc;
}

.prose a:hover { text-decoration-color: var(--ink); }

.prose strong { font-weight: 700; color: var(--ink); }

.prose blockquote {
  margin: 1.8em 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--ink);
  color: #3d3d3d;
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose img { display: block; max-width: 100%; height: auto; margin: 1.6em 0; border-radius: var(--rad); }

.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: .85rem; color: #7c7c7c; margin-top: .5em; }

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: .94rem;
}

.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .6em .6em; text-align: left; }
.prose th { background: var(--haze); font-weight: 600; }

.prose code { font-size: .92em; background: var(--haze); padding: .1em .4em; border-radius: 4px; }
.prose pre { background: var(--ink); color: #f5f5f5; padding: 16px; border-radius: var(--rad); overflow: auto; font-size: .9rem; line-height: 1.7; }
.prose pre code { background: none; padding: 0; color: inherit; }

/* ---------- side rail ---------- */
.rail {
  position: sticky;
  top: 86px;
  padding: 18px 0 0;
  border-top: 2px solid var(--ink);
}

.rail__head {
  margin: 0;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .24em;
  color: var(--ink-soft);
}

.rail__rule { border: 0; border-top: 1px solid var(--line); margin: 10px 0 12px; }

.rail__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }

.rail__list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 9px;
  font-size: .87rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--rad);
  border-bottom: 1px solid var(--line);
  transition: background .2s ease, color .2s ease, padding-left .2s ease;
}

.rail__list a:hover { background: var(--haze); color: var(--ink); padding-left: 15px; }

.rail__top { margin: 16px 0 0; }

.rail__top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: .82rem;
  letter-spacing: .1em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

/* ---------- footer ---------- */
.foot {
  margin-top: clamp(36px, 6vw, 76px);
  padding: clamp(36px, 6vw, 64px) var(--pad) 26px;
  background: var(--haze);
  border-top: 2px solid var(--ink);
}

.foot__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.foot__addr {
  font-family: var(--serif);
  font-style: normal;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--ink);
}

.foot__links { list-style: none; display: flex; flex-wrap: wrap; gap: 0 18px; margin: 14px 0 0; padding: 0; }

.foot__links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: .86rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot__links a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.foot__nav dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

.foot__nav dt {
  grid-column: 1 / -1;
  font-size: .72rem;
  letter-spacing: .24em;
  color: #8e8e8e;
  margin-bottom: 6px;
}

.foot__nav dd { margin: 0; }

.foot__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: .87rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.foot__nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.foot__form {
  max-width: var(--maxw);
  margin: clamp(26px, 4vw, 44px) auto 0;
  padding-top: 22px;
  border-top: 1px solid #d9d9d9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.foot__label { width: 100%; font-size: .72rem; letter-spacing: .24em; color: #8e8e8e; }

.foot__form input {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #cfcfcf;
  border-radius: var(--rad);
  background: #fff;
  font: inherit;
  font-size: .9rem;
  color: var(--ink);
}

.foot__form button {
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--rad);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: .83rem;
  letter-spacing: .16em;
  cursor: pointer;
  transition: transform .2s ease;
}

.foot__form button:hover { transform: translateY(-1px); }

.foot__base {
  max-width: var(--maxw);
  margin: 26px auto 0;
  text-align: center;
  font-size: .79rem;
  letter-spacing: .06em;
  color: #8e8e8e;
}

.foot__base p { margin: 0; }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .3, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .top__nav, .top__contact { display: none; }
  .top__row { display: flex; justify-content: space-between; }
  .top__brand { justify-self: start; }
}

@media (max-width: 920px) {
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; margin-top: 4px; }
  .foot__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { min-height: 84vh; min-height: 84svh; }
  .hero__title { font-size: clamp(2rem, 9vw, 2.9rem); }
  .foot__nav dl { grid-template-columns: 1fr; }
  .foot__form button { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .top__burger, .foot__form button, .rail__list a, .veil__list a { transition: none !important; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
