/* =========================================================
   Chonin Cheang — Personal Site (Apple / SpaceX aesthetic)
   Cinematic, dark, full-bleed imagery, generous negative space
   ========================================================= */

:root {
  --bg: #06080F;
  --bg-alt: #0A0F1C;
  --bg-elev: #0F1626;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #F2F4F8;
  --text-muted: #A6B0C5;
  --text-dim: #6B7791;
  --accent: #6BA1FF;
  --accent-hover: #8FB8FF;

  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1280px;
  --container-narrow: 880px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; cursor: pointer; }
em { font-style: italic; color: var(--text); }
strong { font-weight: 600; color: var(--text); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 12px 20px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 32px; }

/* =============== HEADER =============== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(6, 8, 15, 0.5);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  border-color: var(--border);
  background: rgba(6, 8, 15, 0.85);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--container); margin: 0 auto;
  padding: 16px 32px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 500; letter-spacing: 0.01em;
  font-size: 15px;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 17px; }
.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav a {
  color: var(--text-muted); font-size: 14px; font-weight: 400;
  letter-spacing: 0.005em;
}
.site-nav a:hover { color: var(--text); }
.site-nav .nav-cta {
  color: var(--text); padding: 8px 16px; border: 1px solid var(--border-strong);
  border-radius: 999px; transition: all 0.2s ease;
}
.site-nav .nav-cta:hover { background: var(--surface-hover); border-color: var(--accent); }

.mobile-menu-btn {
  display: none;
  background: none; border: none; padding: 8px;
  flex-direction: column; gap: 5px;
}
.mobile-menu-btn span {
  display: block; width: 22px; height: 1.5px; background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.mobile-menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.mobile-menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column; gap: 4px;
  padding: 8px 32px 20px;
  background: rgba(6, 8, 15, 0.95);
  border-top: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  color: var(--text); padding: 12px 0; font-size: 16px;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: none; }

/* =============== HERO =============== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
  padding: 120px 32px 80px;
}
.hero-image {
  position: absolute; inset: 0;
  z-index: 0;
}
.hero-image img {
  width: 100%; height: 100%; object-fit: cover;
  animation: heroZoom 30s ease-out forwards;
}
@keyframes heroZoom {
  from { transform: scale(1.05); }
  to { transform: scale(1); }
}
.hero-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 8, 15, 0.4) 0%, rgba(6, 8, 15, 0.1) 30%, rgba(6, 8, 15, 0.7) 80%, var(--bg) 100%),
    linear-gradient(90deg, rgba(6, 8, 15, 0.5) 0%, transparent 40%);
}
.hero-content {
  position: relative; z-index: 2;
  max-width: var(--container); width: 100%;
  margin: 0 auto;
  padding-bottom: 40px;
}
.eyebrow {
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
  margin: 0 0 20px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 128px);
  line-height: 0.95; letter-spacing: -0.03em;
  font-weight: 400;
  margin: 0 0 32px;
  color: var(--text);
}
.hero-lede {
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 40px;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 16px;
}
.hero-stats {
  position: relative; z-index: 2;
  max-width: var(--container); width: 100%;
  margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.5vw, 48px);
  font-weight: 400; letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 13px; color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* =============== BUTTONS =============== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px;
  font-size: 15px; font-weight: 500;
  border-radius: 999px;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.25s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn-primary {
  background: var(--text); color: var(--bg);
}
.btn-primary:hover { background: #fff; color: var(--bg); }
.btn-ghost {
  color: var(--text); border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover {
  border-color: var(--accent); color: var(--accent);
}
.btn-large { padding: 18px 32px; font-size: 16px; }

/* =============== SECTIONS =============== */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 160px 32px;
}
.section-narrow {
  max-width: var(--container-narrow);
}
.section-alt {
  background: var(--bg-alt);
  max-width: none;
  margin: 0;
  padding: 160px 32px;
}
.section-alt > * { max-width: var(--container); margin-left: auto; margin-right: auto; }

.section-num {
  font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 24px;
}
.section-num.light { color: var(--text); opacity: 0.7; }

.section-head { margin-bottom: 80px; max-width: 920px; }

