:root {
  --bg: #ffffff;
  --bg-elevated: #f8fafc;
  --surface: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --gradient-start: #6366f1;
  --gradient-end: #8b5cf6;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --max-width: 1100px;
  --header-height: 72px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

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

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* MiMo 同款：名字逐字 + 下方标语上浮淡入 */
.hero-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: charReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-tagline {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

@keyframes charReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  overflow: hidden;
}

.hero-name-zone {
  --zone-pad-x: 5rem;
  --zone-pad-top: 3.5rem;
  --zone-pad-bottom: 3rem;
  position: relative;
  display: inline-block;
  padding: var(--zone-pad-top) var(--zone-pad-x) var(--zone-pad-bottom);
  margin-bottom: 1.5rem;
  cursor: default;
}

.hero-name-zone .hero-tagline {
  position: relative;
  z-index: 1;
  pointer-events: none;
  margin-bottom: 0;
}

.hero-name {
  display: inline-block;
  font-size: clamp(3rem, 12vw, 7.5rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.1;
  margin-bottom: 0;
  color: var(--text);
  white-space: nowrap;
  padding: 0.06em 0.18em;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.hero-invert {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #000000;
  color: #ffffff;
  pointer-events: none;
  overflow: hidden;
  clip-path: circle(0px at -300px -300px);
  will-change: clip-path;
}

.hero-invert-content {
  position: absolute;
  left: var(--zone-pad-x);
  top: var(--zone-pad-top);
  right: var(--zone-pad-x);
  pointer-events: none;
}

.hero-invert .hero-name {
  position: static;
  left: auto;
  top: auto;
  pointer-events: none;
}

.hero-name--invert {
  color: #ffffff;
  margin-bottom: 0;
}

.hero-tagline--invert {
  color: #ffffff !important;
  opacity: 1 !important;
  animation: none !important;
  transform: none !important;
  margin-bottom: 0;
}

.hero-char--static {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  filter: none !important;
}

.hero-tagline {
  font-size: clamp(1.125rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.25;
  white-space: nowrap;
}

.hero-desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 2rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  width: 100%;
  padding: 4rem 1.5rem;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

#hero-canvas {
  width: 100%;
  max-width: 480px;
  height: auto;
  aspect-ratio: 1;
  cursor: crosshair;
}


.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.scroll-hint svg {
  animation: bounce 2s ease-in-out infinite;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  text-align: center;
}

.about {
  background: var(--bg-elevated);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.about-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
}

.about-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
  transition: transform 0.3s var(--ease-out);
}

.about-card:hover .about-icon {
  transform: scale(1.15) rotate(8deg);
}

.about-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.contact-intro {
  text-align: center;
  color: var(--text-muted);
  margin: -1.5rem auto 2.5rem;
  max-width: 480px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.25s;
}

.contact-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.12);
  transform: translateY(-3px);
}

.contact-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer p {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    min-height: 300px;
    order: -1;
  }

  #hero-canvas {
    max-width: 320px;
  }

  .hero-name-zone {
    --zone-pad-x: 2rem;
    --zone-pad-top: 2rem;
    --zone-pad-bottom: 2.5rem;
  }

  .hero-name {
    white-space: normal;
    font-size: clamp(2rem, 10vw, 3rem);
    font-weight: 500;
    line-height: 1.2;
  }

  .hero-tagline {
    white-space: normal;
    font-size: 1.125rem;
    line-height: 1.6;
  }
}

@media (max-width: 640px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
  }

  .hero-layout {
    padding: 2.5rem 1.5rem 4rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .scroll-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-hint svg {
    animation: none;
  }
}
