/*
Theme Name:  Helai Coming Soon
Theme URI:   https://helai.co
Author:      Helai
Author URI:  https://helai.co
Description: Official coming soon theme for Helai – Modern Linen, Made in Indonesia.
Version:     1.1.0
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: helai
Tags:        one-page, coming-soon, minimal, fashion, linen

Changelog:
  1.1.0 — Fix horizontal overflow on iOS (html overflow-x); remove countdown
          min-width causing overflow on 375px devices; fix .about-text h2
          selector (was h3); add page.php; new 480px + 360px breakpoints;
          newsletter-left animation moved to .reveal; global min-width:0
          on flex/grid children; dvh hero height for iOS Chrome.
*/

/* ─────────────────────────────────────────────
   CSS CUSTOM PROPERTIES
───────────────────────────────────────────── */
:root {
  --white:      #FDFAF5;
  --linen:      #F7F2EA;
  --ecru:       #EDE4D5;
  --sand:       #C8B49A;
  --clay:       #9C7E63;
  --warm-mid:   #4A3F35;
  --warm-dark:  #1C1712;
  --rule:       #D0C4B0;
  --rule-light: rgba(208,196,176,0.3);
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Jost', 'Helvetica Neue', sans-serif;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ─────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* FIX 1: overflow-x on html AND body. iOS Safari ignores body-only. */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--linen);
  color: var(--warm-dark);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

img { max-width: 100%; height: auto; display: block; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }

/* Global safety: flex/grid children can shrink below content size */
.countdown-unit,
.origin-stat,
.product-card,
.hero-meta-item { min-width: 0; }

/* ─────────────────────────────────────────────
   GRAIN OVERLAY
───────────────────────────────────────────── */
body::before {
  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='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.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
  will-change: transform; /* prevents iOS scroll repaint flicker */
}

/* ─────────────────────────────────────────────
   NAVIGATION
───────────────────────────────────────────── */
.helai-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  width: 100%;
  z-index: 900;
  padding: 28px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition), padding var(--transition);
}

.helai-nav.scrolled {
  background: rgba(253,250,245,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 18px 60px;
  border-bottom: 1px solid var(--rule-light);
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--white);
  transition: color var(--transition);
  padding-right: 0.55em;
  white-space: nowrap;
}

.helai-nav.scrolled .nav-wordmark { color: var(--warm-dark); }

.nav-links { display: flex; align-items: center; gap: 32px; }

.nav-links a {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(253,250,245,0.65);
  transition: color var(--transition);
  white-space: nowrap;
}

.helai-nav.scrolled .nav-links a { color: var(--warm-mid); }
.nav-links a:hover { color: var(--clay) !important; }

/* ─────────────────────────────────────────────
   HERO
───────────────────────────────────────────── */
.helai-hero {
  min-height: 100vh;
  min-height: 100dvh; /* iOS Chrome dynamic viewport */
  background: var(--warm-dark);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 60px 80px;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero-bg-texture {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 65% 35%, rgba(156,126,99,0.12) 0%, transparent 65%),
    radial-gradient(ellipse 60% 90% at 15% 75%, rgba(200,180,154,0.07) 0%, transparent 60%);
  pointer-events: none;
}

.hero-linen-lines {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 39px,
    rgba(208,196,176,0.04) 39px, rgba(208,196,176,0.04) 40px
  );
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; max-width: 900px; width: 100%; }

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 10px; font-weight: 400;
  letter-spacing: 0.5em; text-transform: uppercase;
  color: var(--sand); margin-bottom: 32px;
  opacity: 0; animation: fadeUp 0.8s 0.3s forwards;
}

/* FIX: lowered min clamp from 96px to 72px for < 380px screens */
.hero-wordmark {
  font-family: var(--font-display);
  font-size: clamp(72px, 14vw, 200px);
  font-weight: 300; line-height: 0.88; letter-spacing: -0.01em;
  color: var(--white); margin-bottom: 40px;
  opacity: 0; animation: fadeUp 1s 0.5s forwards;
}

.hero-divider {
  width: 64px; height: 1px; background: var(--clay);
  margin-bottom: 28px;
  opacity: 0; animation: fadeUp 0.8s 0.8s forwards;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 30px);
  font-weight: 300; font-style: italic;
  color: rgba(253,250,245,0.55); max-width: 520px;
  line-height: 1.5; margin-bottom: 48px;
  opacity: 0; animation: fadeUp 0.8s 1s forwards;
}

/* FIX: flex-wrap so meta items wrap on narrow screens */
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 28px 48px;
  opacity: 0; animation: fadeUp 0.8s 1.2s forwards;
}