.display-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05; letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 24px;
  color: var(--text);
}
.section-sub {
  font-size: 17px; color: var(--text-muted);
  max-width: 640px;
  margin: 0;
}

.prose { max-width: 720px; }
.prose p {
  font-size: 18px; line-height: 1.7; color: var(--text-muted);
  margin: 0 0 24px;
}
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--accent); border-bottom: 1px solid rgba(107, 161, 255, 0.3); }
.prose a:hover { border-color: var(--accent-hover); }

/* =============== ROLES =============== */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.role-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  transition: all 0.3s ease;
  display: flex; flex-direction: column;
  min-height: 260px;
}
.role-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.role-card.highlight {
  background: linear-gradient(135deg, rgba(107, 161, 255, 0.1), rgba(107, 161, 255, 0.02));
  border-color: rgba(107, 161, 255, 0.3);
}
.role-org {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--text);
}
.role-position {
  font-size: 14px; letter-spacing: 0.02em;
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 20px;
}
.role-desc {
  font-size: 15px; line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 20px;
  flex: 1;
}
.role-link {
  font-size: 14px; color: var(--accent);
  border-bottom: 1px solid transparent;
  align-self: flex-start;
}
.role-link:hover { border-color: var(--accent); }

/* =============== FULL-BLEED =============== */
.fullbleed {
  position: relative;
  height: 80vh;
  min-height: 560px;
  overflow: hidden;
  display: flex; align-items: flex-end;
}
.fullbleed img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  z-index: 0;
}
.fullbleed::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 8, 15, 0.3) 0%, transparent 40%, rgba(6, 8, 15, 0.85) 100%);
  z-index: 1;
}
.fullbleed-content {
  position: relative; z-index: 2;
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 0 32px 80px;
}
.fullbleed-eyebrow {
  font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
  margin: 0 0 20px;
}
.fullbleed-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.02; letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0 0 20px;
  color: var(--text);
}
.fullbleed-sub {
  font-size: 18px; color: var(--text-muted); max-width: 560px;
  margin: 0;
}

/* =============== VENTURES =============== */
.ventures-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.venture {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  transition: all 0.3s ease;
  display: flex; flex-direction: column;
  min-height: 300px;
}
.venture:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.venture-role {
  font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 16px;
}
.venture-name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--text);
}
.venture-loc {
  font-size: 13px; color: var(--text-dim);
  margin: 0 0 20px;
}
.venture-desc {
  font-size: 14.5px; line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 20px;
  flex: 1;
}
.venture-link {
  font-size: 13px; color: var(--accent);
  border-bottom: 1px solid transparent;
  align-self: flex-start;
}
.venture-link:hover { border-color: var(--accent); }

