:root {
  --paper: #e8e6df;
  --ink: #191a18;
  --muted: #686a63;
  --line: rgba(25, 26, 24, .23);
  --card: #d8d6ce;
  --max: 1480px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
body.dialog-open { overflow: hidden; }
img, video { display: block; width: 100%; }
a { color: inherit; }
button { color: inherit; font: inherit; }

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 3.5vw, 64px);
  color: #f4f2eb;
  mix-blend-mode: difference;
}
.wordmark { display: flex; gap: 14px; align-items: baseline; font-weight: 650; text-decoration: none; letter-spacing: .04em; }
.wordmark-en { font-size: 11px; letter-spacing: .16em; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); font-size: 13px; }
.nav a { text-decoration: none; }
.lang-toggle { border: 1px solid currentColor; border-radius: 100%; width: 42px; height: 42px; background: transparent; cursor: pointer; }
.top-edge-fade { position: fixed; z-index: 12; inset: 0 0 auto; height: clamp(105px, 15vh, 180px); pointer-events: none; opacity: 0; background: linear-gradient(to bottom, var(--paper) 0%, rgba(232,230,223,.9) 30%, rgba(232,230,223,.42) 62%, rgba(232,230,223,0) 100%); transition: opacity .65s ease; }
body.past-hero .top-edge-fade { opacity: 1; }

.hero { min-height: 100svh; position: relative; overflow: hidden; color: #f2f0e8; }
.hero-image-wrap { position: absolute; inset: 0; background: #272a25 url("assets/images/carriage-still.jpg") center / cover no-repeat; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: saturate(.58) contrast(1.05) brightness(.64); transform: scale(1.015); transition: opacity 1.4s ease-in-out; }
.hero-video.is-active { opacity: 1; }
.hero-wash { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,15,13,.62) 0%, rgba(13,15,13,.16) 60%, rgba(13,15,13,.32) 100%); }
.hero-copy { position: absolute; z-index: 2; left: clamp(24px, 6vw, 96px); bottom: clamp(90px, 12vh, 150px); max-width: 840px; }
.eyebrow, .section-number { margin: 0 0 18px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(74px, 14vw, 210px); line-height: .76; letter-spacing: -.065em; font-weight: 540; }
.hero-intro { margin: 42px 0 0; max-width: 580px; font-size: clamp(17px, 1.45vw, 23px); }
.scroll-cue { position: absolute; z-index: 2; right: clamp(24px, 4vw, 64px); bottom: 38px; font-size: 12px; text-decoration: none; }

.section { max-width: var(--max); margin: 0 auto; padding: clamp(92px, 12vw, 180px) clamp(20px, 4vw, 64px); }
.section-heading { display: grid; grid-template-columns: minmax(80px, .45fr) 1.1fr 1.3fr; gap: 24px; align-items: start; border-top: 1px solid var(--line); padding-top: 18px; margin-bottom: clamp(55px, 8vw, 110px); }
.section-heading h2 { margin: 0; font-size: clamp(36px, 5vw, 76px); line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.section-heading > p:last-child { margin: 0; max-width: 620px; }

.works-grid { position: relative; padding-top: 20px; }
.works-grid::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line); }
.timeline-year { position: relative; }
.timeline-year-heading { position: relative; z-index: 2; display: flex; justify-content: center; padding: 12px 0 clamp(56px, 7vw, 100px); }
.timeline-year-heading span { display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid var(--ink); border-radius: 50%; background: var(--paper); font-size: 14px; font-variant-numeric: tabular-nums; }
.timeline-work { --gray: 100%; --sat: .72; --focus: 0; --line-scale: .35; --card-opacity: .54; --image-scale: 1.035; --shift-x: 0px; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr); align-items: center; min-height: clamp(430px, 54vw, 720px); }
.timeline-work::before { content: ""; grid-column: 2; grid-row: 1; width: 50%; height: 1px; background: var(--line); transform: scaleX(var(--line-scale)); transition: transform .18s linear; }
.timeline-work.side-left::before { justify-self: end; transform-origin: right; }
.timeline-work.side-right::before { justify-self: start; transform-origin: left; }
.timeline-work button { width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; opacity: var(--card-opacity); transition: opacity .18s linear, transform .18s linear; }
.timeline-work.side-left button { grid-column: 1; transform: translateX(var(--shift-x)); }
.timeline-work.side-right button { grid-column: 3; transform: translateX(var(--shift-x)); }
.work-image { overflow: hidden; aspect-ratio: 16 / 10; background: #272824; }
.work-image img { height: 100%; object-fit: cover; filter: grayscale(var(--gray)) saturate(var(--sat)); transform: scale(var(--image-scale)); transition: filter .18s linear, transform .18s linear; }
.timeline-work button:hover img { transform: scale(1.025); }
.work-meta { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); margin-top: 10px; }
.work-meta span, .work-meta p { font-size: 12px; color: var(--muted); }
.work-meta h3 { margin: 0; font-size: clamp(24px, 2.8vw, 43px); font-weight: 500; line-height: 1.15; }
.work-meta p { grid-column: 1; margin: 8px 0 0; }
.view-label { grid-column: 2; grid-row: 1 / span 2; }

