/* =========================
   DESIGN TOKENS
========================= */
/* ── Extra tokens ── */
/* --radius-card: 20px (used below) */
/* Theme inputs. The Customize panel (prefs.js) overrides the three
   *-rgb values; every accent/background colour on the site derives from
   them. The "--gold*" names are kept from before theming was added —
   read them as "accent". */
:root {
  --accent-rgb: 201, 168, 76;        /* #c9a84c */
  --accent-light-rgb: 232, 208, 138; /* #e8d08a */
  --bg-rgb: 5, 5, 7;                 /* #050507 */
  --bg-soft-rgb: 10, 10, 15;         /* #0a0a0f */

  /* Foreground: --fg-rgb tints borders/cards (white on dark, ink on
     Paper); --text-rgb is body text. Both flip for the Paper background. */
  --fg-rgb: 255, 255, 255;
  --text-rgb: 240, 237, 232;         /* #f0ede8 */

  --bg: rgb(var(--bg-rgb));
  --bg-soft: rgb(var(--bg-soft-rgb));
  --bg-card: rgba(var(--fg-rgb), 0.025);

  --text: rgb(var(--text-rgb));
  --text-strong: #fff;               /* "brighter than text" emphasis */
  --text-dim: #7a7870;
  --muted: #8a8880;
  --on-accent: #0a0a0c;              /* text on filled accent buttons */

  --gold: rgb(var(--accent-rgb));
  --gold-light: rgb(var(--accent-light-rgb));
  --gold-pale: color-mix(in srgb, var(--gold-light) 35%, #fff);
  --gold-dark: color-mix(in srgb, var(--gold) 82%, #000);
  --gold-deep: color-mix(in srgb, var(--gold) 55%, #000);
  --gold-dim: rgba(var(--accent-rgb), 0.18);
  --gold-glow: rgba(var(--accent-rgb), 0.08);

  --border: rgba(var(--fg-rgb), 0.07);
  --border-gold: rgba(var(--accent-rgb), 0.22);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

/* =========================
   RESET + BASE
========================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html[data-text="large"] { font-size: 112.5%; }  /* Customize → Text size */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;  /* = 16px by default; scales with the text-size setting */
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

body.intro-playing {
  overflow: hidden;
}

/* =========================
   CUSTOM CURSOR
========================= */
.cursor-outer {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  mix-blend-mode: difference;
}

.cursor-dot {
  position: fixed;
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
}

body.cursor-hover .cursor-outer {
  width: 56px;
  height: 56px;
  border-color: rgba(var(--accent-rgb), 0.9);
  background: rgba(var(--accent-rgb), 0.06);
}

body.cursor-text .cursor-outer {
  width: 80px;
  height: 80px;
  border-color: rgba(var(--text-rgb), 0.3);
}

body.cursor-click .cursor-outer {
  width: 26px;
  height: 26px;
  border-color: rgba(var(--accent-rgb), 0.9);
  background: rgba(var(--accent-rgb), 0.12);
}

body.cursor-click .cursor-dot {
  transform: translate(-50%, -50%) scale(1.6);
}

/* =========================
   GRAIN OVERLAY
========================= */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* =========================
   GLOBAL ATMOSPHERE
========================= */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 70% 30%, rgba(var(--accent-rgb), 0.09), transparent),
    radial-gradient(ellipse 40% 60% at 15% 75%, rgba(var(--accent-rgb), 0.04), transparent);
  z-index: -1;
  pointer-events: none;
}

/* =========================
   INTRO OVERLAY
========================= */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.intro-center {
  position: relative;
  text-align: center;
  max-width: 920px;
  padding: 32px;
}

/* Skip-intro button */
.intro-skip {
  position: absolute;
  bottom: 38px;
  right: 40px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: rgba(var(--fg-rgb), 0.03);
  border: 1px solid var(--border-gold);
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(var(--text-rgb), 0.7);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  animation: intro-skip-in 0.6s ease 1.1s forwards;
}
.intro-skip:hover {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--gold-light);
  transform: translateY(-2px);
}
.intro-skip span { transition: transform 0.3s ease; }
.intro-skip:hover span { transform: translateX(3px); }

@keyframes intro-skip-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .intro-skip {
    bottom: 26px;
    right: 50%;
    transform: translateX(50%);
  }
  .intro-skip:hover { transform: translateX(50%) translateY(-2px); }
}

.intro-name {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.38em;
  color: rgba(var(--accent-rgb), 0.7);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(12px);
}

.intro-title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.8rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
  opacity: 0;
  transform: translateY(18px);
}

.intro-title em {
  font-style: italic;
  color: var(--gold-light);
}

.intro-sub {
  margin-top: 22px;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  color: rgba(var(--text-rgb), 0.55);
  opacity: 0;
  text-transform: uppercase;
}

/* =========================
   NAVIGATION
========================= */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 28px 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 500;
  transition: padding 0.4s ease, background 0.4s ease;
}

.site-header.scrolled {
  padding: 18px 52px;
  background: rgba(var(--bg-rgb), 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.18em;
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  cursor: none;
}

/* The seal: ring + star in the accent, J in the text colour. Drawn from two
   one-colour masks so it follows the theme and the accent customizer. */
.logo-mark {
  position: relative;
  display: inline-block;   /* .logo is also .magnetic (inline-block) */
  vertical-align: middle;
  width: 30px;
  height: 30px;
  margin: -4px 12px 0 0;
}
.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.logo-mark::before {
  -webkit-mask-image: url("assets/logo/mark-ring.svg");
  mask-image: url("assets/logo/mark-ring.svg");
  background: var(--gold);
}
.logo-mark::after {
  -webkit-mask-image: url("assets/logo/mark-j.svg");
  mask-image: url("assets/logo/mark-j.svg");
  background: var(--text);
}

nav {
  display: flex;
  gap: 36px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  transition: color 0.28s ease;
  position: relative;
  cursor: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* =========================
   BUTTONS
========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: none;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease, color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(var(--fg-rgb), 0.06);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--on-accent);
  box-shadow: 0 8px 32px rgba(var(--accent-rgb), 0.22), 0 0 0 0 rgba(var(--accent-rgb), 0);
}

.btn.primary:hover {
  box-shadow: 0 12px 40px rgba(var(--accent-rgb), 0.32), 0 0 0 6px rgba(var(--accent-rgb), 0.06);
}

.btn.secondary {
  border: 1px solid var(--border-gold);
  color: var(--text);
  background: transparent;
}

.btn.secondary:hover {
  border-color: rgba(var(--accent-rgb), 0.6);
  color: var(--gold-light);
}

/* =========================
   MAGNETIC ELEMENT
========================= */
.magnetic {
  display: inline-block;
  transition: transform 0.5s cubic-bezier(0.23,1,0.32,1);
}

/* =========================
   SHIMMER UTILITY
========================= */
@keyframes shimmer-sweep {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.shimmer-line {
  background: linear-gradient(
    90deg,
    var(--gold) 0%,
    var(--gold-light) 40%,
    var(--gold) 60%,
    transparent 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer-sweep 4s linear infinite;
}

/* about-divider is not text so use a different approach */
.about-divider {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin-top: 32px;
  opacity: 0.7;
  position: relative;
  overflow: hidden;
}

.about-divider::after {
  content: "";
  position: absolute;
  top: 0; left: -60%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-light-rgb), 0.9), transparent);
  animation: shimmer-sweep 3s ease-in-out infinite;
}

/* =========================
   ABOUT SECTION
========================= */
.about-section {
  position: relative;
  padding: 160px 72px;
  background: var(--bg-soft);
  overflow: hidden;
}

.about-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.about-container {
  max-width: 1280px;
  margin: 0 auto;
}

.about-intro {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 72px;
  align-items: start;
  margin-bottom: 88px;
}

.about-intro-text {
  max-width: 680px;
}

.section-tag {
  font-family: var(--font-body);
  color: rgba(var(--accent-rgb), 0.7);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: block;
}

.about-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 28px;
}

.about-title em {
  font-style: italic;
  color: var(--gold-light);
}

.about-lead {
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--muted);
}

.about-divider {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin-top: 32px;
  opacity: 0.7;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 80px;
}

.about-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.35s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  cursor: none;
}

.about-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
}

.card-inner {
  padding: 32px;
  position: relative;
  z-index: 1;
}

.card-glow {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.12), transparent 70%);
  top: -40px;
  right: -40px;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.about-card:hover .card-glow {
  opacity: 1;
}

.about-card-number {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: rgba(var(--accent-rgb), 0.65);
  margin-bottom: 14px;
}

.about-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
}

.about-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.8;
}

.about-footer {
  max-width: 640px;
}

.about-footer p {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 300;
  line-height: 1.75;
  color: rgba(var(--text-rgb), 0.75);
}

/* =========================
   PROJECTS SECTION
========================= */
.projects-section {
  padding: 140px 72px;
  background: var(--bg);
  position: relative;
}

.projects-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.projects-header {
  max-width: 1280px;
  margin: 0 auto 72px;
}

.projects-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.2rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--text);
  margin-top: 16px;
}

.projects-grid {
  max-width: 1280px;
  margin: 0 auto;
}

.project-item {
  position: relative;
  cursor: none;
}

.project-item-inner {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 28px;
  padding: 36px 0;
  transition: padding-left 0.4s cubic-bezier(0.23,1,0.32,1);
}

.project-item:hover .project-item-inner {
  padding-left: 20px;
}

.project-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
  grid-column: 1;
}

.project-tag {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
  border: 1px solid var(--border-gold);
  padding: 3px 10px;
  border-radius: 20px;
}

