/* WM STORY v2 — "world coordinates": graph-paper ground, ink and graphite from the logo, one coordinate blue. */
:root {
  --paper: #f3f4f1;
  --surface: #ffffff;
  --sheet: #fbfbfa;            /* logo card stays light in both themes */
  --ink: #151617;
  --graphite: #474747;
  --mute: #686c70;
  --line: #d9dbdb;
  --grid: rgba(21, 22, 23, .045);
  --blue: #436d8e;
  --blue-soft: #e3ebf2;
  --on-blue: #ffffff;
  --display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --display-vi: "Noto Serif", Georgia, serif;
  --body: "Be Vietnam Pro", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --label: "Chakra Petch", "Be Vietnam Pro", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --wrap: 1200px;
  --radius: 2px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111315; --surface: #181b1e; --sheet: #f1f2ef; --ink: #eceeef; --graphite: #c6c9cb; --mute: #98a0a6;
    --line: #2b3034; --grid: rgba(236, 238, 239, .05); --blue: #6ea8d6; --blue-soft: #16283a; --on-blue: #0d1a26; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111315; --surface: #181b1e; --sheet: #f1f2ef; --ink: #eceeef; --graphite: #c6c9cb; --mute: #98a0a6;
  --line: #2b3034; --grid: rgba(236, 238, 239, .05); --blue: #6ea8d6; --blue-soft: #16283a; --on-blue: #0d1a26; color-scheme: dark;
}

/* Language: both ship in the HTML; site.js shows one. Without JS both stay visible. */
html.js[data-lang="zh"] .t-vi, html.js[data-lang="vi"] .t-zh { display: none; }
html:not(.js) .t-vi::before { content: " / "; color: var(--mute); }
.t-vi { font-family: var(--body); }
h1 .t-vi, h2 .t-vi, h3 .t-vi { font-family: var(--display-vi); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.75;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 900; line-height: 1.25; text-wrap: balance; letter-spacing: .01em; }
h1 em, h2 em { font-style: normal; color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.mono, .coord { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.coord { color: var(--mute); white-space: nowrap; }
.coord b { font-family: var(--body); font-weight: 600; color: var(--graphite); margin-right: .35em; letter-spacing: 0; }
.eyebrow { font-family: var(--label); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.eyebrow .coord { letter-spacing: .02em; text-transform: none; }
.dot { width: 10px; height: 10px; background: var(--blue); display: inline-block; }
.lede { color: var(--graphite); font-size: 18px; max-width: 60ch; }
.row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 14px; }
.skip:focus { top: 12px; }

.button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--paper); font: 600 15px/1 var(--body); text-decoration: none; cursor: pointer; border-radius: var(--radius);
  transition: background .2s, color .2s, border-color .2s;
}
.button:hover { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.button.ghost { background: transparent; color: var(--ink); }
.button.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.text-link { font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--blue); padding-bottom: 2px; display: inline-flex; gap: 6px; }
.text-link:hover { color: var(--blue); }
.arrow { font-family: var(--mono); font-size: .85em; margin-left: 4px; }

