/* ============================================================
   AtelierPX — Design tokens + site styles
   ============================================================ */

@font-face {
  font-family: 'AtelierPX';
  src: url('fonts/AtelierPX-EN.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'AtelierPX CN';
  src: url('fonts/AtelierPX-CN.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: 'AtelierPX', 'Space Grotesk', sans-serif;
  --font-body: 'Space Grotesk', 'AtelierPX', sans-serif;
  --font-cn: 'AtelierPX CN', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Space Mono', 'SF Mono', 'Menlo', monospace;
  --font-pixel: 'Silkscreen', monospace;

  --pink-50:  #fef2f3;
  --pink-100: #fde6e8;
  --pink-200: #fad1d6;
  --pink-300: #f4a8b1;
  --pink-400: #ef7f8e;
  --pink-500: #e5516a;
  --pink-600: #d4405a;
  --pink-700: #b83347;
  --pink-800: #9a2e3e;
  --pink-900: #7a2734;
  --pink-950: #4a1520;

  --navy-50:  #f2f4f8;
  --navy-100: #e3e7f0;
  --navy-200: #c7cfe0;
  --navy-300: #9eabc8;
  --navy-400: #7284ab;
  --navy-500: #546591;
  --navy-600: #424f75;
  --navy-700: #353f5e;
  --navy-800: #2c344d;
  --navy-900: #232a3e;
  --navy-950: #141825;

  --sienna-200: #e8cfc0;
  --sienna-300: #d4a98e;
  --sienna-400: #c08565;
  --sienna-500: #a86d4c;
  --sienna-600: #8e5739;

  --mint-300: #90d1b6;
  --mint-400: #5ab893;

  --white: #f9fafb;
  --black: var(--navy-950);

  --color-fg: var(--navy-950);
  --color-fg-secondary: var(--navy-600);
  --color-fg-muted: var(--navy-400);
  --color-border: var(--navy-200);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--navy-950);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--pink-400); color: white; }

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--pink-400);
  outline-offset: 3px;
}

html[lang="zh-CN"],
html[lang="zh-CN"] body { font-family: var(--font-cn); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 200;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 12px 20px;
  background: var(--navy-950);
  color: var(--white);
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  outline: 2px solid var(--pink-400);
  outline-offset: 2px;
}

/* ── Pixel clip utility ── */
.pixel-clip-4 {
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
}
.pixel-clip-8 {
  clip-path: polygon(
    0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px)
  );
}

/* ── Scroll pulse ── */
@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.15); }
}
.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
  transform-origin: top;
}

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal-left.is-visible { opacity: 1; transform: translateX(0); }

.reveal-fade { opacity: 0; transition: opacity 0.8s var(--ease-out); }
.reveal-fade.is-visible { opacity: 1; }
.reveal-fade.delay-1 { transition-delay: 0.2s; }
.reveal-fade.delay-2 { transition-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-left, .reveal-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .scroll-line { animation: none; }
}

/* ── Pixel grid background ── */
.pixel-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ── Pixel cursor ── */
.pixel-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  background: var(--navy-950);
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.8;
  transform: translate(-50%, -50%);
  left: -100px;
  top: -100px;
  will-change: transform;
}
.pixel-cursor.on-dark { background: var(--white); }

/* Hide cursor only when pixel cursor is active and device has fine pointer */
@media (pointer: fine) {
  body.pixel-cursor-on,
  body.pixel-cursor-on * { cursor: none !important; }
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: padding 0.3s ease, background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
.nav.is-scrolled {
  padding: 12px 40px;
  background: rgba(44, 52, 77, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--navy-700);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav__logo {
  width: 28px;
  height: 28px;
  filter: invert(1) brightness(2);
}
.nav__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
}
.nav__menu {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__link {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--navy-200);
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 12px;
  transition: color 0.2s;
  text-transform: uppercase;
}
.nav__link:hover,
.nav__link:focus-visible { color: var(--pink-300); }

.nav__lang {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--navy-200);
  cursor: pointer;
  background: none;
  border: 1px solid var(--navy-500);
  padding: 5px 10px;
  margin-left: 12px;
  transition: color 0.2s, border-color 0.2s;
}
.nav__lang:hover,
.nav__lang:focus-visible {
  color: var(--pink-300);
  border-color: var(--pink-300);
}

/* Hamburger toggle (hidden on desktop) */
.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 110;
  align-items: center;
  justify-content: center;
}
.nav__toggle-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--white);
  transition: transform 0.25s var(--ease-out), opacity 0.2s var(--ease-out), top 0.25s var(--ease-out);
}
.nav__toggle-bar:nth-child(1) { top: 14px; }
.nav__toggle-bar:nth-child(2) { top: 21px; }
.nav__toggle-bar:nth-child(3) { top: 28px; }
.nav__toggle:focus-visible .nav__toggle-bar { background: var(--pink-300); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

.nav__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 37, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out);
  z-index: 90;
}

@media (max-width: 820px) {
  .nav, .nav.is-scrolled { padding: 16px 20px; }
  .nav__toggle { display: inline-flex; }

  .nav__menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(320px, 85vw);
    padding: 88px 28px 32px;
    background: rgba(20, 24, 37, 0.98);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--navy-700);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s var(--ease-out), visibility 0s linear 0.3s;
    z-index: 100;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav.is-open .nav__menu {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s var(--ease-out), visibility 0s linear 0s;
  }
  .nav.is-open .nav__backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav__link {
    text-align: left;
    padding: 16px 12px;
    font-size: 13px;
    min-height: 52px;
  }
  .nav__link + .nav__link { border-top: 1px solid var(--navy-800); }

  .nav__lang {
    margin: 20px 0 0;
    padding: 12px 16px;
    font-size: 12px;
    align-self: flex-start;
    min-height: 44px;
  }

  .nav__wordmark { font-size: 14px; }
}

