/* ========================================
   Structure cloned from redcollar.co
   Typography, spacing, trigger system, layout
   ======================================== */

/* ----- Vars ----- */
:root {
  --bg: #0d0c0c;
  --white: #fafafa;
  --grey: #666;
  --dim: #343434;
  --orange: #ff6b35;
  --purple: #c44dff;
  --cyan: #00d4aa;
  --font: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Inter', 'Courier New', monospace;
}

/* ----- Reset ----- */
*, *::before, *::after { margin: 0; padding: 0; border: none; box-sizing: border-box; }
html {
  font-size: 16px;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  font-weight: 400;
  cursor: none;
  scroll-behavior: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { height: auto; min-height: 100vh; overflow-x: hidden; }
a, button { cursor: none; color: inherit; text-decoration: none; background: none; font-family: inherit; font-weight: 400; }
img { display: block; max-width: 100%; }
li { list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ----- Canvas layers ----- */
#noise-canvas { position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0; mix-blend-mode: overlay; }
#particle-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#cat-canvas { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 5; pointer-events: none; opacity: 0; transition: opacity 0.3s; }

/* ===== INTRO OVERLAY (ten.375.studio-style gate) ===== */
.intro-overlay {
  position: fixed; inset: 0; z-index: 20000;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  cursor: pointer;
  transition: opacity 0.8s ease;
}
.intro-overlay.is-dismissed {
  opacity: 0; pointer-events: none;
}
.intro-center { text-align: center; }
.intro-name {
  width: min(560px, 78vw); height: auto; display: block; margin: 0 auto;
}
.intro-name .ipath {
  stroke-dasharray: 500; stroke-dashoffset: 500;
}
.intro-progress {
  width: min(280px, 50vw); height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 40px auto 0;
  overflow: hidden;
}
.intro-progress-fill {
  height: 100%; width: 0%;
  background: var(--orange);
  transition: width 0.3s linear;
}
.intro-hint {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--dim); margin-top: 40px;
  opacity: 0;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.7; }
}

/* ===== CURSOR SPOTLIGHT (ten.375.studio light-on-page effect) ===== */
.cursor-spotlight {
  position: fixed; top: 0; left: 0;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none; z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s;
}
body.is-ready .cursor-spotlight { opacity: 1; }

/* ===== 3D BOOK WRAPPER (mouse-driven perspective) ===== */
.book-stage {
  perspective: 1200px;
  perspective-origin: center center;
}
.book-spread {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  will-change: transform;
}


/* Spine glow line in center */

/* ----- Cursor ----- */
.cursor {
  position: fixed; top: 0; left: 0; width: 20px; height: 20px;
  border: 1.5px solid var(--orange); border-radius: 50%;
  pointer-events: none; z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
  mix-blend-mode: screen;
  box-shadow: 0 0 8px rgba(255,107,53,0.3);
}
.cursor.is-hover { width: 60px; height: 60px; border-color: var(--purple); background: rgba(196,77,255,0.1); backdrop-filter: blur(2px); }
#cursor-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em;
  color: var(--white); opacity: 0; transition: opacity 0.2s;
}
.cursor.is-hover #cursor-text { opacity: 1; }

/* ----- Nav dots ----- */
.nav-dots { position: fixed; right: 28px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 14px; z-index: 100; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(250,250,250,0.15); transition: background 0.3s, transform 0.3s; }
.nav-dot.active { background: var(--orange); transform: scale(1.6); box-shadow: 0 0 10px rgba(255,107,53,0.5); }

/* ----- Progress bar ----- */
.progress-bar { position: fixed; top: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--orange), var(--purple), var(--cyan)); z-index: 10001; transform-origin: 0 0; transform: scaleX(0); }

/* ----- Site header ----- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 24px 32px;
  mix-blend-mode: difference;
}
.header-left {
  font-family: var(--font);
  font-size: 15px; font-weight: 500; letter-spacing: 0.08em;
  color: var(--white);
  pointer-events: auto;
  transition: opacity 0.3s;
}
.header-left:hover { opacity: 0.6; }
.header-right {
  display: flex; gap: 10px; align-items: center;
  pointer-events: auto;
}
.header-right a {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 400; letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey);
  transition: color 0.3s;
}
.header-right a:hover { color: var(--white); }
.header-divider {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--dim);
  pointer-events: none;
}

/* ========================================
   REDCOLLAR TYPOGRAPHY SYSTEM
   ======================================== */