.project-year {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.project-name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  grid-column: 1;
  transition: color 0.3s ease;
}

.project-item:hover .project-name {
  color: var(--gold-light);
}

.project-blurb {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 560px;
  grid-column: 1;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.project-item:hover .project-blurb {
  opacity: 1;
  transform: translateY(0);
}

.project-arrow {
  grid-column: 3;
  grid-row: 1 / 4;
  color: var(--muted);
  transition: color 0.3s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  align-items: center;
}

.project-item:hover .project-arrow {
  color: var(--gold);
  transform: translateX(8px);
}

.project-item-line {
  height: 1px;
  background: var(--border);
  transition: background 0.3s ease;
}

.project-item:hover .project-item-line {
  background: var(--border-gold);
}

/* =========================
   RECOGNITION
========================= */
.recognition-section {
  padding: 140px 72px;
  background: var(--bg);
  position: relative;
}
.recognition-section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}
.recognition-inner { max-width: 1280px; margin: 0 auto; }
.recognition-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.2rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--text);
  margin-top: 16px;
}
.recognition-intro { color: var(--muted); margin-top: 18px; font-size: 0.95rem; }
.rec-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 56px;
}
.rec-stat {
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-gold);
  background: var(--bg-card);
  border-radius: 14px;
  padding: 26px 24px;
}
.rec-stat b {
  display: block;
  font-family: var(--font-display);
  font-variant-numeric: lining-nums;
  font-weight: 400;
  font-size: clamp(2.6rem, 4vw, 3.4rem);
  line-height: 1;
  color: var(--gold-light);
}
.rec-stat span { display: block; margin-top: 12px; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.rec-note { margin-top: 16px; color: var(--text-dim); font-size: 0.8rem; font-style: italic; }
.rec-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
  margin-top: 48px;
}
.rec-list li { padding: 18px 0; border-bottom: 1px solid var(--border); }
.rec-list b { display: block; color: var(--text); font-weight: 500; font-size: 0.98rem; }
.rec-list span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.86rem; }
.rec-cv { margin-top: 48px; display: inline-flex; }

@media (max-width: 900px) {
  .recognition-section { padding: 100px 28px; }
  .rec-stats { grid-template-columns: 1fr 1fr; }
  .rec-list { grid-template-columns: 1fr; }
}

/* =========================
   CONTRIBUTIONS
========================= */
.contributions-section {
  padding: 140px 72px;
  background: var(--bg-soft);
  position: relative;
}

.contributions-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.contributions-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.contributions-header {
  margin-bottom: 64px;
}

.contributions-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-top: 16px;
}

.contribution-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contribution-item {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 56px;
  align-items: center;
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.contribution-item:last-child {
  border-bottom: none;
}

/* Alternate sides for visual rhythm */
.contribution-item:nth-child(even) .contribution-text {
  order: 2;
}
.contribution-item:nth-child(even) .contribution-gallery {
  order: 1;
}

.contribution-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contribution-num {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: rgba(var(--accent-rgb), 0.55);
  margin-bottom: 18px;
}

.contribution-item h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
}

.contribution-item p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
  max-width: 42ch;
}

/* =========================
   CONTACT
========================= */
.contact-section {
  padding: 160px 72px 80px;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
  justify-content: center;
}

.contact-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.contact-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.contact-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.contact-title-main {
  display: block;
}

.contact-title-accent {
  display: block;
  font-style: italic;
  color: var(--gold-light);
}

.contact-text {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 520px;
}

.contact-footer {
  display: flex;
  justify-content: space-between;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* =========================
   IMAGE UTILITIES
========================= */

/* Fit modes — apply directly to <img> */
.img-cover   { object-fit: cover;   width: 100%; height: 100%; display: block; }
.img-contain { object-fit: contain; width: 100%; height: 100%; display: block; }

/* Object-position helpers */
.img-pos-top    { object-position: center top; }
.img-pos-bottom { object-position: center bottom; }
.img-pos-left   { object-position: left center; }
.img-pos-right  { object-position: right center; }
.img-pos-center { object-position: center center; }

/* Reusable image frame container */
.img-frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(var(--fg-rgb), 0.02);
}

.img-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.55s ease;
}

.img-frame:hover img {
  transform: scale(1.03);
}

/* Gold-accented frame variant */
.img-frame-gold {
  border-color: var(--border-gold);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.06), inset 0 0 0 1px rgba(var(--accent-rgb), 0.04);
}

/* Contain variant — full image visible, no crop */
.img-frame.img-contain-frame img {
  object-fit: contain;
  padding: 8px;
  background: var(--bg-card);
}

/* =========================
   PROJECT THUMBNAILS
========================= */

.project-thumb {
  grid-column: 2;
  grid-row: 1 / 4;
  width: 110px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  align-self: center;
  flex-shrink: 0;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.project-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.55s ease;
}

/* Gradient placeholder shown when no thumbnail is provided */
.project-thumb-empty {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.05) 0%,
    rgba(var(--fg-rgb), 0.015) 50%,
    rgba(var(--accent-rgb), 0.03) 100%
  );
}

.project-item:hover .project-thumb {
  border-color: var(--border-gold);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.12);
}

.project-item:hover .project-thumb img {
  transform: scale(1.06);
}

/* =========================
   ABOUT — VISUAL FRAME
========================= */

.about-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 56px;
  position: relative;
}

.about-photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.05) 0%,
    rgba(var(--fg-rgb), 0.02) 100%
  );
  box-shadow:
    0 0 60px rgba(var(--accent-rgb), 0.07),
    0 24px 48px rgba(0,0,0,0.45),
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.04);
  transition: box-shadow 0.45s ease;
}

.about-photo-frame:hover {
  box-shadow:
    0 0 80px rgba(var(--accent-rgb), 0.12),
    0 24px 48px rgba(0,0,0,0.5),
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.09);
}

.about-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.65s ease;
}

/* Hide broken/empty img while keeping frame visible */
.about-photo[src=""],
.about-photo:not([src]) {
  display: none;
}

.about-photo-frame:hover .about-photo {
  transform: scale(1.03);
}

/* Dark gradient at bottom of photo frame */
.about-photo-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 42%;
  background: linear-gradient(to top, rgba(var(--bg-rgb), 0.78), transparent);
  pointer-events: none;
}

/* Caption inside frame */
.about-photo-caption {
  position: absolute;
  bottom: 18px;
  left: 20px;
  right: 20px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: rgba(var(--accent-rgb), 0.8);
  text-transform: uppercase;
}

/* Optional secondary visual slot below the main photo */
.about-visual-secondary {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.03) 0%,
    rgba(var(--fg-rgb), 0.015) 100%
  );
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.about-visual-secondary:hover {
  border-color: var(--border-gold);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.06);
}

.about-visual-secondary img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.55s ease;
}

.about-visual-secondary:hover img {
  transform: scale(1.03);
}

/* =========================
   CONTRIBUTION IMAGES
========================= */

/* =========================
   CONTRIBUTION GALLERY
========================= */
.contribution-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 168px;
  gap: 14px;
}

/* Single-image galleries get one large tile */
.contribution-gallery:has(.gallery-tile:only-child) {
  grid-template-columns: 1fr;
  grid-auto-rows: 320px;
}

/* Galleries with 3 items: first tile spans full width as a banner */
.contribution-gallery:has(.gallery-tile:nth-child(3):last-child) .gallery-tile:first-child {
  grid-column: 1 / -1;
}

.gallery-tile {
  position: relative;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: none;
  outline: none;
  transition: border-color 0.35s ease, box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.34,1.4,0.64,1);
}

.gallery-tile::after {
  content: "⤢";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--gold-light);
  background: rgba(var(--bg-rgb), 0.55);
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.35s ease, transform 0.35s ease;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.gallery-tile:hover,
.gallery-tile:focus-visible {
  border-color: var(--border-gold);
  box-shadow: 0 10px 34px rgba(var(--accent-rgb), 0.12);
  transform: translateY(-3px);
}

.gallery-tile:hover::after,
.gallery-tile:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.gallery-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1);
}

.gallery-tile:hover img,
.gallery-tile:focus-visible img {
  transform: scale(1.06);
}

/* =========================
   LIGHTBOX
========================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(3,3,5,0.92);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  margin: 0;
  max-width: min(90vw, 1100px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: scale(0.94);
  transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
}

.lightbox.active .lightbox-figure {
  transform: scale(1);
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  border-radius: 12px;
  border: 1px solid var(--border-gold);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  object-fit: contain;
}

.lightbox-caption {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(var(--fg-rgb), 0.04);
  border: 1px solid var(--border-gold);
  color: var(--text);
  border-radius: 50%;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: var(--gold);
  color: var(--bg);
  transform: scale(1.08);
}

.lightbox-close {
  top: 28px;
  right: 32px;
  width: 48px;
  height: 48px;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 1.8rem;
  line-height: 1;
}

.lightbox-nav:hover {
  transform: translateY(-50%) scale(1.08);
}

.lightbox-prev { left: 28px; }
.lightbox-next { right: 28px; }

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px) {
  .story-panel {
    right: 28px;
    width: 260px;
  }
  .hero-overlay {
    padding: 0 40px;
  }
  .about-intro {
    grid-template-columns: 1fr 240px;
    gap: 48px;
  }
  .project-thumb {
    width: 88px;
    height: 60px;
  }
}

@media (max-width: 900px) {
  .about-section,
  .projects-section,
  .contributions-section,
  .contact-section {
    padding-left: 32px;
    padding-right: 32px;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  /* Stack about intro on tablet */
  .about-intro {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-intro-text {
    max-width: 100%;
  }

  .about-visual {
    padding-top: 0;
    max-width: 320px;
  }

  /* Collapse project thumbnail column on tablet */
  .project-item-inner {
    grid-template-columns: 1fr auto;
  }

  .project-thumb {
    display: none;
  }

  .project-arrow {
    grid-column: 2;
  }

  .site-header {
    padding: 22px 28px;
  }

  .project-overlay {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-gold);
    height: auto;
    bottom: -100vh;
    right: 0;
    top: auto;
    transition: bottom 0.55s cubic-bezier(0.76,0,0.24,1), visibility 0s linear 0.55s;
    padding: 48px 32px;
  }

  .project-overlay.active {
    bottom: 0;
    right: 0;
    transition: bottom 0.55s cubic-bezier(0.76,0,0.24,1), visibility 0s;
  }

  /* Stack community feature rows on tablet */
  .contribution-item {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 44px 0;
  }

  .contribution-item:nth-child(even) .contribution-text {
    order: 0;
  }
  .contribution-item:nth-child(even) .contribution-gallery {
    order: 0;
  }

  .contribution-item p {
    max-width: 56ch;
  }

  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}

