/* ═══════════════════════════════════════════
   Kēshī — Main Stylesheet
   Nordic Wabi-Sabi · Modular Cat Tunnel
   ═══════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  --clay: #D4C5B5;
  --terracotta: #A8937A;
  --linen: #F0EAE0;
  --chestnut: #5A4A3A;
  --sandgold: #C4A882;
  --bronze: #8B7355;
  --deep-charcoal: #2D251F;
  --warm-white: #F7F3EE;
  --text-primary: #3D3229;
  --text-muted: #7A6B5A;
  --text-light: #B5A99A;

  --transition-slow: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-med: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 0.25s ease;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Jost', 'Helvetica Neue', sans-serif;

  --container: 1440px;
  --grid-gap: 2rem;
}

/* ─── Noise Texture Overlay ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ─── Typography ─── */
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 { font-size: clamp(3rem, 8vw, 6.5rem); font-weight: 300; }
h2 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 300; }
h3 { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 400; }
h4 { font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: 500; }

.body-large { font-size: 1.2rem; line-height: 1.7; color: var(--text-muted); }
.body-small { font-size: 0.875rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }

.sans { font-family: var(--font-body); }

/* ─── Utility ─── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 2.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9999px;
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--chestnut);
  color: var(--warm-white);
  border: 1px solid var(--chestnut);
}

.btn-primary:hover {
  background: var(--deep-charcoal);
  border-color: var(--deep-charcoal);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(42, 35, 29, 0.15);
}

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

.btn-secondary:hover {
  background: var(--chestnut);
  color: var(--warm-white);
  transform: translateY(-2px);
}

.btn-outline-light {
  background: transparent;
  color: var(--warm-white);
  border: 1px solid rgba(247, 243, 238, 0.4);
}

.btn-outline-light:hover {
  background: var(--warm-white);
  color: var(--chestnut);
  border-color: var(--warm-white);
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-med);
  mix-blend-mode: difference;
}

.nav.scrolled {
  background: rgba(240, 234, 224, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  mix-blend-mode: normal;
  padding: 1rem 2rem;
  box-shadow: 0 1px 0 rgba(90, 74, 58, 0.06);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--warm-white);
  letter-spacing: 0.05em;
}

.nav.scrolled .nav-logo {
  color: var(--chestnut);
}

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

.nav-links a {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm-white);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  font-weight: 400;
}

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

.nav-links a:hover {
  opacity: 1;
}

.nav-cta {
  padding: 0.6rem 1.6rem;
  border: 1px solid rgba(247, 243, 238, 0.3);
  border-radius: 9999px;
  color: var(--warm-white);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all var(--transition-fast);
}

.nav.scrolled .nav-cta {
  border-color: var(--chestnut);
  color: var(--chestnut);
}

.nav-cta:hover {
  background: var(--warm-white);
  color: var(--chestnut);
  border-color: var(--warm-white);
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.nav-burger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--warm-white);
  transition: all var(--transition-fast);
}

.nav.scrolled .nav-burger span {
  background: var(--chestnut);
}

/* ─── Hero Section ─── */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 700px;
  overflow: hidden;
  background: var(--deep-charcoal);
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  filter: saturate(0.7) brightness(0.7);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(42, 35, 29, 0.85) 0%,
    rgba(42, 35, 29, 0.4) 40%,
    transparent 70%
  );
  z-index: 1;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  align-items: end;
  padding: 0 2rem 4rem;
  max-width: var(--container);
  margin: 0 auto;
}

.hero-content {
  padding-bottom: 3rem;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sandgold);
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.hero-title {
  color: var(--warm-white);
  font-size: clamp(3.5rem, 9vw, 7rem);
  line-height: 1.05;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.hero-title em {
  font-style: italic;
  color: var(--sandgold);
}

.hero-desc {
  color: rgba(247, 243, 238, 0.7);
  font-size: 1.1rem;
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

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

.hero-visual {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding-bottom: 2rem;
}

.hero-sculpture {
  width: 320px;
  height: 480px;
  background: linear-gradient(160deg, var(--terracotta), var(--chestnut));
  border-radius: 50% 50% 30% 30% / 60% 60% 20% 20%;
  opacity: 0.3;
  position: relative;
  transform: rotate(-5deg);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(247, 243, 238, 0.4);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: float-down 2.5s ease-in-out infinite;
}

.hero-scroll-hint .line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(247,243,238,0.4), transparent);
}

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

