/*
 * YiYi HuYu Corporate Homepage Styling System
 * Based on design-taste-frontend Guidelines (Light Theme)
 */

/* Color & Variable Tokens */
:root {
  --bg-base: #f9fafb;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-muted: rgba(79, 70, 229, 0.06);
  --border: #e2e8f0;
  --border-focus: #818cf8;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-card: 16px;
  --radius-btn: 8px;
  --radius-pill: 9999px;

  --transition-spring: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px; /* Offset for sticky nav */
}

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

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

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

/* Typography Base Styles */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* General Layout Section Padding */
section {
  padding: 6.5rem 0; /* VISUAL_DENSITY: 4 (Generous padding) */
}

.section-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Section Header Styles */
.section-header {
  margin-bottom: 3.5rem;
  max-width: 65ch;
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.section-title {
  font-size: 2.25rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Button & Interactive Element Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap; /* CTA BUTTON WRAP BAN */
}

.btn:active {
  transform: scale(0.97); /* Tactile Feedback scale-[0.98] */
}

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

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

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

.btn-secondary:hover {
  background-color: var(--bg-base);
  border-color: var(--text-muted);
}

/* Navigation Bar (Single Line, Height Cap 72px) */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px; /* Height cap: 72px (within 80px limit) */
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-img {
  height: 80px;
  width: 80px;
  object-fit: contain;
}

.logo-accent {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link.active {
  color: var(--accent);
}


.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-nav {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  display: none;
  padding: 0.25rem;
}

/* Hero Section (Viewport Stable, min-h-[100dvh], top-padding cap) */
.hero-section {
  min-height: 100dvh; /* Viewport Stability */
  display: flex;
  align-items: center;
  padding-top: 72px; /* Offset for sticky nav */
  padding-bottom: 4rem;
  background-color: var(--bg-card);
}

.hero-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr; /* Asymmetric grid */
  gap: 4rem;
  align-items: center;
}

.hero-content {
  padding-top: 1.5rem; /* Cap top padding */
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.hero-title {
  font-size: 3.25rem; /* text-5xl equivalent */
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-subtext {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2.25rem;
  max-width: 25ch; /* Limit word count to fit look precisely */
  line-height: 1.6;
}

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

.hero-media-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-media {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
}

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

.hero-media:hover .hero-img {
  transform: scale(1.03);
}

.media-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0) 60%, rgba(15, 23, 42, 0.03) 100%);
  pointer-events: none;
}

/* Stats Section (Horizontal Layout Under Hero) */
.stats-section {
  padding: 4rem 0;
  background-color: var(--bg-base);
  border-bottom: 1px solid var(--border);
}

.stats-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  text-align: center;
}

.stat-card {
  padding: 1.5rem;
  border-radius: var(--radius-card);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
}

.stat-number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
  font-family: var(--font-sans);
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Bento Grid (Exactly 3 Cells, Rhythm & Spacing) */
.business-section {
  background-color: var(--bg-base);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Reusable 3D Tilt Card Component (Tilted Card from React Bits) */
.tilt-card {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reflection Sheen overlay */
.tilt-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle 280px at var(--mouse-x, 0px) var(--mouse-y, 0px), rgba(255, 255, 255, 0.12), transparent 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 4;
}

.tilt-card:hover::after {
  opacity: 1;
}

.bento-card {
  position: relative;
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 380px;
  padding: 2.5rem;
}

.bento-card:hover {
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.12);
  border-color: var(--border-focus);
}

.card-large {
  grid-column: span 2;
  min-height: 440px;
}

.card-medium {
  grid-column: span 1;
}

.card-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.card-bg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-spring);
}

.bento-card:hover .card-bg-image img {
  transform: scale(1.04);
}

.card-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.5) 50%, rgba(15, 23, 42, 0.1) 100%);
  z-index: 2;
}

/* Custom styled card (AI Video section accent theme overlay) */
.accent-card .card-gradient-overlay {
  background: linear-gradient(to top, rgba(79, 70, 229, 0.95) 0%, rgba(15, 23, 42, 0.6) 60%, rgba(15, 23, 42, 0.1) 100%);
}