@media (max-width: 560px) {
  .contribution-gallery {
    grid-auto-rows: 140px;
    gap: 10px;
  }
  .contribution-gallery:has(.gallery-tile:only-child) {
    grid-auto-rows: 240px;
  }
  .lightbox { padding: 16px; }
  .lightbox-close { top: 16px; right: 16px; width: 42px; height: 42px; }
  .lightbox-nav { width: 44px; height: 44px; font-size: 1.5rem; }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: clamp(3rem, 13vw, 4.5rem);
  }

  .story-panel {
    display: none;
  }

  .site-header nav {
    gap: 20px;
  }

  nav .nav-link {
    font-size: 0.82rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-footer {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }

  /* Hide about visual on small mobile */
  .about-visual {
    display: none;
  }

  body {
    cursor: auto;
  }

  .cursor-outer, .cursor-dot {
    display: none;
  }
}

/* ╔══════════════════════════════════════════════════════╗
   ║  TYPOGRAPHY SCALE UPDATE
   ║  Increases readability globally without breaking layout
   ╚══════════════════════════════════════════════════════╝ */

body {
  font-size: 1.0625rem;  /* 17px at default size; scales with Customize → Text size */
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.9;
}

.hero-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
}

/* Slightly larger story panel text */
.story-panel h2 {
  font-size: 1.72rem;
}
.story-panel p {
  font-size: 0.97rem;
  line-height: 1.85;
}

/* Section tags — larger but still compact */
.section-tag {
  font-size: 0.76rem;
  letter-spacing: 0.22em;
}

/* About section */
.about-lead {
  font-size: 1.13rem;
  line-height: 1.95;
}

.about-card h3 {
  font-size: 1.5rem;
}

.about-card p {
  font-size: 1rem;
  line-height: 1.85;
}

.about-footer p {
  font-size: 1.38rem;
}

/* Project section */
.project-tag {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  padding: 4px 12px;
}

.project-year {
  font-size: 0.84rem;
}

.project-blurb {
  font-size: 1rem;
  line-height: 1.8;
}

/* Contributions */
.contribution-item h3 {
  font-size: 1.65rem;
}
.contribution-item p {
  font-size: 1rem;
  line-height: 1.85;
}

/* Overlay */
.overlay-desc {
  font-size: 1rem;
  line-height: 1.9;
}
.detail-label {
  font-size: 0.76rem;
}
.detail-value {
  font-size: 0.97rem;
}

/* Buttons — slightly larger */
.btn {
  font-size: 0.94rem;
  padding: 14px 30px;
}

/* ╔══════════════════════════════════════════════════════╗
   ║  MARQUEE ICON — sized for img tags
   ╚══════════════════════════════════════════════════════╝ */

/* ╔══════════════════════════════════════════════════════╗
   ║  PROJECT THUMBNAILS — ENLARGED
   ╚══════════════════════════════════════════════════════╝ */

/* Override the existing 110×72 with a larger, more prominent size */
.project-thumb {
  width: 232px;
  height: 148px;
  border-radius: 12px;
  border-color: var(--border-gold);
  box-shadow: 0 6px 22px rgba(0,0,0,0.35);
}
@media (max-width: 1100px) {
  .project-thumb { width: 168px; height: 108px; }
}

/* ╔══════════════════════════════════════════════════════╗
   ║  PROJECTS SECTION — INTRO TEXT
   ╚══════════════════════════════════════════════════════╝ */

.projects-intro {
  margin-top: 16px;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 520px;
}

/* ╔══════════════════════════════════════════════════════╗
   ║  TOOLS / SKILLS MARQUEE
   ╚══════════════════════════════════════════════════════╝ */

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-section {
  position: relative;
  padding: 28px 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.marquee-label {
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  color: rgba(var(--accent-rgb), 0.45);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.marquee-wrapper {
  position: relative;
  overflow: hidden;
}

/* Edge fade overlays */
.marquee-fade-l,
.marquee-fade-r {
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.marquee-fade-l {
  left: 0;
  background: linear-gradient(to right, var(--bg-soft), transparent);
}

.marquee-fade-r {
  right: 0;
  background: linear-gradient(to left, var(--bg-soft), transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 44s linear infinite;
  will-change: transform;
}

/* Pause on hover */
.marquee-section:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-content {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 7px;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: rgba(var(--fg-rgb), 0.015);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(var(--text-rgb), 0.62);
  white-space: nowrap;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
  cursor: default;
}

.marquee-item:hover {
  color: var(--gold-light);
  border-color: var(--border-gold);
  background: rgba(var(--accent-rgb), 0.06);
  transform: translateY(-2px);
}

.marquee-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.marquee-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.marquee-item:hover .marquee-icon {
  opacity: 1;
  color: var(--gold-light);
  transform: scale(1.12);
}

.marquee-sep {
  color: rgba(var(--accent-rgb), 0.3);
  font-size: 0.5rem;
  flex-shrink: 0;
}

/* ╔══════════════════════════════════════════════════════╗
   ║  ABOUT — MEDIA & STORYTELLING CARD
   ╚══════════════════════════════════════════════════════╝ */

.about-media-card {
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.04) 0%, transparent 50%),
    var(--bg-card);
  overflow: hidden;
  margin-bottom: 80px;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.about-media-card:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 0 48px rgba(var(--accent-rgb), 0.07);
}

.about-media-inner {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  min-height: 260px;
}

.about-media-text {
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

.about-media-text h3 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0;
}

.about-media-text p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.85;
  max-width: 540px;
}

/* YouTube CTA button */
.about-media-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  margin-top: 8px;
  padding: 11px 22px;
  border-radius: 8px;
  background: rgba(var(--fg-rgb), 0.04);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: none;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.about-media-cta:hover {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--text);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.12);
}

.about-media-cta-icon {
  display: flex;
  align-items: center;
  color: #ff4444;
  flex-shrink: 0;
}

.about-media-cta-arrow {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-left: 2px;
}

/* Right visual panel of media card */
.about-media-visual {
  border-left: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.03) 0%, transparent 60%),
    var(--bg);
  position: relative;
  overflow: hidden;
}

.about-media-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

.about-media-play-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(var(--text-rgb), 0.3);
  transition: color 0.3s ease;
}

.about-media-card:hover .about-media-play-hint {
  color: rgba(var(--accent-rgb), 0.6);
}

.about-media-play-hint p {
  font-family: var(--font-body);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: inherit;
}

/* ╔══════════════════════════════════════════════════════╗
   ║  COMMUNITY & INDUSTRY — IMPROVEMENTS
   ╚══════════════════════════════════════════════════════╝ */

.contributions-intro {
  margin-top: 20px;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.85;
  max-width: 680px;
}

.contribution-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.contribution-category {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border-gold);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ╔══════════════════════════════════════════════════════╗
   ║  CONTACT LINKS
   ╚══════════════════════════════════════════════════════╝ */

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 560px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: transparent;
  transition: background 0.3s ease, padding-left 0.3s ease;
  cursor: none;
}

.contact-link:last-child {
  border-bottom: none;
}

.contact-link:hover {
  background: rgba(var(--accent-rgb), 0.05);
  padding-left: 30px;
}

.contact-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(var(--fg-rgb), 0.03);
  color: var(--gold);
  flex-shrink: 0;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.contact-link:hover .contact-link-icon {
  border-color: var(--border-gold);
  background: rgba(var(--accent-rgb), 0.08);
}

.contact-link-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.contact-link-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.contact-link-value {
  font-size: 0.97rem;
  color: var(--text);
  font-weight: 400;
}

.contact-link-arrow {
  font-size: 1.1rem;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.contact-link:hover .contact-link-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--gold);
}

/* ╔══════════════════════════════════════════════════════╗
   ║  RESPONSIVE — NEW ELEMENTS
   ╚══════════════════════════════════════════════════════╝ */

@media (max-width: 1100px) {
  .project-thumb {
    width: 140px;
    height: 92px;
  }
  .about-media-inner {
    grid-template-columns: 1fr 200px;
  }
}

@media (max-width: 900px) {
  /* Marquee */
  .marquee-label {
    display: none;
  }

  /* About media card */
  .about-media-inner {
    grid-template-columns: 1fr;
  }
  .about-media-visual {
    border-left: none;
    border-top: 1px solid var(--border);
    height: 120px;
  }
  .about-media-text {
    padding: 28px 28px 20px;
  }

  /* Contact links */
  .contact-links {
    max-width: 100%;
  }

  /* Project thumbnails — hide on tablet (already handled above) */
}

