/* ══════════════════════════════════════════════
   几里造物 JILI CREATION
   Spatial Dark — Culture × Tech × Color
   ══════════════════════════════════════════════ */

:root {
  --bg: #060606;
  --bg-warm: #0a0806;
  --bg-cool: #06070a;
  --surface: #0e0e0e;
  --surface-raised: #141414;
  --text: #edeae6;
  --text-soft: rgba(237, 234, 230, 0.5);
  --text-faint: rgba(237, 234, 230, 0.2);
  --border: rgba(255, 255, 255, 0.05);
  --border-visible: rgba(255, 255, 255, 0.08);

  /* Warm palette — culture / humanity */
  --red: #c23a2e;
  --red-glow: rgba(194, 58, 46, 0.22);
  --amber: #c9a050;
  --amber-glow: rgba(201, 160, 80, 0.15);
  --coral: #d4786e;

  /* Cool palette — tech / precision */
  --electric: #5b8fde;
  --electric-glow: rgba(91, 143, 222, 0.12);
  --cyan: #5ec4c9;
  --cyan-glow: rgba(94, 196, 201, 0.1);

  --font-cn: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  --font-en: "Outfit", "DM Sans", -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }

body {
  font-family: var(--font-cn);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1;
  cursor: none;
}

a { color: inherit; text-decoration: none; }

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

/* ── Three.js canvas ── */
#bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ── Custom cursor ── */
.cursor {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  mix-blend-mode: difference;
}

.cursor-dot {
  position: absolute;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out),
              height 0.3s var(--ease-out),
              background 0.3s var(--ease-out);
}

.cursor-ring {
  position: absolute;
  width: 36px; height: 36px;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease-out),
              height 0.4s var(--ease-out),
              border-color 0.4s var(--ease-out);
}

.cursor.is-hover .cursor-ring {
  width: 60px; height: 60px;
  border-color: rgba(255,255,255,0.8);
}

.cursor.is-hover .cursor-dot {
  width: 12px; height: 12px;
  background: var(--coral);
}

.cursor.is-click .cursor-ring {
  width: 28px; height: 28px;
  border-color: #fff;
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 36px 48px;
  mix-blend-mode: difference;
}