.card-content {
  position: relative;
  z-index: 3;
  color: #ffffff;
  max-width: 600px;
  transform: translateZ(0);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover .card-content {
  transform: translateZ(30px);
}

.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.bento-card:hover .card-tag {
  color: #ffffff;
}

.card-title {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.card-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

/* About Section (Asymmetric Layout) */
.about-section {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr; /* Asymmetric grid */
  gap: 5rem;
  align-items: center;
}

.about-text-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-title {
  font-size: 2.25rem;
  color: var(--text-primary);
}

.about-body p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.about-body p:last-child {
  margin-bottom: 0;
}

.about-visual-col {
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  padding: 3rem;
  border-radius: var(--radius-card);
}

.philosophies {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.philosophy-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.philosophy-icon {
  background-color: var(--accent-muted);
  color: var(--accent);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.philosophy-name {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.philosophy-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* Testimonial Section */
.testimonial-section {
  background-color: var(--bg-base);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.testimonial-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.testimonial-icon {
  font-size: 2.5rem;
  color: var(--accent);
  opacity: 0.8;
  line-height: 1;
}

.testimonial-quote {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-style: normal;
}

.author-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.author-title {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Contact Form Section */
.contact-section {
  background-color: var(--bg-card);
}

.contact-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: stretch;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.culture-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.contact-info-col {
  padding-top: 1rem;
}

.contact-title {
  font-size: 2.25rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.contact-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  line-height: 1.7;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

.detail-item i {
  font-size: 1.5rem;
  color: var(--accent);
}

.contact-form-col {
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 3rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background-color: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.btn-submit {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* Footer Section */
.footer {
  background-color: #0f172a; /* Keep dark background strictly for footer contrast */
  color: #94a3b8;
  padding: 5rem 0 3rem;
  border-top: 1px solid #1e293b;
}

.footer-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand .logo {
  color: #ffffff;
}

.footer-slogan {
  font-size: 0.9rem;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.links-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.links-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.links-col a {
  font-size: 0.88rem;
  color: #94a3b8;
}

.links-col a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.82rem;
}

.footer-bottom p {
    text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}

.footer-bottom p a {
    display: inline-flex; align-items: center; gap: 4px;
}

.footer-bottom p img {
    width: 20px; height: 20px;
}

/* Tech Aesthetic Utility Classes */
.tech-dot-grid {
  background-image: radial-gradient(var(--border) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

.tech-line-grid {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 50px 50px;
}

.tech-frame {
  position: relative;
  border: 1px solid var(--border);
}

/* Corner bracket details */
.tech-bracket {
  position: relative;
}

.tech-bracket::before,
.tech-bracket::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
  transition: all var(--transition-spring);
  z-index: 10;
  opacity: 0.7;
}

.tech-bracket::before {
  top: 8px;
  left: 8px;
  border-width: 2px 0 0 2px;
}

.tech-bracket::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 2px 2px 0;
}

.tech-bracket:hover::before {
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  opacity: 1;
}

.tech-bracket:hover::after {
  bottom: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  opacity: 1;
}

/* Monospace small details */
.tech-data {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Soft light bloom behind visual cards */
.tech-bloom {
  position: relative;
}

.tech-bloom::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  filter: blur(20px);
}

/* Responsiveness (Mobile Fallback & Layout Collapse) */
@media (max-width: 1024px) {
  .hero-container,
  .about-grid,
  .contact-grid {
    gap: 3rem;
  }

  .hero-title {
    font-size: 2.75rem;
  }
}

@media (max-width: 768px) {
  /* Spacing Adjustments */
  section {
    padding: 4.5rem 0;
  }

  .section-container {
    padding: 0 1.25rem;
  }

  /* Navbar Collapse */
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 1.5rem 0;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.03);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 1rem 0;
  }

  .nav-link::after {
    display: none;
  }

  .btn-nav {
    display: none;
  }

  /* Layout Collapses (Force single-column grid) */
  .hero-container {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .hero-content {
    order: 1;
  }

  .hero-media-wrapper {
    order: 2;
    max-width: 500px;
    margin: 0 auto;
  }

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

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }

  .card-large {
    grid-column: span 1;
    min-height: 380px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-visual-col {
    padding: 2rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .culture-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-form-col {
    padding: 2rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .footer-links-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.25rem;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }

  .hero-ctas .btn {
    width: 100%;
  }
}