/* Header */
.header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--paper); z-index: 21; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { border-radius: var(--radius); background: var(--sheet); }
.brand-word { white-space: nowrap; font-family: var(--label); font-weight: 600; font-size: 20px; letter-spacing: .08em; line-height: 1; display: grid; gap: 4px; }
.brand-word small { font-size: 10px; letter-spacing: .24em; color: var(--mute); font-weight: 500; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 500; position: relative; padding: 6px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px; background: var(--blue); transition: right .25s; }
.nav a:hover::after { right: 0; }
.lang { display: none; border: 1px solid var(--line); border-radius: var(--radius); }
html.js .lang { display: flex; }
.lang .short { display: none; }
.lang button { white-space: nowrap; font: 500 13px/1 var(--body); padding: 9px 12px; background: none; border: 0; color: var(--mute); cursor: pointer; min-height: 36px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.menu-toggle span { width: 18px; height: 2px; background: var(--ink); transition: transform .2s; }
.menu-open .menu-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-open .menu-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Hero */
.hero { padding-block: clamp(48px, 8vw, 104px) clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero-copy { display: grid; gap: 28px; min-width: 0; }
.hero h1 { font-size: clamp(40px, 6.4vw, 84px); line-height: 1.12; }
.hero h1 .t-vi { font-size: .78em; line-height: 1.2; display: block; }
html:not(.js) .hero h1 .t-vi::before { content: none; }
.hero-logo { position: relative; margin: 0; padding: 28px 28px 52px 52px; color: var(--ink); }
.hero-logo .axes { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--graphite); opacity: .9; }
.hero-logo img { position: relative; background: var(--sheet); box-shadow: 0 1px 0 var(--line), 0 24px 60px -30px rgba(0, 0, 0, .35); }
.hero-logo figcaption { position: absolute; right: 0; bottom: 8px; color: var(--mute); }
.hero-logo.small { width: 160px; padding: 0; height: 160px; margin-bottom: 24px; }

.ticker { border-block: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.ticker-track { display: flex; gap: 28px; width: max-content; padding: 14px 0; animation: ticker 48s linear infinite; font-size: 14px; white-space: nowrap; }
.ticker-track b { font-family: var(--mono); font-weight: 400; color: var(--mute); margin-left: 6px; font-size: 13px; }
.ticker-track i { font-style: normal; color: var(--blue); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Sections */
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-head { display: grid; gap: 20px; max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head h2 { font-size: clamp(32px, 4.6vw, 54px); }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.pillar { padding: 28px 28px 8px 0; display: grid; gap: 12px; align-content: start; position: relative; }
.pillar + .pillar { padding-left: 28px; border-left: 1px solid var(--line); }
.pillar h3 { font-size: 24px; }
.pillar p { color: var(--graphite); }
.axis-label { color: var(--blue); }

.band { margin: 0; position: relative; }
.band img { width: 100%; height: clamp(320px, 52vw, 640px); object-fit: cover; filter: grayscale(.25) contrast(1.05); }
.band figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-block: 14px; font-size: 14px; color: var(--mute); border-bottom: 1px solid var(--line); }

/* Brand universe */
.universe { background: var(--surface); border-block: 1px solid var(--line); }
.levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-left: 2px solid var(--ink); }
.level { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 24px; padding: 28px 0; position: relative; }
.level + .level { border-top: 1px solid var(--line); }
.level::before { content: ""; position: absolute; left: -2px; top: 36px; width: 44px; height: 2px; background: var(--ink); }
.level-1::before { background: var(--blue); height: 4px; top: 35px; }
.tier { font-size: 40px; font-family: var(--label); font-weight: 600; color: var(--line); padding-left: 52px; line-height: 1; }
.level-body { display: grid; gap: 8px; align-content: start; max-width: 62ch; }
.level-body h3 { font-size: clamp(24px, 3vw, 34px); }
.level-role { font-family: var(--label); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.domain { color: var(--mute); }
.level-body > p:not(.level-role):not(.domain) { color: var(--graphite); }
.level-body .text-link, .here { justify-self: start; margin-top: 6px; }
.here { font-weight: 600; color: var(--blue); display: inline-flex; gap: 8px; align-items: center; }
.here::before { content: ""; width: 8px; height: 8px; background: var(--blue); }
.level-2 { margin-left: clamp(0px, 4vw, 48px); }
.level-3 { margin-left: clamp(0px, 8vw, 96px); }
.routes { margin-top: 56px; display: grid; gap: 20px; }
.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.route { display: grid; gap: 8px; align-content: start; padding: 22px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; border-radius: var(--radius); transition: border-color .2s, transform .2s; }
.route:hover { border-color: var(--blue); transform: translateY(-2px); }
.route .mono { color: var(--blue); }
.route b { font-family: var(--label); font-size: 18px; letter-spacing: .04em; }
.route p { color: var(--graphite); font-size: 15px; }

/* Brands */
.brand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.brand-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); display: grid; gap: 28px; align-content: start; }
.brand-card > div { display: grid; gap: 14px; align-content: start; min-width: 0; }
.brand-card h3 { font-family: var(--label); font-weight: 600; font-size: clamp(30px, 4vw, 44px); letter-spacing: .06em; }
.brand-card p { color: var(--graphite); }
.brand-card .tag { color: var(--ink); font-weight: 600; }
.brand-wm img { width: 96px; height: 96px; background: var(--sheet); padding: 10px; border-radius: var(--radius); }
.brand-photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); }
.chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--line); padding: 4px 12px; font-size: 14px; border-radius: 99px; }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.projects-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; }
.project-card { display: grid; gap: 14px; align-content: start; min-width: 0; }
.project-image { overflow: hidden; display: block; border-radius: var(--radius); }
.project-image img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .6s; filter: grayscale(.2); }
.project-card:hover .project-image img { transform: scale(1.04); }
.project-meta { display: flex; justify-content: space-between; font-family: var(--label); font-size: 12px; letter-spacing: .14em; color: var(--mute); border-top: 2px solid var(--ink); padding-top: 12px; }
.project-meta .mono { color: var(--blue); }
.project-card h3 { font-family: var(--label); font-weight: 600; font-size: 24px; letter-spacing: .02em; }
.project-card h3 a { text-decoration: none; }
.project-card > p { color: var(--graphite); }
.project-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.method { margin-top: clamp(64px, 9vw, 112px); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.method h3 { font-size: clamp(24px, 3vw, 32px); margin-top: 12px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.steps li { display: grid; gap: 8px; align-content: start; }
.steps .mono { color: var(--blue); font-size: 15px; }
.steps h4 { font-size: 20px; }
.steps p { color: var(--graphite); font-size: 15px; }

/* Journey */
.journey { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--ink); color: var(--paper); }
.journey-photo img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; }
.journey-copy { padding: clamp(40px, 7vw, 96px) max(20px, env(safe-area-inset-right, 0px)) clamp(40px, 7vw, 96px) clamp(24px, 6vw, 80px); display: grid; gap: 22px; align-content: center; max-width: 640px; }
.journey-copy h2 { font-size: clamp(32px, 4.4vw, 52px); }
.journey-copy h2 em { color: var(--blue); }
.journey-copy .lede { color: color-mix(in srgb, var(--paper) 78%, var(--ink)); }
.journey-copy .eyebrow { color: color-mix(in srgb, var(--blue) 70%, var(--paper)); }
.route-line { list-style: none; margin: 8px 0 0; padding: 0 0 0 20px; display: grid; gap: 14px; border-left: 2px dashed color-mix(in srgb, var(--paper) 40%, var(--ink)); }
.route-line li { position: relative; }
.route-line li::before { content: ""; position: absolute; left: -27px; top: 7px; width: 12px; height: 12px; background: var(--blue); }
.route-line .coord, .route-line .coord b { color: color-mix(in srgb, var(--paper) 82%, var(--ink)); }

