/* ============================================
   MODU — Design System & Styles
   Mobile-first, dark theme, premium spacing
   ============================================ */

:root {
  --bg: #0A0A0A;
  --surface: #1A1A1A;
  --border: #2A2A2A;
  --text: #FFFFFF;
  --text-dim: #999999;
  --accent: #A8D65B;
  --accent-dark: #2D5016;
  --yk-orange: #FF6600;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --space: 8px;
  --max-width: 1200px;
  --section-pad: calc(var(--space) * 16);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.6; overflow-x: hidden; touch-action: pan-y; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }

/* --- Loading Screen --- */
.loading-screen { position: fixed; inset: 0; z-index: 9999; background: var(--bg); display: flex; align-items: center; justify-content: center; transition: opacity 0.6s ease, visibility 0.6s ease; }
.loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-logo { font-size: 32px; font-weight: 700; letter-spacing: 8px; color: var(--accent); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.4; transform: scale(0.98); } 50% { opacity: 1; transform: scale(1); } }

/* --- Layout --- */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 calc(var(--space) * 3); }
section { padding: var(--section-pad) 0; position: relative; }

/* --- Typography --- */
.section-title { font-size: clamp(36px, 6vw, 80px); font-weight: 700; line-height: 1.1; letter-spacing: -1px; }
.section-sub { font-size: clamp(16px, 2.5vw, 24px); font-weight: 400; color: var(--text-dim); line-height: 1.5; }
.label { font-size: clamp(12px, 1.5vw, 16px); font-weight: 600; letter-spacing: 4px; text-transform: uppercase; color: var(--accent); }
.mono { font-family: var(--mono); font-size: 15px; }
.mb-2 { margin-bottom: calc(var(--space) * 2); }
.mb-3 { margin-bottom: calc(var(--space) * 3); }
.mb-4 { margin-bottom: calc(var(--space) * 4); }
.mt-2 { margin-top: calc(var(--space) * 2); }
.mt-3 { margin-top: calc(var(--space) * 3); }
.mt-4 { margin-top: calc(var(--space) * 4); }
.mt-6 { margin-top: calc(var(--space) * 6); }
/* All pinned sections need min-height for ScrollTrigger pin to work */
.module-section, .system, .partners-section, .app-section, .yk-section { min-height: 100vh; will-change: transform; }
.breaker { padding: 12vh 0; display: flex; align-items: center; justify-content: center; }

/* ==================== HERO ==================== */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; }
.hero-content { position: relative; z-index: 2; }
.hero-label { font-size: clamp(12px, 1.5vw, 17px); font-weight: 600; letter-spacing: 6px; text-transform: uppercase; color: var(--accent); margin-bottom: calc(var(--space) * 5); }
.hero-logo { font-size: clamp(64px, 15vw, 180px); font-weight: 800; letter-spacing: clamp(8px, 2vw, 24px); line-height: 1; margin-bottom: calc(var(--space) * 5); background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0.75) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-tagline { font-size: clamp(20px, 3vw, 32px); font-weight: 400; color: var(--text); opacity: 0.75; letter-spacing: 1px; line-height: 1.4; padding: 0 calc(var(--space) * 2); }

/* Particles */
.particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.particle { position: absolute; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; opacity: 0.15; }
.particle:nth-child(1) { top: 20%; left: 15%; animation: float1 8s ease-in-out infinite; }
.particle:nth-child(2) { top: 60%; left: 75%; animation: float2 10s ease-in-out infinite; }
.particle:nth-child(3) { top: 35%; left: 55%; animation: float1 12s ease-in-out infinite 2s; }
.particle:nth-child(4) { top: 75%; left: 30%; animation: float2 9s ease-in-out infinite 1s; }
@keyframes float1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-10px, -50px); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(15px, -30px); } }

/* ==================== PROBLEM (scroll-locked) ==================== */
.problem { min-height: 100vh; display: flex; align-items: flex-start; padding-top: 12vh; padding-bottom: var(--section-pad); will-change: transform; }
.problem-lines { max-width: 800px; }
.problem-line { font-size: clamp(28px, 5vw, 60px); font-weight: 700; line-height: 1.15; margin-bottom: calc(var(--space) * 3); }
.problem-green { color: var(--accent); }

