/* =========================================================
   Immersive Studio — Global Styles
   ========================================================= */

:root {
  --bg: #ececec;
  --bg-2: #e2e2e2;
  --surface: #ffffff;
  --text: #0a0a0a;
  --text-muted: #555555;
  --text-faint: #8a8a8a;
  --border: #c9c9c9;
  --border-soft: #d6d6d6;
  --accent: #0a0a0a;
  --card-dark: #111111;
  --max: 1480px;
  --gutter: clamp(20px, 4vw, 56px);
  --radius-pill: 999px;
  /* Latin first, then Chinese fallback — browser falls through per-glyph */
  --serif: "Cormorant Garamond", "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "Times New Roman", Georgia, serif;
  --sans: "Inter", "Noto Sans TC", "Source Han Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0c0c0c;
  --bg-2: #141414;
  --surface: #1a1a1a;
  --text: #ececec;
  --text-muted: #b5b5b5;
  --text-faint: #6e6e6e;
  --border: #2a2a2a;
  --border-soft: #1f1f1f;
  --accent: #ececec;
  --card-dark: #050505;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Typography helpers ---------- */
.eyebrow,
.label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.serif { font-family: var(--serif); font-weight: 400; }
.italic { font-style: italic; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text);
}

.h-display {
  font-size: clamp(44px, 7.4vw, 108px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
:lang(zh) .h-display { letter-spacing: 0; }
.h-display em { font-style: italic; font-weight: 400; }

.h-section {
  font-size: clamp(36px, 4.8vw, 64px);
  line-height: 1.05;
}

p.lead {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 38ch;
}

/* ---------- Container & layout ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container-flush {
  width: 100%;
  max-width: 100%;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--border-soft); }

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--serif);
  font-size: 28px;
  font-style: italic;
  letter-spacing: -0.02em;
}
.brand svg { width: 32px; height: 32px; }

.nav-links {
  display: flex;
  gap: clamp(20px, 3vw, 48px);
  list-style: none;
}
.nav-links a {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  padding: 6px 0;
  transition: opacity 0.2s var(--ease);
}
.nav-links a:hover { opacity: 0.55; }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor;
}

.nav-right { display: flex; align-items: center; gap: 14px; }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: transparent;
  color: var(--text);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn-pill:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.3s var(--ease);
}
.theme-toggle::before {
  content: "";
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg);
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}
[data-theme="dark"] .theme-toggle::before { transform: scale(0.6); }

.nav-burger { display: none; flex-direction: column; gap: 5px; width: 26px; height: 26px; padding: 4px 0; }
.nav-burger span { display: block; height: 1px; background: var(--text); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.nav-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: 110px;
  padding-bottom: 40px;
  padding-left: var(--gutter);
  padding-right: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: center;
  min-height: calc(100vh - 64px);
}
.hero-copy { padding-top: 48px; }
.hero-copy .eyebrow { margin-bottom: 28px; }
.hero-copy h1 { margin-bottom: 28px; }
.hero-copy p.lead { margin-bottom: 48px; }

.play-button {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--text);
}
.play-button .play-icon {
  width: 44px; height: 44px;
  border: 1px solid var(--text);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.play-button .play-icon svg { width: 12px; height: 12px; fill: currentColor; }
.play-button:hover .play-icon { background: var(--text); color: var(--bg); }

.hero-visual {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1a1620;
  width: 100%;
  margin-right: 0;
}
.hero-visual img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Scroll cue */
.scroll-cue {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Services grid ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.service-cell {
  position: relative;
  padding: 28px var(--gutter) 28px clamp(24px, 3vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.3s var(--ease);
}
.service-cell:last-child { border-right: 0; }
.service-cell:hover { background: var(--bg-2); }
.service-cell .num {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  margin-right: 18px;
}
.service-cell .name {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  flex: 1;
}
.service-cell .plus {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 300;
  color: var(--text);
  transition: transform 0.3s var(--ease);
}
.service-cell:hover .plus { transform: rotate(90deg); }

/* ---------- Philosophy section ---------- */
.philosophy {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.philosophy-text {
  padding: clamp(60px, 8vw, 120px) clamp(40px, 6vw, 96px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
}
.philosophy-text .eyebrow { margin-bottom: 32px; }
.philosophy-text h2 { margin-bottom: 28px; max-width: 14ch; }
.philosophy-text p { color: var(--text-muted); max-width: 42ch; margin-bottom: 56px; }
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}
.link-arrow .arrow {
  display: inline-block;
  width: 36px; height: 1px;
  background: var(--text);
  position: relative;
  transition: width 0.25s var(--ease);
}
.link-arrow .arrow::after {
  content: "";
  position: absolute;
  right: 0; top: -3px;
  width: 8px; height: 8px;
  border-top: 1px solid var(--text);
  border-right: 1px solid var(--text);
  transform: rotate(45deg);
}
.link-arrow:hover .arrow { width: 56px; }

.philosophy-visual {
  position: relative;
  min-height: 480px;
  background: var(--bg-2);
  overflow: hidden;
}
.philosophy-visual img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ---------- Featured work ---------- */
.featured {
  padding: clamp(48px, 6vw, 80px) 0 clamp(60px, 8vw, 100px);
}
.featured-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter) 28px;
}
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.6vw, 20px);
  padding: 0 var(--gutter);
}
.work-card {
  position: relative;
  aspect-ratio: 3 / 4.4;
  overflow: hidden;
  border-radius: 4px;
  background: var(--card-dark);
  isolation: isolate;
  cursor: pointer;
}
.work-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), opacity 0.4s var(--ease);
}
.work-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 55%);
  z-index: 1;
}
.work-card:hover img { transform: scale(1.05); }
.work-card .info {
  position: absolute;
  left: 24px; right: 24px; bottom: 24px;
  color: #f5f5f5;
  z-index: 2;
}
.work-card .info .title {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  margin-bottom: 6px;
}
.work-card .info .meta {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d2d2d2;
}

