/* ===== ETHEREAL SCALE — LEAK CALCULATOR ===== */

:root {
  --bg-light: #F5F5F5;
  --bg-dark: #0A0A0A;
  --green: #00FF66;
  --red: #FF3D00;
  --ink: #0A0A0A;
  --paper: #F5F5F5;
  --muted: #6B6B6B;
  --card-light: #FFFFFF;
  --card-dark: #141414;
  --border-dark: #2A2A2A;
  --border-light: #D0D0D0;
  --locked: #3A3A3A;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-light);
  color: var(--ink);
  transition: background 0.6s ease, color 0.6s ease;
  -webkit-font-smoothing: antialiased;
}

body.dark-mode { background: var(--bg-dark); color: var(--paper); }

.wrap { width: 100%; max-width: 800px; margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }
.hidden { display: none !important; }
.is-hidden { display: none !important; } /* progressive-disclosure gate */

/* ===== TOP PROGRESS BAR ===== */
.top-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60;
  background: rgba(128,128,128,0.18);
}
.top-progress-fill {
  height: 100%; width: 0; background: var(--green);
  box-shadow: 0 0 12px rgba(0,255,102,0.55);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== SECTION REVEAL ANIMATION ===== */
@keyframes sectionIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.section.animate-in { animation: sectionIn 0.6s ease both; }

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center;
  padding: 18px 24px;
  pointer-events: none;
}
.logo { pointer-events: auto; text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--green); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
}

/* ===== SECTIONS ===== */
.section {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 100px 0;
}
.section--hero { min-height: 100vh; }
.section--dark { background: transparent; }
.section--closer { flex-direction: column; padding: 140px 0 40px; }

/* ===== TYPOGRAPHY ===== */
.hero-headline {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(36px, 7vw, 56px); line-height: 1.05;
  margin: 0 0 18px; letter-spacing: -0.02em;
}
.hero-subline { font-size: clamp(17px, 2.5vw, 20px); color: var(--muted); margin: 0 0 36px; }

.h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(26px, 5vw, 32px); margin: 0 0 32px; letter-spacing: -0.01em;
}
.h2--light { color: var(--paper); }
.subline { color: var(--muted); font-size: 17px; margin: -18px 0 28px; }
.subline--light { color: #C0C0C0; }

/* ===== BUTTONS ===== */
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 16px;
  border: none; border-radius: 999px; cursor: pointer;
  padding: 14px 30px; transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
  display: inline-block; text-decoration: none; text-align: center;
}
.btn--lg { padding: 17px 42px; font-size: 18px; }
.btn--primary { background: var(--green); color: var(--ink); }
.btn--primary:hover { transform: scale(1.02); box-shadow: 0 8px 30px rgba(0,255,102,0.35); }
.btn--ghost { background: transparent; border: 1px solid var(--ink); color: var(--ink); }
.btn--ghost-light { border-color: var(--paper); color: var(--paper); }
.btn--ghost:hover { transform: scale(1.02); }

.btn--shake { animation: shake 2.4s ease-in-out infinite; }
@keyframes shake {
  0%, 88%, 100% { transform: translateX(0); }
  90% { transform: translateX(-3px); }
  92% { transform: translateX(3px); }
  94% { transform: translateX(-3px); }
  96% { transform: translateX(3px); }
}

.btn--pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,255,102,0.5); }
  50% { transform: scale(1.03); box-shadow: 0 0 24px 4px rgba(0,255,102,0.45); }
}

/* ===== REVEAL ANIM ===== */
.reveal { opacity: 0; transform: translateY(16px); animation: fadeUp 0.6s ease forwards; }
.reveal--d1 { animation-delay: 0.2s; }
.reveal--d2 { animation-delay: 0.4s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.io-reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.io-reveal.in { opacity: 1; transform: translateY(0); }

/* ===== TYPE GRID ===== */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.type-card {
  position: relative; background: var(--card-light);
  border: 1px solid var(--border-light); border-radius: 12px;
  padding: 32px 24px; font-family: var(--font-body); font-weight: 600; font-size: 17px;
  cursor: pointer; transition: all 0.3s ease; color: var(--ink);
  min-height: 120px; display: flex; align-items: center; justify-content: center;
}
.type-card:hover { border-color: var(--green); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.08); }
.type-card.selected { border-color: var(--green); border-width: 2px; }
.type-card.dimmed { opacity: 0.5; }
.type-card .check {
  position: absolute; top: 12px; right: 14px;
  color: var(--green); font-weight: 700; opacity: 0; transition: opacity 0.3s ease;
}
.type-card.selected .check { opacity: 1; }

