/* ---------- Fonts ----------
   Serif: Instrument Serif (Google Fonts, OFL) — the community's go-to free
   stand-in for PP Editorial New. Loaded via the <link> tag in each page. */

/* ---------- Tokens ---------- */
:root {
  --bg: #fffefd; /* back to the original warm white */
  --ink: #121212;
  --muted: #71717a;
  --faint: #a1a1aa;
  --accent: #0099ff;
  --card-dark: #09090b;
  --card-dark-ink: #fafafa;
  --card-dark-muted: #a1a1aa;
  --card-light: #f4f4f5;
  --footer-bg: #0c0c0c;
  --serif: "Instrument Serif", "Noto Serif TC", Georgia, serif;
  --sans: "Geist", "Noto Sans TC", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --radius: 28px;
  --page-pad: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }

/* ---------- Reveal on scroll (.reveal) / timed entrance (.seq) ---------- */
.reveal,
.seq {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible,
.seq.visible { opacity: 1; transform: none; }

/* ---------- Nav ---------- */
.topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav {
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 254, 253, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 212, 216, 0.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-link svg { width: 15px; height: 15px; color: #52525b; }
.nav-link:hover { background: rgba(228, 228, 231, 0.7); }
.nav-logo, .nav-mail {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(212, 212, 216, 0.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}
.nav-logo {
  background: rgba(255, 254, 253, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.06em;
  color: var(--ink);
}
.nav-mail { background: #fdcf00; color: #121212; }
.nav-mail svg { width: 19px; height: 19px; }
.nav-logo:hover, .nav-mail:hover { transform: scale(1.08) rotate(-6deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px var(--page-pad) 60px;
  position: sticky;
  top: 0;
  z-index: 0;
}
.hero-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 28px;
}
.hero-face {
  width: 48px;
  height: 64px;
  border-radius: 999px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-face:hover { transform: scale(1.6) rotate(-4deg); }

/* Animated gradient avatar — ocean waves: light on top, deep below,
   with highlights flowing endlessly from left to right */
.hero-gradient {
  position: relative;
  display: block;
  overflow: hidden;
  flex: none;
}
.hero-gradient::before {
  content: "";
  position: absolute;
  inset: -14px;
  /* two wavy water layers sliding sideways over a light sky-to-sea base;
     blurred so the wave lines melt into one continuous dark-to-light gradient */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 64' preserveAspectRatio='none'%3E%3Cpath d='M0 42 Q15 34 30 42 T60 42 T90 42 T120 42 V64 H0 Z' fill='%232e6fe0'/%3E%3C/svg%3E") repeat-x 0 0 / 96px 100%,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 64' preserveAspectRatio='none'%3E%3Cpath d='M0 34 Q15 25 30 34 T60 34 T90 34 T120 34 V64 H0 Z' fill='%234fa8f5' fill-opacity='0.6'/%3E%3C/svg%3E") repeat-x 0 0 / 64px 100%,
    linear-gradient(to bottom, #dff7ff 0%, #a5e3ff 50%, #7ad0ff 100%);
  filter: blur(7px) hue-rotate(0deg);
  animation:
    wave-slide 5s linear infinite,
    hue-cycle 21s linear infinite;
}
@keyframes wave-slide {
  to { background-position: 96px 0, 64px 0, 0 0; }
}
/* starts on blue, then drifts through the whole color wheel (~3s per hue);
   blur rides along in the keyframes because filter is a single property */
@keyframes hue-cycle {
  from { filter: blur(7px) hue-rotate(0deg); }
  to { filter: blur(7px) hue-rotate(360deg); }
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 4.75vw, 72px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
}
.hero-current {
  margin-top: 36px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}
.hero-current strong { color: #3f3f46; font-weight: 600; }
.hero-current a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.hero-current a:hover, .hero-current a:hover strong { color: var(--accent); }
/* ---------- MinaGPT (plan A: static preview — no API keys, no external calls) ---------- */
.minagpt {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  margin-top: 32px;
}
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(212, 212, 216, 0.45);
  background: transparent;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--faint);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.chip:hover { background: rgba(255, 254, 253, 0.9); border-color: var(--accent); color: var(--accent); }

/* Full-page chat mode — ChatGPT-style: nav stays, everything else yields */
.chat-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-top: 96px;
}
/* author display:flex would defeat the hidden attribute without this */
.chat-screen[hidden] { display: none; }
body.chat-open { overflow: hidden; }
.chat-scroll {
  flex: 1;
  overflow-y: auto;
}
.chat-log {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 20px 24px;
}
.chat-msg { font-size: 15px; line-height: 1.65; }
.chat-msg + .chat-msg { margin-top: 20px; }
.chat-msg-user-row { text-align: right; }
.chat-msg-user {
  display: inline-block;
  max-width: 80%;
  padding: 10px 18px;
  border-radius: 22px;
  background: var(--card-light);
  color: var(--ink);
  font-weight: 500;
  text-align: left;
}
.chat-msg-bot { color: #3f3f46; text-align: left; max-width: 92%; }
.chat-msg-bot::before {
  content: "MinaGPT";
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.chat-screen-bar {
  padding: 14px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}
.chat-screen-bar .chat-bar {
  max-width: 720px;
  margin: 0 auto;
}
/* Horizontally scrollable / draggable suggestion row above the input */
.chat-suggest {
  max-width: 720px;
  margin: 0 auto 10px;
  overflow-x: auto;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.chat-suggest::-webkit-scrollbar { display: none; }
.chat-suggest.dragging { cursor: grabbing; }
.chat-suggest-track {
  display: flex;
  gap: 8px;
  width: max-content;
  padding: 2px 24px;
}
.chat-suggest .chip { white-space: nowrap; background: rgba(255, 254, 253, 0.85); }
.chat-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(212, 212, 216, 0.5);
  background: rgba(255, 254, 253, 0.8);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}
.chat-close:hover { color: var(--ink); transform: scale(1.08); }
.chat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 18px;
  border-radius: 999px;
  background: rgba(255, 254, 253, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 212, 216, 0.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.chat-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
}
.chat-input::placeholder { color: var(--faint); }
.chat-send {
  flex: none;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.chat-send:hover { background: var(--accent); transform: scale(1.08); }

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
  transition: color 0.2s ease;
}
.hero-scroll:hover { color: var(--accent); }

/* ---------- Falling pills ---------- */
.pills {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.pill {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 20px 30px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  white-space: nowrap;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transform: translate3d(-400px, -400px, 0);
  will-change: transform;
}
.pill svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.pill-dot {
  padding: 0;
  width: 52px;
  height: 52px;
  justify-content: center;
}
.pill-dot svg {
  width: 24px;
  height: 24px;
}
.pill.held { cursor: grabbing; z-index: 3; }

/* ---------- Selected work: flat client rows ----------
   One row per client: identity + note on the left, a 2x2 grid of that
   client's case studies on the right, hairline between rows. */
.projects {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 48px 48px 0 0;
  box-shadow:
    0 -1px 1px rgba(0, 0, 0, 0.14),
    0 -6px 14px rgba(0, 0, 0, 0.06);
  padding: clamp(40px, 5vw, 72px) clamp(20px, 4vw, 64px) 0;
}
html, body { overflow-x: clip; }

.work-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
}
.work-bar-label {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Round badge: translucent ring, spinning VIEW ALL label, eye at centre */
.work-badge {
  flex: none;
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  /* very light disc on white; the ring label carries the contrast instead */
  background: rgba(12, 12, 12, 0.15);
  display: grid;
  place-items: center;
  text-decoration: none;
}
.badge-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: badge-spin 14s linear infinite;
}
.badge-ring text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  fill: #3f3f46;
}
@keyframes badge-spin {
  to { transform: rotate(360deg); }
}
.badge-core {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card-dark);
  color: #fafafa;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.badge-core svg { width: 24px; height: 24px; }
.work-badge:hover .badge-core { background: var(--accent); transform: scale(1.08); }
html[lang="zh-Hant"] .badge-ring text { font-size: 12.5px; letter-spacing: 0.04em; }
@media (prefers-reduced-motion: reduce) {
  .badge-ring { animation: none; }
}

.client {
  display: grid;
  grid-template-columns: minmax(210px, 25%) 1fr;
  gap: clamp(24px, 4vw, 60px);
  padding: clamp(30px, 3.6vw, 48px) 0;
  border-top: 1px solid rgba(212, 212, 216, 0.85);
}
.client:last-of-type { border-bottom: 1px solid rgba(212, 212, 216, 0.85); }

.client-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
}
.client-id {
  display: flex;
  align-items: center;
  gap: 12px;
}
.client-mark {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--lg, var(--card-light));
}
.client-name {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.client-sector {
  display: block;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.35;
}
.client-note {
  font-size: 15px;
  line-height: 1.7;
  color: #52525b;
  max-width: 36ch;
}
.client-years {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.client-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(12px, 1.4vw, 18px);
  row-gap: clamp(22px, 2.4vw, 34px);
}
.tile {
  display: block;
  text-decoration: none;
  color: inherit;
}
.tile-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  overflow: hidden;
  background: var(--ph, var(--card-light));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.tile:hover .tile-media { transform: translateY(-3px); }
.tile-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.tile:hover .tile-media img { transform: scale(1.03); }
/* Placeholder label — real screenshots replace it one tile at a time */
.tile-media span {
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(18, 18, 18, 0.35);
  transform: rotate(-3deg);
}
.tile-cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.tile-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.tile-year {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}
.tile:hover .tile-name { color: var(--accent); }

/* ---------- What I do: three disciplines ---------- */
.craft {
  position: relative;
  z-index: 1;
  background: #fff;
  padding: clamp(72px, 9vw, 130px) clamp(20px, 4vw, 64px) clamp(80px, 10vw, 140px);
}
.craft-lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.9vw, 54px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  max-width: 22ch;
}
.craft-lead em { font-style: italic; }
.craft-sub {
  margin-top: 24px;
  max-width: 58ch;
  font-size: 17px;
  line-height: 1.7;
  color: #3f3f46;
}
.craft-grid {
  margin-top: clamp(48px, 6vw, 84px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(212, 212, 216, 0.85);
  border-radius: 24px;
  overflow: hidden;
}
.craft-col {
  display: flex;
  flex-direction: column;
  min-height: clamp(300px, 30vw, 400px);
  padding: clamp(26px, 3vw, 40px) clamp(22px, 2.6vw, 38px) clamp(28px, 3.4vw, 44px);
  border-right: 1px solid rgba(212, 212, 216, 0.85);
}
.craft-col:last-child { border-right: none; }
.craft-num {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.craft-num::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.craft-title {
  margin-top: clamp(26px, 4vw, 52px);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.9vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.craft-list {
  margin-top: 18px;
  list-style: none;
  font-size: 15px;
  line-height: 1.9;
  color: #52525b;
}
.craft-icon {
  margin-top: auto;
  padding-top: 40px;
  color: var(--ink);
}
.craft-icon svg {
  display: block;
  width: 52px;
  height: 52px;
  /* the marks rotate and scale past the 48-unit viewBox (the triangle by
     2.5 units at a quarter turn), and an SVG root clips by default */
  overflow: visible;
}

/* The three marks animate once their column has scrolled in, each loop saying
   something about the discipline: the brand marks breathe and turn, the layout
   blocks reflow, the chevrons run left to right. */
.craft-icon svg * { transform-box: fill-box; transform-origin: center; }

/* Branding: the three marks get placed rather than spun — each turns a quarter
   and settles, staggered, like a set being arranged. The circle can't show
   rotation, so it settles in scale on the same beat. */
.craft-col.visible .ci-a { animation: ci-settle 6s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.craft-col.visible .ci-b { animation: ci-place 6s cubic-bezier(0.22, 1, 0.36, 1) 0.45s infinite; }
.craft-col.visible .ci-c { animation: ci-place-back 6s cubic-bezier(0.22, 1, 0.36, 1) 0.9s infinite; }

.craft-col.visible .ci-e { transform-origin: top; animation: ci-grow 5s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.craft-col.visible .ci-f { transform-origin: bottom; animation: ci-shrink 5s cubic-bezier(0.22, 1, 0.36, 1) infinite; }

.craft-col.visible .ci-g { animation: ci-run 2s ease-in-out infinite; }
.craft-col.visible .ci-g:nth-of-type(2) { animation-delay: 0.13s; }
.craft-col.visible .ci-g:nth-of-type(3) { animation-delay: 0.26s; }
.craft-col.visible .ci-g:nth-of-type(4) { animation-delay: 0.39s; }

@keyframes ci-settle { 0%, 8% { transform: scale(1); } 26%, 58% { transform: scale(1.13); } 82%, 100% { transform: scale(1); } }
@keyframes ci-place { 0%, 8% { transform: rotate(0deg); } 26%, 58% { transform: rotate(90deg); } 82%, 100% { transform: rotate(0deg); } }
@keyframes ci-place-back { 0%, 8% { transform: rotate(0deg); } 26%, 58% { transform: rotate(-90deg); } 82%, 100% { transform: rotate(0deg); } }
@keyframes ci-grow { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.5); } }
@keyframes ci-shrink { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.55); } }
@keyframes ci-run { 0%, 100% { opacity: 0.28; } 22% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .craft-col.visible .ci-a, .craft-col.visible .ci-b, .craft-col.visible .ci-c,
  .craft-col.visible .ci-e, .craft-col.visible .ci-f, .craft-col.visible .ci-g { animation: none; }
}

@media (max-width: 900px) {
  .client { grid-template-columns: 1fr; }
  .client-info { gap: 18px; }
  .client-note { max-width: 52ch; }
  .craft-grid { grid-template-columns: 1fr; }
  .craft-col { min-height: 0; border-right: none; border-bottom: 1px solid rgba(212, 212, 216, 0.85); }
  .craft-col:last-child { border-bottom: none; }
}
/* On a phone the 2x2 grid puts each cover at ~165px — too small to read.
   One per row instead, full width. */
@media (max-width: 640px) {
  .client-grid { grid-template-columns: 1fr; row-gap: clamp(20px, 5vw, 28px); }
}
@media (max-width: 560px) {
  .work-badge { width: 80px; height: 80px; }
  .badge-core { width: 42px; height: 42px; }
  .badge-core svg { width: 21px; height: 21px; }
  .tile-media { border-radius: 14px; }
  .tile-name { font-size: 14px; }
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 2;
  background: var(--footer-bg);
  color: #fafafa;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: clamp(64px, 7vw, 110px) 0 32px;
  overflow: hidden;
}
/* Eyes that follow the mouse */
.eyes {
  display: flex;
  gap: 12px;
  padding: 0 clamp(20px, 4vw, 64px);
}
.eye {
  position: relative;
  display: block;
  width: 36px;
  height: 54px;
  background: #fffefd;
  border-radius: 40px;
}
.pupil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 33px;
  margin: -16.5px 0 0 -12px;
  background: #0c0c0c;
  border-radius: 50%;
  will-change: transform;
}
.pupil::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 24px;
  width: 4.5px;
  height: 4.5px;
  margin-left: -2.25px;
  background: #fffefd;
  border-radius: 50%;
}

.footer-connect {
  text-align: center;
  margin-top: clamp(40px, 5vw, 72px);
  padding: 0 clamp(20px, 4vw, 64px);
}
.footer-title {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(40px, 6vw, 80px);
  letter-spacing: -0.02em;
}
.footer-sub { margin-top: 16px; color: #8f8f8f; font-size: 17px; }
.footer-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.footer-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #1c1c1f;
  color: #fafafa;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.footer-actions svg { width: 19px; height: 19px; }
.footer-actions a:hover { background: var(--accent); transform: scale(1.08); }

.marquee {
  display: block;
  margin-top: clamp(40px, 5vw, 64px);
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex;
  animation: scroll 18s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  font-family: var(--mono);
  font-size: clamp(18px, 2.4vw, 28px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fafafa;
  transition: color 0.2s ease;
}
.marquee:hover span { color: var(--accent); }
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.footer-name {
  margin-top: clamp(32px, 4vw, 56px);
  padding: 0 clamp(20px, 4vw, 64px);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 15.5vw, 300px);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: #fafafa;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: clamp(28px, 3vw, 48px);
  padding: 0 clamp(20px, 4vw, 64px);
  font-size: 13px;
  color: #8f8f8f;
}
.footer-privacy {
  margin: 12px auto 0;
  padding: 0 clamp(20px, 4vw, 64px);
  max-width: 640px;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
  color: #b0b0b0;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 560px) {
  .hero-title br { display: none; }
  .pill { padding: 14px 20px; font-size: 11.5px; gap: 7px; }
  .pill svg { width: 18px; height: 18px; }
  .nav-link { padding: 8px 10px; }
  .nav-link svg { display: none; }
  .nav-logo, .nav-mail { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .seq { opacity: 1; transform: none; transition: none; }
  .hero-gradient::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Language toggle in the nav ---------- */
.nav-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--faint);
}
.nav-lang a { color: var(--faint); text-decoration: none; transition: color 0.2s ease; }
.nav-lang a:hover { color: var(--accent); }
.nav-lang .on { color: var(--ink); font-weight: 600; }

/* ---------- Traditional Chinese typography ----------
   CJK has no italics and hates negative tracking; emphasis uses Kai style
   (LXGW WenKai TC) the way Latin uses italic. */
html[lang="zh-Hant"] body { line-height: 1.75; }
html[lang="zh-Hant"] .hero-title,
html[lang="zh-Hant"] .footer-title { letter-spacing: 0.02em; }
/* CJK has no italics: emphasis renders as gray instead (EN keeps italic) */
html[lang="zh-Hant"] em { font-style: normal; color: var(--muted); }
/* pen-on-paper handwriting: homepage hero only — an accent, not a system */
html[lang="zh-Hant"] .hero-title em {
  font-family: "辰宇落雁體 Thin", "Chenyuluoyan", "Iansui", "Noto Serif TC", serif;
  color: inherit;
}
