/* ============================================
   TranFu — Design System & Base
   ============================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Brand */
  --brand-red: #e63946;
  --brand-red-light: #ff4d5a;
  --brand-red-glow: rgba(230, 57, 70, 0.3);
  --brand-red-subtle: rgba(230, 57, 70, 0.08);

  /* Typography */
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  --font-display: 'Inter', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;

  /* Spacing */
  --nav-h: 64px;
  --section-pad: clamp(48px, 8vw, 80px);
  --container: 1200px;
  --gap: 24px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;

  /* Transition */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-move: cubic-bezier(0.25, 1, 0.5, 1);
  --t-fast: 0.15s;
  --t-med: 0.3s;
  --t-slow: 0.5s;
}

/* DARK THEME */
[data-theme="dark"] {
  --bg-primary: #08080a;
  --bg-secondary: #111114;
  --bg-card: rgba(22, 22, 28, 0.7);
  --bg-card-hover: rgba(30, 30, 38, 0.85);
  --bg-glass: rgba(22, 22, 28, 0.5);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text-primary: #f0f0f2;
  --text-secondary: #9a9aaa;
  --text-tertiary: #78788a;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-glow: 0 0 40px var(--brand-red-glow), 0 0 80px rgba(230, 57, 70, 0.1);
  --code-bg: #0d0d10;
  --modal-bg: rgba(0,0,0,0.55);
}

/* LIGHT THEME */
[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f2;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.5);
  --border: rgba(0, 0, 0, 0.07);
  --border-hover: rgba(0, 0, 0, 0.14);
  --text-primary: #1a1a1e;
  --text-secondary: #555560;
  --text-tertiary: #6e6e78;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
  --shadow-glow: 0 0 40px rgba(230, 57, 70, 0.15), 0 0 80px rgba(230, 57, 70, 0.06);
  --code-bg: #f5f5f7;
  --modal-bg: rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
/* Subtle dot grid background */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}
/* Noise grain overlay for depth */
body::after {
  content: '';
  position: fixed; inset: 0;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
[data-theme="light"] body::after { opacity: 0.3; }
main, .nav, .footer, .modal-overlay, .loading-screen { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* Skip to content link */
.skip-link {
  position: fixed; top: -100px; left: 16px;
  padding: 10px 20px;
  background: var(--brand-red);
  color: #fff;
  font-weight: 600; font-size: 0.9rem;
  border-radius: var(--r-sm);
  z-index: 9999;
  transition: top var(--t-fast);
}
.skip-link:focus-visible {
  top: 12px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gap); }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 3px; }

/* ============================================
   CURSOR GLOW (desktop only)
   ============================================ */
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 600px; height: 600px;
  pointer-events: none; z-index: 0;
  background: radial-gradient(circle, var(--brand-red-glow) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.6s;
  transform: translate(-50%, -50%);
}
body:hover .cursor-glow { opacity: 0.15; }
@media (max-width: 768px) { .cursor-glow { display: none; } }
@media (max-width: 768px) {
  .loading-logo { width: 128px; height: auto; border-radius: 0; }
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 100;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-med) var(--ease);
}
[data-theme="dark"] .nav {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}
.nav-inner {
  max-width: var(--container); margin: 0 auto;
  padding: 0 var(--gap); height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em;
  transition: opacity var(--t-fast);
}
.nav-logo:hover { opacity: 0.8; }
.logo-img { width: 96px; height: auto; border-radius: 0; object-fit: contain; }
/* 主题感知 logo: data-theme=dark 显示 --dark 变体, light 显示 --light 变体 */
.logo-img--light, .loading-logo--light { display: none; }
[data-theme="light"] .logo-img--dark,
[data-theme="light"] .loading-logo--dark { display: none; }
[data-theme="light"] .logo-img--light,
[data-theme="light"] .loading-logo--light { display: inline-block; }
.logo-sub {
  font-size: 0.65rem; font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-left: 2px;
  white-space: nowrap;
}
.logo-svg { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 32px; }
.nav-link {
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-secondary);
  position: relative; padding: 4px 0;
  transition: color var(--t-fast);
}
.nav-link::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--brand-red);
  transition: width var(--t-med) var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
}
.nav-btn:hover { background: var(--bg-card); color: var(--text-primary); }

.theme-toggle {
  width: 44px; height: 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: inline-flex; align-items: center; justify-content: space-between;
  padding: 0 5px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}
