/* All values come from DESIGN.md. Change tokens here, not in the rules below. */

:root {
  /* Colours (DESIGN.md 2.1): white, soft black, gold lines. No fills, no cream, no brown. */
  --color-white: #FFFFFF;
  --color-ink: #1C1C1C;
  --color-grey: #555555;
  --color-gold: #C4A24A;
  --color-line: #E6D9B4; /* pale gold hairline */

  /* Fonts (DESIGN.md 2.2): chosen by the owner. All free Google Fonts. */
  --font-display: "Bellefair", "Noto Serif TC", Georgia, serif;
  --font-signature: "Allison", cursive;
  --font-reading: "Jost", "Noto Sans TC", "Segoe UI", sans-serif;

  /* Type scale (DESIGN.md 2.4) */
  --text-hero: clamp(40px, 6.4vw, 96px);
  --text-h1: clamp(34px, 4.6vw, 60px);
  --text-h2: clamp(24px, 2.8vw, 34px);
  --text-h3: 21px;
  --text-script-xl: clamp(54px, 7vw, 104px);
  --text-script: clamp(40px, 4.4vw, 58px);
  --text-quote: clamp(20px, 2.2vw, 27px);
  --text-body: 18px;
  --text-small: 14px;
  --text-label: 12px;

  /* Spacing (DESIGN.md 3) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --space-7: 96px;
  --space-8: 160px;
  --section-pad: clamp(var(--space-7), 12vw, var(--space-8));

  --w-reading: 680px;
  --w-content: 960px;
  --w-wide: 1240px;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-white);
  color: var(--color-ink);
  font-family: var(--font-reading);
  font-size: var(--text-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, blockquote, figure { margin: 0; padding: 0; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
a { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-gold); text-decoration-thickness: 1px; text-underline-offset: 6px; transition: text-underline-offset 300ms; }
a:hover { text-underline-offset: 3px; }
:focus-visible { outline: 1px solid var(--color-ink); outline-offset: 4px; }

h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; text-transform: uppercase; text-wrap: balance; }
h1 { font-size: var(--text-h1); letter-spacing: 0.2em; }
h2 { font-size: var(--text-h2); letter-spacing: 0.22em; }
h3 { font-family: var(--font-display); font-size: var(--text-h3); font-weight: 400; letter-spacing: 0.08em; line-height: 1.3; }

.label { font-size: var(--text-label); font-weight: 400; letter-spacing: 0.24em; text-transform: uppercase; color: var(--color-grey); }
.small { font-size: var(--text-small); color: var(--color-grey); }
.signature { font-family: var(--font-signature); font-size: var(--text-script); line-height: 1; font-weight: 400; }
.todo { color: var(--color-grey); font-style: italic; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--space-3); top: var(--space-3); z-index: 100; background: var(--color-white); padding: var(--space-2) var(--space-3); }

/* Traditional Chinese pages (DESIGN.md 2.3): no italics, no script font, looser lines */
:lang(zh-Hant) { font-style: normal; }
html:lang(zh-Hant) body { line-height: 1.9; }
:lang(zh-Hant) .signature { font-family: var(--font-display); font-size: calc(var(--text-script) * 0.5); letter-spacing: 0.4em; line-height: 1.6; }
:lang(zh-Hant) .hero__tagline { font-size: clamp(22px, 2.6vw, 34px); margin-top: var(--space-4); }
:lang(zh-Hant) .section__head .signature, :lang(zh-Hant) .page-header .signature { margin-top: var(--space-3); font-size: 15px; letter-spacing: 0.5em; color: var(--color-grey); }

/* Containers */
.container { width: 100%; max-width: var(--w-content); margin-inline: auto; padding-inline: var(--space-5); }
.container--reading { max-width: var(--w-reading); }
.container--wide { max-width: var(--w-wide); }
@media (max-width: 639px) { .container { padding-inline: var(--space-4); } }

/* Sections */
.section { padding-block: var(--section-pad); }
.section--tight { padding-block: var(--space-7); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--space-4); }
.actions { margin-top: var(--space-6); text-align: center; }

/* Section heading: spaced capitals with a handwritten line tucked underneath */
.section__head { text-align: center; margin-bottom: var(--space-7); }
.section__head .signature { display: block; margin-top: -0.12em; }

/* Vertical divider */
.divider { width: 1px; height: var(--space-7); background: var(--color-gold); margin: 0 auto; }