/* ─── Philosophy Section ─── */
.philosophy {
  background: var(--linen);
  position: relative;
}

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

.philosophy-image {
  position: relative;
  height: 600px;
  background: linear-gradient(145deg, var(--clay), var(--sandgold));
  border-radius: 4px;
  overflow: hidden;
}

.philosophy-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='rgba(247,243,238,0.08)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

.philosophy-image .image-placeholder {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to top, var(--chestnut), transparent);
  opacity: 0.3;
}

.philosophy-text {
  padding: 2rem 0;
}

.philosophy-text h2 {
  margin-bottom: 1.5rem;
}

.philosophy-text p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

.philosophy-text .signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--chestnut);
  margin-top: 2rem;
}

/* ─── Module System Section ─── */
.modules {
  background: var(--warm-white);
  position: relative;
}

.modules-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

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

.module-card {
  background: var(--linen);
  border-radius: 4px;
  padding: 2.5rem;
  transition: all var(--transition-med);
  position: relative;
  border: 1px solid transparent;
}

.module-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168, 147, 122, 0.2);
  box-shadow: 0 20px 50px rgba(42, 35, 29, 0.06);
}

.module-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.module-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--clay);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--chestnut);
}

.module-card h4 {
  margin-bottom: 0.8rem;
  color: var(--deep-charcoal);
}

.module-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.module-tag {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  background: var(--clay);
  color: var(--chestnut);
  border-radius: 9999px;
  margin-top: 1rem;
}

/* ─── 3D Configurator Section ─── */
.configurator {
  background: var(--deep-charcoal);
  color: var(--warm-white);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.configurator-canvas {
  width: 100%;
  height: 80vh;
  min-height: 500px;
  position: relative;
}

.configurator-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.configurator-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 2rem;
  background: linear-gradient(to top, rgba(42,35,29,0.9), transparent);
  z-index: 10;
}

.configurator-overlay .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.configurator-info h2 {
  color: var(--warm-white);
  margin-bottom: 0.5rem;
}

.configurator-info p {
  color: rgba(247, 243, 238, 0.6);
  font-size: 0.95rem;
}

.configurator-controls {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.ctrl-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(247, 243, 238, 0.2);
  color: var(--warm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  background: transparent;
}

.ctrl-btn:hover {
  background: rgba(247, 243, 238, 0.1);
  border-color: var(--warm-white);
}

.ctrl-btn.active {
  background: var(--warm-white);
  color: var(--deep-charcoal);
  border-color: var(--warm-white);
}

.color-swatches {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.color-swatch:hover,
.color-swatch.active {
  border-color: var(--warm-white);
  transform: scale(1.15);
}

/* ─── Products Section (Asymmetric Grid) ─── */
.products {
  background: var(--linen);
}

.products-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
  align-items: end;
}

.products-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.product-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.5rem;
}

.product-card {
  position: relative;
  background: var(--warm-white);
  border-radius: 4px;
  overflow: hidden;
  transition: all var(--transition-med);
  cursor: pointer;
  border: 1px solid rgba(168, 147, 122, 0.1);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(42, 35, 29, 0.08);
  border-color: rgba(168, 147, 122, 0.25);
}

.product-card.hero-product {
  grid-row: span 2;
}

.product-card:nth-child(2) { grid-column: 2; grid-row: 1; }
.product-card:nth-child(3) { grid-column: 3; grid-row: 1; }
.product-card:nth-child(4) { grid-column: 2; grid-row: 2; }
.product-card:nth-child(5) { grid-column: 3; grid-row: 2; }