.theme-toggle__icon {
  font-size: 11px;
  line-height: 1;
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
  opacity: 0.6;
  transition: color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
[data-theme="dark"] .theme-toggle__icon--moon { color: var(--text-primary); opacity: 1; }
[data-theme="dark"] .theme-toggle__icon--sun  { color: var(--text-tertiary); opacity: 0.6; }
[data-theme="light"] .theme-toggle__icon--sun  { color: var(--text-primary); opacity: 1; }
[data-theme="light"] .theme-toggle__icon--moon { color: var(--text-tertiary); opacity: 0.6; }

.lang-switch {
  position: relative;
  display: inline-block;
}
.lang-switch__trigger {
  min-width: 68px; height: 31px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 5.6px 11.2px;
  font-size: 12.48px;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.lang-switch__trigger:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.lang-switch__chev {
  width: 10px; height: 10px;
  display: inline-block;
  border-right: 1.25px solid currentColor;
  border-bottom: 1.25px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transform-origin: center;
  transition: transform var(--t-fast) var(--ease);
}
.lang-switch[aria-expanded="true"] .lang-switch__chev {
  transform: rotate(225deg) translate(-2px, -2px);
}
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: max(100%, 100px);
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  list-style: none;
  margin: 0;
  transform-origin: top center;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.lang-switch__menu[hidden] { display: none; }
.lang-switch[aria-expanded="false"] .lang-switch__menu {
  opacity: 0;
  transform: scaleY(0.97);
  pointer-events: none;
}
.lang-switch[aria-expanded="true"] .lang-switch__menu {
  opacity: 1;
  transform: scaleY(1);
}
.lang-switch__item {
  display: block;
  padding: 6px 10px;
  font-size: 12.48px;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.lang-switch__item:hover,
.lang-switch__item--active {
  background: var(--bg-card);
  color: var(--text-primary);
}
.lang-switch__item--active::after {
  content: '✓';
  float: right;
  color: var(--brand-red);
  font-size: 11px;
}

.nav-cta {
  padding: 8px 20px;
  background: var(--brand-red);
  color: #fff;
  font-size: 0.85rem; font-weight: 600;
  border-radius: var(--r-sm);
  transition: background var(--t-fast) ease, box-shadow var(--t-fast) ease, transform var(--t-fast) ease;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--brand-red-light); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.nav-cta:active { transform: scale(0.97); }

.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-burger span { width: 20px; height: 2px; background: var(--text-primary); transition: transform var(--t-fast) ease, opacity var(--t-fast) ease; border-radius: 1px; }
.nav-burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* MOBILE MENU */
.mobile-menu {
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: var(--bg-primary);
  display: flex; flex-direction: column;
  padding: 40px var(--gap);
  z-index: 99;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 0.15s var(--ease), visibility 0.15s;
  overscroll-behavior: contain;
}
.mobile-menu.open {
  opacity: 1; pointer-events: all; visibility: visible;
  transition: opacity 0.22s var(--ease), visibility 0.22s;
}
.mobile-link {
  font-size: 1.5rem; font-weight: 600;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  transition: color var(--t-fast);
}
.mobile-link:hover { color: var(--text-primary); }
.mobile-link.cta { color: var(--brand-red); border: none; margin-top: 16px; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-burger { display: flex; }
}

/* ============================================
   PAGE BASE
   ============================================ */
.page { display: none; padding-top: var(--nav-h); min-height: 100vh; scroll-margin-top: var(--nav-h); }
.page.active { display: block; }

/* Section shared */
.section {
  padding: var(--section-pad) 0;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
  position: relative;
}
/* Diagonal divider between sections */
.section + .section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-red) 30%, var(--brand-red-light) 70%, transparent);
  border-radius: 1px;
  opacity: 0.5;
}
.section + .section::after {
  content: '';
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 3px;
  background: radial-gradient(ellipse, rgba(230, 57, 70, 0.15) 0%, transparent 70%);
  filter: blur(2px);
  pointer-events: none;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brand-red);
  margin-bottom: 12px;
  display: inline-block;
  padding: 4px 12px;
  background: var(--brand-red-subtle);
  border-radius: 4px;
  border: 1px solid rgba(230, 57, 70, 0.15);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  text-wrap: balance;
}
.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 60px var(--gap) var(--section-pad);
  position: relative;
}
/* Decorative gradient orb */
.hero::before {
  content: '';
  position: absolute;
  top: 10%; left: -15%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: orb-float 8s ease-in-out infinite;
}
/* Second ambient glow orb */
.hero::after {
  content: '';
  position: absolute;
  bottom: 5%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.08) 0%, rgba(255, 107, 122, 0.04) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: orb-float-2 10s ease-in-out infinite;
  z-index: 0;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}