@media (max-width: 640px) {
  /* Marquee items slightly smaller */
  .marquee-item {
    font-size: 0.82rem;
    padding: 8px 15px;
    margin: 0 5px;
  }

  /* About media card */
  .about-media-inner {
    grid-template-columns: 1fr;
  }
  .about-media-text {
    padding: 24px 20px;
  }
  .about-media-visual {
    height: 100px;
  }

  /* Contact links tighter on mobile */
  .contact-link {
    padding: 16px 18px;
    gap: 14px;
  }
  .contact-link-value {
    font-size: 0.88rem;
  }

  /* Contributions category badge */
  .contribution-category {
    font-size: 0.68rem;
  }

  /* Nav — show 5 items but smaller */
  nav {
    gap: 14px;
  }
  .nav-link {
    font-size: 0.78rem;
  }
}

/* ╔══════════════════════════════════════════════════════╗
   ║  ACCESSIBILITY — prefers-reduced-motion
   ╚══════════════════════════════════════════════════════╝ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .marquee-track {
    animation: none;
  }

  .marker-pulse::before {
    animation: none;
  }
}

/* ============================================================
   LENIS SMOOTH SCROLL — required base styles
============================================================ */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ============================================================
   UNIFIED SCROLL-REVEAL
   Elements marked [data-reveal] start hidden ONLY when JS is
   active (body.reveal-ready). GSAP animates them in. With no JS
   or reduced-motion, they simply show — no hidden content.
============================================================ */
body.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  will-change: opacity, transform;
}

/* ============================================================
   EDITORIAL — vertical section labels
============================================================ */
.section-vlabel {
  position: absolute;
  top: 128px;
  right: 30px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-body);
  font-size: 0.64rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.32);
  pointer-events: none;
  user-select: none;
  z-index: 4;
}
.section-vlabel::after {
  content: "";
  display: block;
  width: 1px;
  height: 54px;
  margin: 14px auto 0;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.4), transparent);
}
/* sections that host a vertical label need a positioning context */
.projects-section,
.about-section,
.contributions-section,
.contact-section { position: relative; }

@media (max-width: 1024px) {
  .section-vlabel { display: none; }
}

/* ============================================================
   AMBIENT CONSTELLATION FIELD (behind section content)
============================================================ */
.has-ambient { position: relative; }
.ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}
/* Lift each section's real content above its ambient canvas */
.about-container,
.projects-header,
.projects-grid,
.contributions-inner,
.contact-inner,
.contact-footer { position: relative; z-index: 1; }

/* ============================================================
   SOUND TOGGLE
============================================================ */
.sound-toggle {
  position: fixed;
  left: 26px;
  bottom: 26px;
  z-index: 9000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: rgba(var(--bg-rgb), 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.sound-toggle:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.55);
  transform: translateY(-2px);
}
.sound-toggle .bar {
  width: 3px;
  height: 9px;
  border-radius: 2px;
  background: var(--gold-light);
  transition: height 0.25s ease, opacity 0.25s ease;
}
.sound-toggle.is-on .bar {
  animation: sound-bars 1.1s ease-in-out infinite;
}
.sound-toggle.is-on .bar:nth-child(2) { animation-delay: 0.18s; }
.sound-toggle.is-on .bar:nth-child(3) { animation-delay: 0.36s; }
.sound-toggle.is-off .bar { height: 4px; opacity: 0.4; }
@keyframes sound-bars {
  0%, 100% { height: 5px; }
  50%      { height: 14px; }
}
@media (max-width: 640px) {
  .sound-toggle { left: 18px; bottom: 18px; width: 40px; height: 40px; }
}

/* ============================================================
   CERTIFICATES PAGE
============================================================ */
.cert-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 150px 72px 20px;
}
.cert-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-top: 14px;
}
.cert-intro {
  margin-top: 18px;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.cert-section {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 54px 72px;
}
.cert-section::before {
  content: "";
  position: absolute;
  top: 0; left: 72px; right: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}
.cert-section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 30px;
}
.cert-num {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: rgba(var(--accent-rgb), 0.55);
}
.cert-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 400;
  color: var(--text);
}
.cert-note {
  color: var(--muted);
  font-size: 0.9rem;
}
.cert-count {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.cert-grid .gallery-tile {
  aspect-ratio: 3 / 4;
  width: 100%;
}

@media (max-width: 900px) {
  .cert-hero { padding: 130px 32px 12px; }
  .cert-section { padding: 44px 32px; }
  .cert-section::before { left: 32px; right: 32px; }
  .cert-section-head { flex-wrap: wrap; gap: 10px; }
  .cert-count { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .cert-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}
.about-footer .about-cert-link { margin-top: 24px; display: inline-flex; }

/* ============================================================
   CERTIFICATES TIMELINE (snaking milestones)
============================================================ */
.ctl {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 72px 90px;
}
.ctl-line {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
.ctl-track {
  fill: none;
  stroke: rgba(var(--accent-rgb), 0.16);
  stroke-width: 2;
}
.ctl-progress {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.4));
}

.ctl-milestone {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 48px;
  align-items: flex-start;
  padding: 46px 0 64px;
}
.ctl-milestone.right { flex-direction: row-reverse; }

.ctl-side {
  width: 230px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.ctl-marker {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 1.5px solid var(--border-gold);
  background: rgba(var(--bg-rgb), 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.9rem;
  color: var(--gold-light);
  transition: box-shadow 0.45s ease, border-color 0.45s ease, transform 0.45s ease;
}
.ctl-milestone.active .ctl-marker {
  border-color: var(--gold);
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.09), 0 0 26px rgba(var(--accent-rgb), 0.28);
  transform: scale(1.06);
}
.ctl-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--text);
}
.ctl-note {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 210px;
}
.ctl-count {
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ctl-grid { flex: 1; margin: 0; }

@media (max-width: 900px) {
  .ctl { padding: 10px 26px 60px; }
  .ctl-milestone,
  .ctl-milestone.right {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    padding: 30px 0 46px;
  }
  .ctl-side {
    flex-direction: row;
    width: auto;
    text-align: left;
    align-items: center;
    gap: 16px;
  }
  .ctl-note { max-width: none; }
}

/* ============================================================
   MOBILE — hamburger button
============================================================ */
.nav-burger { display: none; }
@media (max-width: 768px) {
  .site-header nav { display: none; }
  .nav-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
  }
  .nav-burger span {
    display: block;
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.4s cubic-bezier(0.76,0,0.24,1), opacity 0.3s ease, width 0.3s ease;
  }
  .nav-burger span:nth-child(2) { width: 20px; }
  .nav-burger.open span { background: var(--gold-light); width: 26px; }
  .nav-burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { opacity: 0; }
  .nav-burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ============================================================
   MOBILE — full-screen menu overlay
============================================================ */
.mnav {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px 46px 46px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-24px);
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.76,0,0.24,1), visibility 0.6s;
}
.mnav.open { opacity: 1; visibility: visible; transform: none; }

.mnav-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15vh;
  line-height: 0.82;
  letter-spacing: -0.03em;
  color: rgba(var(--fg-rgb), 0.035);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.mnav-close {
  position: absolute;
  top: 24px;
  right: 26px;
  z-index: 3;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 2.1rem;
  line-height: 1;
  cursor: pointer;
}

.mnav-links {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mnav-link {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--text);
  text-decoration: none;
  padding: 7px 0;
  width: fit-content;
  opacity: 0;
  transform: translateX(-22px);
  transition: color 0.3s ease;
}
.mnav.open .mnav-link {
  animation: mnav-link-in 0.55s cubic-bezier(0.22,1,0.36,1) forwards;
  animation-delay: calc(var(--i) * 0.06s + 0.18s);
}
@keyframes mnav-link-in { to { opacity: 1; transform: none; } }
.mnav-link.active { color: var(--gold-light); }
.mnav-link:hover { color: var(--gold-light); }

.mnav-socials {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 24px;
  margin-top: 42px;
  opacity: 0;
  transition: opacity 0.5s ease 0.5s;
}
.mnav.open .mnav-socials { opacity: 1; }
/* 23px icons, 44px tap targets: the padding is cancelled by the negative
   margin so the icons keep their spacing */
.mnav-socials a { color: var(--muted); transition: color 0.3s ease, transform 0.3s ease; padding: 10.5px; margin: -10.5px; }
.mnav-socials a:hover { color: var(--gold-light); transform: translateY(-2px); }
.mnav-socials svg { width: 23px; height: 23px; display: block; }

body.mnav-lock { overflow: hidden; }

/* ============================================================
   MOBILE RESPONSIVENESS — hero / globe / sections
============================================================ */
@media (max-width: 768px) {
  .site-header { padding: 20px 24px; }
  .site-header.scrolled { padding: 16px 24px; }

  /* Hero: keep the globe + text tidy in portrait */
  .hero-overlay { padding: 0 30px; max-width: 100%; }
  .hero-kicker { font-size: 0.62rem; letter-spacing: 0.14em; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-subtitle br { display: none; }

  /* Decorative orbiting markers overlap text on small screens — hide them */
  .project-markers { display: none; }

  /* Scroll cue lower so it doesn't collide with buttons */
  .hero-scrollcue { bottom: 22px; }
  .hero-nodehint { display: none; }
}

@media (max-width: 560px) {
  .about-section,
  .projects-section,
  .contributions-section,
  .contact-section,
  .cs-section { padding-left: 22px; padding-right: 22px; }
  .marquee-section { padding-left: 0; padding-right: 0; }
  .sound-toggle { bottom: 16px; }
}

/* ╔══════════════════════════════════════════════════════╗
   ║  MOTION LAYER — styles for motion.js                  ║
   ╚══════════════════════════════════════════════════════╝ */

/* Hero headline exit — driven by the scroll story timeline.
   Uses the independent `translate` property so it doesn't fight
   the centring transform. */
.hero-overlay { translate: 0 var(--exit-y, 0px); }

/* Scroll progress line */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: 600;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.5);
}