/* ==================== BREAKER QUOTES ==================== */
.breaker { text-align: center; }
.breaker-line { height: 1px; background: var(--border); max-width: 120px; margin: 0 auto calc(var(--space) * 6); }
.breaker-line:last-child { margin: calc(var(--space) * 6) auto 0; }
.breaker-text { font-size: clamp(22px, 3.5vw, 44px); font-weight: 600; font-style: italic; color: var(--accent); line-height: 1.3; max-width: 700px; margin: 0 auto; }
.breaker-mark { font-size: 1.5em; display: inline; }
.breaker-word { display: inline-block; }

/* ==================== MODULE SECTION ==================== */
.module-section { padding: calc(var(--space) * 5) 0; }
.blueprint-wrap { margin: calc(var(--space) * 3) auto; max-width: 500px; }
.blueprint-svg { width: 100%; height: auto; }

/* Stats bar */
.stats-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--space) * 2); padding: calc(var(--space) * 2) 0; text-align: center; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: calc(var(--space) * 3) 0; }
.stat-value { display: block; font-size: clamp(24px, 4vw, 40px); font-weight: 800; color: var(--accent); margin-bottom: calc(var(--space)); }
.stat-label { display: block; font-size: clamp(11px, 1.5vw, 14px); color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* Configuration showcase */
.configs-section { margin-top: calc(var(--space) * 4); }
.configs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: calc(var(--space) * 1.5); }
@media (min-width: 768px) { .configs-grid { grid-template-columns: repeat(3, 1fr); } }