/* h1 — project names, 100-130px, negative letter-spacing, tight */
h1, .h1 {
  font-family: var(--font);
  font-size: 38px; line-height: 1.1; letter-spacing: -0.05em; font-weight: 700;
  margin-left: -0.04em;
}
@media (min-width: 640px)  { h1, .h1 { font-size: 70px; } }
@media (min-width: 1000px) { h1, .h1 { font-size: 100px; } }
@media (min-width: 1400px) { h1, .h1 { font-size: 120px; } }

/* h2 — section subtitles, 42-64px */
h2, .h2 {
  font-family: var(--font);
  font-size: 22px; line-height: 1.2; letter-spacing: -0.03em; font-weight: 700;
  margin-left: -0.04em;
}
@media (min-width: 640px)  { h2, .h2 { font-size: 34px; } }
@media (min-width: 1000px) { h2, .h2 { font-size: 48px; } }

/* .t — section eyebrow label, like redcollar "our work" */
.t {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 400; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--grey);
}

/* .h3.circle — service headings with pill border */
.h3 { font-family: var(--font); font-size: 16px; line-height: 1; font-weight: 400; letter-spacing: -0.02em; margin-left: -0.02em; }
.h3.circle { font-size: 16px; margin-bottom: 20px; }
.h3.circle span { display: inline-block; padding: 10px 24px; font-size: 16px; border-radius: 20px; border: 1px solid; opacity: 0.5; }
@media (min-width: 1000px) { .h3 { font-size: 20px; } .h3.circle { font-size: 20px; margin-bottom: 25px; } .h3.circle span { font-size: 18px; padding: 12px 28px; } }

/* Body text */
p { font-size: 18px; line-height: 1.6; }
ul > li { font-size: 16px; line-height: 2; }
h4 { font-size: 14px; font-weight: 300; color: var(--grey); }

/* Middle text — description paragraphs */
.middle-text { max-width: 680px; }

/* ========================================
   REDCOLLAR LAYOUT SYSTEM
   ======================================== */

/* Wrapper — centered content */
.wrapper { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 90px; }

/* Section base */
section { position: relative; padding-top: 60px; padding-bottom: 60px; }
@media (min-width: 1000px) { section { padding-top: 64px; padding-bottom: 120px; } }

/* Full-height sections */
.vh-height { height: 100vh; min-height: 600px; display: flex; align-items: center; }

/* ===== ALL SECTIONS FULLSCREEN + SNAP ===== */
#work, #gallery { height: 100vh; min-height: 600px; overflow: hidden; }
#work { display: flex; flex-direction: column; justify-content: center; }
/* Snap points defined in app.js initScroll() */

/* ===== SECTION SEPARATORS ===== */
.home::after,
.projects::after {
  content: ''; position: absolute; bottom: 0; left: 5%; right: 5%; z-index: 2;
  height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(250,250,250,0.08) 30%, rgba(250,250,250,0.2) 50%, rgba(250,250,250,0.08) 70%, transparent);
}

/* sections use default padding */

/* uniform dark background */

/* ===== DANMAKU KEYWORDS ===== */
.kw-l, .kw-m, .kw-s, .kw-x {
  position: absolute; pointer-events: none; z-index: 2;
}
.kw-l  { font-family: var(--font); font-size: 2.2rem; font-weight: 500; }
.kw-m  { font-family: var(--font); font-size: 1.3rem; font-weight: 400; }
.kw-s  { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400; letter-spacing: 0.02em; }
.kw-x  { font-family: var(--font); font-size: 0.6rem; font-style: italic; color: rgba(250,250,250,0.12); }
.kw-word {
  color: rgba(250,250,250,0.12);
  transition: color 0.3s;
}
.kw-word.lit { color: var(--orange); }
.kw-tip {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font);
  font-size: 0.7rem; font-weight: 300;
  color: rgba(250,250,250,0.85);
  background: rgba(13,12,12,0.92);
  padding: 6px 14px; border-radius: 2px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  margin-top: 6px;
  z-index: 10;
}
.kw-tip.show { opacity: 1; }


/* Section header */
.section-header { margin-bottom: 0; }
.section-header .wrapper { padding-top: 0; }

/* Dark section background */
.dark { background: rgba(13,12,12,0.82); }

/* Margin-left indent */
.m-l { margin-top: 32px; }

/* ========================================
   HERO
   ======================================== */
.home {
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.hero-logo {
  width: min(520px, 72vw); height: auto; display: block; display: none;
}

/* Decorative concentric rings */
.hero-ornament {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 80vw); height: min(600px, 80vw);
  border-radius: 50%; border: 1px solid rgba(255,107,53,0.08);
  pointer-events: none; z-index: 0;
}
.hero-ornament::before {
  content: ''; position: absolute; inset: 40px; border-radius: 50%;
  border: 1px solid rgba(196,77,255,0.05);
}
.hero-ornament::after {
  content: ''; position: absolute; inset: 100px; border-radius: 50%;
  border: 1px solid rgba(0,212,170,0.04);
}
.hero-content { position: relative; z-index: 1; text-align: center; }