.about-section { padding-top: 40px; }
.about-grid { display: grid; grid-template-columns: .88fr 1.12fr; gap: clamp(38px, 8vw, 130px); align-items: start; }
.portrait-wrap { margin: 0; position: sticky; top: 90px; }
.portrait-wrap img { filter: saturate(.82); }
.about-copy { padding-top: 4vw; max-width: 760px; }
.about-copy p { font-size: clamp(17px, 1.5vw, 23px); margin: 0 0 1.4em; }
.about-copy .lead { font-size: clamp(26px, 3vw, 46px); line-height: 1.35; letter-spacing: -.025em; }
.source-note { display: flex; flex-wrap: wrap; gap: 12px 22px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 54px; font-size: 12px; color: var(--muted); }

.download-link { justify-self: start; font-size: 13px; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.cv-content { display: grid; grid-template-columns: 1fr 1fr; gap: 80px 44px; }
.cv-group { border-top: 1px solid var(--line); padding-top: 14px; }
.cv-group h3 { margin: 0 0 30px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.cv-group ul { margin: 0; padding: 0; list-style: none; }
.cv-group li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid rgba(25,26,24,.1); }
.cv-group time { color: var(--muted); font-variant-numeric: tabular-nums; }

.site-footer { display: flex; justify-content: space-between; padding: 28px clamp(20px, 4vw, 64px); border-top: 1px solid var(--line); font-size: 12px; }
.contact-section { min-height: 78vh; }
.contact-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(54px, 8vw, 130px); align-items: start; }
.contact-details { position: sticky; top: 120px; }
.contact-kicker { margin: 0 0 14px; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.contact-email { display: inline-block; max-width: 100%; font-size: clamp(25px, 3.4vw, 52px); line-height: 1.08; letter-spacing: -.045em; overflow-wrap: anywhere; text-decoration-thickness: 1px; text-underline-offset: 8px; }
.contact-note { max-width: 430px; margin: 36px 0 0; color: var(--muted); }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 34px 22px; padding-top: 2px; }
.form-field { display: grid; gap: 9px; }
.form-field > span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.form-field-wide, .form-actions, .contact-status { grid-column: 1 / -1; }
.form-field input, .form-field textarea { width: 100%; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 12px 0 14px; background: transparent; color: var(--ink); font: inherit; outline: none; appearance: none; }
.form-field textarea { min-height: 185px; resize: vertical; }
.form-field input::placeholder, .form-field textarea::placeholder { color: rgba(25,26,24,.45); }
.form-field input:focus, .form-field textarea:focus { border-bottom-width: 2px; padding-bottom: 13px; }
.form-actions { display: grid; grid-template-columns: minmax(180px, .58fr) 1fr; gap: 22px; align-items: start; }
.contact-submit { display: flex; justify-content: space-between; gap: 20px; border: 1px solid var(--ink); padding: 15px 18px; background: var(--ink); color: var(--paper); cursor: pointer; transition: background .2s ease, color .2s ease; }
.contact-submit:hover { background: transparent; color: var(--ink); }
.contact-submit:disabled { cursor: wait; opacity: .58; }
.contact-privacy { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.contact-status { min-height: 1.6em; margin: -16px 0 0; color: var(--muted); font-size: 13px; }
.contact-status.is-success { color: var(--ink); }
.contact-honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.work-dialog { width: min(1180px, calc(100vw - 28px)); max-height: calc(100svh - 28px); border: 0; padding: 0; background: #d9d7cf; color: var(--ink); box-shadow: 0 28px 80px rgba(0,0,0,.38); }
.work-dialog::backdrop { background: rgba(16,17,15,.78); backdrop-filter: blur(8px); }
.dialog-close { position: sticky; float: right; top: 18px; right: 18px; z-index: 3; margin: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(232,230,223,.9); cursor: pointer; font-size: 25px; line-height: 1; }
#dialog-content { padding: clamp(28px, 5vw, 72px); }
.dialog-header { display: grid; grid-template-columns: 80px 1fr 1fr; gap: 20px; align-items: end; margin: 20px 0 64px; }
.dialog-header p { margin: 0; }
.dialog-header h2 { margin: 0; font-size: clamp(44px, 7vw, 98px); line-height: .95; font-weight: 500; letter-spacing: -.05em; }
.dialog-medium { font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}
.work-dialog video { background: #0f100f; aspect-ratio: 16 / 9; }
.media-caption, .installation-grid figcaption { margin: 8px 0 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.dialog-body { max-width: 790px; margin: 80px 0; font-size: clamp(18px, 2vw, 28px); }
.work-source { display: inline-block; margin-top: 24px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.installation-gallery { margin-top: clamp(90px, 12vw, 170px); }
.gallery-heading { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 34px; border-top: 1px solid var(--line); }
.gallery-heading h3 { margin: 0; font-size: clamp(26px, 4vw, 56px); font-weight: 500; letter-spacing: -.04em; }
.gallery-heading span { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.installation-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(45px, 7vw, 90px) 18px; align-items: end; }
.installation-grid figure { margin: 0; }
.installation-grid figure:nth-child(1) { grid-column: 1 / span 8; }
.installation-grid figure:nth-child(2) { grid-column: 9 / span 4; }
.installation-grid figure:nth-child(3) { grid-column: 2 / span 10; }
.installation-grid figure:nth-child(4) { grid-column: 1 / span 6; }
.installation-grid figure:nth-child(5) { grid-column: 7 / span 6; }
.installation-grid figure:nth-child(6) { grid-column: 3 / span 8; }
.installation-grid img { background: #171815; }

@media (max-width: 800px) {
  .site-header { align-items: flex-start; }
  .nav a { display: none; }
  .hero h1 { font-size: clamp(66px, 24vw, 120px); }
  .section-heading { grid-template-columns: 46px 1fr; }
  .section-heading > p:last-child, .section-heading .download-link { grid-column: 2; }
  .works-grid::before { left: 18px; }
  .timeline-year-heading { justify-content: flex-start; padding-bottom: 58px; }
  .timeline-year-heading span { width: 58px; height: 58px; margin-left: 18px; transform: translateX(-50%); font-size: 12px; }
  .timeline-work { grid-template-columns: 48px minmax(0, 1fr); min-height: 0; margin-bottom: 92px; }
  .timeline-work::before, .timeline-work.side-left::before, .timeline-work.side-right::before { grid-column: 1; width: 30px; justify-self: start; transform-origin: left; }
  .timeline-work.side-left button, .timeline-work.side-right button { grid-column: 2; }
  .work-meta { grid-template-columns: 1fr; }
  .work-meta h3, .work-meta p { grid-column: 1; }
  .view-label { display: none; }
  .about-grid, .cv-content { grid-template-columns: 1fr; }
  .portrait-wrap { position: static; }
  .dialog-header { grid-template-columns: 1fr; }
  .dialog-header h2 { font-size: 50px; }
  .installation-grid { display: block; }
  .installation-grid figure { margin-bottom: 48px; }
  .contact-grid, .contact-form, .form-actions { grid-template-columns: 1fr; }
  .contact-details { position: static; }
  .contact-email { font-size: clamp(24px, 8vw, 40px); }
  .contact-note { margin-top: 28px; }
  .contact-form { margin-top: 10px; gap: 28px; }
}

@media (max-width: 800px) and (orientation: portrait) {
  .hero { min-height: 100svh; }
  .hero-video { object-position: 54% center; transform: scale(1.025); }
  .hero-video:nth-of-type(2) { object-position: 62% center; }
  .hero-video:nth-of-type(3) { object-position: 56% center; }
  .hero-wash { background: linear-gradient(180deg, rgba(13,15,13,.22) 0%, rgba(13,15,13,.22) 40%, rgba(13,15,13,.76) 100%); }
  .hero-copy { left: 24px; right: 24px; bottom: 108px; }
  .hero-intro { max-width: 88vw; margin-top: 30px; }
  .scroll-cue { right: 24px; bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