.hero-meta-item { display: flex; flex-direction: column; gap: 6px; }
.hero-meta-label { font-size: 9px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--sand); font-weight: 400; }
.hero-meta-value { font-family: var(--font-display); font-size: 17px; font-weight: 300; color: var(--white); }

.hero-scroll-hint {
  position: absolute; bottom: 40px; right: 60px;
  display: flex; align-items: center; gap: 14px;
  color: rgba(253,250,245,0.3); font-size: 9px;
  letter-spacing: 0.35em; text-transform: uppercase;
  opacity: 0; animation: fadeIn 1s 2s forwards;
}

.scroll-line {
  width: 48px; height: 1px;
  background: rgba(253,250,245,0.2);
  position: relative; overflow: hidden;
}

.scroll-line::after {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%; background: var(--sand);
  animation: scanLine 2s 2.5s infinite;
}

/* ─────────────────────────────────────────────
   COUNTDOWN
───────────────────────────────────────────── */
.helai-countdown {
  background: var(--ecru); padding: 72px 60px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: center;
  border-bottom: 1px solid var(--rule); width: 100%;
}

.countdown-left h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 300; line-height: 1.2;
  color: var(--warm-dark); margin-bottom: 20px;
}

.countdown-left h2 em { font-style: italic; color: var(--clay); }

.countdown-left p {
  font-size: 15px; font-weight: 300;
  color: var(--warm-mid); line-height: 1.8; max-width: 400px;
}

.countdown-timer {
  display: flex; gap: 24px; justify-content: flex-end;
}

.countdown-unit {
  text-align: center;
  flex: 1;       /* FIX 2: equal share, no fixed width */
  min-width: 0;  /* FIX 2: allow shrink */
}

/* FIX 2: Removed min-width: 80px — primary overflow culprit on mobile */
.countdown-number {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 300; line-height: 1;
  color: var(--warm-dark); display: block;
}

.countdown-label {
  font-size: 9px; letter-spacing: 0.35em;
  text-transform: uppercase; color: var(--sand);
  font-weight: 400; margin-top: 10px; display: block;
}

/* ─────────────────────────────────────────────
   ABOUT STRIP
───────────────────────────────────────────── */
.helai-about {
  padding: 100px 60px; background: var(--white);
  border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 100px; align-items: center; width: 100%;
}

.about-label {
  font-size: 10px; letter-spacing: 0.4em;
  text-transform: uppercase; color: var(--sand);
  font-weight: 400; margin-bottom: 32px;
}

/* FIX 3: was .about-text h3 — front-page.php uses <h2> */
.about-text h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 300; line-height: 1.25;
  color: var(--warm-dark); margin-bottom: 28px;
}

.about-text h2 em { font-style: italic; color: var(--clay); }
.about-text p { font-size: 15px; font-weight: 300; color: var(--warm-mid); line-height: 1.85; }
.about-text p em { font-style: italic; color: var(--clay); }

.about-pillars { display: grid; gap: 2px; }

.pillar {
  padding: 28px 32px; background: var(--linen);
  border-left: 2px solid var(--clay);
  transition: background var(--transition);
}
.pillar:hover { background: var(--ecru); }
.pillar-num { font-family: var(--font-display); font-size: 32px; font-weight: 300; color: var(--sand); line-height: 1; margin-bottom: 8px; }
.pillar-title { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--warm-dark); font-weight: 400; margin-bottom: 8px; }
.pillar-text { font-size: 13px; font-weight: 300; color: var(--warm-mid); line-height: 1.7; }

/* ─────────────────────────────────────────────
   PRODUCTS
───────────────────────────────────────────── */
.helai-products {
  padding: 100px 60px; background: var(--linen);
  border-bottom: 1px solid var(--rule); width: 100%;
}

.products-header {
  display: flex; justify-content: space-between;
  align-items: flex-end; margin-bottom: 64px;
  padding-bottom: 32px; border-bottom: 1px solid var(--rule);
}

.products-header-left h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 300; line-height: 1.1; color: var(--warm-dark);
}

.products-header-left h2 em { font-style: italic; color: var(--clay); display: block; }

.products-header-right {
  font-size: 12px; font-weight: 300; color: var(--warm-mid);
  max-width: 280px; line-height: 1.75; text-align: right;
}

.products-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 2px; width: 100%; }

.product-card {
  background: var(--white); overflow: hidden;
  position: relative; cursor: default;
  transition: transform var(--transition); min-width: 0;
}

.product-card:hover { transform: translateY(-4px); }
.product-card:hover .product-overlay { opacity: 1; }

.product-illustration {
  aspect-ratio: 3/4;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; width: 100%;
}

