:root {
  --bg: #0a0a0a;
  --cream: #e8e6e0;
  --muted: #6a6a6a;
  --muted-dim: #4a4a4a;
  --ghost: #1b1b1b;
  --line: rgba(232, 230, 224, 0.12);
  --live: oklch(0.72 0.16 150);
  --display: 'Bebas Neue', sans-serif;
  --body: 'Space Grotesk', sans-serif;

  /* --- tweakable --- */
  --hero-max: 240px;
  --statement-max: 6rem;
  --pillar-max: 5rem;
  --contact-max: 8rem;
  --caption-opacity: 0.45;
  --label-opacity: 0.3;
  --label-tracking: 0.35em;
  --reveal-duration: 0.75s;
  --reveal-distance: 28px;
  --reveal-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--body);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--cream);
  color: var(--bg);
}

/* ---------- Particle canvas ---------- */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Custom dot cursor ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--cream);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(232, 230, 224, 0.4);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.cursor-ring.hover {
  width: 56px;
  height: 56px;
  border-color: rgba(232, 230, 224, 0.8);
}

@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }

  a,
  button {
    cursor: none;
  }
}

@media (hover: none),
(pointer: coarse) {

  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

/* ---------- Layout shell ---------- */
.wrap {
  position: relative;
  z-index: 2;
}

.section-pad {
  padding: 0 clamp(28px, 6vw, 96px);
}

/* ---------- Nav ---------- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px clamp(28px, 6vw, 96px);
  mix-blend-mode: difference;
}

.brand {
  font-family: var(--body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.5em;
  color: var(--cream);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: clamp(28px, 4vw, 56px);
  list-style: none;
}

.nav-links a {
  font-family: var(--body);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1px;
  background: var(--cream);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--cream);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ---------- Language switch ---------- */
.nav-right {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--body);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.25em;
}

.lang-switch a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.lang-switch a:hover,
.lang-switch a.active {
  color: var(--cream);
}

.lang-switch .sep {
  color: var(--muted-dim);
  user-select: none;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero-title {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.82;
  font-size: clamp(64px, 15vw, var(--hero-max));
  letter-spacing: 0.01em;
  margin-left: -0.02em;
  word-break: keep-all;
  overflow-wrap: break-word;
  will-change: transform;
}

.hero-title span {
  display: inline-block;
  white-space: nowrap;
}

.hero-title .l1,
.hero-title .l2 {
  color: var(--cream);
}

.hero-title .l3 {
  /* half-lit: readable but dimmer than l1/l2, keeps the fade-out layering */
  color: rgba(232, 230, 224, 0.7);
}

.hero-sub {
  margin-top: clamp(40px, 6vh, 80px);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--muted);
  max-width: 30ch;
  animation: heroSubIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

@keyframes heroSubIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.scroll-cue {
  position: absolute;
  right: clamp(28px, 6vw, 96px);
  bottom: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: cuePulse 2.4s ease-in-out infinite;
}

@keyframes cuePulse {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.7;
  }
}

.scroll-cue .bar {
  width: 56px;
  height: 1px;
  background: var(--muted);
  position: relative;
  overflow: hidden;
}

.scroll-cue .bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cream);
  transform: translateX(-100%);
  animation: scrollbar 2.4s ease-in-out infinite;
}

@keyframes scrollbar {
  0% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(0%);
  }

  100% {
    transform: translateX(100%);
  }
}

.scroll-cue span {
  font-size: 9px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Section label ---------- */
.label {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: rgba(255, 255, 255, var(--label-opacity));
  display: flex;
  align-items: center;
  gap: 14px;
}

.label::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--muted-dim);
}

/* ---------- Statement ---------- */
.statement {
  padding-top: clamp(120px, 18vh, 220px);
  padding-bottom: clamp(120px, 18vh, 220px);
  max-width: 1400px;
}

.statement-body {
  margin-top: 48px;
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(2.8rem, 6vw, var(--statement-max));
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: rgba(232, 230, 224, 0.7);
  max-width: 18ch;
  will-change: transform;
}

.statement-body .sg {
  opacity: 0;
  transition: opacity var(--reveal-duration) var(--reveal-ease);
}

.statement-body .sg.in {
  opacity: 1;
}

.statement-body .em {
  font-style: normal;
  color: var(--cream);
}

/* ---------- Projects ---------- */
.projects {
  padding-top: clamp(100px, 14vh, 180px);
  padding-bottom: clamp(100px, 14vh, 180px);
  border-top: 1px solid var(--line);
}

.projects-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
}

.more {
  font-size: 0.65rem;
  letter-spacing: var(--label-tracking);
  color: rgba(255, 255, 255, var(--label-opacity));
  text-transform: uppercase;
}

.project-list {
  margin-top: clamp(48px, 8vh, 96px);
}

.project {
  display: block;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--line);
  padding: clamp(28px, 4vw, 48px) 0;
  position: relative;
}

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

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.project-name-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.project-name {
  font-family: var(--display);
  font-size: clamp(48px, 9vw, 132px);
  line-height: 0.9;
  color: var(--cream);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--live);
  border: 1px solid color-mix(in oklch, var(--live) 40%, transparent);
  padding: 6px 12px;
  border-radius: 100px;
  align-self: center;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--live) 60%, transparent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in oklch, var(--live) 60%, transparent);
  }

  70% {
    box-shadow: 0 0 0 7px transparent;
  }

  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.project-arrow {
  font-family: var(--body);
  font-size: 28px;
  color: var(--muted);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s ease;
}

