/* ============================================
   IPFunBox - Main Stylesheet
   Premium Designer Toy Brand
   ============================================ */

/* --- CSS Custom Properties (Theme System) --- */
:root {
  /* Light Theme (Default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f8f8;
  --bg-tertiary: #f0f0f0;
  --bg-card: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.85);
  --bg-nav: rgba(255, 255, 255, 0.95);

  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --text-inverse: #ffffff;

  --accent: #e8453c;
  --accent-hover: #d63a31;
  --accent-light: rgba(232, 69, 60, 0.08);

  --border-color: #e8e8e8;
  --border-light: #f0f0f0;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-display: 'Inter', var(--font-sans);

  --container-max: 1400px;
  --container-narrow: 900px;
  --nav-height: 72px;
  --section-padding: 120px;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1e1e1e;
  --bg-card: #181818;
  --bg-overlay: rgba(0, 0, 0, 0.92);
  --bg-nav: rgba(10, 10, 10, 0.95);

  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666666;
  --text-inverse: #0a0a0a;

  --accent: #ff5a4f;
  --accent-hover: #ff7066;
  --accent-light: rgba(255, 90, 79, 0.1);

  --border-color: #2a2a2a;
  --border-light: #1e1e1e;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

::selection {
  background: var(--accent);
  color: var(--text-inverse);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
}

h4 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 40px;
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--section-padding) 0;
}

.section--compact {
  padding: 80px 0;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  transition: all var(--transition-base);
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 40px;
}

.nav__logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text-primary);
  transition: opacity var(--transition-fast);
}

.nav__logo:hover {
  opacity: 0.7;
}

.nav__logo span {
  color: var(--accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  position: relative;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base);
}

.nav__link:hover,
.nav__link.active {
  color: var(--text-primary);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--border-color);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: var(--text-secondary);
  transition: fill var(--transition-fast);
}

/* Mobile Menu Toggle */
.nav__menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  cursor: pointer;
  padding: 4px 0;
}

.nav__menu-toggle span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav__menu-toggle span:nth-child(1) { width: 100%; }
.nav__menu-toggle span:nth-child(2) { width: 70%; }
.nav__menu-toggle span:nth-child(3) { width: 100%; }

.nav__menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav__menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav__menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-primary);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  transition: opacity var(--transition-slow);
}

[data-theme="dark"] .hero__bg-image {
  opacity: 0.08;
}

.hero__gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, var(--accent-light) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(100, 100, 255, 0.03) 0%, transparent 50%);
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 0 40px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

.hero__title {
  margin-bottom: 24px;
  color: var(--text-primary);
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-tertiary), transparent);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn--primary:hover {
  background: var(--accent);
  color: var(--text-inverse);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
  background: transparent;
}

.btn--outline:hover {
  border-color: var(--text-primary);
  background: var(--text-primary);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

.btn--accent {
  background: var(--accent);
  color: #fff;
}

.btn--accent:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  color: var(--text-secondary);
  padding: 14px 16px;
}

.btn--ghost:hover {
  color: var(--text-primary);
}

.btn--sm {
  padding: 10px 20px;
  font-size: 0.8rem;
}

.btn--lg {
  padding: 18px 40px;
  font-size: 1rem;
}

.btn--icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}

.btn--icon svg {
  width: 20px;
  height: 20px;
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: 72px;
}

.section-header__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-header__title {
  margin-bottom: 20px;
}

.section-header__desc {
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-color);
}

.card__image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card__image img {
  transform: scale(1.06);
}

.card__body {
  padding: 24px;
}

.card__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card__desc {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge--new {
  background: var(--accent-light);
  color: var(--accent);
}

.status-badge--limited {
  background: rgba(168, 130, 255, 0.1);
  color: #8b5cf6;
}

.status-badge--available {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.status-badge--dev {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

/* --- Grid Systems --- */
.grid {
  display: grid;
  gap: 24px;
}

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

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 80px 0 40px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}

.footer__brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer__brand-name span {
  color: var(--accent);
}

.footer__brand-desc {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 300px;
}

.footer__social {
  display: flex;
  gap: 12px;
}

.footer__social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.footer__social-link:hover {
  background: var(--accent);
}

.footer__social-link:hover svg {
  fill: #fff;
}

.footer__social-link svg {
  width: 16px;
  height: 16px;
  fill: var(--text-tertiary);
  transition: fill var(--transition-fast);
}

.footer__col-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.footer__link {
  display: block;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  padding: 6px 0;
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--text-primary);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* --- Page Header (Inner Pages) --- */
.page-header {
  padding-top: calc(var(--nav-height) + 80px);
  padding-bottom: 80px;
  text-align: center;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.page-header__bg {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background: radial-gradient(ellipse at center, var(--accent) 0%, transparent 70%);
}

.page-header__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.page-header__title {
  margin-bottom: 20px;
}

.page-header__desc {
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.4s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 16px; }
.mb-md { margin-bottom: 32px; }
.mb-lg { margin-bottom: 48px; }
.mb-xl { margin-bottom: 72px; }

/* Placeholder Images */
.placeholder-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--border-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* --- Mobile Nav Overlay --- */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.mobile-nav.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav__link {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.mobile-nav__link:hover {
  color: var(--accent);
}