/* Top menu: one white box of links floating over the page (and over the photo on Home). Wraps to two rows when narrow. */
:root { --nav-space: 84px; }
.site-nav { position: fixed; top: var(--space-3); left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding-inline: var(--space-3); pointer-events: none; }
.site-nav__list {
  pointer-events: auto;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 clamp(16px, 2.8vw, 40px);
  background: var(--color-white);
  padding: 4px clamp(18px, 3vw, 36px);
}
.site-nav__list a {
  display: inline-block; white-space: nowrap; padding: 12px 0 8px;
  font-size: var(--text-label); font-weight: 400; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--color-ink); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 300ms;
}
.site-nav__list a:hover { border-bottom-color: var(--color-line); }
.site-nav__list a[aria-current="page"] { border-bottom-color: var(--color-gold); }
.site-nav__lang { padding-left: clamp(14px, 2.4vw, 32px); border-left: 1px solid var(--color-gold); }
.nav-short { display: none; }
@media (max-width: 639px) {
  :root { --nav-space: 104px; }
  .site-nav { top: var(--space-2); padding-inline: var(--space-2); }
  .site-nav__list { gap: 0 16px; padding: 2px 14px; }
  .site-nav__list a { font-size: 11px; letter-spacing: 0.18em; padding: 10px 0 6px; }
  .site-nav__lang { padding-left: 14px; }
}

/* Home hero: one full-width photo that fades into the white page, name set over the fade */
.hero { position: relative; padding-bottom: var(--space-6); }
.hero__image {
  position: relative; height: min(72vh, 720px); min-height: 380px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 30%, rgba(0, 0, 0, 0.5) 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 30%, rgba(0, 0, 0, 0.5) 62%, transparent 100%);
}
/* The image box is larger than its window and pinned bottom-right, so the top-left corner of the photo stays out of view */
.hero__image img { position: absolute; right: 0; bottom: 0; width: 118%; height: 130%; max-width: none; object-fit: cover; object-position: 50% 50%; }
/* Media page: same treatment, image pinned bottom-left so its top-right corner (photographer's logo) stays out of view */
.hero__image--pin-left img { left: 0; right: auto; }
/* Contact page: same size as the other pages, dragged slightly left to cut the shirt; the right edge stays short of the photographer's logo */
.hero__image--contact img { left: -3%; right: auto; }
@media (max-width: 639px) { .hero__image--contact img { object-position: 58% 100% !important; } } /* contact-phone: keep the hand centred */
/* Teaching page: a portrait, so the photo is not enlarged and is anchored near the top to keep the face in view */
.hero__image--portrait img { inset: 0; width: 100%; height: 100%; object-position: 50% 5%; }
.hero__title { position: relative; text-align: center; margin-top: clamp(-170px, -15vh, -90px); padding-inline: var(--space-4); }
.hero__name { font-size: var(--text-hero); letter-spacing: 0.14em; line-height: 1.08; }
.hero__name span { display: block; }
.hero__tagline { font-size: var(--text-script-xl); margin-top: -0.08em; }
@media (max-width: 639px) {
  .hero__image { height: 64vh; }
  .hero__title { margin-top: -100px; }
}

/* Page header */
.page-header { text-align: center; padding: calc(var(--nav-space) + clamp(48px, 8vw, 104px)) var(--space-4) 0; }
.page-header .signature { display: block; font-size: var(--text-script-xl); margin-top: -0.14em; }
.page-header .divider { margin-top: var(--space-6); }

/* Placeholders (skeleton only): outlined frames, replaced by real photos later */
.ph {
  display: grid; place-items: center;
  border: 1px solid var(--color-line);
  color: var(--color-grey);
  font-size: var(--text-label); letter-spacing: 0.24em; text-transform: uppercase; text-align: center;
  padding: var(--space-3);
  aspect-ratio: 3 / 2;
}
.ph--portrait { aspect-ratio: 3 / 4; }
.ph--video { aspect-ratio: 16 / 9; }
.ph--square { aspect-ratio: 1; }

/* Photos */
.photo { width: 100%; display: block; object-fit: cover; }
.photo--hero { aspect-ratio: 4 / 5; }
.photo--portrait { aspect-ratio: 3 / 4; }
.photo--square { aspect-ratio: 1; }
.photo--landscape { aspect-ratio: 3 / 2; }
.card .photo + h3 { margin-top: var(--space-4); }
@media (max-width: 899px) { .split > .photo { max-width: 340px; margin-inline: auto; } }

/* Press quotes */
.quotes > * + * { margin-top: var(--space-7); }
.quote { text-align: center; }
.quote::before { content: "\201C"; display: block; font-family: var(--font-display); font-size: 72px; line-height: 0.6; color: var(--color-gold); margin-bottom: var(--space-3); }
:lang(zh-Hant) .quote::before { content: none; }
.quote p { font-size: var(--text-quote); font-style: italic; line-height: 1.5; }
.quote footer { margin-top: var(--space-4); }

/* Long text */
.prose > * + * { margin-top: var(--space-4); }
.prose blockquote { border-left: 1px solid var(--color-gold); padding-left: var(--space-4); margin-block: var(--space-5); }
.prose blockquote footer { margin-top: var(--space-2); }