/* Contact */
.contact { padding-block: clamp(72px, 10vw, 120px); }
.contact-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: end; }
.contact h2 { font-size: clamp(30px, 4.2vw, 48px); margin-block: 16px 18px; }
.contact-actions { display: grid; gap: 18px; justify-items: start; min-width: 0; }
.email { font-family: var(--label); font-weight: 600; font-size: clamp(22px, 3vw, 30px); text-decoration: none; border-bottom: 2px solid var(--blue); overflow-wrap: anywhere; }
.copy-status { min-height: 1.5em; color: var(--blue); font-size: 14px; }

/* Footer */
.footer { border-top: 2px solid var(--ink); background: var(--surface); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 32px; padding-block: 48px 32px; }
.footer-brand { display: grid; gap: 16px; align-content: start; }
.footer-tag { color: var(--mute); }
.footer-links { display: grid; gap: 10px; align-content: start; }
.footer-links a { text-decoration: none; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--blue); }
.label { font-family: var(--label); font-size: 12px; font-weight: 600; letter-spacing: .16em; color: var(--mute); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 18px 28px; border-top: 1px solid var(--line); color: var(--mute); font-size: 13px; }

/* Project detail, credits, 404 */
.detail .back-link { display: inline-block; margin-top: 40px; text-decoration: none; color: var(--mute); }
.detail .back-link:hover { color: var(--blue); }
.detail-head { display: grid; gap: 20px; padding-block: 32px 48px; max-width: 820px; }
.detail-head h1 { font-family: var(--label); font-weight: 600; font-size: clamp(40px, 6vw, 72px); letter-spacing: .02em; }
.detail-band figcaption { flex-direction: column; }
.detail-body { display: grid; gap: 40px; padding-block: 64px 24px; max-width: 820px; justify-items: start; }
.detail-body section { display: grid; gap: 14px; border-top: 2px solid var(--ink); padding-top: 20px; }
.detail-body h2 { font-size: clamp(24px, 3vw, 32px); }
.detail-body section p { color: var(--graphite); }
.credits { display: grid; gap: 28px; justify-items: start; }
.credits h1 { font-size: clamp(32px, 5vw, 48px); }
.credit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; width: 100%; }
.credit-list li { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.credit-list b { min-width: 220px; }
.not-found { padding-block: 96px 120px; display: grid; gap: 20px; justify-items: start; }
.not-found h1 { font-size: clamp(32px, 5vw, 56px); }

/* Responsive */
@media (max-width: 960px) {
  .nav { position: fixed; inset: 72px 0 auto; background: var(--paper); flex-direction: column; gap: 0; padding: 8px max(20px, env(safe-area-inset-right, 0px)) 20px max(20px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); display: none; }
  .menu-open .nav { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .menu-toggle { display: flex; }
  .lang { margin-left: auto; }
  html:not(.js) .nav { display: flex; position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 16px; padding: 0; border: 0; background: none; }
  html:not(.js) .header-inner { flex-wrap: wrap; padding-block: 12px; }
  .hero-grid, .brand-grid, .contact-inner, .method, .journey { grid-template-columns: minmax(0, 1fr); }
  .hero-logo { max-width: 460px; }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-grid, .steps { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
  .journey-copy { max-width: none; padding-left: max(20px, env(safe-area-inset-left, 0px)); }
  .journey-photo img { min-height: 300px; max-height: 420px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand-word small { display: none; }
  .lang button { padding: 9px 12px; }
  .lang .long { display: none; }
  .lang .short { display: inline; }
  .header-inner { gap: 12px; }
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .pillar, .pillar + .pillar { padding: 24px 0; border-left: 0; }
  .pillar + .pillar { border-top: 1px solid var(--line); }
  .projects-grid, .projects-grid.two { grid-template-columns: minmax(0, 1fr); }
  .project-image img { aspect-ratio: 4 / 3; }
  .level { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .level-2, .level-3 { margin-left: 0; }
  .tier { padding-left: 52px; font-size: 28px; }
  .level-body { padding-left: 24px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-logo { padding: 20px 20px 40px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .project-image img, .route { transition: none; }
}