/* Gradient-filled name with glow */
.hero-name-cn {
  display: block;
  font-family: var(--font);
  font-size: clamp(64px, 10vw, 140px); font-weight: 700;
  letter-spacing: 0.06em; line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #ffb088 40%, #ff6b35 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(255,107,53,0.3));
}
.hero-sub {
  font-family: var(--font);
  font-size: clamp(13px, 1.2vw, 16px); font-weight: 300;
  letter-spacing: 0.3em; color: var(--grey); margin-top: 24px;
}
.hero-hint {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.25em;
  color: var(--grey); margin-top: 64px;
  opacity: 0;
  animation: pulse 2s ease-in-out infinite;
}
.hero-hint::after {
  content: ''; display: block; margin: 14px auto 0;
  width: 1px; height: 32px;
  background: linear-gradient(to bottom, var(--orange), transparent);
}

/* Scroll-down indicator — bouncing chevron at bottom of hero */
.scroll-indicator {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 3; opacity: 0;
  transition: opacity 0.8s ease;
}
.scroll-indicator-chevron {
  display: block; width: 12px; height: 12px;
  border-right: 1.5px solid rgba(255,255,255,0.35);
  border-bottom: 1.5px solid rgba(255,255,255,0.35);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(8px); }
}

/* ========================================
   PROJECTS SECTION (redcollar: section.projects)
   ======================================== */
.projects {
  padding-top: 80px; padding-bottom: 0;
  position: relative; z-index: 1;
}
.projects-mask, .projects-parallax-mask {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.projects-list {
  display: flex; flex-direction: column;
}

/* Each project entry */
.project-area {
  padding: 48px 0;
  border-bottom: 1px solid rgba(250,250,250,0.06);
  display: flex; justify-content: space-between; align-items: center;
  cursor: none;
  position: relative;
}
.project-area:first-child { padding-top: 24px; }
.project-area:last-child { border-bottom: none; }
.project-area::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.04) 0%, transparent 70%);
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.project-area:hover::after {
  opacity: 1; transform: scale(1);
}

/* .mn — name container */
.mn { flex: 0 0 auto; max-width: 60%; }

/* .year — category label */
.year {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 8px;
}

/* .name — the huge project title */
.name { margin-bottom: 0; }

/* Project link */
.project-link { display: inline-block; color: var(--white); transition: color 0.4s; }
.project-link:hover { color: var(--orange); }
.project-link .letter {
  display: inline-block;
  transition: transform 0.25s ease-out, color 0.3s;
}
.project-link:hover .letter {
  color: var(--orange);
  transform: translateY(-4px);
}
.project-link .letter:nth-child(1) { transition-delay: 0s; }
.project-link .letter:nth-child(2) { transition-delay: 0.03s; }
.project-link .letter:nth-child(3) { transition-delay: 0.06s; }
.project-link .letter:nth-child(4) { transition-delay: 0.09s; }
.project-link .letter:nth-child(5) { transition-delay: 0.12s; }

/* Transparent hit area over project title — reliable hover + click */
.project-hitarea {
  position: absolute; top: 0; left: 0; right: 50%; bottom: 0;
  z-index: 10; cursor: none;
}

/* Project image — appears on hover, right side */
.project-img {
  max-width: 400px; flex-shrink: 0;
  margin-left: 60px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.project-area:hover .project-img { opacity: 1; }
.project-area:hover .project-img img { transform: scale(1.02); }
.project-img { will-change: opacity; }
.project-img img {
  width: 100%; height: auto;
  border-radius: 2px;
  transition: transform 0.3s ease;
}

/* ========================================
   SERVICES / CARDS SECTION
   ======================================== */
.services {
  padding-top: 140px; padding-bottom: 200px;
  position: relative; z-index: 1;
}

/* 2-column grid */
.col-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 80px;
}

.col.text {
  display: flex; flex-direction: column;
  position: relative;
}
.col.text::before {
  content: ''; position: absolute; inset: -10px; z-index: 0;
  background: var(--bg-img) center/cover no-repeat;
  opacity: 0; transition: opacity 0.5s ease;
  pointer-events: none;
}
.col.text:hover::before { opacity: 0.18; }
.col.text > * { position: relative; z-index: 1; }

.inline-cta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--orange);
  margin-top: 20px;
  transition: color 0.3s;
}
.inline-cta:hover { color: var(--white); }

/* ========================================
   DIAGONAL AUTO-SCROLL GALLERY (rotated stage)
   ======================================== */