/* Cursor label ("View", …) */
.cursor-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
body.cursor-labelled .cursor-outer {
  width: 84px;
  height: 84px;
  mix-blend-mode: normal;
  background: var(--gold-light);
  border-color: transparent;
}
body.cursor-labelled .cursor-label { opacity: 1; transform: scale(1); }
body.cursor-labelled .cursor-dot { opacity: 0; }

/* Floating project preview */
.proj-float {
  position: fixed;
  top: 0; left: 0;
  width: 340px;
  aspect-ratio: 16 / 10;
  margin: -150px 0 0 48px; /* sits up and to the right of the cursor, clear of the title */
  z-index: 450;
  pointer-events: none;
  visibility: hidden;
  transform-origin: 0 100%;
}
.proj-float-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  box-shadow: 0 30px 70px rgba(0,0,0,0.6), 0 0 60px rgba(var(--accent-rgb), 0.12);
  background: var(--bg-soft);
}
.proj-float img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.15);
  transition: opacity 0.45s ease, transform 0.9s cubic-bezier(0.22,1,0.36,1);
}
.proj-float img.on { opacity: 1; transform: scale(1); }

/* Focus mode: dim the rows you're not on. Applied to the inner
   wrapper — .project-item's own opacity is animated by GSAP, and a
   CSS transition there corrupts the values GSAP reads back. */
@media (pointer: fine) {
  .projects-grid .project-item-inner {
    transition: padding-left 0.4s cubic-bezier(0.23,1,0.32,1), opacity 0.45s ease, filter 0.45s ease;
  }
  .projects-grid.is-focusing .project-item:not(:hover) .project-item-inner { opacity: 0.28; filter: saturate(0.4); }
  /* The floating preview replaces the small inline thumbnail on hover */
  .projects-grid .project-thumb { transition: opacity 0.35s ease, transform 0.5s ease; }
  .projects-grid .project-item:hover .project-thumb { opacity: 0; transform: scale(0.9); }
}

/* About portrait reveal zoom (see initPortrait) */
.about-photo { scale: var(--reveal-scale, 1); }

/* JS-driven marquee */
.marquee-track.marquee-js { animation: none; }

/* Masked heading words */
.mask-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  /* room for italic overhang and descenders inside the clip */
  padding: 0 0.08em 0.12em;
  margin: 0 -0.08em -0.12em;
}
.mask-word {
  display: inline-block;
  transform-origin: 0 100%;
  will-change: transform;
}

/* ╔══════════════════════════════════════════════════════╗
   ║  TYBW LAYER — slash cuts, negative flashes, ink,      ║
   ║  chapter title cards. Palette unchanged: gold plays   ║
   ║  the role the show gives to red.                      ║
   ╚══════════════════════════════════════════════════════╝ */

/* ── Slash transition (slash.js) ── */
.slash {
  position: fixed;
  inset: 0;
  z-index: 99990;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}
.slash.active { visibility: visible; pointer-events: auto; }

.slash-half {
  position: absolute;
  inset: 0;
  background: var(--bg);
  will-change: transform;
}
/* The diagonal crosses the centre at 72° (brand v2): it moves
   tan(18°) × 100vh = 32.5vh across the screen's height */
.slash-l { clip-path: polygon(0 0, calc(50% + 16.25vh + 1px) 0, calc(50% - 16.25vh + 1px) 100%, 0 100%); }
.slash-r { clip-path: polygon(calc(50% + 16.25vh - 1px) 0, 100% 0, 100% 100%, calc(50% - 16.25vh - 1px) 100%); }

.slash-line,
.intro-cut {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 140vh;
  margin: -70vh 0 0 -1px;
  transform: rotate(var(--slash-angle, 18deg));
  background: linear-gradient(180deg, transparent, var(--gold) 12%, var(--gold-pale) 50%, var(--gold) 88%, transparent);
  box-shadow: 0 0 14px rgba(var(--accent-light-rgb), 0.9), 0 0 60px rgba(var(--accent-rgb), 0.5);
  opacity: 0;
  pointer-events: none;
}

/* Speed lines that tear along the cut */
.slash-streaks {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60vw;
  height: 140vh;
  margin: -70vh 0 0 -30vw;
  transform: rotate(var(--slash-angle, 18deg));
  pointer-events: none;
}
.slash-streaks i {
  position: absolute;
  top: 0;
  width: 1px;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-light-rgb), 0.8), transparent);
  opacity: 0;
}
.slash-streaks i:nth-child(1) { left: 44%; }
.slash-streaks i:nth-child(2) { left: 47%; height: 30%; }
.slash-streaks i:nth-child(3) { left: 49.2%; height: 60%; }
.slash-streaks i:nth-child(4) { left: 51%; height: 35%; }
.slash-streaks i:nth-child(5) { left: 53.5%; }
.slash-streaks i:nth-child(6) { left: 56%; height: 25%; }
.slash-streaks i:nth-child(7) { left: 41%; height: 20%; }

.slash-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 32px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.slash-kicker {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
}
.slash-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── Intro cold open ── */
.intro-poem {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 32px;
}
.poem-line {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
  line-height: 1.3;
  color: var(--text);
}
/* Each line steps in a little, like a verse set on a page
   (offset with `left`, since GSAP owns this element's transform) */
.poem-line {
  position: relative;
  overflow: hidden;
  /* room for italic overhang and descenders inside the mask */
  padding: 0 0.15em 0.12em;
}
.poem-inner { display: inline-block; will-change: transform, opacity; }
.poem-line:nth-child(1) { left: -1.6em; }
.poem-line:nth-child(3) { left: 1.6em; color: var(--gold-light); }

.intro-center { z-index: 2; }
.intro-title { font-size: clamp(3.4rem, 8vw, 7.4rem); }
.intro-sub::after {
  content: "";
  display: block;
  width: 72px;
  height: 1px;
  margin: 26px auto 0;
  background: var(--gold);
}

.intro-vert {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  writing-mode: vertical-rl;
  font-family: var(--font-body);
  font-size: 0.64rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.6);
  opacity: 0;
}
.intro-vert-l { left: 40px; rotate: 180deg; }
.intro-vert-r { right: 40px; }

@media (max-width: 640px) {
  .poem-line:nth-child(1),
  .poem-line:nth-child(3) { left: 0; }
  .intro-vert-l { left: 14px; }
  .intro-vert-r { right: 14px; }
}

/* ── Chapter labels ── */
.chapter-no {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-right: 14px;
  color: var(--gold-light);
}
.chapter-no::after {
  content: "";
  width: 44px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ── Brush stroke under headings ── */
.brush {
  display: block;
  width: min(340px, 70%);
  height: 22px;
  margin: -6px 0 24px;
  overflow: visible;
}
.brush path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.brush-main { stroke: var(--gold); stroke-width: 5; opacity: 0.9; }
.brush-dry  { stroke: var(--gold-light); stroke-width: 1.6; stroke-dasharray: 26 7 44 5 12 9; opacity: 0.55; }
.contact-inner .brush { margin: -24px auto 0; }

/* ── Ink splat reveal (mask swells from the centre) ── */
.ink-reveal {
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: var(--ink, 0%) var(--ink, 0%);
          mask-size: var(--ink, 0%) var(--ink, 0%);
}

/* ── Blade-cut buttons: sharp, with two clipped corners ── */
.btn {
  border-radius: 0;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

/* ── Gold duotone: black & gold until hovered / centred on touch ── */
.duo {
  /* sepia gives a warm base; --duo-hue / --duo-sat (set by prefs.js)
     rotate it to the chosen accent. Defaults = gold. */
  filter: grayscale(1) sepia(0.85) saturate(var(--duo-sat, 1.35)) hue-rotate(var(--duo-hue, -6deg)) brightness(0.8) contrast(1.18);
  transition: filter 0.7s ease, transform 0.6s cubic-bezier(0.22,1,0.36,1), opacity 0.4s ease;
}
.gallery-tile:hover .duo,
.gallery-tile:focus-visible .duo,
.about-photo-frame:hover .duo,
.cs-gallery-item:hover .duo,
.cs-story-media:hover .duo,
.duo.is-lit { filter: none; }

/* ── Slash titles: two halves split along a diagonal on hover ── */
.slash-text {
  position: relative;
  display: inline-block;
  margin-bottom: -0.14em;
}
.st-a,
.st-b {
  display: block;
  padding: 0 0.06em 0.14em 0;  /* keeps descenders inside the clip */
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1);
}
/* The cut runs corner to corner (bottom-left → top-right), so it reads
   as a slash across the title rather than a strikethrough */
.st-a { clip-path: polygon(0 0, 100% 0, 0 100%); }
.st-b {
  position: absolute;
  inset: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
/* the cut itself: a hairline along the same diagonal */
.slash-text::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold-light);
  clip-path: polygon(0 99%, 100% -1%, 100% 1.5%, 0 101.5%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.slash-hover:hover .st-a { transform: translate(-5px, -3px); }
.slash-hover:hover .st-b { transform: translate(5px, 3px); }
.slash-hover:hover .slash-text::after { opacity: 0.7; }

/* ── Manga panels: community galleries get angled gutters ── */
.gallery-tile {
  --cut: 16px;
  border: 0;
  border-radius: 0;
}
.contribution-gallery .gallery-tile:nth-child(odd)  { clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); }
.contribution-gallery .gallery-tile:nth-child(even) { clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%); }
.contribution-gallery .gallery-tile:only-child {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%);
}
/* 3 images: banner on top (corner cut), then left + right panels */
.contribution-gallery:has(.gallery-tile:nth-child(3):last-child) .gallery-tile:nth-child(1) {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 26px 100%, 0 calc(100% - 26px));
}
.contribution-gallery:has(.gallery-tile:nth-child(3):last-child) .gallery-tile:nth-child(2) {
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
}
.contribution-gallery:has(.gallery-tile:nth-child(3):last-child) .gallery-tile:nth-child(3) {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%);
}
.gallery-tile::after { border-radius: 0; }