@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(-25px, 15px) scale(1.08); }
  70% { transform: translate(15px, -25px) scale(0.92); }
}
.hero-left {}
/* Hero depth gradient overlay (dark mode) */
[data-theme="dark"] .hero {
  background: linear-gradient(160deg, rgba(230, 57, 70, 0.03) 0%, transparent 40%, rgba(8, 8, 10, 0.5) 100%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: var(--brand-red-subtle);
  border: 1px solid rgba(230, 57, 70, 0.2);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 600;
  color: var(--brand-red);
  margin-bottom: 28px;
  animation: badge-pulse 3s ease-in-out infinite;
}
.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--brand-red);
  border-radius: 50%;
  animation: dot-blink 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,0.15); }
  50% { box-shadow: 0 0 0 8px rgba(230,57,70,0); }
}
@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 20px;
  text-wrap: balance;
}
.hero-title .line-1 {
  display: block;
  opacity: 0.9;
  font-size: 0.85em;
  letter-spacing: -0.02em;
}
.hero-title .highlight {
  background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-light) 40%, #ff6b7a 70%, #ff8a95 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  font-size: 1.1em;
}
[data-theme="dark"] .hero-title .highlight {
  filter: drop-shadow(0 0 12px rgba(230, 57, 70, 0.35));
}
.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 520px;
}
.hero-terminal {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 460px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
}
[data-theme="dark"] .hero-terminal {
  background: linear-gradient(170deg, #0e0e12 0%, #0d0d10 50%, #0b0b0f 100%);
}
[data-theme="light"] .hero-terminal {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.5);
}
.hero-terminal::before {
  content: '';
  display: block;
  height: 36px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.hero-terminal::after {
  content: '';
  position: absolute;
  top: 10px; left: 14px;
  width: 8px; height: 8px;
  background: #ff5f57;
  border-radius: 50%;
  box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
}
.hero-terminal > div:first-child { padding: 16px 20px 4px; }
.hero-terminal > div:last-child { padding: 0 20px 16px; }
.hero-terminal .prompt { color: var(--brand-red); }
.hero-terminal .cmd { color: var(--text-primary); }
.hero-terminal .cursor {
  display: inline-block; width: 8px; height: 16px;
  background: var(--brand-red);
  animation: cursor-blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* HERO RIGHT — Hybrid Cards (Terminal + Dashboard) */
.hero-right { display: flex; flex-direction: column; gap: 12px; }

.hybrid-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-red);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--t-fast) var(--ease);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2);
}
.hybrid-card[data-accent="blue"] { border-left-color: #3b82f6; }
.hybrid-card[data-accent="amber"] { border-left-color: #f59e0b; }
@media (hover: hover) and (pointer: fine) {
  .hybrid-card {
    transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), border-color 140ms var(--ease);
  }
  .hybrid-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--shadow-card);
    border-color: var(--border-hover);
  }
  .hybrid-card[data-accent="red"]:hover { border-left-color: var(--brand-red-light); box-shadow: 0 6px 28px rgba(230,57,70,0.18), var(--shadow-card); }
  .hybrid-card[data-accent="blue"]:hover { border-left-color: #60a5fa; box-shadow: 0 6px 28px rgba(59,130,246,0.18), var(--shadow-card); }
  .hybrid-card[data-accent="amber"]:hover { border-left-color: #fbbf24; box-shadow: 0 6px 28px rgba(245,158,11,0.18), var(--shadow-card); }
}
.hybrid-card:active {
  transform: scale(0.98);
}

.hybrid-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .hybrid-bar { background: rgba(0,0,0,0.02); }
.hybrid-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-red); flex-shrink: 0;
}
.hybrid-card[data-accent="blue"] .hybrid-dot { background: #3b82f6; }
.hybrid-card[data-accent="amber"] .hybrid-dot { background: #f59e0b; }
.hybrid-label {
  font-family: var(--font-mono);
  font-size: 0.68rem; font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex: 1;
}
.hybrid-status {
  font-family: var(--font-mono);
  font-size: 0.58rem; font-weight: 600;
  padding: 1px 7px;
  border-radius: 100px;
  background: rgba(230,57,70,0.12);
  color: var(--brand-red);
  letter-spacing: 0.05em;
}
.hybrid-status.blue { background: rgba(59,130,246,0.12); color: #3b82f6; }
.hybrid-status.amber { background: rgba(245,158,11,0.12); color: #f59e0b; }

.hybrid-body { padding: 12px 14px 14px; }

.hybrid-row {
  display: flex; align-items: baseline; gap: 5px;
  margin-bottom: 6px;
}
.hybrid-num {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  transition: text-shadow var(--t-fast) ease;
  font-variant-numeric: tabular-nums;
}
.hybrid-card[data-accent="red"] .hybrid-num { color: var(--brand-red); }
.hybrid-card[data-accent="blue"] .hybrid-num { color: #3b82f6; }
.hybrid-card[data-accent="amber"] .hybrid-num { color: #f59e0b; }
.hybrid-card[data-accent="red"]:hover .hybrid-num { text-shadow: 0 0 20px rgba(230,57,70,0.3); }
.hybrid-card[data-accent="blue"]:hover .hybrid-num { text-shadow: 0 0 20px rgba(59,130,246,0.3); }
.hybrid-card[data-accent="amber"]:hover .hybrid-num { text-shadow: 0 0 20px rgba(245,158,11,0.3); }
.hybrid-unit {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.hybrid-cmd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  opacity: 0.7;
}
.hybrid-prompt { color: var(--brand-red); margin-right: 4px; }
.hybrid-card[data-accent="blue"] .hybrid-prompt { color: #3b82f6; }
.hybrid-card[data-accent="amber"] .hybrid-prompt { color: #f59e0b; }

.hybrid-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.hybrid-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
[data-theme="light"] .hybrid-tag { background: rgba(0,0,0,0.03); }

.hybrid-progress {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.hybrid-progress-fill {
  height: 100%;
  width: var(--w, 50%);
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
}
.hybrid-meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
}
.hybrid-meta-sep { opacity: 0.4; margin: 0 4px; }

.hybrid-list { display: flex; flex-direction: column; gap: 3px; }
.hybrid-li {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.hybrid-li-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; min-height: auto; padding-top: 40px; }
  .hero-right { flex-direction: row; flex-wrap: wrap; }
  .hybrid-card { flex: 1; min-width: 240px; }
}
@media (max-width: 560px) {
  .hero-right { flex-direction: column; }
  .hero-terminal { max-width: 100%; font-size: 0.78rem; word-break: break-all; }
}

/* Entry cards (coming-soon page fallback) */
.entry-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease;
}
.entry-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}
.entry-card .arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--text-tertiary);
  transition: transform var(--t-fast);
  flex-shrink: 0;
}
.entry-card:hover .arrow { color: var(--brand-red); transform: translateX(4px); }

/* ============================================
   PRODUCT CARDS
   ============================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-top: 40px;
}
@media (max-width: 600px) {
  .products-grid { grid-template-columns: 1fr; }
}.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 32px;
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  transition: border-color var(--t-fast) var(--ease);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
/* Diagonal cut motif on product cards */
.product-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  background: var(--brand-red-subtle);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  transition: opacity var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .product-card {
    transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), border-color 140ms var(--ease);
  }
  .product-card:hover {
    border-color: rgba(230, 57, 70, 0.2);
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--shadow-card), 0 0 24px rgba(230, 57, 70, 0.06);
  }
  .product-card:hover::after {
    opacity: 1.5;
  }
}
.product-card:active {
  transform: scale(0.98);
}
.product-tag {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600;
  padding: 3px 8px;
  background: var(--brand-red-subtle);
  color: var(--brand-red);
  border-radius: 3px;
  margin-bottom: 16px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.product-card h3 {
  font-size: 1.25rem; font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.product-card .desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex: 1;
  line-height: 1.6;
}
.product-features {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.product-feature {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  white-space: nowrap;
}
.product-actions { display: flex; gap: 10px; margin-top: auto; }
.btn-primary {
  padding: 10px 22px;
  background: var(--brand-red);
  color: #fff;
  font-size: 0.85rem; font-weight: 600;
  border-radius: var(--r-sm);
  transition: background var(--t-fast) ease, box-shadow var(--t-fast) ease, transform var(--t-fast) ease;
  cursor: pointer;
  border: none;
}
.btn-primary:hover { background: var(--brand-red-light); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  padding: 10px 22px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem; font-weight: 500;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease;
  cursor: pointer;
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-secondary:active { transform: scale(0.97); }

@media (max-width: 768px) {
  .products-grid { grid-template-columns: 1fr; }
}

/* ============================================
   RESOURCES
   ============================================ */
.tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  width: fit-content;
  margin-bottom: 32px;
  margin-top: 32px;
}
.tab {
  padding: 8px 18px;
  font-size: 0.85rem; font-weight: 500;
  border-radius: 4px;
  color: var(--text-secondary);
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
  cursor: pointer;
}
.tab:hover { color: var(--text-primary); }
.tab:active { transform: scale(0.97); }
.tab.active {
  background: var(--brand-red);
  color: #fff;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.resource-card {
  display: flex; flex-direction: column;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  transition: border-color var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .resource-card {
    transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), border-color 140ms var(--ease);
  }
  .resource-card:hover {
    border-color: rgba(230, 57, 70, 0.18);
    transform: translateY(-2px) scale(1.005);
    box-shadow: var(--shadow-card), 0 0 20px rgba(230, 57, 70, 0.05);
  }
}
.resource-meta {
  display: flex; gap: 8px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.resource-type {
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.resource-type.skill { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.resource-type.prompt { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.resource-type.workflow { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.resource-platform {
  font-size: 0.7rem; font-weight: 500;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-tertiary);
}
.resource-card h3 {
  font-size: 1rem; font-weight: 600;
  margin-bottom: 6px;
}
.resource-card .desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
  margin-bottom: 16px;
  line-height: 1.6;
}
.resource-action {
  display: flex; justify-content: flex-end;
}
.resource-action .btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem; font-weight: 600;
  border-radius: 4px;
  transition: background var(--t-fast) ease;
  cursor: pointer;
}
.btn-install {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.btn-install:hover { background: rgba(59, 130, 246, 0.2); }
.btn-copy {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.2);
}
.btn-copy:hover { background: rgba(168, 85, 247, 0.2); }
.btn-view {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-view:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.resource-action--row {
  gap: 8px;
}

/* Install banner */
.install-banner {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  margin-top: 32px;
}
.install-banner .code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
}
.install-banner .code .prompt { color: var(--brand-red); }

@media (max-width: 768px) {
  .resources-grid { grid-template-columns: 1fr; }
  .install-banner { flex-direction: column; text-align: center; }
}

/* ============================================
   PRACTICE / ARTICLES
   ============================================ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 28px;
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  transition: border-color var(--t-fast) var(--ease);
  display: flex; flex-direction: column;
  position: relative;
}
@media (hover: hover) and (pointer: fine) {
  .article-card {
    transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), border-color 140ms var(--ease);
  }
  .article-card:hover {
    border-color: rgba(230, 57, 70, 0.18);
    transform: translateY(-2px) scale(1.005);
    box-shadow: var(--shadow-card), 0 0 20px rgba(230, 57, 70, 0.05);
  }
}
.article-card .new-badge {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 6px;
  background: var(--brand-red);
  color: #fff;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
/* Featured card — first/isNew article, spans 2 cols with accent */
.article-card--featured {
  grid-column: span 2;
  border-left: 3px solid var(--brand-red);
  padding-left: 25px;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.04) 0%, var(--bg-card) 60%);
}
.article-card--featured .new-badge {
  position: static;
  top: auto;
  right: auto;
  display: inline-block;
}
.article-card__top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.article-card__top-row .article-category {
  margin-bottom: 0;
}
.article-card__top-row .article-date {
  margin-bottom: 0;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.article-card--featured h3 {
  font-size: 1.2rem;
}
.article-card--featured .desc {
  -webkit-line-clamp: 4;
}
@media (max-width: 560px) {
  .article-card--featured { grid-column: span 1; }
}
.product-badge {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
}
.product-badge--new {
  background: var(--brand-red);
  color: #fff;
}
.product-badge--hot {
  background: var(--brand-red-subtle);
  color: var(--brand-red);
  border: 1px solid var(--brand-red);
}
.article-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.article-category {
  font-size: 0.75rem; font-weight: 600;
  color: var(--brand-red);
  margin-bottom: 12px;
}
.article-card h3 {
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.article-card .desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
  margin-bottom: 16px;
  line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.article-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px;
}
.article-tag {
  font-size: 0.7rem; font-weight: 500;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-tertiary);
}
.article-tag:hover { border-color: var(--border-hover); }

.article-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.article-interact { display: flex; gap: 16px; }
.interact-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--t-fast);
  padding: 4px 0;
}
.interact-btn:hover { color: var(--text-primary); }
.interact-btn:active { transform: scale(0.93); }
.interact-btn.liked { color: var(--brand-red); }
.interact-btn .like-icon {
  fill: currentColor;
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .articles-grid { grid-template-columns: 1fr; }
}