/* Performance rows */
.performances { border-top: 1px solid var(--color-line); }
.performance {
  display: grid; grid-template-columns: 150px 1fr 1fr auto; gap: var(--space-4); align-items: baseline;
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-line);
}
.performance__date { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.06em; }
.year { margin-top: var(--space-6); margin-bottom: var(--space-3); color: var(--color-grey); }
@media (max-width: 767px) { .performance { grid-template-columns: 1fr; gap: var(--space-1); } }

/* Grids and cards */
.grid { display: grid; gap: var(--space-6) var(--space-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: 1fr; max-width: var(--w-content); margin-inline: auto; } /* project cards: one per row */
.grid--4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); align-items: center; }
.grid--4 > :nth-child(even) { margin-top: var(--space-6); } /* staggered, not a flat row */
.split { display: grid; grid-template-columns: 4fr 6fr; gap: var(--space-7); align-items: start; }
@media (max-width: 899px) {
  .split { grid-template-columns: 1fr; gap: var(--space-6); }
  .split > .ph { max-width: 340px; margin-inline: auto; width: 100%; }
}
@media (max-width: 639px) {
  .grid--2 { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
.card > * + * { margin-top: var(--space-3); }
.card .ph + h3 { margin-top: var(--space-4); }
.card--text { text-align: center; padding-top: var(--space-4); border-top: 1px solid var(--color-gold); }

/* Audio rows */
.audio { border-top: 1px solid var(--color-line); }
.audio__item { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--space-4); align-items: center; padding-block: var(--space-4); border-bottom: 1px solid var(--color-line); }
.audio__play { width: 56px; height: 56px; border: 1px solid var(--color-gold); border-radius: 50%; display: grid; place-items: center; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }

/* Teaching entries */
.entries { border-top: 1px solid var(--color-line); max-width: var(--w-reading); margin-inline: auto; }
.entries > li { padding-block: var(--space-4); border-bottom: 1px solid var(--color-line); }
.entries > li > * + * { margin-top: var(--space-2); }
.entries--compact { margin-top: var(--space-4); text-align: center; }
.entries--compact > li { padding-block: var(--space-3); }
.plain > li + li { margin-top: var(--space-2); }

/* Masterclasses: small heading, then text */
.mc-text { margin-top: var(--space-3); }
.mc-label { margin-top: var(--space-6); }
.mc-text li { padding-block: var(--space-1); }
.mc-text li + li { margin-top: 0; }

/* Media: videos */
.videos { display: grid; gap: var(--space-7); max-width: var(--w-content); margin-inline: auto; }
.video video { display: block; width: 100%; height: auto; max-height: 80vh; background: var(--color-ink); }
.video__frame { position: relative; aspect-ratio: 16 / 9; background: var(--color-ink); }
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video h3 { margin-top: var(--space-4); }
.video figcaption { margin-top: var(--space-2); }

/* Projects: selected performances */
.selected > li { display: grid; grid-template-columns: 72px 1fr; gap: var(--space-4); padding-block: var(--space-2); }
.selected__year { font-family: var(--font-display); letter-spacing: 0.06em; }

/* Buttons */
.button {
  display: inline-block; min-height: 44px; padding: 14px 36px;
  border: 1px solid var(--color-ink); background: transparent; color: var(--color-ink);
  font: inherit; font-size: var(--text-label); font-weight: 400; letter-spacing: 0.24em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: background-color 400ms, color 400ms, letter-spacing 400ms;
}
.button:hover { background: var(--color-ink); color: var(--color-white); letter-spacing: 0.3em; }

/* Contact form: underlined fields, no boxes */
.form > * + * { margin-top: var(--space-5); }
.form label { display: block; }
.form input, .form textarea { width: 100%; padding: 10px 0; background: transparent; color: var(--color-ink); border: 0; border-bottom: 1px solid var(--color-line); border-radius: 0; font: inherit; }
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--color-gold); }
.form textarea { min-height: 140px; resize: vertical; }

/* Footer */
.site-footer { padding: var(--space-6) var(--space-4); text-align: center; border-top: 1px solid var(--color-line); }
.site-footer__name { font-family: var(--font-signature); font-size: 46px; line-height: 1; }
.site-footer__social, .site-footer__menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--space-4); }
.site-footer__social { margin-top: var(--space-4); }
.site-footer a { font-size: var(--text-label); letter-spacing: 0.24em; text-transform: uppercase; text-decoration: none; padding: 12px 0; display: inline-block; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--color-gold); }
.site-footer__menu a { color: var(--color-grey); }
.site-footer .small { margin-top: var(--space-4); }

/* Gentle reveal on scroll (only when scripts run and motion is welcome) */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 1100ms ease, transform 1100ms ease; }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js .section__head[data-reveal] .signature, .js .page-header[data-reveal] .signature { transition: opacity 1200ms ease 350ms; opacity: 0; }
.js .is-visible .signature { opacity: 1 !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .js [data-reveal], .js [data-reveal] .signature { opacity: 1 !important; transform: none; }
}