/* ── Volume cover (About) ── */
/* Wide screens only — below 900px the intro stacks (see RESPONSIVE) */
@media (min-width: 1101px) {
  .about-intro { grid-template-columns: 1fr 340px; }
}
.about-photo-frame { border-radius: 0; z-index: 1; }
/* offset registration frame behind the portrait */
.about-visual::before {
  content: "";
  position: absolute;
  top: calc(56px + 18px);
  left: 18px;
  right: -18px;
  bottom: -18px;
  border: 1px solid var(--border-gold);
  pointer-events: none;
}
.cover-vol {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.cover-vol b {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 2.6rem;
  letter-spacing: 0;
  line-height: 0.9;
  color: var(--text);
}
.cover-name {
  position: absolute;
  left: -76px;
  bottom: 60px;
  z-index: 3;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.6rem, 6vw, 5.4rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  color: var(--text);
  text-shadow: 0 6px 30px rgba(0,0,0,0.65);
  pointer-events: none;
}
.cover-name em { color: var(--gold-light); padding-left: 0.9em; }
/* caption moves to the top-left so the big name has the bottom to itself */
.about-visual .about-photo-caption {
  top: 20px;
  bottom: auto;
  right: 90px;
  z-index: 2;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}
@media (min-width: 901px) and (max-width: 1100px) {
  .about-intro { grid-template-columns: 1fr 280px; }
  .cover-name { left: -40px; font-size: 3.6rem; }
}

/* ── Closing poem ── */
.closing {
  margin: 64px 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}
.closing-poem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.closing-line {
  overflow: hidden;
  padding: 0 0.15em 0.12em;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.3;
  color: var(--text);
}
.closing-line:nth-child(3) { color: var(--gold-light); }
.closing-inner { display: inline-block; }
.tbc {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
}
.tbc-rule {
  display: block;
  width: 56px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

/* ── Gold veins along section tops ── */
.vein {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  z-index: 2;
  overflow: hidden;   /* nothing may poke past the screen edge (iOS side-scroll) */
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.55));
}
.vein path {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.55;
}
.vein .vein-main { stroke: var(--gold-light); opacity: 0.85; }

/* ╔══════════════════════════════════════════════════════╗
   ║  MOBILE PASS — everything on desktop, reachable on    ║
   ║  touch. Placed last so it overrides older rules that  ║
   ║  hid content on small screens.                        ║
   ╚══════════════════════════════════════════════════════╝ */

/* Touch devices of any size: no custom cursor (it would sit stuck
   in the corner on tablets), and hover-only content is shown */
@media (hover: none) {
  body { cursor: auto; }
  .scrollcue-mouse { display: none; }   /* a mouse icon means nothing on a phone */
  .cursor-outer, .cursor-dot { display: none; }
  .project-blurb { opacity: 1; transform: none; }
  .marker-cta { opacity: 1; transform: none; }
  .gallery-tile::after { opacity: 1; transform: none; }   /* "tap to enlarge" icon */
  /* The row centred on screen gets the "hover" treatment (motion.js):
     gold while centred, and the slash plays once as it arrives */
  .project-item.in-view .project-name { color: var(--gold-light); }
  .project-item.slashing .st-a { transform: translate(-5px, -3px); }
  .project-item.slashing .st-b { transform: translate(5px, 3px); }
  .project-item.slashing .slash-text::after { opacity: 0.7; }
  .project-item.in-view .project-item-line { background: var(--border-gold); }
}

/* Phones & small tablets */
@media (max-width: 900px) {
  /* Project rows: stacked, with the image shown inline (the cursor
     preview doesn't exist on touch) */
  .project-item-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 32px 0;
  }
  .project-item:hover .project-item-inner { padding-left: 0; }
  .project-meta { margin-bottom: 0; flex-wrap: wrap; gap: 10px; }
  .project-name { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .project-thumb {
    display: block;
    order: 3;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  }
  .project-blurb { order: 4; margin-top: 0; opacity: 1; transform: none; }
  .project-arrow { display: none; }

  /* About: the volume cover is shown, full width, name inside the frame */
  .about-visual { display: block; max-width: 340px; width: 100%; margin: 0 auto; padding-top: 0; }
  .about-visual::before { top: 18px; }
  .cover-name { left: 14px; bottom: 48px; font-size: clamp(3rem, 14vw, 4rem); }

  .marquee-label { display: block; }
}

@media (max-width: 768px) {
  /* Hero: sun sits in the upper half (camera offset in script.js),
     text anchored to the bottom, and the story + project nodes are
     all shown — they no longer compete with the headline, which
     leaves before they arrive */
  .hero-sticky { height: 100vh; height: 100svh; }
  .hero-overlay {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(124px + env(safe-area-inset-bottom));  /* clears the sound + customize buttons */
    transform: none;
    padding: 0 24px;
  }
  .hero-kicker { margin-bottom: 16px; }
  .hero-title { font-size: clamp(2.6rem, 11.5vw, 3.4rem); margin-bottom: 18px; }
  .hero-subtitle { font-size: 0.92rem; line-height: 1.7; }
  .hero-buttons { flex-direction: row; flex-wrap: wrap; margin-top: 24px; gap: 10px; }
  .hero-buttons .btn { padding: 12px 20px; }

  .project-markers { display: block; }
  .marker-name { font-size: 0.72rem; padding: 4px 10px; }
  .marker-preview { display: none; }   /* hover card — tapping opens the project instead */

  .story-panel {
    display: block;
    left: 24px;
    right: 24px;
    width: auto;
    top: auto;
    bottom: calc(124px + env(safe-area-inset-bottom));
  }
  .panel-1, .panel-2, .panel-3, .panel-4 { top: auto; }
  .story-panel h2 { font-size: 1.5rem; }

  .hero-nodehint { display: inline-flex; bottom: calc(64px + env(safe-area-inset-bottom)); font-size: 0.7rem; }
  .hero-scrollcue { bottom: calc(18px + env(safe-area-inset-bottom)); }

  /* Tighter vertical rhythm */
  .about-section,
  .projects-section,
  .contributions-section,
  .contact-section { padding-top: 96px; padding-bottom: 96px; }
  .about-intro { margin-bottom: 56px; }

  .closing-line { font-size: 1.3rem; }
  .tbc { letter-spacing: 0.36em; }
  .tbc-rule { width: 32px; }
}

@media (max-width: 640px) {
  /* Earlier rules hid these on small phones */
  .about-visual { display: block; }
  .story-panel { display: block; }
  .gallery-tile { --cut: 12px; }
}


/* ╔══════════════════════════════════════════════════════╗
   ║  CUSTOMIZE — panel (prefs.js) + Simple mode           ║
   ╚══════════════════════════════════════════════════════╝ */

/* Toggle: sits just above the sound button, same style */
.cz-toggle {
  position: fixed;
  left: 26px;
  bottom: calc(26px + 44px + 12px);
  z-index: 9000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: rgba(var(--bg-rgb), 0.6);
  backdrop-filter: blur(6px);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.cz-toggle:hover,
.cz-toggle[aria-expanded="true"] {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.55);
}
.cz-toggle:focus-visible,
.cz-panel :focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }

/* Panel */
.cz-panel {
  position: fixed;
  left: 26px;
  bottom: calc(26px + 44px + 12px + 44px + 12px);
  z-index: 9001;
  width: 300px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 18px 18px 16px;
  background: rgba(var(--bg-soft-rgb), 0.96);
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  font-family: var(--font-body);
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.cz-panel.open { opacity: 1; transform: none; }
.cz-panel, .cz-panel * { cursor: auto; }
.cz-panel label, .cz-panel button { cursor: pointer; }

.cz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cz-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; }
.cz-close {
  width: 32px; height: 32px;
  background: transparent; border: 0;
  color: var(--muted); font-size: 1.4rem; line-height: 1;
}
.cz-close:hover { color: var(--text); }