.product-image {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--clay), var(--terracotta));
  position: relative;
  overflow: hidden;
}

.product-card.hero-product .product-image {
  aspect-ratio: 3/4;
}

.product-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(42,35,29,0.3), transparent 60%);
}

.product-info {
  padding: 1.5rem;
}

.product-card.hero-product .product-info {
  padding: 2rem;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--deep-charcoal);
  margin-bottom: 0.3rem;
}

.product-card.hero-product .product-name {
  font-size: 1.6rem;
}

.product-material {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.product-price {
  font-size: 1rem;
  font-weight: 500;
  color: var(--chestnut);
}

.product-card.hero-product .product-price {
  font-size: 1.2rem;
}

/* ─── Testimonials Section ─── */
.testimonials {
  background: var(--warm-white);
  position: relative;
}

.testimonials::before {
  content: '“';
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-family: var(--font-display);
  font-size: 12rem;
  color: var(--clay);
  line-height: 1;
  opacity: 0.4;
  pointer-events: none;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

.testimonial-card {
  padding: 3rem;
  background: var(--linen);
  border-radius: 4px;
  position: relative;
}

.testimonial-card.featured {
  background: var(--chestnut);
  color: var(--warm-white);
}

.testimonial-card.featured p {
  color: rgba(247, 243, 238, 0.8);
}

.testimonial-stars {
  color: var(--sandgold);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.2em;
}

.testimonial-text {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--clay);
  flex-shrink: 0;
}

.testimonial-card.featured .testimonial-avatar {
  background: rgba(247, 243, 238, 0.2);
}

.author-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.author-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.testimonial-card.featured .author-detail {
  color: rgba(247, 243, 238, 0.6);
}

/* ─── Footer / Bottom CTA ─── */
.footer {
  background: var(--deep-charcoal);
  color: var(--warm-white);
  padding: 6rem 2rem 3rem;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100px;
  background: linear-gradient(to bottom, var(--sandgold), transparent);
  opacity: 0.3;
}

.footer-cta {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 5rem;
}

.footer-cta h2 {
  color: var(--warm-white);
  margin-bottom: 1rem;
}

.footer-cta p {
  color: rgba(247, 243, 238, 0.6);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

.footer-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(247, 243, 238, 0.06);
}

.footer-brand p {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.footer-brand .tagline {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(247, 243, 238, 0.4);
  max-width: 280px;
  line-height: 1.6;
}

.footer-col h5 {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sandgold);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: rgba(247, 243, 238, 0.6);
  margin-bottom: 0.8rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--warm-white);
}

.footer-legal {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(247, 243, 238, 0.05);
  font-size: 0.75rem;
  color: rgba(247, 243, 238, 0.3);
}

/* ─── Reveal Animation ─── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: center;
    text-align: center;
    padding-bottom: 6rem;
  }

  .hero-visual { display: none; }
  .hero-desc { margin: 0 auto 2rem; }
  .hero-actions { justify-content: center; }

  .philosophy-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .philosophy-image { height: 400px; }

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

  .module-card.featured {
    grid-column: span 2;
    grid-template-columns: 1fr;
  }

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

  .product-card.hero-product {
    grid-column: span 2;
    grid-row: auto;
  }

  .product-card:nth-child(2),
  .product-card:nth-child(3),
  .product-card:nth-child(4),
  .product-card:nth-child(5) {
    grid-column: auto;
    grid-row: auto;
  }

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

  .footer-bottom {
    grid-template-columns: 1fr 1fr;
  }

  .products-header {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

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

  .section { padding: 4rem 0; }
  .container { padding: 0 1.5rem; }

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

  .module-card.featured {
    grid-column: 1;
  }

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

  .product-card.hero-product {
    grid-column: 1;
  }

  .footer-bottom {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-legal {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .configurator-canvas {
    height: 60vh;
  }

  .configurator-overlay .container {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2.5rem; }
  .hero { min-height: 600px; }
  .hero-grid { padding: 0 1.5rem 4rem; }
}