.site-header * { color: #fff; }

.brand { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }

.brand-cn {
  font-family: var(--font-cn);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.brand-en {
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.45;
}

.site-nav {
  display: flex;
  gap: 32px;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-nav a {
  opacity: 0.45;
  transition: opacity 350ms var(--ease-out);
  cursor: pointer;
}

.site-nav a:hover { opacity: 1; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #fff;
  transition: transform 280ms var(--ease-out), opacity 280ms var(--ease-out);
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Hero ── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 120px 48px 48px;
  overflow: hidden;
  z-index: 1;
}

.hero-chars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.5vw, 20px);
  line-height: 0.8;
  position: relative;
  z-index: 3;
  perspective: 1200px;
}

.hero-char {
  display: block;
  font-family: var(--font-cn);
  font-size: clamp(80px, 19vw, 250px);
  font-weight: 700;
  letter-spacing: -0.04em;
  cursor: default;
  user-select: none;
  will-change: transform;
  transition: transform 0.15s ease-out, color 1s var(--ease-out);
  background: linear-gradient(180deg, var(--text) 0%, rgba(237,234,230,0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Warm tone on specific chars */
.hero-char:nth-child(3) {
  background: linear-gradient(180deg, #fff 0%, var(--coral) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-char:nth-child(1) { --ty: -0.03em; --tz: 0px; }
.hero-char:nth-child(2) { --ty: 0.05em; --tz: 40px; }
.hero-char:nth-child(3) { --ty: -0.07em; --tz: 80px; }
.hero-char:nth-child(4) { --ty: 0.04em; --tz: 50px; }

.hero-char:nth-child(1) { transform: translateY(var(--ty)) translateZ(var(--tz)); }
.hero-char:nth-child(2) { transform: translateY(var(--ty)) translateZ(var(--tz)); }
.hero-char:nth-child(3) { transform: translateY(var(--ty)) translateZ(var(--tz)); }
.hero-char:nth-child(4) { transform: translateY(var(--ty)) translateZ(var(--tz)); }

/* Glow behind hero text */
.hero-glow {
  position: absolute;
  width: clamp(300px, 50vw, 700px);
  height: clamp(200px, 30vh, 400px);
  background: radial-gradient(ellipse, rgba(201,160,80,0.08) 0%, rgba(194,58,46,0.05) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  filter: blur(40px);
}

.hero-tagline {
  margin-top: clamp(36px, 5vh, 64px);
  font-family: var(--font-cn);
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 400;
  letter-spacing: 0.26em;
  color: rgba(237,234,230,0.45);
  text-align: center;
  position: relative;
  z-index: 3;
}

.hero-meta {
  position: absolute;
  bottom: 48px; left: 48px;
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  z-index: 3;
}

.hero-meta-right {
  position: absolute;
  bottom: 48px; right: 48px;
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  z-index: 3;
}

/* ── Scroll indicator ── */
.scroll-indicator {
  position: absolute;
  bottom: 40px; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 48px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  z-index: 3;
}

.scroll-indicator::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, var(--amber), var(--red));
  animation: scroll-pulse 2.2s var(--ease-out) infinite;
}

@keyframes scroll-pulse {
  0% { transform: translateY(-100%); }
  50% { transform: translateY(100%); }
  100% { transform: translateY(-100%); }
}

/* ── Manifesto ── */
.manifesto {
  padding: clamp(140px, 24vh, 260px) 48px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.manifesto-text {
  font-family: var(--font-cn);
  font-size: clamp(30px, 4.8vw, 64px);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: 0.02em;
  max-width: 800px;
  margin: 0 auto;
}

/* ── Section header ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: clamp(80px, 15vh, 160px) 48px 20px;
  position: relative;
  z-index: 1;
}

.section-label {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Color-coded section labels */
#services .section-label:first-child,
.section-header:has(+ .services-wrapper) .section-label:first-child {
  color: var(--amber);
}

#method .section-label:first-child,
.section-header:has(+ .method) .section-label:first-child {
  color: var(--red);
}

#contact .section-label:first-child,
.section-header:has(+ .contact) .section-label:first-child {
  color: var(--electric);
}

/* ── Services (horizontal scroll) ── */
.services-wrapper {
  position: relative;
  height: 400vh;
  z-index: 1;
}

.services-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.services-track {
  display: flex;
  gap: 0;
  padding: 0 48px;
  will-change: transform;
}

.service-card {
  flex: 0 0 auto;
  width: clamp(340px, 40vw, 560px);
  padding: 0 56px 0 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  cursor: pointer;
  transition: transform 0.5s var(--ease-spring);
}

.service-card:hover { transform: scale(1.02); }

.service-num {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  transition: color 0.4s var(--ease-out);
}

/* Each service card gets a different accent on hover */
.service-card:nth-child(1):hover .service-num { color: var(--amber); }
.service-card:nth-child(2):hover .service-num { color: var(--electric); }
.service-card:nth-child(3):hover .service-num { color: var(--cyan); }
.service-card:nth-child(4):hover .service-num { color: var(--red); }

.service-title {
  font-family: var(--font-cn);
  font-size: clamp(28px, 3.4vw, 50px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  transition: transform 0.5s var(--ease-spring);
}

.service-card:hover .service-title { transform: translateX(6px); }

.service-desc {
  font-family: var(--font-cn);
  font-size: clamp(13px, 0.95vw, 15px);
  line-height: 1.75;
  color: var(--text-soft);
  max-width: 380px;
}

.service-tag {
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: inline-block;
  align-self: flex-start;
  transition: border-color 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

.service-card:hover .service-tag {
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.35);
}

/* ── Method ── */
.method {
  padding: 0 48px clamp(80px, 12vh, 140px);
  position: relative;
  z-index: 1;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.method-card {
  padding: 56px 40px 56px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.5s var(--ease-out),
              transform 0.5s var(--ease-spring);
}

.method-card:hover {
  background: rgba(255,255,255,0.015);
  transform: translateY(-4px);
}

.method-card:nth-child(2) {
  padding-left: 40px; padding-right: 40px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.method-card:nth-child(3) { padding-left: 40px; padding-right: 0; }

.method-num {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  margin-bottom: 36px;
  transition: color 0.4s var(--ease-out);
}

.method-card:nth-child(1):hover .method-num { color: var(--amber); }
.method-card:nth-child(2):hover .method-num { color: var(--red); }
.method-card:nth-child(3):hover .method-num { color: var(--electric); }

.method-title {
  font-family: var(--font-cn);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  transition: transform 0.5s var(--ease-spring);
}

.method-card:hover .method-title { transform: translateX(4px); }

.method-desc {
  font-size: clamp(13px, 0.9vw, 14px);
  line-height: 1.8;
  color: var(--text-soft);
}

/* ── Contact ── */
.contact {
  padding: 0 48px clamp(80px, 12vh, 120px);
  position: relative;
  z-index: 1;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--border);
}

.contact-item {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.4s var(--ease-out);
}

.contact-item:hover { background: rgba(255,255,255,0.012); }

.contact-item:nth-child(2) { padding-left: 40px; border-left: 1px solid var(--border); }
.contact-item:nth-child(3) { padding-left: 40px; border-left: 1px solid var(--border); }

.contact-label {
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.contact-value {
  font-family: var(--font-cn);
  font-size: clamp(16px, 1.3vw, 20px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.contact-value a { transition: color 350ms var(--ease-out); cursor: pointer; }
.contact-value a:hover { color: var(--electric); }

/* ── CTA ── */
.cta-row {
  display: flex;
  gap: 12px;
  padding: 56px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 17px 38px;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--border-visible);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.5s var(--ease-spring);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.btn:hover {
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  font-weight: 600;
}

.btn-primary:hover {
  background: #d44a3e;
  border-color: #d44a3e;
  box-shadow: 0 0 50px var(--red-glow), 0 8px 32px rgba(194,58,46,0.25);
  transform: translateY(-2px);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--amber), var(--red), var(--coral));
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  z-index: -1;
  filter: blur(8px);
}

.btn-primary:hover::after { opacity: 0.5; }

/* ── Footer ── */
.site-footer {
  padding: 28px 48px 36px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* ── Clip-path reveal animations ── */
.reveal {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transition: opacity 0.8s var(--ease-out),
              clip-path 1s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  clip-path: inset(0 0 0% 0);
}

.hero .reveal {
  clip-path: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s var(--ease-out),
              transform 1s var(--ease-out);
}

.hero .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.06s; }
.reveal-delay-2 { transition-delay: 0.14s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.36s; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  body { cursor: auto; }
  .cursor { display: none; }

  .site-header { padding: 24px 28px; }
  .hero { padding: 100px 28px 40px; }
  .hero-chars { perspective: none; }
  .hero-char {
    font-size: clamp(56px, 18vw, 120px);
    background: none;
    -webkit-text-fill-color: var(--text);
    color: var(--text);
  }
  .hero-char:nth-child(3) {
    background: none;
    -webkit-text-fill-color: var(--text);
  }
  .hero-meta { left: 28px; bottom: 32px; font-size: 8px; }
  .hero-meta-right { right: 28px; bottom: 32px; font-size: 8px; }
  .hero-glow { display: none; }
  .manifesto { padding: 100px 28px; }
  .section-header { padding: 80px 28px 20px; }

  .services-wrapper { height: auto; }
  .services-sticky { position: static; height: auto; overflow: visible; }
  .services-track { flex-direction: column; padding: 0 28px; }
  .service-card { width: 100%; padding: 36px 0; border-bottom: 1px solid var(--border); }

  .method { padding: 0 28px 80px; }
  .method-grid { grid-template-columns: 1fr; }
  .method-card { padding: 36px 0; border-left: none !important; border-right: none !important; }

  .contact { padding: 0 28px 80px; }
  .contact-inner { grid-template-columns: 1fr; }
  .contact-item { padding: 28px 0; border-left: none !important; }

  .site-footer { padding: 24px 28px 32px; flex-direction: column; gap: 8px; }
  .scroll-indicator { display: none; }
}

@media (max-width: 640px) {
  .site-header { padding: 18px 20px; }
  .site-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    background: var(--bg);
  }
  .site-nav.is-open { display: flex; }
  .site-nav.is-open a { color: var(--text); font-size: 15px; }
  .nav-toggle { display: flex; cursor: pointer; }

  .hero { padding: 100px 20px 40px; }
  .hero-char { font-size: clamp(44px, 18vw, 76px); }
  .hero-tagline { font-size: 13px; }
  .hero-meta { left: 20px; bottom: 24px; }
  .hero-meta-right { right: 20px; bottom: 24px; }

  .manifesto { padding: 80px 20px; }
  .section-header { padding: 60px 20px 16px; }
  .section-label { font-size: 9px; }
  .services-track { padding: 0 20px; }
  .service-card { padding: 32px 0; }
  .method { padding: 0 20px 60px; }
  .contact { padding: 0 20px 60px; }
  .cta-row { flex-direction: column; }
  .site-footer { padding: 20px; }

  .reveal { clip-path: none; }
}

@media (prefers-reduced-motion: reduce) {
  body { cursor: auto; }
  .cursor { display: none; }
  .reveal { opacity: 1; clip-path: none; transform: none; transition: none; }
  .hero-char { transform: none !important; }
  .scroll-indicator { display: none; }
  .services-wrapper { height: auto; }
  .services-sticky { position: static; height: auto; overflow: visible; }
  .services-track { flex-direction: column; }
  .service-card { width: 100%; }
  #bg-canvas { display: none; }
}
