/* ============================================
   Responsive + layout safety fixes
   ============================================ */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* Prevent overflow without breaking words letter-by-letter */
h1, h2, h3, h4, h5, h6, p, li, a, label {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.logo,
.logo-img,
.btn,
.nav-links a {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* Nav safety */
.nav {
  gap: 0.75rem;
  max-width: 100%;
}

.logo-img {
  height: clamp(36px, 5.5vw, 52px) !important;
  max-width: min(220px, 42vw) !important;
  width: auto !important;
}

.nav-links {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  white-space: nowrap;
}

/* Hero text safety */
.hero-slider {
  max-width: 100%;
}

.slide-content {
  max-width: min(640px, 100%);
  width: min(1180px, calc(100% - 2rem));
  padding-left: 0;
  padding-right: 0;
}

.slide h1 {
  font-size: clamp(1.75rem, 5.5vw, 3.75rem) !important;
  line-height: 1.15 !important;
  max-width: 100%;
}

.slide .lead {
  font-size: clamp(0.95rem, 2.4vw, 1.08rem) !important;
  max-width: min(480px, 100%) !important;
}

.slide-actions {
  width: 100%;
}

.slide-actions .btn {
  max-width: 100%;
  justify-content: center;
  text-align: center;
}

/* split-title disabled — normal headings only */
.split-title {
  display: block !important;
}

.split-title .char {
  display: inline !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Stats */
.stat-card {
  min-width: 0;
  padding: clamp(1rem, 2.5vw, 1.75rem) clamp(0.5rem, 1.5vw, 1.25rem) !important;
}

.stat-card .num {
  font-size: clamp(1.5rem, 4vw, 2.4rem) !important;
  word-break: keep-all;
}

.stat-card .label {
  font-size: clamp(0.75rem, 2vw, 0.88rem) !important;
  line-height: 1.35;
}

/* Cards / panels */
.service-card,
.vision-card,
.mission-card,
.about-panel,
.contact-form,
.info-card,
.feature-copy,
.value-item,
.process-step,
.story-card {
  min-width: 0;
  max-width: 100%;
}

.service-body {
  padding: clamp(1.15rem, 3vw, 1.75rem) clamp(1.15rem, 3vw, 2rem) clamp(1.35rem, 3vw, 2rem) !important;
}

.service-card h3,
.feature-copy h2,
.stage-copy h2,
.about-text h2,
.page-hero h1 {
  overflow-wrap: break-word;
}

/* About panel long values */
.about-panel li {
  flex-wrap: wrap;
  align-items: flex-start;
}

.about-panel li span:last-child {
  max-width: 100%;
  text-align: left;
  word-break: break-word;
}

@media (min-width: 961px) {
  .about-panel li {
    flex-wrap: nowrap;
  }
  .about-panel li span:last-child {
    text-align: right;
    max-width: 58%;
  }
}

/* Stage */
.stage {
  padding: clamp(2.5rem, 6vw, 6rem) 0 !important;
}

.stage-inner {
  width: min(1180px, calc(100% - 2rem)) !important;
  gap: clamp(1.5rem, 4vw, 3rem) !important;
}

.powder-scene,
.kepenk-scene {
  max-width: 100%;
}

/* Feature strip */
.feature-copy {
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2.75rem) !important;
}

/* CTA */
.cta-band {
  margin-left: auto;
  margin-right: auto;
  width: min(1180px, calc(100% - 2rem));
  padding: clamp(2rem, 5vw, 4rem) clamp(1.15rem, 3vw, 2.5rem) !important;
  box-sizing: border-box;
}

.cta-band h2 {
  font-size: clamp(1.35rem, 4vw, 2.3rem) !important;
  line-height: 1.25;
}

/* Footer */
.footer .container {
  width: min(1180px, calc(100% - 2rem));
}

.footer-bottom {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
}

.footer-brand p {
  max-width: 100%;
}

/* Contact */
.info-card {
  align-items: flex-start;
}

.info-card > div:last-child {
  min-width: 0;
  flex: 1;
}

/* Slider controls */
.slider-nav {
  width: min(1180px, calc(100% - 2rem)) !important;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.slider-arrows button {
  width: 44px;
  height: 44px;
}

/* Buttons don't overflow */
.btn {
  max-width: 100%;
  white-space: normal;
  line-height: 1.3;
}

/* Marquee safety */
.marquee-wrap {
  max-width: 100%;
  overflow: hidden;
}

/* ========== LARGE TABLET / SMALL DESKTOP ========== */
@media (max-width: 1100px) {
  .nav-links a {
    padding: 0.55rem 0.7rem;
    font-size: 0.86rem;
  }

  .nav-cta {
    padding: 0.6rem 1rem !important;
  }

  .logo-img {
    max-width: min(180px, 38vw) !important;
  }
}

/* ========== TABLET ========== */
@media (max-width: 960px) {
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    padding: 0.4rem 0;
  }

  .topbar .container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }

  .topbar-right {
    display: none;
  }

  .topbar .sep {
    display: none;
  }

  .topbar-left {
    gap: 0.85rem;
    justify-content: center;
    width: 100%;
  }

  .stage-inner {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }

  /* Text first, animation second for readability */
  .stage-kepenk .stage-inner {
    display: flex !important;
    flex-direction: column;
  }

  .stage-kepenk .stage-copy {
    order: 1;
  }

  .stage-kepenk .kepenk-wrap {
    order: 2;
  }

  .stage-powder .stage-inner {
    display: flex !important;
    flex-direction: column;
  }

  .stage-powder .stage-copy {
    order: 1;
  }

  .stage-powder .powder-scene,
  .stage-powder .reveal-right {
    order: 2;
  }

  .stage-copy {
    text-align: left;
    width: 100%;
  }

  .stage-copy h2 {
    font-size: clamp(1.45rem, 5.5vw, 2rem) !important;
    line-height: 1.3 !important;
    margin-bottom: 0.85rem !important;
  }

  .stage-copy p {
    max-width: 100% !important;
  }

  .stage-copy .pill-row {
    justify-content: flex-start;
  }

  .stage-copy .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  .powder-scene,
  .kepenk-scene {
    height: min(300px, 70vw) !important;
    min-height: 240px;
    width: 100%;
  }

  .kepenk-wrap {
    width: 100%;
    min-width: 0;
  }

  /* Prevent reveal transforms from causing horizontal shift */
  .reveal-left,
  .reveal-right {
    transform: translateY(24px) !important;
  }

  .reveal-left.visible,
  .reveal-right.visible {
    transform: none !important;
  }

  .hero-slider {
    height: auto !important;
    min-height: 0 !important;
  }

  .slide {
    position: relative !important;
    padding: 3.25rem 0 5.5rem !important;
    min-height: min(72vh, 560px);
  }

  .slide:not(.active) {
    display: none;
  }

  .slide.active {
    display: flex;
  }

  .slides {
    min-height: auto;
  }

  .hero-float-badges,
  .slide-float {
    display: none !important;
  }

  .stats {
    margin-top: -28px;
    padding: 0 0 1.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
  }

  .section {
    padding: 3.25rem 0 !important;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .section-header h2 {
    font-size: clamp(1.5rem, 4.5vw, 2.2rem) !important;
  }

  .feature-photo {
    min-height: 220px !important;
    max-height: 280px !important;
  }

  .values-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .process-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }

  .gallery-item,
  .gallery-item:nth-child(1),
  .gallery-item:nth-child(n) {
    aspect-ratio: 4 / 3 !important;
    grid-column: auto !important;
    grid-row: auto !important;
    transform: none !important;
    width: 100% !important;
  }

  .gallery-item img {
    transform: none !important;
    object-fit: cover !important;
    object-position: center !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Disable 3D tilt overflow on tablet */
  .service-card,
  .tilt-card {
    transform: none !important;
  }

  .service-card:hover,
  .tilt-card:hover {
    transform: translateY(-4px) !important;
  }
}

/* ========== MOBILE ========== */
@media (max-width: 720px) {
  .topbar {
    display: none;
  }

  .nav {
    height: 68px;
    padding: 0 1rem !important;
  }

  :root {
    --nav-h: 68px;
  }

  .logo-img {
    height: 38px !important;
    max-width: min(160px, 52vw) !important;
  }

  .menu-toggle {
    display: flex !important;
  }

  .nav-links {
    position: fixed !important;
    top: 0;
    right: 0;
    width: min(300px, 86vw);
    height: 100vh;
    height: 100dvh;
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    padding: 5rem 1.25rem 2rem !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.08);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    gap: 0.25rem !important;
    z-index: 1000;
    overflow-y: auto;
  }

  .nav-links.open {
    transform: translateX(0) !important;
  }

  .nav-links a {
    white-space: normal;
    padding: 0.9rem 1rem !important;
  }

  .nav-cta {
    margin-left: 0 !important;
    text-align: center;
    justify-content: center !important;
    display: flex !important;
  }

  .slide {
    min-height: auto;
    padding: 2.5rem 0 5.25rem !important;
    align-items: flex-start;
  }

  .slide-content {
    padding-top: 0.5rem;
  }

  .slide h1 {
    font-size: clamp(1.65rem, 7.5vw, 2.2rem) !important;
  }

  .slide-tag {
    font-size: 0.7rem !important;
    letter-spacing: 0.08em !important;
  }

  .slide-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .slide-actions .btn {
    width: 100%;
  }

  .slider-nav {
    bottom: 1.1rem !important;
  }

  .stats {
    margin-top: -20px;
  }

  .stats-grid {
    gap: 0.4rem;
    padding: 0.35rem !important;
  }

  .stat-card .num {
    font-size: 1.45rem !important;
  }

  .process-grid,
  .values-grid,
  .footer-grid,
  .services-grid {
    grid-template-columns: 1fr !important;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .page-hero {
    padding: 2.75rem 0 2rem !important;
  }

  .page-hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.4rem) !important;
  }

  .contact-form,
  .vision-card,
  .mission-card {
    padding: 1.35rem !important;
  }

  .info-card {
    padding: 1.1rem !important;
  }

  .info-card:hover {
    transform: none;
  }

  .story-rail,
  .story-rail-fit {
    grid-template-columns: 1fr 1fr !important;
  }

  .story-card {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  .footer {
    padding: 2.5rem 0 1.25rem;
  }

  .footer .logo {
    max-width: 100%;
  }

  .footer .logo-img {
    max-width: min(200px, 70vw) !important;
    height: 40px !important;
  }

  /* Reduce heavy effects on mobile */
  .cursor-glow,
  .powder-field {
    display: none !important;
  }

  .btn-magnetic,
  .btn-primary,
  .nav-cta {
    transform: none !important;
  }
}

/* ========== SMALL PHONES ========== */
@media (max-width: 400px) {
  .container,
  .stage-inner,
  .cta-band,
  .slider-nav,
  .slide-content {
    width: calc(100% - 1.25rem) !important;
  }

  .logo-img {
    max-width: 140px !important;
    height: 34px !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .gallery-grid {
    grid-template-columns: 1fr !important;
  }

  .pill {
    font-size: 0.75rem !important;
  }
}

/* Touch: no hover transforms that shift layout */
@media (hover: none) {
  .service-card:hover,
  .value-item:hover,
  .process-step:hover,
  .stat-card:hover,
  .story-card:hover,
  .gallery-item:hover {
    transform: none;
  }

  .service-card,
  .tilt-card {
    transform: none !important;
  }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none !important;
  }
}