/* ============================================
   JOIN CTA SECTION
   ============================================ */
.join-section {
  padding: var(--section-pad) 0;
  text-align: center;
  position: relative;
}
.join-section::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(230, 57, 70, 0.06) 30%, rgba(230, 57, 70, 0.1) 50%, rgba(230, 57, 70, 0.06) 70%, transparent 100%);
  pointer-events: none;
  border-radius: var(--r-lg);
}
.join-section .section-title { max-width: 600px; margin: 0 auto 16px; }
.join-section .section-desc { margin: 0 auto 32px; text-align: center; }

/* ============================================
   COMING SOON PAGE
   ============================================ */
.coming-soon {
  min-height: calc(100vh - var(--nav-h));
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: var(--gap);
}
.coming-soon h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 16px;
  text-wrap: balance;
}
.coming-soon p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1.05rem;
}
.coming-soon .back-link {
  color: var(--brand-red);
  font-weight: 600;
  transition: opacity var(--t-fast);
}
.coming-soon .back-link:hover { opacity: 0.8; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--modal-bg);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 0.2s var(--ease), visibility 0.2s;
  overscroll-behavior: contain;
}
.modal-overlay.open {
  opacity: 1; pointer-events: all; visibility: visible;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
}
.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px;
  max-width: 480px; width: 90%;
  position: relative;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.modal-overlay.open .modal-card {
  transform: scale(1);
  opacity: 1;
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  font-size: 1.5rem;
  color: var(--text-tertiary);
  transition: color var(--t-fast);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text-primary); }