.cz-group { border: 0; padding: 0; margin: 0 0 16px; }
.cz-group legend {
  margin-bottom: 9px;
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Segmented choices */
.cz-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cz-seg label { position: relative; display: block; }
.cz-seg input { position: absolute; opacity: 0; inset: 0; }
.cz-seg span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.cz-seg small { font-size: 0.68rem; color: var(--muted); line-height: 1.35; }
.cz-seg-sm span { padding: 8px 11px; align-items: center; }
.cz-seg input:checked + span { border-color: var(--gold); background: rgba(var(--accent-rgb), 0.1); }
.cz-seg input:focus-visible + span { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.cz-note { margin-top: 8px; font-size: 0.72rem; color: var(--gold-light); }

/* Swatches */
.cz-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.cz-swatch {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(var(--fg-rgb), 0.18);
  transition: transform 0.2s ease;
}
.cz-swatch:hover { transform: scale(1.08); }
.cz-swatch input[type="radio"] { position: absolute; opacity: 0; inset: 0; margin: 0; }
.cz-swatch:has(input[type="radio"]:checked) { box-shadow: 0 0 0 2px var(--bg-soft), 0 0 0 3.5px var(--text); }
.cz-swatch:has(input[type="radio"]:focus-visible) { outline: 2px solid var(--gold-light); outline-offset: 4px; }
/* Custom colour: rainbow ring around the current pick */
.cz-custom {
  background:
    radial-gradient(circle, var(--sw) 0 46%, transparent 48%),
    conic-gradient(#e44, #ec4, #4c6, #4ce, #46e, #c4e, #e44);
}
.cz-color { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; }
.cz-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.cz-reset {
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}
.cz-reset:hover { color: var(--text); border-color: var(--border-gold); }

@media (max-width: 768px) {
  .cz-toggle { left: 18px; bottom: calc(18px + 40px + 10px); width: 40px; height: 40px; }
  /* bottom sheet on phones */
  .cz-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 82vh;
    padding: 20px 20px calc(18px + env(safe-area-inset-bottom));
    clip-path: none;
    border-width: 1px 0 0;
    transform: translateY(24px);
  }
}

/* ── Paper (light) background ──
   prefs.js sets data-theme="light" and the ink/accent variables; these
   are the few things that can't be expressed as a colour swap. */
html[data-theme="light"] { color-scheme: light; }
/* Blend modes tuned for a dark page: "difference" cursor and "screen"
   glow would vanish or invert on paper */
html[data-theme="light"] .cursor-outer { mix-blend-mode: normal; }
html[data-theme="light"] .hero-glow { mix-blend-mode: multiply; }
/* Text laid over the portrait: a paper-coloured halo instead of a dark
   shadow, so ink text stays legible over dark parts of the photo */
html[data-theme="light"] .cover-name,
html[data-theme="light"] .cover-vol,
html[data-theme="light"] .about-visual .about-photo-caption {
  text-shadow: 0 0 3px rgba(var(--bg-rgb), 0.95), 0 0 14px rgba(var(--bg-rgb), 0.9), 0 0 28px rgba(var(--bg-rgb), 0.7);
}
/* Small accent labels: the paper gold is 4.3:1 here, just under AA */
html[data-theme="light"] .contribution-category { color: var(--gold-dark); }
/* Grain reads as dirt on a light page */
html[data-theme="light"] .grain-overlay { opacity: 0.02; }
/* Duotone images: a touch less darkening so they don't go muddy */
html[data-theme="light"] .duo { filter: grayscale(1) sepia(0.8) saturate(var(--duo-sat, 1.35)) hue-rotate(var(--duo-hue, -6deg)) brightness(0.92) contrast(1.08); }
html[data-theme="light"] .gallery-tile:hover .duo,
html[data-theme="light"] .gallery-tile:focus-visible .duo,
html[data-theme="light"] .about-photo-frame:hover .duo,
html[data-theme="light"] .cs-gallery-item:hover .duo,
html[data-theme="light"] .cs-story-media:hover .duo,
html[data-theme="light"] .duo.is-lit { filter: none; }

/* ── Simple mode ── */
/* Fade veil for page changes (replaces the slash cut) */
.simple-veil {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
}
/* The hero is one calm screen: no scroll story, story panels or nodes */
html[data-mode="simple"] .hero-three { min-height: 100vh; min-height: 100svh; }
html[data-mode="simple"] .story-panels,
html[data-mode="simple"] .project-markers,
html[data-mode="simple"] .hero-nodehint,
html[data-mode="simple"] .hero-glow,
html[data-mode="simple"] .grain-overlay,
html[data-mode="simple"] .ambient-canvas,
html[data-mode="simple"] .cursor-outer,
html[data-mode="simple"] .cursor-dot { display: none; }
/* Native cursor back, with the usual pointer on anything clickable */
html[data-mode="simple"] body,
html[data-mode="simple"] body * { cursor: auto; }
html[data-mode="simple"] a,
html[data-mode="simple"] button,
html[data-mode="simple"] label,
html[data-mode="simple"] .project-item,
html[data-mode="simple"] .project-marker,
html[data-mode="simple"] .gallery-tile,
html[data-mode="simple"] .cs-gallery-item img,
html[data-mode="simple"] .cs-next-link { cursor: pointer; }
/* No floating preview in Simple mode, so the row keeps its thumbnail */
html[data-mode="simple"] .projects-grid .project-item:hover .project-thumb { opacity: 1; transform: none; }

/* ============================================================
   BRAND V2 — HOMEPAGE (2026-10-11)
   Poster headlines (DM Sans 900 caps) with one Cormorant italic
   counter-word, the 72° slash, one inversion section.
   Rules: motion-studio/clients/javier-leo/BRAND.md
============================================================ */
:root {
  --ease-sig: cubic-bezier(0.22, 1, 0.36, 1);
  /* gold and muted on an ink ground (plain gold fails contrast there) */
  --gold-on-ink: color-mix(in srgb, var(--gold) 62%, #000);   /* #7d682f at the default accent */
  --muted-on-ink: #5c5a54;
  --pad-x: clamp(22px, 5vw, 72px);
}

/* ---------- Shared type ---------- */
.sec-kicker {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.poster {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--text);
}
.counter {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.22em;
  line-height: 0.8;
  letter-spacing: -0.01em;
  text-transform: none;
  padding-right: 0.06em;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}
/* Once split into words, each word carries the gradient itself */
.counter .mask-word,
.counter .ht-word {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-right: 0.08em;
}
.poster .mask-wrap { padding-bottom: 0.06em; margin-bottom: -0.06em; }
.sec-head { max-width: 1240px; margin: 0 auto 64px; }

.work-section,
.motion-section,
.more-section,
.about-section,
.contributions-section,
.contact-section {
  position: relative;
  padding: 140px var(--pad-x);
}

/* ---------- Header ---------- */
.logo { color: inherit; text-decoration: none; }
.nav-link.nav-cv { color: var(--gold); }

/* ---------- Intro (under 2 s) ---------- */
.intro-overlay { flex-direction: column; gap: 22px; }
.intro-seal { position: relative; width: 112px; height: 112px; }
.intro-seal-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.intro-ring {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.intro-star { fill: var(--gold-light); }
.intro-j {
  position: absolute;
  inset: 0;
  background: var(--text);
  -webkit-mask: url("assets/logo/mark-j.svg") center / contain no-repeat;
  mask: url("assets/logo/mark-j.svg") center / contain no-repeat;
  opacity: 0;
}
.intro-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.9rem;
  letter-spacing: 0.01em;
  color: var(--text);
  opacity: 0;
}
.intro-name em { font-style: italic; color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 70% at 72% 50%, rgba(var(--accent-rgb), 0.07), transparent 60%),
    var(--bg);
}
#three-hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.9s var(--ease-sig);
}
#three-hero-canvas.is-live { opacity: 1; }
.hero-still {
  display: none;
  position: absolute;
  z-index: 1;
  right: -4vw;
  top: 50%;
  width: min(58vw, 820px);
  height: auto;
  translate: 0 -50%;
  pointer-events: none;
}
.hero.use-still .hero-still { display: block; }

.hx-copy {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 940px;
  padding: 120px var(--pad-x) 80px;
}
.hx-kicker {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
}
.hx-title {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.ht-line { display: block; white-space: nowrap; }
.ht-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.ht-word { display: inline-block; }
.hx-title .counter { font-size: 1.24em; }

.hx-sub {
  margin-top: 30px;
  max-width: 520px;
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(var(--text-rgb), 0.82);
}
.hx-proof {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  margin-top: 26px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.hx-proof b { color: var(--text); font-weight: 700; margin-right: 4px; }
.hx-buttons { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.show-sm { display: none; }

/* Before the intro hands over, keep the hero text hidden (no flash) */
body.intro-playing .hx-copy > * { opacity: 0; }

/* Project nodes over the sun (3D) or the still image */
.hero-nodes { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.hero-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translate(16px, 14px);
  transition: opacity 0.5s var(--ease-sig);
}
.hero-node.visible { opacity: 1; }
.marker-dot { display: none; }
.marker-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(var(--bg-rgb), 0.62);
  border: 1px solid var(--border-gold);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.marker-name { font-size: 0.9rem; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.marker-meta { font-size: 0.62rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.hero-node:hover .marker-info,
.hero-node:focus-visible .marker-info { border-color: var(--gold); background: rgba(var(--bg-rgb), 0.85); }

/* Still-image mode: nodes sit in fixed spots over the picture */
.hero.use-still .hero-node { opacity: 1; transform: none; }
.hero.use-still .marker-dot {
  display: block;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 14px rgba(var(--accent-light-rgb), 0.9);
}
.hero.use-still #marker-spf      { left: 60%; top: 31%; }
.hero.use-still #marker-vr       { left: 63%; top: 69%; }
.hero.use-still #marker-seatsure { left: 82%; top: 20%; }

/* ---------- Selected work ---------- */
.work-cards {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  gap: clamp(80px, 10vw, 140px);
}
.work-card {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  cursor: pointer;
}
.work-card:nth-child(even) .work-media { order: 2; }
.work-media {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-sig);
}
.work-card:hover .work-media img { transform: scale(1.035); }
.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.work-meta span:first-child { color: var(--gold); }
.work-title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.work-title a { color: var(--text); text-decoration: none; transition: color 0.3s ease; }
.work-card:hover .work-title a { color: var(--gold-light); }
.work-role { margin-top: 18px; color: rgba(var(--text-rgb), 0.78); font-size: 1rem; line-height: 1.6; }
.work-result {
  margin-top: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--gold);
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
}
.work-cta {
  display: inline-flex;
  gap: 10px;
  margin-top: 26px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.work-cta span { transition: transform 0.35s var(--ease-sig); }
.work-card:hover .work-cta span { transform: translateX(6px); }

/* ---------- Motion ---------- */
.motion-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.motion-lead { margin-top: 26px; max-width: 460px; font-size: 1.08rem; line-height: 1.6; color: rgba(var(--text-rgb), 0.82); }
.motion-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  margin: 34px 0 36px;
}
.motion-facts b {
  display: block;
  font-weight: 900;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}
.motion-facts span {
  display: block;
  margin-top: 8px;
  max-width: 150px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.motion-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border-gold);
}
.motion-media video,
.motion-media iframe { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
.motion-figure { margin: 0; }
.motion-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.motion-play img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.7s var(--ease-sig); }
.motion-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  display: grid;
  place-items: center;
  padding-left: 5px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 0 8px rgba(0, 0, 0, 0.25);
  color: var(--gold-light);
  font-size: 1.5rem;
  transition: transform 0.35s var(--ease-sig), background 0.35s ease;
}
.motion-play:hover img,
.motion-play:focus-visible img { transform: scale(1.04); }
.motion-play:hover .motion-play-icon,
.motion-play:focus-visible .motion-play-icon { transform: scale(1.08); background: rgba(0, 0, 0, 0.85); }
.motion-play:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.motion-caption {
  margin-top: 14px;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- More work ---------- */
.more-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 28px;
}
.more-card { cursor: pointer; }
.more-media {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.more-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease-sig); }
.more-card:hover .more-media img { transform: scale(1.04); }
.more-meta {
  margin-top: 16px;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.more-title { margin-top: 6px; font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; line-height: 1.1; }
.more-title a { color: var(--text); text-decoration: none; transition: color 0.3s ease; }
.more-card:hover .more-title a { color: var(--gold-light); }

/* ---------- Recognition: the one inversion section ---------- */
.recognition-section {
  background: var(--text);
  color: var(--bg);
  padding: 140px var(--pad-x);
  overflow: hidden;
}
.recognition-section::before { display: none; }
/* The 72° cut: the top-right corner is sliced off along the brand slash
   (462 / 150 = tan 72°), so the dark page shows through */
.recognition-section {
  clip-path: polygon(0 0, calc(100% - 150px) 0, 100% 462px, 100% 100%, 0 100%);
}
.recognition-inner { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; }
.recognition-section .sec-kicker { color: var(--muted-on-ink); }
.recognition-section .poster { color: var(--bg); }
.recognition-section .counter {
  background: none;
  -webkit-text-fill-color: var(--gold-on-ink);
  color: var(--gold-on-ink);
}
.recognition-section .counter .mask-word { -webkit-text-fill-color: var(--gold-on-ink); background: none; }
.recognition-intro { color: var(--muted-on-ink); margin-top: 22px; }
.recognition-section .rec-stat {
  background: transparent;
  border: 1px solid rgba(var(--bg-rgb), 0.14);
  border-top: 2px solid var(--gold-on-ink);
}
.recognition-section .rec-stat b {
  font-family: var(--font-body);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--bg);
}
.recognition-section .rec-stat span,
.recognition-section .rec-list span { color: var(--muted-on-ink); }
.recognition-section .rec-note { color: var(--muted-on-ink); }
.recognition-section .rec-list b { color: var(--bg); }
.recognition-section .rec-list li { border-bottom-color: rgba(var(--bg-rgb), 0.14); }
/* On paper the inversion is a dark panel, so it takes the dark-page
   colours: the undeepened accent and the dark theme's muted grey */
html[data-theme="light"] .recognition-section {
  --gold-on-ink: rgb(var(--accent-base-rgb, 201, 168, 76));
  --muted-on-ink: #8a8880;
}
.rec-more { margin-top: 36px; }
.rec-more summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-on-ink);
}
.rec-more summary::-webkit-details-marker { display: none; }
.rec-more summary::after { content: "+"; font-size: 1rem; letter-spacing: 0; }
.rec-more[open] summary::after { content: "–"; }
.rec-more .rec-list { margin-top: 20px; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 44px; }
.recognition-section .btn.primary { background: var(--bg); color: var(--text); border-color: var(--bg); }
.recognition-section .btn.secondary { color: var(--bg); border-color: rgba(var(--bg-rgb), 0.3); }
.recognition-section .btn.secondary:hover { border-color: var(--bg); }