.product-illustration svg { width: 60%; height: 60%; transition: transform var(--transition); }
.product-card:hover .product-illustration svg { transform: scale(1.03); }

.product-overlay {
  position: absolute; inset: 0; background: rgba(28,23,18,0.06);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
}

.overlay-text {
  font-size: 9px; letter-spacing: 0.5em; text-transform: uppercase;
  color: var(--warm-dark); font-weight: 400;
  background: var(--white); padding: 12px 24px;
}

.product-info { padding: 20px 20px 24px; }
.product-category { font-size: 9px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--sand); font-weight: 400; margin-bottom: 10px; }
.product-name { font-family: var(--font-display); font-size: 20px; font-weight: 400; color: var(--warm-dark); margin-bottom: 6px; line-height: 1.2; }
.product-name em { font-style: italic; font-weight: 300; }
.product-collection { font-size: 11px; font-weight: 300; color: var(--warm-mid); margin-bottom: 16px; }
.product-tag { display: inline-block; font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase; padding: 5px 12px; border: 1px solid var(--rule); color: var(--clay); font-weight: 400; }

/* ─────────────────────────────────────────────
   NEWSLETTER
───────────────────────────────────────────── */
.helai-newsletter {
  background: var(--warm-dark); padding: 120px 60px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: center; width: 100%;
}

/* FIX 6: Animation removed from newsletter-left/right.
   Use .reveal class on those elements in the template instead. */

.newsletter-eyebrow { font-size: 10px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--sand); margin-bottom: 24px; font-weight: 400; }

.newsletter-headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 300; color: var(--white);
  line-height: 1.15; margin-bottom: 24px;
}

.newsletter-headline em { font-style: italic; color: var(--sand); }
.newsletter-body { font-size: 15px; font-weight: 300; color: rgba(253,250,245,0.5); line-height: 1.8; max-width: 380px; }

.newsletter-form { display: flex; flex-direction: column; gap: 16px; width: 100%; }

.newsletter-form input[type="text"],
.newsletter-form input[type="email"] {
  width: 100%; padding: 18px 20px;
  background: rgba(253,250,245,0.06);
  border: 1px solid rgba(208,196,176,0.2);
  color: var(--white); font-family: var(--font-body);
  font-size: 14px; font-weight: 300; letter-spacing: 0.05em;
  outline: none; transition: border-color var(--transition);
  border-radius: 0; -webkit-appearance: none; appearance: none;
}

.newsletter-form input::placeholder { color: rgba(253,250,245,0.3); }
.newsletter-form input:focus { border-color: var(--clay); background: rgba(253,250,245,0.09); }

.newsletter-form button {
  width: 100%; padding: 18px 16px;
  background: var(--clay); border: none;
  color: var(--white); font-family: var(--font-body);
  font-size: 10px; font-weight: 400;
  letter-spacing: 0.3em; text-transform: uppercase;
  cursor: pointer; transition: background var(--transition);
  border-radius: 0; -webkit-appearance: none;
  touch-action: manipulation; /* removes 300ms iOS tap delay */
}

.newsletter-form button:hover { background: var(--sand); color: var(--warm-dark); }
.newsletter-note { font-size: 11px; color: rgba(253,250,245,0.25); letter-spacing: 0.05em; line-height: 1.6; }

/* ─────────────────────────────────────────────
   ORIGIN STRIP
───────────────────────────────────────────── */
.helai-origin {
  padding: 80px 60px; background: var(--ecru);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between;
  align-items: center; gap: 0; width: 100%;
}

.origin-stat {
  text-align: center; flex: 1; min-width: 0;
  padding: 0 16px; border-right: 1px solid var(--rule);
}

.origin-stat:last-child { border-right: none; }
.origin-number { font-family: var(--font-display); font-size: clamp(36px, 4vw, 48px); font-weight: 300; color: var(--clay); line-height: 1; margin-bottom: 10px; display: block; }
.origin-label { font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--warm-mid); font-weight: 400; line-height: 1.7; }

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.helai-footer {
  background: var(--warm-dark); padding: 56px 60px;
  display: flex; justify-content: space-between;
  align-items: center; gap: 40px; width: 100%;
}

.footer-wordmark { font-family: var(--font-display); font-size: 32px; font-weight: 300; letter-spacing: 0.5em; text-transform: uppercase; color: var(--white); padding-right: 0.5em; white-space: nowrap; }
.footer-middle { text-align: center; font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(253,250,245,0.3); line-height: 2; }
.footer-social { display: flex; gap: 24px; align-items: center; }
.footer-social a { font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(253,250,245,0.35); font-weight: 400; transition: color var(--transition); white-space: nowrap; }
.footer-social a:hover { color: var(--sand); }