.modal-content h2 {
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: 8px;
}
.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.95rem;
  line-height: 1.6;
}
.modal-social {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 20px;
}
.social-link {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.85rem; font-weight: 500;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease;
}
.social-link svg { flex-shrink: 0; }
.social-link:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.modal-qr {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: center;
}
.modal-qr .qr-placeholder {
  width: 160px; height: 160px;
  background: var(--bg-primary);
  border: 1px dashed var(--border-hover);
  border-radius: var(--r-sm);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: var(--text-tertiary);
}
.modal-qr .qr-image {
  width: 160px; height: 160px;
  display: block;
  margin: 0 auto 12px;
  border-radius: var(--r-sm);
  background: #fff;
  object-fit: contain;
}
.modal-qr p { font-size: 0.8rem; color: var(--text-secondary); }
.modal-contact {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 16px;
}
.contact-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--text-secondary);
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.contact-link:hover { color: var(--text-primary); border-color: var(--border-hover); }
.contact-link svg { flex-shrink: 0; }

/* ============================================
   SHARE MODAL (slice-3 #9 layout)
   ============================================ */
.modal-card.share-modal {
  width: fit-content;
  max-width: 960px;
  overflow-y: auto;
  max-height: calc(100dvh - 64px);
  padding: 24px;
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.share-modal__header {
  margin-bottom: 20px;
}
.share-modal__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}
.share-modal__subtitle {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.5;
  word-break: break-all;
}
.share-modal__layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.share-modal__tabs {
  display: inline-flex;
  align-self: stretch;
  background: var(--surface-1, var(--bg-card));
  padding: 4px;
  border-radius: 10px;
  gap: 2px;
}
.share-tab {
  flex: 1 1 0;
  padding: 8px 16px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.share-tab[aria-selected="true"] {
  background: var(--surface-2, var(--bg-card-hover));
  color: var(--text-primary);
}
.share-tab:focus-visible {
  outline: 2px solid var(--focus-ring, var(--brand-red));
  outline-offset: 2px;
}
.share-modal__panels {
  display: contents;
}
.share-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.share-panel[hidden] {
  display: none;
}
.share-modal__copy-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.share-modal__copy-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
}
.share-modal__copy-input:hover { border-color: var(--border-hover); }
.share-modal__copy-input:focus { border-color: var(--border-hover); }
.share-modal__copy-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--text-primary);
  cursor: pointer;
  transition: opacity var(--t-fast) var(--ease);
  white-space: nowrap;
}
.share-modal__copy-btn:hover { opacity: 0.85; }
.share-modal__copy-btn:active { transform: scale(0.97); }
.share-modal__copy-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.share-modal__download-btn {
  width: 100%;
  padding: 10px 18px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-hover);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.share-modal__download-btn:hover {
  background: var(--bg-card);
  border-color: var(--text-primary);
}
.share-modal__download-btn:active { transform: scale(0.97); }
.share-modal__download-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.share-modal__preview--poster {
  width: 100%;
  aspect-ratio: 1080 / 1350;
  background: var(--surface-1, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}
.share-modal__qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.share-modal__qr-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.01em;
}
.share-modal__qr {
  width: 128px;
  height: 128px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px;
  box-sizing: content-box;
}
.share-modal__qr-fallback {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}
.share-modal__qr-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}
.share-channels-card {
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.share-channels-card__title {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-secondary);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}
.share-channels-card__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.share-channel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.share-channel-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.share-channel-btn__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex-shrink: 0;
}
.share-channel-btn__icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.share-channel-btn__label {
  font-size: 0.625rem;
  line-height: 1.3;
  color: currentColor;
  text-align: center;
  word-break: keep-all;
}
@media (min-width: 860px) {
  .share-modal__tabs {
    display: none;
  }
  .share-modal__panels {
    display: grid;
    grid-template-columns: minmax(0, 390px) minmax(0, 360px);
    justify-content: center;
    gap: 24px;
    align-items: start;
  }
  .share-panel[hidden] {
    display: flex;
  }
  .share-channels-host {
    display: none;
  }
  .share-modal__preview--poster {
    max-width: 390px;
  }
}
@media (max-width: 859.98px) {
  .modal-card.share-modal {
    width: 90%;
  }
  .share-modal__preview--poster {
    max-width: 390px;
    margin: 0 auto;
  }
  .share-channel-btn {
    justify-content: center;
    min-height: 74px;
  }
  .share-channel-btn__label {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .share-modal__preview--poster {
    aspect-ratio: 1080 / 1350;
    max-height: none;
  }
}
.share-modal__snapshot {
  position: absolute;
  left: -10000px;
  top: -10000px;
  width: 600px;
  pointer-events: none;
  visibility: hidden;
}
.share-modal__snapshot--capturing {
  left: 0;
  top: 0;
  z-index: -1;
  min-height: 675px;
  height: 675px;
  visibility: visible;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}
.footer-inner {
  max-width: var(--container); margin: 0 auto;
  padding: 0 var(--gap);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 40px;
}
.footer-brand-col {}
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.1rem;
  margin-bottom: 10px;
}
.footer-brand .logo-img { width: 84px; height: auto; border-radius: 0; }
.footer-tagline {
  font-size: 0.95rem; color: var(--text-secondary);
  font-weight: 600; letter-spacing: 0.02em;
  margin-bottom: 4px;
  font-style: italic;
}
.footer-tagline-desc {
  font-size: 0.82rem; color: var(--text-tertiary); line-height: 1.6;
}
.footer-col {
  display: flex; flex-direction: column; gap: 10px;
}
.footer-col-title {
  font-size: 0.8rem; font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.footer-col-link {
  font-size: 0.85rem; color: var(--text-tertiary);
  transition: color var(--t-fast);
}
.footer-col-link:hover { color: var(--text-primary); }
.footer-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.footer-social-link {
  font-size: 0.82rem; color: var(--text-tertiary);
  transition: color var(--t-fast);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.footer-social-link svg { flex-shrink: 0; vertical-align: middle; }
.footer-social-link:hover { color: var(--brand-red); }
.footer-contact {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.footer-contact-link:hover { color: var(--text-primary) !important; }
.footer-bottom {
  grid-column: 1 / -1;
  padding-top: 24px; margin-top: 8px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 16px;
}
.footer-legal {
  flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.75rem; color: var(--text-tertiary);
}
.footer-legal-company { font-weight: 500; }
.footer-legal-address::before { content: '｜'; margin-right: 8px; opacity: 0.4; }
.footer-copy {
  font-size: 0.75rem; color: var(--text-tertiary);
}
.footer-beian {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
}
.footer-beian a {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.75rem; color: var(--text-tertiary);
  transition: color var(--t-fast);
}
.footer-beian a:hover { color: var(--text-secondary); }
.footer-beian img { width: 14px; height: 14px; }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-brand-col { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: center; gap: 8px; }
}

/* ============================================
   PAGE HEADERS (subpages)
   ============================================ */
.page-header {
  padding: 60px 0 20px;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}
.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  text-wrap: balance;
}
.page-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.stagger.visible > *:nth-child(1) { transition-delay: 0.04s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.12s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.16s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.20s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.24s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.27s; }
.stagger.visible > *:nth-child(8) { transition-delay: 0.30s; }
.stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  padding: 12px 24px;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.85rem; font-weight: 600;
  border-radius: var(--r-sm);
  z-index: 300;
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============================================
   WORKFLOW PLACEHOLDER
   ============================================ */
.workflow-placeholder {
  grid-column: 1 / -1;
  padding: 48px;
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  text-align: center;
  color: var(--text-tertiary);
}
.workflow-placeholder h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.workflow-placeholder p {
  font-size: 0.9rem;
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
  position: fixed; inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s var(--ease);
}
.loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 20px;
  animation: loading-in 0.8s var(--ease) both;
}
.loading-logo {
  width: 160px; height: auto;
  border-radius: 0;
  object-fit: contain;
}
.loading-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-tertiary);
  animation: loading-text-in 0.6s 0.4s var(--ease) both;
}
.loading-content::after {
  content: '';
  width: 48px; height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-red), transparent);
  animation: loading-line-pulse 1.5s 0.6s ease-in-out infinite;
  opacity: 0;
}
@keyframes loading-line-pulse {
  0% { opacity: 0; width: 24px; }
  30% { opacity: 0.8; width: 48px; }
  70% { opacity: 0.8; width: 48px; }
  100% { opacity: 0; width: 24px; }
}
@keyframes loading-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes loading-text-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PREFERS-REDUCED-MOTION (CRITICAL)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  /* Disable scroll reveal — always visible */
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  /* Disable stagger animations */
  .stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  /* Disable cursor glow */
  .cursor-glow {
    display: none !important;
  }
  /* Disable orb-float animations */
  .hero::before,
  .hero::after {
    animation: none !important;
  }
  /* Disable badge-pulse and dot-blink */
  .hero-badge {
    animation: none !important;
  }
  .hero-badge .dot {
    animation: none !important;
  }
  /* Disable hero cursor blink */
  .hero-terminal .cursor {
    animation: none !important;
    opacity: 1 !important;
  }
  /* Loading screen: instant, no decorative animation */
  .loading-screen {
    transition: none !important;
  }
  .loading-content {
    animation: none !important;
  }
  .loading-text {
    animation: none !important;
    opacity: 1 !important;
  }
  .loading-content::after {
    animation: none !important;
    display: none !important;
  }
  /* Disable all decorative transitions */
  .entry-card,
  .hybrid-card,
  .product-card,
  .resource-card,
  .article-card,
  .nav-link::after,
  .toast {
    transition: none !important;
  }
  /* Page transitions instant */
  .page,
  .page.active {
    animation: none !important;
    transition: none !important;
  }
  /* Modal instant */
  .modal-overlay,
  .modal-card {
    transition: none !important;
  }
  /* Mobile menu instant */
  .mobile-menu {
    transition: none !important;
  }
  /* Toast instant */
  .toast {
    transition: none !important;
  }
  /* Terminal result fade-in instant */
  .terminal-result-fade {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* ============================================
   FOCUS-VISIBLE STATES
   ============================================ */
.nav-link:focus-visible,
.nav-btn:focus-visible,
.theme-toggle:focus-visible,
.lang-switch__trigger:focus-visible,
.nav-cta:focus-visible,
.nav-logo:focus-visible,
.nav-burger:focus-visible,
.entry-card:focus-visible,
.hybrid-card:focus-visible,
.product-card:focus-visible,
.resource-card:focus-visible,
.article-card:focus-visible,
.tab:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-sm:focus-visible,
.interact-btn:focus-visible,
.social-link:focus-visible,
.footer-col-link:focus-visible,
.footer-social-link:focus-visible,
.mobile-link:focus-visible,
.modal-close:focus-visible,
.coming-soon .back-link:focus-visible,
.share-modal__copy-input:focus-visible,
.share-modal__copy-btn:focus-visible,
.share-modal__download-btn:focus-visible,
.share-channel-btn:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

/* ============================================
   TOUCH & INTERACTION
   ============================================ */
button, a, .tab, .hybrid-card, .entry-card, .product-card, .resource-card, .article-card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================
   CURSOR-POINTER ON CLICKABLE ELEMENTS
   ============================================ */
.nav-link,
.nav-cta,
.nav-logo,
.entry-card,
.hybrid-card,
.tab,
.social-link,
.footer-col-link,
.footer-social-link,
.mobile-link,
.modal-close,
.interact-btn,
.coming-soon .back-link {
  cursor: pointer;
}

/* ============================================
   PAGE TRANSITION (crossfade with directional hint)
   ============================================ */
.page.active {
  animation: page-enter 0.3s var(--ease) both;
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
}

/* ============================================
   TERMINAL RESULT FADE-IN
   ============================================ */
.terminal-result-fade {
  animation: terminal-result-appear 0.6s var(--ease) both;
}
@keyframes terminal-result-appear {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PRACTICE DETAIL PAGE
   ============================================ */
.practice-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px var(--gap) 40px;
}
.practice-detail__back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 24px;
  transition: color var(--t-fast);
}
.practice-detail__back:hover { color: var(--brand-red); }