.diagonal-gallery {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 0 1rem;
  overflow: hidden;
  z-index: 1;
}
.gallery-stage {
  position: relative;
  width: 120vw;
  transform: rotate(-12deg) scale(1.25);
  overflow: hidden;
  will-change: transform;
  contain: layout style paint;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}
.gallery-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem 0;
}
.gtrack {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.gtrack-scroll {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}
.gtrack-scroll.paused { animation-play-state: paused; }
.gtrack-scroll img {
  height: var(--h);
  width: auto;
  border-radius: 1px;
  object-fit: contain;
  transition: opacity 0.3s, transform 0.25s ease-out;
  will-change: transform;
  opacity: 0.3;
  cursor: pointer;
}
.gtrack-scroll img.lit {
  opacity: 0.95;
}
.gtrack-scroll img:hover {
  transform: scale(1.08);
}
.gt-1 { --h: 180px; }
.gt-2 { --h: 230px; }
.gt-3 { --h: 160px; }
.gt-4 { --h: 280px; }

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

/* ========================================
   CLIENTS / MORE SECTION (legacy — kept for reference)
   ======================================== */
.clients {
  padding-top: 80px; padding-bottom: 200px;
  position: relative; z-index: 1;
}

.section-block { position: relative; }

.gallery-flipbook { overflow: hidden; cursor: grab; user-select: none; margin-top: 40px; }
.gallery-flipbook:active { cursor: grabbing; }
.flipbook-track { display: flex; gap: 40px; will-change: transform; }
.flipbook-page {
  flex: 0 0 auto;
  display: grid; grid-template-columns: repeat(3, 260px);
  gap: 24px; padding: 16px 0;
}
.flipbook-page .gallery-item {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  background: rgba(250,250,250,0.03);
  transition: transform 0.3s;
}
.flipbook-page .gallery-item:hover { transform: translateY(-6px); }
.flipbook-page .gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-size: 12px; font-weight: 300; color: var(--white);
}
.gallery-hint {
  text-align: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--dim); margin-top: 32px;
}

/* ========================================
   CONTACTS SECTION
   ======================================== */
.contacts {
  display: flex; flex-direction: column; justify-content: center;
  z-index: 1;
}
.contacts .section-header { margin-bottom: 60px; }
.contacts .flex { display: flex; align-items: center; justify-content: center; width: 100%; }
.contacts .inner { width: 100%; }
.contacts-mail {
  font-family: var(--font);
  font-size: clamp(80px, 22vw, 280px); font-weight: 700;
  letter-spacing: 0.06em; line-height: 1;
  color: var(--white);
  text-align: center;
  width: 100%;
}
.yl-letter {
  display: inline-block;
  transition: transform 0.15s ease-out, color 0.3s;
  will-change: transform;
  cursor: default;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  padding: 80px 0 40px; text-align: center;
  z-index: 1; position: relative;
}
.spectrum-line { display: flex; justify-content: center; margin-bottom: 24px; }
.spectrum-line canvas { opacity: 0.3; }
.footer-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--dim); }

/* ========================================
   LIGHTBOX
   ======================================== */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 20000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 85vw; max-height: 85vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 24px; right: 24px; font-size: 28px; color: var(--grey); z-index: 1; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 48px; color: var(--grey); padding: 16px; }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-caption { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 300; color: var(--grey); }

/* ========================================
   ANIMATION SYSTEM (redcollar trigger pattern)
   ======================================== */

/* Elements that animate on scroll */
.trigger { transition: transform 0.8s cubic-bezier(0.34,1.56,0.64,1), opacity 0.8s ease; }

/* Hidden state — translateY(300px) like redcollar */
.will-trigger { transform: translateY(80px); opacity: 0; transition: transform 0.9s cubic-bezier(0.34,1.56,0.64,1), opacity 0.6s ease; }
.will-trigger.triggered { transform: translateY(0); opacity: 1; }

.trigger-section { }
.trigger-section.triggered { }

.appear-default { transform: translateY(60px); opacity: 0; transition: transform 0.8s ease, opacity 0.6s ease; }
.appear-default.triggered { transform: translateY(0); opacity: 1; }

/* Letter-by-letter animation (redcollar animation-letters) */
.animation-letters .letter {
  display: inline-block;
  transform: translateY(100%) rotateX(-40deg);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
}
.animation-letters.triggered .letter {
  transform: translateY(0) rotateX(0);
  opacity: 1;
}

/* Stagger delay applied via JS inline style or CSS custom property */
.animation-letters .letter { transition-delay: var(--delay, 0s); }

/* Split text chars */
.split-text .char {
  display: inline-block; opacity: 0;
  transform: translateY(60px) rotateX(-20deg);
}