/* ===== INPUTS ===== */
.input {
  width: 100%; font-family: var(--font-body); font-size: 17px;
  padding: 16px 18px; border-radius: 12px;
  border: 1px solid var(--border-light); background: #fff; color: var(--ink);
  outline: none; transition: border 0.3s ease;
}
.input:focus { border-color: var(--green); }
.input--lg { font-size: 19px; padding: 18px 22px; max-width: 440px; margin: 0 auto; display: block; }
.input--dark { background: var(--card-dark); border-color: var(--border-dark); color: var(--paper); }

.stack { margin-top: 18px; }
.skip-link { display: inline-block; margin-top: 18px; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 15px; }

/* ===== EXTRA INPUTS (linkedin / website) ===== */
.h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 0 0 18px; }
.extra-input { margin-top: 40px; animation: slideIn 0.3s ease; }
.nudge { color: var(--red); font-size: 15px; font-weight: 500; margin-top: 14px; animation: fadeUp 0.4s ease; }

/* ===== SHIMMER / PROFILE ===== */
.shimmer-card { max-width: 440px; margin: 24px auto 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.shimmer { background: linear-gradient(90deg, #e8e8e8 25%, #f4f4f4 50%, #e8e8e8 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
.shimmer--avatar { width: 72px; height: 72px; border-radius: 50%; }
.shimmer--line { width: 240px; height: 16px; }
.shimmer--line.short { width: 160px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.profile-card {
  max-width: 440px; margin: 24px auto 0; background: var(--card-light);
  border: 1px solid var(--border-light); border-radius: 16px; padding: 28px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: fadeUp 0.5s ease;
}
.avatar { width: 72px; height: 72px; border-radius: 50%; background: #d9d9d9; }
.profile-handle { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; color: var(--muted); font-size: 14px; }
.got-it { color: #00b347; font-weight: 600; margin-top: 6px; }
.check-inline, .check-inline * { color: var(--green); }

/* ===== MANUAL ===== */
.manual { max-width: 460px; margin: 24px auto 0; display: flex; flex-direction: column; gap: 22px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 500; }
.field > span { font-size: 15px; }
.range { width: 100%; accent-color: var(--green); }
.range-out { color: var(--muted); font-size: 14px; }

/* ===== PROGRESS ===== */
.progress { max-width: 460px; margin: 0 auto 36px; }
.progress-label { font-size: 14px; color: var(--muted); margin-bottom: 8px; text-align: left; }
.progress-track { height: 8px; background: #e2e2e2; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 999px; transition: width 0.5s ease; }

/* ===== QUESTIONS (dark cards) ===== */
.questions { display: flex; flex-direction: column; gap: 32px; max-width: 560px; margin: 0 auto 40px; }

/* each top-level question = its own dark card */
.q {
  opacity: 0; transform: translateY(18px); animation: slideIn 0.4s ease forwards;
  background: #141414; border: 1px solid #2A2A2A; border-radius: 16px;
  padding: 28px 26px; text-align: left;
}
@keyframes slideIn { to { opacity: 1; transform: translateY(0); } }

/* nested follow-up questions live inside the same card, below the parent answer */
.q .q {
  animation: subIn 0.35s ease forwards;
  background: transparent; border: none; border-top: 1px solid #2A2A2A;
  border-radius: 0; padding: 0; margin-top: 22px; padding-top: 20px;
}
@keyframes subIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.q-text { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--paper); margin: 0 0 24px; line-height: 1.3; }
.q .q .q-text { font-size: 15px; font-weight: 500; color: #C0C0C0; margin-bottom: 16px; }

/* pill grid — fixed columns, equal height, no orphaned pills */
.pill-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; } /* used by static DFY timing */
.pill {
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  min-height: 46px; padding: 11px 16px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1.5px solid #3A3A3A; color: var(--paper);
  transition: all 0.25s ease; display: flex; align-items: center; justify-content: center; text-align: center;
}
.pill:hover { border-color: var(--green); }
.pill.selected { border-color: var(--green); background: var(--green); color: var(--ink); font-weight: 600; }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1.5px solid #3A3A3A; color: var(--paper);
  transition: all 0.25s ease;
}
.chip:hover { border-color: var(--green); }
.chip.selected { border-color: var(--green); background: rgba(0,255,102,0.14); }

/* ===== LEAK TABLE ===== */
.leak-group { max-width: 620px; margin: 0 auto; }
.leak-group-title {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  color: #9a9a9a; text-transform: none; letter-spacing: 0.01em;
  margin: 0 0 16px; text-align: left;
}
.leak-sep { max-width: 620px; height: 1px; background: var(--border-dark); margin: 34px auto; }
.leak-table { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.leak-row {
  background: var(--card-dark); border: 1px solid var(--border-dark); border-radius: 14px;
  border-left-width: 4px;
  overflow: hidden; opacity: 0; transform: translateY(18px);
}
.leak-row.growth { border-left-color: #FF6B00; }
.leak-row.conversion { border-left-color: var(--red); }
.leak-row.growth .leak-amount { color: #FF6B00; }
.leak-row.conversion .leak-amount { color: var(--red); }
.leak-row.in { animation: fadeUp 0.5s ease forwards; }
.leak-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 22px;
}
.leak-name { font-family: var(--font-body); font-weight: 600; font-size: 17px; color: var(--paper); text-align: left; }
.leak-right { display: flex; align-items: center; gap: 16px; }
.leak-amount { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--red); white-space: nowrap; }

.leak-toggle {
  width: 34px; height: 34px; border-radius: 9px; border: none; cursor: not-allowed;
  display: flex; align-items: center; justify-content: center;
  background: var(--locked); color: #888; opacity: 0.4;
  font-size: 18px; transition: all 0.4s ease; position: relative;
}
.leak-toggle .lock { font-size: 14px; }
.leak-toggle .plus { display: none; }
.leak-row.unlocked .leak-toggle {
  cursor: pointer; opacity: 1; background: rgba(0,255,102,0.15); color: var(--green);
}
.leak-row.unlocked .leak-toggle .lock { display: none; }
.leak-row.unlocked .leak-toggle .plus { display: block; }
.leak-row.flash { animation: rowFlash 0.7s ease; }
@keyframes rowFlash {
  0% { box-shadow: 0 0 0 0 rgba(0,255,102,0); }
  40% { box-shadow: 0 0 0 3px rgba(0,255,102,0.6); border-color: var(--green); }
  100% { box-shadow: 0 0 0 0 rgba(0,255,102,0); }
}

.leak-detail {
  max-height: 0; overflow: hidden; transition: max-height 0.45s ease;
  padding: 0 22px;
}
.leak-row.open .leak-detail { max-height: 640px; padding-bottom: 22px; }
.leak-math { color: #C0C0C0; font-size: 16px; line-height: 1.5; margin: 4px 0 14px; text-align: left; }
.leak-fix { color: var(--green); font-weight: 600; margin: 0 0 18px; text-align: left; }
.leak-detail .btn { display: block; margin: 0 auto; }

/* ===== TOTAL ===== */
.total-row {
  max-width: 620px; margin: 26px auto 0; display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-top: 1px solid var(--border-dark);
}
.total-label { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--paper); }
.total-amount { font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--green); }
.year-note { color: var(--muted); font-style: italic; margin-top: 22px; }
.year-note span { color: var(--red); font-style: normal; font-weight: 600; }

/* ===== EMAIL GATE ===== */
.gate-copy { font-weight: 500; font-size: 18px; color: var(--paper); max-width: 600px; margin: 0 auto 28px; line-height: 1.55; }
#s6 .input--lg { margin-bottom: 18px; }

/* ===== EMAIL GATE POPUP ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.78); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeUp 0.3s ease;
}
.modal--email {
  position: relative;
  width: 100%; max-width: 460px; text-align: center;
  background: var(--card-dark); border: 1px solid var(--border-dark);
  border-radius: 20px; padding: 44px 32px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: popIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-x {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1;
  padding: 4px; transition: color 0.2s ease;
}
.modal-x:hover { color: var(--paper); }
.email-modal-title { font-family: var(--font-display); font-weight: 700; font-size: 23px; color: var(--paper); margin: 0 0 22px; line-height: 1.2; }
.modal--email .input--lg { margin: 0 0 12px; max-width: none; }
.email-modal-sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.modal--email .btn { width: 100%; }

/* ===== PRODUCT SECTIONS (inline) ===== */
.section--products {
  min-height: 100vh; align-items: flex-start; overflow: visible;
  padding: 100px 0 80px; scroll-margin-top: 40px;
}
.section--products .h2 { scroll-margin-top: 40px; }
/* tall sections must top-align so growing content never clips at the top */
#s5, #s8 { align-items: flex-start; }
#s5 { scroll-margin-top: 40px; }
.product-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  align-items: stretch; margin-top: 44px;
}
.fork-card {
  position: relative; height: 100%; background: var(--card-dark); border: 1px solid var(--border-dark);
  border-radius: 20px; padding: 36px 30px;
  display: flex; flex-direction: column; gap: 16px;
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.fork-card--green { border-top: 4px solid var(--green); }
.fork-card--red { border-top: 4px solid var(--red); }
.fork-card.highlight { box-shadow: 0 0 0 2px currentColor, 0 20px 50px rgba(0,0,0,0.45); transform: translateY(-3px); }
.fork-card--green.highlight { color: var(--green); }
.fork-card--red.highlight { color: var(--red); }

.fork-tag {
  align-self: flex-start; font-family: var(--font-body); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em; padding: 6px 12px; border-radius: 999px;
}
.fork-tag--green { color: var(--green); background: rgba(0,255,102,0.12); }
.fork-tag--red { color: var(--red); background: rgba(255,61,0,0.12); }

.fork-h { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--paper); margin: 0; letter-spacing: -0.01em; }
.fork-body { color: #C0C0C0; font-size: 15px; line-height: 1.55; margin: 0; }
.fork-price { font-family: var(--font-display); font-weight: 700; font-size: 34px; }
.fork-price--green { color: var(--green); }
.fork-price--red { color: var(--red); }
.fork-price-note { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; }

.fork-list { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.fork-list li { position: relative; padding-left: 26px; color: #D5D5D5; font-size: 15px; line-height: 1.45; }
.fork-list li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  color: var(--green); font-weight: 700; font-size: 14px;
}
.fork-list--red li::before { color: var(--red); }

.fork-timeline { display: flex; flex-direction: column; gap: 0; margin: 4px 0; border-left: 1.5px solid var(--border-dark); }
.tl-step { position: relative; padding: 4px 0 16px 20px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before { content: ''; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.tl-when { display: block; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--paper); }
.tl-what { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }

.fork-cta { margin-top: auto; text-align: center; }
.fork-fine { color: var(--muted); font-size: 13px; margin: 4px 0 0; text-align: center; }

/* ===== DFY INLINE FORM ===== */
.dfy-form { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; text-align: left; animation: fadeUp 0.4s ease; }
.dfy-field { display: flex; flex-direction: column; gap: 8px; }
.dfy-field > span { font-size: 14px; font-weight: 500; color: #C0C0C0; }
.dfy-form .input--dark:focus { border-color: var(--green); }
.dfy-form select.input--dark option { background: var(--card-dark); color: var(--paper); }

.dfy-redirect { margin-top: 6px; padding: 18px; border-radius: 12px; background: rgba(0,255,102,0.08); border: 1px solid rgba(0,255,102,0.3); animation: fadeUp 0.4s ease; }
.dfy-redirect p { color: var(--green); font-size: 15px; line-height: 1.5; margin: 0 0 14px; }
.dfy-redirect .btn { display: block; width: 100%; }

.dfy-success { margin-top: 6px; color: var(--green); font-weight: 600; font-size: 16px; animation: fadeUp 0.4s ease; text-align: center; }

/* ===== CLOSER ===== */
.closer-line { font-weight: 500; font-size: 18px; color: var(--muted); max-width: 560px; margin: 0 auto; line-height: 1.6; }
.footer { width: 100%; max-width: 800px; margin: 80px auto 0; padding: 0 24px; font-size: 12px; color: var(--locked); text-align: left; }

/* ===== CONFETTI ===== */
.confetti { position: fixed; top: -10px; width: 8px; height: 12px; z-index: 200; pointer-events: none; }
@keyframes confettiFall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .type-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .total-amount { font-size: 26px; }
  .total-label { font-size: 15px; }
  .total-row { flex-direction: column; gap: 8px; align-items: flex-start; }
  .section { padding: 80px 0; }
  .section--products { padding: 72px 0 88px; }
  .fork-card { padding: 30px 22px; }
  .modal--email { padding: 32px 24px; }
  .email-modal-title { font-size: 21px; }
  .leak-head { padding: 16px 16px; }
  .leak-name { font-size: 15px; }
  .leak-amount { font-size: 17px; }
}