.practice-detail__head { margin-bottom: 32px; }
.practice-detail__meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.practice-detail__meta .article-date,
.practice-detail__meta .article-category { margin-bottom: 0; }

.practice-detail__title {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 12px;
  text-wrap: balance;
}
.practice-detail__desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
}

.practice-detail__body {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.practice-detail__h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 32px 0 12px;
}
.practice-detail__p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.practice-detail__code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--code-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin: 16px 0;
  overflow-x: auto;
  line-height: 1.6;
}
.practice-detail__quote {
  border-left: 3px solid var(--brand-red);
  background: var(--brand-red-subtle);
  padding: 12px 16px;
  margin: 16px 0;
  color: var(--text-secondary);
  font-style: normal;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.practice-detail__empty {
  color: var(--text-tertiary);
  font-size: 0.95rem;
  padding: 24px 0;
}
.practice-detail__md { font-size: 1rem; line-height: 1.75; color: var(--text-primary); }
.practice-detail__md h1,.practice-detail__md h2,.practice-detail__md h3,.practice-detail__md h4 { font-weight: 700; margin: 32px 0 12px; color: var(--text-primary); }
.practice-detail__md h1 { font-size: 1.5rem; }
.practice-detail__md h2 { font-size: 1.3rem; }
.practice-detail__md h3 { font-size: 1.1rem; }
.practice-detail__md h4 { font-size: 1rem; }
.practice-detail__md p { margin-bottom: 16px; }
.practice-detail__md ul,.practice-detail__md ol { padding-left: 1.5em; margin-bottom: 16px; }
.practice-detail__md li { margin-bottom: 6px; }
.practice-detail__md code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-subtle,#f5f5f5); padding: 2px 5px; border-radius: 3px; }
.practice-detail__md pre { font-family: var(--font-mono); font-size: 0.85rem; background: var(--bg-subtle,#f5f5f5); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; overflow-x: auto; margin: 16px 0; line-height: 1.6; }
.practice-detail__md pre code { background: none; padding: 0; font-size: inherit; }
.practice-detail__md blockquote { border-left: 3px solid var(--brand-red); background: var(--brand-red-subtle); padding: 12px 16px; margin: 16px 0; color: var(--text-secondary); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.practice-detail__md table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.9rem; }
.practice-detail__md th,.practice-detail__md td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.practice-detail__md th { background: var(--bg-subtle,#f5f5f5); font-weight: 600; }
.practice-detail__md strong { font-weight: 700; }
.practice-detail__md em { font-style: italic; }
.practice-detail__foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.practice-detail__related {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px var(--gap) 60px;
}
.practice-detail__related .section-label { display: block; margin-bottom: 16px; }

/* Whole-card click target — title <a> is the real link, ::after stretches over the card */
.article-card { cursor: pointer; }
.article-card__title-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}
.article-card__title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.article-card:hover .article-card__title-link { color: var(--brand-red); }
/* Keep interactive controls clickable above the stretched ::after */
.article-card .new-badge,
.article-card .article-interact,
.article-card .interact-btn { position: relative; z-index: 2; }
.article-card__title-link:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 4px;
  border-radius: var(--r-sm);
}

@media (max-width: 560px) {
  .practice-detail { padding: 40px 16px 24px; }
  .practice-detail__related { padding-left: 16px; padding-right: 16px; }
  .practice-detail__title { font-size: 1.5rem; }
  .practice-detail__desc { font-size: 0.95rem; }
  .practice-detail__p { font-size: 0.95rem; }
  .practice-detail__h2 { font-size: 1.15rem; margin-top: 24px; }
  .practice-detail__code { font-size: 0.78rem; padding: 12px; }
}