.project-hero {
  padding: 0 var(--gutter) clamp(56px, 7vw, 96px);
  border-bottom: 1px solid var(--border);
}
.project-hero .frame {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-2);
}
.project-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-gallery {
  padding: clamp(40px, 5vw, 72px) var(--gutter);
  border-bottom: 1px solid var(--border);
}
.project-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2vw, 24px);
}
.project-gallery-item {
  background: var(--bg-2);
  overflow: hidden;
}
.project-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-copy p {
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 48ch;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.project-fact {
  padding: 28px var(--gutter);
  border-right: 1px solid var(--border);
}
.project-fact:last-child { border-right: 0; }
.project-fact .label {
  display: block;
  margin-bottom: 10px;
}
.project-fact .value {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.15;
}

/* ---------- Inner page header ---------- */
.page-header {
  padding: 160px var(--gutter) 80px;
  border-bottom: 1px solid var(--border);
}
.page-header .eyebrow { margin-bottom: 24px; }
.page-header h1 {
  font-size: clamp(52px, 8.4vw, 124px);
  line-height: 1.08;
  max-width: 18ch;
}
.page-header h1 em { font-style: italic; }
.page-header .lede {
  margin-top: 32px;
  max-width: 60ch;
  font-size: 17px;
  color: var(--text-muted);
}

/* ---------- Generic two-col section ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  padding: clamp(72px, 8vw, 120px) var(--gutter);
  border-bottom: 1px solid var(--border);
}
.two-col h2 { margin-bottom: 24px; }
.two-col p { color: var(--text-muted); margin-bottom: 16px; }

/* ---------- Cards / list rows ---------- */
.row-list { border-top: 1px solid var(--border); }
.row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 120px;
  gap: 24px;
  align-items: center;
  padding: 28px var(--gutter);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s var(--ease);
}
.row:hover { background: var(--bg-2); }
.row .num { font-size: 11px; letter-spacing: 0.22em; color: var(--text-muted); }
.row .title { font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.row .meta { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); }
.row .year { font-size: 11px; letter-spacing: 0.22em; text-align: right; color: var(--text-muted); }

/* ---------- Journal cards ---------- */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 40px);
  padding: clamp(48px, 6vw, 80px) var(--gutter);
}
.journal-card { display: block; }
.journal-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-2);
  margin-bottom: 20px;
}
.journal-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.journal-card:hover .thumb img { transform: scale(1.04); }
.journal-card .meta { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.journal-card h3 { font-size: 26px; line-height: 1.15; }

/* ---------- Contact form ---------- */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  padding: clamp(72px, 8vw, 120px) var(--gutter);
}
.contact-info h2 { margin-bottom: 28px; }
.contact-info .info-block { margin-bottom: 32px; }
.contact-info .info-block .label { display: block; margin-bottom: 8px; }
.contact-info .info-block a { font-family: var(--serif); font-size: 24px; }
.contact-form { display: flex; flex-direction: column; gap: 28px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); }
.field input, .field textarea, .field select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.25s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--text); }
.field textarea { resize: vertical; min-height: 120px; }

.btn-solid {
  align-self: flex-start;
  padding: 18px 36px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-pill);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn-solid:hover { opacity: 0.85; transform: translateY(-1px); }

/* ---------- Footer ---------- */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: clamp(56px, 6vw, 96px) var(--gutter) 32px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 64px;
}
.footer-top h3 { font-family: var(--serif); font-size: clamp(34px, 4vw, 56px); line-height: 1.05; max-width: 12ch; }
.footer-col h4 { font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 18px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 14px; color: var(--text); }
.footer-col a:hover { opacity: 0.6; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Fade-in on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { padding-top: 20px; }
  .hero-visual { aspect-ratio: 4 / 3.2; }
  .services { grid-template-columns: repeat(2, 1fr); }
  .service-cell:nth-child(2) { border-right: 0; }
  .service-cell { border-bottom: 1px solid var(--border); }
  .philosophy { grid-template-columns: 1fr; }
  .philosophy-text { border-right: 0; border-bottom: 1px solid var(--border); }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .project-gallery-grid { grid-template-columns: 1fr; }
  .project-facts { grid-template-columns: repeat(2, 1fr); }
  .project-fact:nth-child(2) { border-right: 0; }
  .project-fact { border-bottom: 1px solid var(--border); }
  .project-fact:nth-last-child(-n+2) { border-bottom: 0; }
  .two-col { grid-template-columns: 1fr; }
  .journal-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 60px 1fr 100px; }
  .row .meta { display: none; }
}
@media (max-width: 640px) {
  .nav-links { display: none; position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0; background: var(--bg); padding: 24px var(--gutter); border-bottom: 1px solid var(--border); }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 14px 0; }
  .nav-burger { display: flex; }
  .btn-pill { display: none; }
  .services { grid-template-columns: 1fr; }
  .service-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .work-grid { grid-template-columns: 1fr; }
  .project-facts { grid-template-columns: 1fr; }
  .project-fact { border-right: 0; border-bottom: 1px solid var(--border); }
  .project-fact:last-child { border-bottom: 0; }
  .journal-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr 80px; }
  .row .num { display: none; }
  .page-header { padding: 130px var(--gutter) 60px; }
}