/* ─────────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────────── */
@keyframes fadeUp  { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes scanLine { 0% { left:-100%; } 100% { left:100%; } }

.reveal { opacity:0; transform:translateY(32px); transition:opacity 0.8s ease, transform 0.8s ease; }
.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; }

/* ─────────────────────────────────────────────
   RESPONSIVE — 1100px
───────────────────────────────────────────── */
@media (max-width:1100px) {
  .products-grid { grid-template-columns:repeat(2,1fr); }
}

/* ─────────────────────────────────────────────
   RESPONSIVE — 900px
───────────────────────────────────────────── */
@media (max-width:900px) {
  .helai-nav, .helai-nav.scrolled { padding:22px 28px; }
  .helai-hero       { padding:0 28px 60px; }
  .helai-countdown  { grid-template-columns:1fr; gap:36px; padding:56px 28px; }
  .countdown-timer  { justify-content:flex-start; gap:20px; }
  .helai-about      { grid-template-columns:1fr; gap:48px; padding:72px 28px; }
  .helai-products   { padding:72px 28px; }
  .products-header  { flex-direction:column; gap:24px; align-items:flex-start; }
  .products-header-right { text-align:left; max-width:100%; }
  .helai-newsletter { grid-template-columns:1fr; gap:48px; padding:80px 28px; }
  .helai-origin     { flex-wrap:wrap; padding:56px 28px; }
  .origin-stat      { border-right:none; border-bottom:1px solid var(--rule); padding:24px 12px; flex-basis:50%; }
  .origin-stat:nth-child(odd)  { border-right:1px solid var(--rule); }
  .origin-stat:nth-last-child(-n+2) { border-bottom:none; }
  .helai-footer     { flex-direction:column; text-align:center; padding:44px 28px; gap:28px; }
  .hero-scroll-hint { display:none; }
}

/* ─────────────────────────────────────────────
   RESPONSIVE — 600px
───────────────────────────────────────────── */
@media (max-width:600px) {
  .products-grid   { grid-template-columns:repeat(2,1fr); }
  .nav-links       { display:none; }
  .countdown-timer { gap:14px; }
}

/* ─────────────────────────────────────────────
   FIX 5 — NEW 480px breakpoint
───────────────────────────────────────────── */
@media (max-width:480px) {
  .helai-nav, .helai-nav.scrolled { padding:18px 20px; }
  .helai-hero       { padding:0 20px 48px; }
  .helai-countdown  { padding:44px 20px; }
  .helai-about      { padding:56px 20px; }
  .helai-products   { padding:56px 20px; }
  .helai-newsletter { padding:64px 20px; }
  .helai-origin     { padding:40px 20px; }
  .helai-footer     { padding:40px 20px; }

  .hero-wordmark    { font-size:clamp(60px,17vw,88px); margin-bottom:28px; }
  .hero-eyebrow     { margin-bottom:20px; }
  .hero-tagline     { font-size:18px; margin-bottom:32px; }
  .hero-meta        { gap:18px 28px; }
  .hero-meta-value  { font-size:15px; }

  .countdown-number { font-size:clamp(34px,9vw,52px); }
  .countdown-label  { font-size:8px; letter-spacing:0.2em; }
  .countdown-timer  { gap:10px; }

  .products-grid    { grid-template-columns:1fr; }
  .products-header-left h2 { font-size:clamp(28px,8vw,40px); }

  .origin-stat      { flex-basis:50%; padding:18px 8px; }
  .origin-number    { font-size:34px; }
  .origin-label     { letter-spacing:0.2em; font-size:9px; }

  .nav-wordmark     { font-size:18px; }
  .footer-wordmark  { font-size:26px; }
  .footer-social    { gap:16px; }
  .newsletter-headline { font-size:clamp(26px,7vw,38px); }
  .pillar           { padding:22px 20px; }
}

/* ─────────────────────────────────────────────
   360px — very small / older Android
───────────────────────────────────────────── */
@media (max-width:360px) {
  .helai-nav, .helai-nav.scrolled { padding:16px 16px; }
  .helai-hero       { padding:0 16px 40px; }
  .helai-countdown  { padding:36px 16px; }
  .helai-about      { padding:44px 16px; }
  .helai-products   { padding:44px 16px; }
  .helai-newsletter { padding:52px 16px; }
  .helai-origin     { padding:28px 16px; }
  .helai-footer     { padding:32px 16px; }

  .countdown-number { font-size:30px; }
  .hero-wordmark    { font-size:clamp(52px,15vw,72px); }
  .countdown-timer  { gap:8px; }
}