/* Prevent body scroll when mobile menu is open */
body.nav-open { overflow: hidden; }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 100px 24px 60px;
  background: var(--navy-800);
}
.hero__logo-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  max-width: 80vw;
  max-height: 80vw;
  opacity: 0.08;
  pointer-events: none;
  background-image: url('assets/logo.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  will-change: transform;
  transform: translate(-50%, -50%);
}
.hero__content {
  position: relative;
  text-align: left;
  max-width: 900px;
  width: 100%;
}
.hero__tagline {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--pink-400);
  margin-bottom: 20px;
}
.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--white);
  white-space: pre-line;
  margin: 0;
}
.hero__sub {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--navy-300);
  margin: 24px 0 0;
  max-width: 520px;
}
.hero__scroll {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: var(--pink-400);
}
.hero__scroll-label {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--navy-400);
  letter-spacing: 0.1em;
}

/* ── Section wrappers ── */
.section {
  position: relative;
  overflow: hidden;
  padding: 80px 24px;
}
.section__inner {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.label {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 40px;
  white-space: pre-line;
}

/* ── About (editorial pink) ── */
.about { background: var(--pink-400); }
.about .label { color: rgba(255, 255, 255, 0.6); }
.about .section__title { color: var(--white); }
.about__lead {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.7;
  color: var(--white);
  font-weight: 600;
  margin: 0 0 20px;
  max-width: 640px;
}
.about__body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 20px;
  max-width: 640px;
}

/* ── Products ── */
.products { background: var(--navy-50); }
.products__inner { max-width: 1100px; margin: 0 auto; }
.products .label { color: var(--pink-400); }
.products .section__title {
  color: var(--navy-950);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 48px;
}
.products__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 28px;
}
.product-card {
  background: var(--white);
  padding: 32px 28px;
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: transform 0.5s var(--ease-out), box-shadow 0.25s var(--ease-out);
  will-change: transform, box-shadow;
  clip-path: polygon(
    0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px)
  );
}
.product-card--accent-0 { box-shadow: 6px 6px 0 var(--pink-200); }
.product-card--accent-1 { box-shadow: 6px 6px 0 var(--navy-300); }
.product-card--accent-2 { box-shadow: 6px 6px 0 var(--sienna-200); }

a.product-card { cursor: pointer; }
a.product-card:hover,
a.product-card:focus-visible {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.product-card__num {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.product-card--accent-0 .product-card__num,
.product-card--accent-0 .product-card__tagline { color: var(--pink-400); }
.product-card--accent-1 .product-card__num,
.product-card--accent-1 .product-card__tagline { color: var(--navy-800); }
.product-card--accent-2 .product-card__num,
.product-card--accent-2 .product-card__tagline { color: var(--sienna-500); }

.product-card__name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--navy-950);
  margin: 0 0 8px;
}
.product-card__tagline {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}
.product-card__desc {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--navy-500);
  margin: 0;
}
.product-card__link {
  margin-top: 16px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--navy-400);
  letter-spacing: 0.08em;
}

/* ── Founder (editorial deep navy) ── */
.founder { background: var(--navy-950); }
.founder .label { color: var(--pink-400); }
.founder__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
  margin: 0 0 24px;
  white-space: pre-line;
}
.founder__lead {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--pink-300);
  margin: 0 0 16px;
}
.founder__body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--navy-300);
  margin: 0;
}

/* ── Contact (editorial pink) ── */
.contact {
  background: var(--pink-400);
  text-align: center;
}
.contact .section__inner {
  max-width: 600px;
}
.contact .label { color: rgba(255, 255, 255, 0.6); }
.contact .section__title {
  color: var(--white);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 32px;
}
.contact__cta {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 14px 36px;
  text-decoration: none;
  background: var(--white);
  color: var(--pink-500);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
}
.contact__cta:hover,
.contact__cta:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.contact__email {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 20px;
}

/* ── Footer ── */
.footer {
  padding: 32px 40px;
  background: var(--navy-950);
  text-align: center;
}
.footer__text {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--navy-600);
  letter-spacing: 0.08em;
  margin: 0;
}

/* ── Responsive tweaks ── */
@media (max-width: 820px) {
  .section { padding: 64px 20px; }
  .hero { padding: 96px 20px 56px; }
  .footer { padding: 28px 20px; }
  .hero__logo-bg { width: 320px; height: 320px; }
  .section__title { margin-bottom: 32px; }
  .products .section__title { margin-bottom: 36px; }
  .product-card { padding: 28px 22px; }
}

@media (max-width: 480px) {
  .section { padding: 56px 18px; }
  .hero { padding: 88px 18px 48px; }
  .hero__headline { font-size: clamp(2.4rem, 10vw, 3.2rem); }
  .hero__sub { font-size: 1rem; }
  .hero__scroll { margin-top: 40px; }
  .hero__logo-bg { width: 260px; height: 260px; }
  .about__lead { font-size: 1.05rem; }
  .contact__cta { padding: 14px 28px; font-size: 12px; }
  .product-card__name { font-size: 24px; }
}