/* =============== FEATURE (MetaO) =============== */
.feature {
  background: linear-gradient(135deg, #0a1428 0%, #0a0f1c 100%);
  padding: 160px 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.feature-inner {
  max-width: var(--container-narrow);
  margin: 0 auto;
  text-align: center;
}
.feature-inner .display-title { font-size: clamp(56px, 8vw, 112px); }
.feature-lede {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 40px;
}
.feature-tags {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 12px;
}
.feature-tags span {
  padding: 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* =============== RESEARCH THEMES =============== */
.themes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: -80px;
}
.theme {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  transition: all 0.3s ease;
  display: flex; flex-direction: column;
  min-height: 340px;
}
.theme:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.theme-tag {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 20px;
}
.theme-title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--text);
}
.theme-desc {
  font-size: 14.5px; line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 20px;
  flex: 1;
}
.theme-keywords {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

/* =============== PUBLICATIONS =============== */
.pub-tabs {
  display: flex; gap: 12px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.pub-tab {
  background: none; border: none; color: var(--text-muted);
  font-size: 15px; font-weight: 500;
  padding: 12px 4px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
  margin-right: 24px;
}
.pub-tab:hover { color: var(--text); }
.pub-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.pub-panel.hidden { display: none; }
.pub-list {
  list-style: none;
  padding: 0;
  counter-reset: pub;
  display: grid; gap: 24px;
}
.pub-list li {
  counter-increment: pub;
  position: relative;
  padding: 24px 24px 24px 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 14.5px; line-height: 1.65;
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.pub-list li:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.pub-list li::before {
  content: counter(pub, decimal-leading-zero);
  position: absolute; left: 24px; top: 24px;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--accent);
  font-weight: 500;
}
.pub-list em { color: var(--text); font-style: italic; }
.pub-list strong { color: var(--text); font-weight: 600; }
.pub-list .if {
  display: inline-block;
  padding: 2px 10px;
  margin-left: 6px;
  font-size: 11px; letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(107, 161, 255, 0.12);
  border-radius: 999px;
  font-weight: 500;
}

/* =============== EDITORIAL =============== */
.editorial-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
}
.editorial-block h3 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500;
  margin: 0 0 24px;
  color: var(--text);
}
.editorial-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 24px;
}
.editorial-list li {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.editorial-list li:last-child { border-bottom: none; padding-bottom: 0; }
.editorial-role {
  font-size: 13px; color: var(--accent);
  font-weight: 500; letter-spacing: 0.02em;
  margin: 0 0 6px;
}
.editorial-journal {
  font-size: 15px; color: var(--text);
  margin: 0;
  line-height: 1.5;
}
.editorial-journal em { color: var(--text); }
.reviewer-cols {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}
.reviewer-cols li {
  font-size: 14px; color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

/* =============== PRESS =============== */
.press-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 0;
  border-top: 1px solid var(--border);
}
.press-list li {
  border-bottom: 1px solid var(--border);
}
.press-list a {
  display: grid;
  grid-template-columns: 200px 1fr 140px;
  align-items: center;
  gap: 40px;
  padding: 28px 8px;
  color: var(--text);
  transition: all 0.2s ease;
}
.press-list a:hover {
  background: var(--surface);
  padding-left: 24px;
  padding-right: 24px;
}
.press-outlet {
  font-size: 13px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.press-headline {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500;
  line-height: 1.3; letter-spacing: -0.005em;
  color: var(--text);
}
.press-date {
  font-size: 13px; color: var(--text-dim);
  text-align: right;
}

/* =============== CTA =============== */
.cta {
  position: relative;
  overflow: hidden;
  padding: 180px 32px;
}
.cta-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  z-index: 0;
  opacity: 0.6;
}
.cta::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6, 8, 15, 0.9) 0%, rgba(6, 8, 15, 0.75) 50%, var(--bg) 100%);
  z-index: 1;
}
.cta-inner {
  position: relative; z-index: 2;
  max-width: var(--container-narrow);
  margin: 0 auto;
  text-align: center;
}
.cta-title { font-size: clamp(40px, 6vw, 80px); }
.cta-body {
  font-size: 18px; line-height: 1.65;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 48px;
}

/* =============== FOOTER =============== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 60px 32px 32px;
  background: var(--bg);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.footer-name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500;
  margin: 0 0 6px;
  color: var(--text);
}
.footer-role {
  font-size: 14px; color: var(--text-muted); margin: 0;
}
.footer-right { text-align: right; }
.footer-right p { margin: 0 0 6px; font-size: 14px; }
.footer-loc { color: var(--text-dim); }
.footer-fine {
  max-width: var(--container);
  margin: 32px auto 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* =============== RESPONSIVE =============== */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .roles-grid, .ventures-grid, .themes, .editorial-grid, .footer-inner {
    grid-template-columns: 1fr;
  }
  .themes { margin-top: 0; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .press-list a {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 8px;
  }
  .press-date { text-align: left; }
  .section, .section-alt, .feature, .cta { padding: 100px 24px; }
  .fullbleed-content { padding: 0 24px 40px; }
  .fullbleed { min-height: 480px; }
  .footer-right { text-align: left; }
  .reviewer-cols { grid-template-columns: 1fr; }
  .hero { padding: 100px 24px 60px; }
  .container { padding: 0 24px; }
}

@media (max-width: 560px) {
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 20px; }
  .stat-num { font-size: 32px; }
  .role-card, .venture, .theme { padding: 28px; }
  .pub-list li { padding: 20px 20px 20px 52px; font-size: 14px; }
  .pub-list li::before { left: 20px; top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-image img { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