/* ---------- About ---------- */
.about-lead + .about-lead { margin-top: 18px; }

/* ---------- Contact ---------- */
.contact-title { margin-bottom: 26px; }
.contact-footer a { color: var(--muted); text-decoration: none; }
.contact-footer a:hover { color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .more-grid { grid-template-columns: 1fr 1fr; }
  .work-card { grid-template-columns: 1fr; gap: 26px; }
  .work-card:nth-child(even) .work-media { order: 0; }
  .motion-inner { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .work-section, .motion-section, .more-section, .about-section,
  .contributions-section, .contact-section, .recognition-section { padding-top: 96px; padding-bottom: 96px; }
  .hero { align-items: flex-end; }
  .hx-copy { padding-top: 30vh; padding-bottom: calc(132px + env(safe-area-inset-bottom)); }  /* clears the fixed settings + sound buttons */
  .hx-kicker { font-size: 0.58rem; letter-spacing: 0.14em; margin-bottom: 16px; white-space: nowrap; }
  .hx-title { font-size: clamp(2.5rem, 12vw, 3.4rem); }
  .hx-sub { font-size: 0.98rem; margin-top: 18px; }
  .hx-proof { gap: 6px 14px; margin-top: 18px; font-size: 0.58rem; letter-spacing: 0.12em; }
  .hx-buttons { margin-top: 24px; gap: 10px; }
  .hx-buttons { flex-wrap: nowrap; }
  .hx-buttons .btn { padding: 12px 18px; white-space: nowrap; }
  .hx-buttons .btn .hide-sm { display: none; }
  .hx-buttons .btn .show-sm { display: inline; }
  .hero-still { top: 0; right: -16vw; width: 100vw; translate: 0 0; opacity: 0.7; }
  .hero-nodes { display: none; }
  .ht-line { white-space: normal; }
  .sec-head { margin-bottom: 44px; }
  .recognition-section { clip-path: polygon(0 0, calc(100% - 56px) 0, 100% 172px, 100% 100%, 0 100%); }
}
@media (max-width: 560px) {
  .more-grid { grid-template-columns: 1fr; }
}

/* ---------- Services ---------- */
.services-section { position: relative; padding: 140px var(--pad-x); }
.services-lead { margin-top: 26px; max-width: 560px; font-size: 1.08rem; line-height: 1.6; color: rgba(var(--text-rgb), 0.82); }
.services-launch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 8px 16px;
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.services-launch-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-dim); }
.services-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 28px;
  align-items: stretch;
}
.service-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
}
.service-main { border-color: var(--border-gold); }
.service-media { border: 0; border-bottom: 1px solid var(--border-gold); border-radius: 0; }
.service-body { padding: 30px 32px 32px; display: flex; flex-direction: column; flex: 1; }
.service-extra .service-body { justify-content: center; }
.service-tag { font-size: 0.66rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.service-main .service-tag { color: var(--gold); }
.service-name { margin-top: 8px; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.1; color: var(--text); }
.service-price { margin-top: 18px; font-weight: 900; font-size: 2.4rem; line-height: 1; letter-spacing: -0.03em; color: var(--text); }
.service-from { font-size: 0.66rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); vertical-align: 0.9em; margin-right: 4px; }
.service-price del { margin-left: 8px; font-size: 1.1rem; font-weight: 500; letter-spacing: 0; color: var(--text-dim); }
.service-list { list-style: none; margin-top: 22px; display: grid; gap: 10px; }
.service-list li { position: relative; padding-left: 22px; font-size: 0.95rem; line-height: 1.5; color: rgba(var(--text-rgb), 0.82); }
.service-list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 10px; height: 1.5px; background: var(--gold); }
.service-proof { margin-top: auto; padding-top: 22px; font-size: 0.85rem; line-height: 1.55; color: var(--muted); }
.service-proof b { color: var(--text); font-weight: 500; }
.service-proof a { color: var(--gold-light); text-decoration: none; border-bottom: 1px solid var(--border-gold); }
.service-proof a:hover { color: var(--gold); }
.services-note { max-width: 1240px; margin: 22px auto 0; font-size: 0.85rem; color: var(--muted); }
.services-side { display: flex; flex-direction: column; gap: 28px; }
.service-extra { flex: 1; }
.services-quote {
  padding: 28px 32px 30px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--gold-glow), transparent 70%), var(--bg-card);
  border: 1px solid var(--border-gold);
}
.services-quote-title { margin-top: 8px; font-family: var(--font-display); font-style: italic; font-weight: 300; font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 1.15; color: var(--gold-light); }
.services-cta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.services-cta .btn.primary { flex: 1 1 100%; justify-content: center; text-align: center; }
.services-cta .btn.secondary { flex: 1 1 0; justify-content: center; text-align: center; white-space: nowrap; padding-left: 16px; padding-right: 16px; }
.services-cta-note { margin-top: 14px; font-size: 0.75rem; color: var(--text-dim); }
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .services-section { padding-top: 96px; padding-bottom: 96px; }
  .service-body { padding: 24px 22px 26px; }
  .services-quote { padding: 24px 22px 26px; }
}