.project-meta {
  margin-top: 14px;
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  max-width: 46ch;
}

.project:hover .project-name {
  transform: translateX(18px);
}

.project:hover .project-arrow {
  transform: translate(8px, -8px);
  color: var(--cream);
}

/* ---------- Pillars (What We Do) ---------- */
.pillars {
  padding-top: clamp(100px, 14vh, 180px);
  padding-bottom: clamp(100px, 14vh, 180px);
  border-top: 1px solid var(--line);
}

.pillar-list {
  margin-top: clamp(48px, 8vh, 96px);
}

.pillar {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: clamp(20px, 5vw, 80px);
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: clamp(36px, 5vw, 64px) 0;
}

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

.pillar-num {
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.25);
  padding-top: 1.1em;
}

.pillar-title {
  font-family: var(--display);
  font-size: clamp(3rem, 5vw, var(--pillar-max));
  line-height: 0.92;
  color: var(--cream);
}

.pillar-tag {
  margin-top: 14px;
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, var(--caption-opacity));
  text-transform: none;
  line-height: 1.7;
}

/* ---------- Contact ---------- */
.contact {
  padding-top: clamp(120px, 18vh, 220px);
  padding-bottom: clamp(80px, 10vh, 120px);
  border-top: 1px solid var(--line);
}

.contact-big {
  font-family: var(--display);
  font-size: clamp(4rem, 9vw, var(--contact-max));
  line-height: 0.84;
  color: var(--cream);
  margin-top: 40px;
}

.contact-note {
  margin-top: 28px;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.8;
  letter-spacing: 0.02em;
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.4);
}

.contact-mail {
  display: inline-block;
  margin-top: 36px;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-mail:hover {
  color: #fff;
}

footer {
  margin-top: clamp(80px, 12vh, 140px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.2);
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--reveal-duration) var(--reveal-ease),
    transform var(--reveal-duration) var(--reveal-ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {

  .reveal,
  .statement-body .sg {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-cue,
  .hero-sub {
    animation: none;
  }

  .scroll-cue .bar::after {
    animation: none;
  }
}

@media (max-width: 640px) {
  .nav-links {
    gap: 18px;
  }

  .nav-right {
    gap: 16px;
  }

  .lang-switch {
    gap: 7px;
    letter-spacing: 0.15em;
  }

  .pillar {
    grid-template-columns: 48px 1fr;
  }

  .hero-sub {
    margin-top: 32px;
  }
}

/* ---------- CJK locale overrides (zh-Hant / ja) ---------- */
/* Base pages are en; these rules only apply on the localized documents.
   Big display headings switch to Noto Sans (TC/JP) because Bebas Neue has
   no CJK glyphs; body copy widens because full-width CJK glyphs need more room. */
html[lang="zh-Hant"] {
  --cjk-display: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', var(--display);
  --cjk-body: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', var(--body);
}

html[lang="ja"] {
  --cjk-display: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', var(--display);
  --cjk-body: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', var(--body);
}

html[lang="zh-Hant"] .hero-title,
html[lang="ja"] .hero-title {
  font-family: var(--cjk-display);
  font-weight: 500;
  font-size: clamp(42px, 11vw, 168px);
  line-height: 1.04;
  letter-spacing: 0.04em;
  margin-left: 0;
  word-break: normal;
}

html[lang="zh-Hant"] .pillar-title,
html[lang="ja"] .pillar-title {
  font-family: var(--cjk-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  line-height: 1.16;
  letter-spacing: 0.04em;
}

html[lang="zh-Hant"] .contact-big,
html[lang="ja"] .contact-big {
  font-family: var(--cjk-display);
  font-weight: 500;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.06;
  letter-spacing: 0.04em;
}

html[lang="zh-Hant"] .statement-body,
html[lang="ja"] .statement-body {
  font-family: var(--cjk-body);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  max-width: 22ch;
}

html[lang="zh-Hant"] .hero-sub,
html[lang="ja"] .hero-sub {
  font-family: var(--cjk-body);
  letter-spacing: 0.06em;
  max-width: 42ch;
}

html[lang="zh-Hant"] .project-meta,
html[lang="ja"] .project-meta,
html[lang="zh-Hant"] .contact-note,
html[lang="ja"] .contact-note {
  font-family: var(--cjk-body);
  font-style: normal;
  letter-spacing: 0.04em;
  line-height: 1.9;
  max-width: 50ch;
}

html[lang="zh-Hant"] .pillar-tag,
html[lang="ja"] .pillar-tag,
html[lang="zh-Hant"] .nav-links a,
html[lang="ja"] .nav-links a,
html[lang="zh-Hant"] .label,
html[lang="ja"] .label,
html[lang="zh-Hant"] .more,
html[lang="ja"] .more {
  font-family: var(--cjk-body);
}

/* ---------- Narrow screens: drop anchor nav, keep brand + language switch ---------- */
@media (max-width: 520px) {
  .nav-links {
    display: none;
  }
}
