:root {
  --void: #050508;
  --mark: #e8e4dc;
  --mark-dim: #c4bfb4;
  --line: rgba(232, 228, 220, 0.18);
  --focus: #e8e4dc;
  --pad: clamp(1.25rem, 3.2vw, 3rem);
  --measure: 38rem;
  --font-wordmark: "TeX Gyre Pagella", Palatino, "Palatino Linotype", "Book Antiqua",
    "Iowan Old Style", Georgia, serif;
  --font-title: "Noto Sans", ui-sans-serif, sans-serif;
  --font-title-weight: 400;
  --font-body: "Noto Sans", ui-sans-serif, sans-serif;
  --font-body-weight: 400;
}

html[lang="en"] {
  --font-title: "Noto Sans", ui-sans-serif, sans-serif;
  --font-title-weight: 400;
  --font-body: "Noto Sans", ui-sans-serif, sans-serif;
  --font-body-weight: 400;
}

html[lang="zh-Hant"] {
  --font-title: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC",
    sans-serif;
  --font-title-weight: 500;
  --font-hero: "Noto Serif TC", "PingFang TC", "Songti TC", serif;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC",
    sans-serif;
  --font-body-weight: 400;
}

html[lang="ja"] {
  --font-title: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-title-weight: 500;
  --font-hero: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-body-weight: 400;
}

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

html {
  background: var(--void);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--void);
  color: var(--mark);
  font-family: var(--font-body);
  font-weight: var(--font-body-weight);
  font-size: 1.25rem;
  line-height: 1.55;
}

html[lang="en"] body {
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--mark);
  color: var(--void);
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--mark);
  text-decoration: underline;
  text-underline-offset: 0.28em;
  text-decoration-thickness: 1px;
}

/* Layer 0 — fixed viewport atmosphere */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--void);
}

.atmosphere canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Layer 1 — open copy lane (no panels; atmosphere shows between lines and sections) */
.page {
  position: relative;
  z-index: 1;
  max-width: calc(var(--measure) + var(--pad) * 2);
  margin-inline: auto;
  padding: 0 var(--pad) clamp(3rem, 8vh, 5rem);
}

.content-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 12vh, 7rem);
  padding-top: clamp(0.5rem, 2vh, 1.5rem);
}

.content-stack > section {
  background: transparent;
}

.site-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: var(--pad);
  padding-bottom: clamp(2rem, 5vh, 3rem);
}

.wordmark {
  font-family: var(--font-wordmark);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--mark);
}

.wordmark:hover {
  text-decoration: none;
}

.lang {
  font-size: 0.95rem;
  color: var(--mark-dim);
  text-decoration: none;
}

.lang[aria-current="page"] {
  color: var(--mark);
}

.lang:hover {
  color: var(--mark);
}

.lang-pair {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 0.95rem;
}

.lang-sep {
  color: var(--mark-dim);
  user-select: none;
  pointer-events: none;
}

html[lang="en"] .block-section h2,
html[lang="en"] .services dt,
html[lang="en"] .work p strong {
  font-weight: 500;
}

.block-identity {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(68vh, 38rem);
}

h1 {
  margin: 0;
  width: 100%;
  max-width: var(--measure);
  font-family: var(--font-title);
  font-size: clamp(2.15rem, 4.4vw, 2.75rem);
  font-weight: var(--font-title-weight);
  line-height: 1.22;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: rgba(232, 228, 220, 0.94);
}

.lede {
  margin: 1.75rem 0 0;
  width: 100%;
  max-width: var(--measure);
  color: rgba(196, 191, 180, 0.82);
}

.block-section h2 {
  margin: 0 0 1.35rem;
  width: 100%;
  max-width: var(--measure);
  font-family: var(--font-title);
  font-size: clamp(1.65rem, 3.4vw, 1.9rem);
  font-weight: var(--font-title-weight);
  line-height: 1.18;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: rgba(232, 228, 220, 0.94);
}

.services {
  margin: 0;
  width: 100%;
  max-width: var(--measure);
}

.services > div + div {
  margin-top: 1.75rem;
}

.services dt {
  font-family: var(--font-title);
  font-weight: var(--font-title-weight);
  margin: 0 0 0.35rem;
  color: var(--mark);
}

.services dd {
  margin: 0;
  color: rgba(196, 191, 180, 0.82);
}

.work p {
  margin: 0 0 1.1rem;
  width: 100%;
  max-width: var(--measure);
  color: rgba(196, 191, 180, 0.82);
}

.work h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-title);
  font-weight: var(--font-title-weight);
  font-size: inherit;
  color: var(--mark);
}

.work p strong {
  display: block;
  font-family: var(--font-title);
  font-weight: var(--font-title-weight);
  color: var(--mark);
  margin-bottom: 0.4rem;
}

.contact-lede {
  margin: 0 0 1rem;
  max-width: var(--measure);
  color: rgba(196, 191, 180, 0.82);
}

.mail {
  font-family: var(--font-title);
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: var(--font-title-weight);
  letter-spacing: -0.03em;
  color: var(--mark);
}

.contact-wa {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: var(--font-title-weight);
  color: var(--mark-dim);
}

.contact-wa:hover {
  color: var(--mark);
}

html[lang="zh-Hant"] h1,
html[lang="ja"] h1 {
  font-family: var(--font-hero);
  line-height: 1.45;
  letter-spacing: 0;
}

html[lang="zh-Hant"] body,
html[lang="ja"] body {
  line-height: 1.75;
  letter-spacing: 0;
}

html[lang="zh-Hant"] .block-section h2,
html[lang="ja"] .block-section h2 {
  line-height: 1.4;
  letter-spacing: 0;
}

html[lang="zh-Hant"] .mail,
html[lang="ja"] .mail {
  letter-spacing: 0;
}

.site-foot {
  margin-top: clamp(3rem, 8vh, 5rem);
  font-size: 0.95rem;
  color: var(--mark-dim);
}

@media (max-width: 1023px) {
  .content-stack {
    gap: clamp(2.75rem, 10vh, 5rem);
  }

  .block-identity {
    min-height: auto;
    justify-content: flex-start;
    padding-top: clamp(0.5rem, 2vh, 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere canvas {
    animation: none;
  }
}

@font-face {
  font-family: "TeX Gyre Pagella";
  src: url("fonts/texgyrepagella-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TeX Gyre Pagella";
  src: url("fonts/texgyrepagella-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Quote */
.quote {
  margin: 0;
  max-width: var(--measure);
}

.quote blockquote {
  margin: 0 0 1.25rem;
  padding: 0;
}

.quote blockquote p {
  margin: 0;
  color: var(--mark);
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  line-height: 1.5;
}

.quote blockquote p + p {
  margin-top: 0.9rem;
  font-size: 1rem;
  color: rgba(196, 191, 180, 0.82);
}

.quote figcaption {
  color: rgba(196, 191, 180, 0.82);
  font-size: 0.95rem;
}

.quote figcaption cite {
  font-style: normal;
}

html[lang="zh-Hant"] .quote blockquote p,
html[lang="ja"] .quote blockquote p {
  letter-spacing: 0;
  line-height: 1.75;
}

.block-section p a {
  text-decoration: underline;
  text-underline-offset: 0.28em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--mark-dim);
}

.block-section p a:hover {
  text-decoration-color: var(--mark);
}