.config-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: calc(var(--space) * 1.5); text-align: center; transition: border-color 0.3s ease; }
.config-card:hover { border-color: var(--accent); }
.config-visual { display: flex; flex-direction: column; gap: 0; align-items: center; padding: calc(var(--space)); min-height: 40px; justify-content: center; }
.cfg-row { display: flex; gap: 0; }
.cfg-m { width: 12px; height: 12px; border: 1.5px solid var(--accent); background: rgba(168,214,91,0.06); margin: -0.75px; }
.cfg-spacer { width: 12px; height: 12px; margin: -0.75px; }
.config-name { font-size: 12px; font-weight: 700; margin-top: calc(var(--space)); }
.config-count { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* ==================== SYSTEM ==================== */
.system { padding: calc(var(--space) * 5) 0; }
.system-grid { display: grid; grid-template-columns: 1fr; gap: calc(var(--space) * 3); align-items: center; }
@media (min-width: 768px) { .system-grid { grid-template-columns: 1fr 1fr; } }
.system-visual { display: flex; align-items: center; justify-content: center; }
.beam-svg { width: 100%; max-width: 520px; }
.specs-list { list-style: none; }
.specs-list li { padding: calc(var(--space) * 1.5) 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.spec-label { color: var(--text-dim); font-size: 13px; }
.spec-value { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.system-tagline { margin-top: calc(var(--space) * 4); font-style: italic; color: var(--text-dim); font-size: 16px; }
.open-source { margin-top: calc(var(--space) * 4); padding-top: calc(var(--space) * 4); border-top: 1px solid var(--border); }
.accessories-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: calc(var(--space) * 1.5); }
@media (min-width: 768px) { .accessories-grid { grid-template-columns: repeat(4, 1fr); } }
.accessory-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: calc(var(--space) * 2); text-align: center; transition: border-color 0.3s ease; }
.accessory-card:hover { border-color: var(--accent); }
.accessory-icon { width: 32px; height: 32px; margin: 0 auto calc(var(--space)); }
.accessory-name { font-size: 12px; font-weight: 600; }
.accessory-dl { font-size: 10px; color: var(--accent); margin-top: 4px; }

/* ==================== APP — iPhone Mockups ==================== */
.app-section { padding: calc(var(--space) * 5) 0; text-align: center; }
.phones-wrap { display: flex; gap: calc(var(--space) * 2); justify-content: center; align-items: stretch; margin: calc(var(--space) * 3) auto; max-width: 500px; }

.iphone { width: 180px; background: #1A1A1A; border-radius: 28px; border: 2px solid #333; padding: 8px; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,0.5); display: flex; flex-direction: column; }
.iphone-notch { width: 70px; height: 18px; background: #0A0A0A; border-radius: 0 0 12px 12px; margin: 0 auto 6px; }
.iphone-screen { background: #111; border-radius: 18px; padding: 10px; flex: 1; }

.phone-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #222; }
.phone-title { font-size: 13px; font-weight: 700; }
.phone-time { font-size: 10px; color: var(--text-dim); }

.phone-card { background: #1A1A1A; border-radius: 10px; padding: 10px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.phone-card-label { font-size: 11px; color: var(--text-dim); }
.phone-card-value { font-size: 14px; font-weight: 800; color: var(--accent); }

.phone-graph { background: #1A1A1A; border-radius: 10px; padding: 10px; }
.phone-graph svg { width: 100%; height: 35px; }
.phone-graph-label { font-size: 9px; color: var(--text-dim); display: block; margin-top: 4px; }

.phone-alert { background: #1A1A1A; border-radius: 10px; padding: 8px; margin-bottom: 6px; display: flex; gap: 8px; align-items: flex-start; }
.alert-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.alert-dot.warn { background: #FF6B35; }
.alert-dot.ok { background: var(--accent); }
.alert-dot.info { background: #5B9BD5; }
.alert-title { font-size: 11px; font-weight: 600; display: block; }
.alert-sub { font-size: 9px; color: var(--text-dim); display: block; margin-top: 2px; }

.app-features { display: flex; gap: calc(var(--space) * 3); justify-content: center; flex-wrap: wrap; margin-top: calc(var(--space) * 3); }
.app-feature { display: flex; align-items: center; gap: calc(var(--space)); font-size: 12px; color: var(--text-dim); }
.app-feature-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.badge { display: inline-block; padding: calc(var(--space) * 0.75) calc(var(--space) * 2); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--text-dim); margin-top: calc(var(--space) * 2); }
.store-buttons { display: flex; gap: calc(var(--space) * 2); justify-content: center; margin-top: calc(var(--space) * 2); }
.store-btn { padding: calc(var(--space)) calc(var(--space) * 2); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--text); cursor: default; transition: border-color 0.3s ease; }
.store-btn:hover { border-color: var(--accent); }

/* ==================== PARTNERS ==================== */
.partners-section { padding: calc(var(--space) * 5) 0; }
.partners-grid { display: flex; flex-direction: column; gap: calc(var(--space)); }

.partner-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: calc(var(--space) * 1.5) calc(var(--space) * 2); display: flex; align-items: center; gap: calc(var(--space) * 1.5); transition: border-color 0.3s ease; }
.partner-card:hover { border-color: var(--accent); }
.partner-sector { font-size: 9px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); min-width: 80px; flex-shrink: 0; }
.partner-name { font-size: 14px; font-weight: 700; min-width: 120px; flex-shrink: 0; }
.partner-role { font-size: 12px; color: var(--text-dim); line-height: 1.3; }
@media (max-width: 480px) {
  .partner-card { flex-wrap: wrap; gap: 4px; padding: calc(var(--space)) calc(var(--space) * 1.5); }
  .partner-sector { min-width: auto; }
  .partner-name { min-width: auto; font-size: 13px; }
  .partner-role { font-size: 11px; flex-basis: 100%; }
}

/* Endless config card */
.config-card-endless { border-style: dashed; }
.config-card-endless .config-count { color: var(--accent); font-style: italic; }

/* ==================== YK ==================== */
.yk-section { padding: calc(var(--space) * 5) 0; display: flex; align-items: center; }
.yk-section .container { width: 100%; }
.yk-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: calc(var(--space) * 6) calc(var(--space) * 4); max-width: 600px; margin: 0 auto; text-align: center; }
.yk-badge { width: 60px; height: 60px; background: var(--yk-orange); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; color: white; margin: 0 auto calc(var(--space) * 3); }
.yk-title { font-size: 24px; font-weight: 700; margin-bottom: calc(var(--space) * 3); }
.yk-quote { font-size: 16px; font-style: italic; color: var(--text-dim); line-height: 1.6; margin-bottom: calc(var(--space) * 2); }
.yk-attribution { font-size: 13px; color: var(--text-dim); opacity: 0.7; }
.yk-class { margin-top: calc(var(--space) * 3); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--yk-orange); opacity: 0.8; }

/* ==================== FOOTER ==================== */
.footer { padding: calc(var(--space) * 8) 0 calc(var(--space) * 5); text-align: center; }
.footer-title { font-size: 22px; font-weight: 700; margin-bottom: calc(var(--space) * 3); }

/* --- SDG strip --- */
.sdg-section { margin-bottom: calc(var(--space) * 4); }
.sdg-heading { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); opacity: 0.6; margin-bottom: calc(var(--space) * 3); }
.sdg-grid { display: flex; justify-content: center; gap: calc(var(--space) * 3); max-width: 600px; margin: 0 auto; }
.sdg-card { display: flex; flex-direction: column; align-items: center; gap: calc(var(--space)); }
.sdg-img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.sdg-name { font-size: 10px; color: var(--text-dim); opacity: 0.7; text-align: center; line-height: 1.3; }

/* --- Divider --- */
.sdg-divider { width: 60px; height: 1px; background: var(--border); margin: calc(var(--space) * 4) auto; transform-origin: center; }

/* --- Signup --- */
.signup-form { display: flex; gap: calc(var(--space) * 2); max-width: 400px; margin: 0 auto calc(var(--space) * 5); flex-wrap: wrap; justify-content: center; }
.signup-input { flex: 1; min-width: 180px; padding: calc(var(--space) * 1.5) calc(var(--space) * 2.5); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: var(--font); font-size: 13px; outline: none; transition: border-color 0.3s ease; }
.signup-input:focus { border-color: var(--accent); }
.signup-input::placeholder { color: var(--text-dim); opacity: 0.5; }
.signup-btn { padding: calc(var(--space) * 1.5) calc(var(--space) * 3); background: var(--accent); color: var(--bg); border: none; border-radius: 999px; font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.signup-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(168,214,91,0.3); }
.footer-small { font-size: 11px; color: var(--text-dim); opacity: 0.4; margin-bottom: calc(var(--space)); }
.easter-egg { font-size: 10px; color: var(--text-dim); opacity: 0.25; margin-top: calc(var(--space) * 4); }

/* --- Buttons --- */
.btn { display: inline-block; padding: calc(var(--space) * 2) calc(var(--space) * 4); background: transparent; border: 1px solid var(--accent); color: var(--accent); border-radius: 8px; font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-decoration: none; }
.btn:hover { background: var(--accent); color: var(--bg); }

/* --- Confetti --- */
.confetti-piece { position: fixed; width: 8px; height: 8px; z-index: 9998; pointer-events: none; }

/* ==================== RESPONSIVE ==================== */
@media (min-width: 1024px) {
  :root { --section-pad: calc(var(--space) * 22); }
  .container { padding: 0 calc(var(--space) * 6); }

  /* === PINNED SECTIONS: content starts 20% down the viewport === */
  .module-section, .system, .partners-section, .app-section, .yk-section {
    padding: 15vh calc(var(--space) * 8) calc(var(--space) * 8);
  }
  .module-section > .container,
  .system > .container,
  .partners-section > .container,
  .app-section > .container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 15vh - 64px);
  }

  /* === MODULE: blueprint sized to fit with stats below === */
  .blueprint-wrap { margin: calc(var(--space) * 3) auto; max-width: 700px; }
  .stats-bar { margin: calc(var(--space) * 5) 0; padding: calc(var(--space) * 4) 0; }

  /* === BUILD ANYTHING: big cards filling the space === */
  .configs-section { margin-top: auto; }
  .configs-grid { gap: calc(var(--space) * 4); }
  .config-card { padding: calc(var(--space) * 5); border-radius: 16px; }
  .config-visual { min-height: 120px; padding: calc(var(--space) * 3); }
  .cfg-m { width: 24px; height: 24px; }
  .cfg-spacer { width: 24px; height: 24px; }
  .config-name { font-size: 18px; margin-top: calc(var(--space) * 2); }
  .config-count { font-size: 14px; }

  /* === SYSTEM: beam SVG fills available space === */
  .system-grid { gap: calc(var(--space) * 8); flex: 1; align-items: center; }
  .beam-svg { max-width: 100%; }
  .system-visual { flex: 1; }
  .system-visual .beam-svg { width: 100%; height: auto; max-height: 60vh; }
  .specs-list li { padding: calc(var(--space) * 3) 0; }
  .spec-label, .spec-value { font-size: 16px; }
  .system-tagline { margin-top: calc(var(--space) * 6); font-size: 20px; }

  /* === OPEN SOURCE: spacious 3x2 grid === */
  .open-source { margin-top: calc(var(--space) * 8); padding-top: calc(var(--space) * 8); }
  .accessories-grid { grid-template-columns: repeat(3, 1fr); gap: calc(var(--space) * 4); }
  .accessory-card { padding: calc(var(--space) * 5); border-radius: 16px; }
  .accessory-icon { width: 56px; height: 56px; margin: 0 auto calc(var(--space) * 3); }
  .accessory-name { font-size: 16px; }
  .accessory-dl { font-size: 13px; margin-top: calc(var(--space)); }

  /* === PARTNERS: card grid with space === */
  .partners-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--space) * 4); flex: 1; align-content: center; }
  .partner-card { display: block; padding: calc(var(--space) * 4); border-radius: 16px; }
  .partner-sector { display: block; min-width: auto; font-size: 11px; margin-bottom: calc(var(--space) * 1.5); }
  .partner-name { display: block; min-width: auto; font-size: 20px; margin: calc(var(--space) * 1.5) 0; }
  .partner-role { font-size: 15px; line-height: 1.5; }

  /* === APP: bigger phones with equal height === */
  .phones-wrap { gap: calc(var(--space) * 6); margin: calc(var(--space) * 5) auto; max-width: 750px; }
  .iphone { width: 300px; border-radius: 40px; padding: 14px; }
  .iphone-notch { width: 110px; height: 26px; border-radius: 0 0 16px 16px; }
  .iphone-screen { border-radius: 26px; padding: 18px; }
  .phone-header { margin-bottom: 18px; padding-bottom: 10px; }
  .phone-title { font-size: 17px; }
  .phone-time { font-size: 12px; }
  .phone-card { padding: 16px; margin-bottom: 12px; border-radius: 14px; }
  .phone-card-label { font-size: 14px; }
  .phone-card-value { font-size: 22px; }
  .phone-graph { padding: 16px; border-radius: 14px; }
  .phone-graph svg { height: 55px; }
  .phone-graph-label { font-size: 12px; }
  .phone-alert { padding: 14px; margin-bottom: 10px; border-radius: 14px; }
  .alert-dot { width: 9px; height: 9px; }
  .alert-title { font-size: 14px; }
  .alert-sub { font-size: 12px; }
  .app-features { margin-top: calc(var(--space) * 5); gap: calc(var(--space) * 5); }
  .app-feature { font-size: 15px; }
  .app-feature-dot { width: 9px; height: 9px; }

  /* === FOOTER: SDG strip === */
  .sdg-img { width: 56px; height: 56px; border-radius: 10px; }
  .sdg-name { font-size: 11px; }
  .sdg-grid { gap: calc(var(--space) * 5); }
}

@media (min-width: 1440px) {
  :root { --max-width: 1400px; --section-pad: calc(var(--space) * 28); }
  .hero-logo { font-size: 180px; letter-spacing: 24px; }
  .hero-tagline { font-size: 28px; }
  .hero-label { font-size: 18px; letter-spacing: 8px; }
  .breaker-text { font-size: 48px; }
}

@media (min-width: 1680px) {
  :root { --max-width: 1600px; --section-pad: calc(var(--space) * 32); }
  .hero-logo { font-size: 200px; letter-spacing: 28px; }
}

@media (max-width: 480px) {
  .phones-wrap { flex-direction: row; }
  .iphone { width: 150px; padding: 6px; }
  .iphone-notch { width: 55px; height: 14px; }
  .iphone-screen { padding: 8px; }
  .stats-bar { grid-template-columns: repeat(3, 1fr); }
  .configs-grid { gap: 6px; }
  .config-card { padding: calc(var(--space)); }
  .cfg-m { width: 10px; height: 10px; }
  .cfg-spacer { width: 10px; height: 10px; }
}
