/* ==========================================================================
   HerePing v1.0 Landing Draft Design System (Direction B: The Humane Pin-Loop)
   Spec Reference: docs/specs/08-bi-and-design-system.md
   ========================================================================== */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --bg-canvas: #FAF8F5;
  --bg-surface: #FFFFFF;
  --bg-cream: #FFFDF7;
  --bg-dark-slate: #191F28;
  --bg-dark-card: #232B38;
  --text-primary: #221D1A;
  --text-secondary: #4E5968;
  --text-muted: #8B95A1;
  --brand-primary: #FFD43B;
  --brand-primary-dark: #F59F00;
  --brand-yellow-soft: #FFF8DB;
  --brand-coral: #FF6B4A;
  --brand-coral-dark: #E04F2E;
  --brand-coral-soft: #FFF1EE;
  --brand-mint: #2EC4B6;
  --brand-mint-dark: #0F766E;
  --brand-mint-soft: #E6F8F6;
  --border-hairline: #E6E3DC;
  --shadow-card: 0 8px 24px rgba(25, 31, 40, 0.05);
  --shadow-float: 0 16px 40px rgba(25, 31, 40, 0.12);
  --shadow-gold: 0 8px 20px rgba(245, 159, 0, 0.24);
  --shadow-coral: 0 8px 20px rgba(255, 107, 74, 0.24);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  letter-spacing: -0.02em;
  padding-bottom: 84px;
  overflow-x: hidden;
}

html[data-font-mode="system"] body {
  font-family: system-ui, -apple-system, "Noto Sans SC", "Noto Sans TC", "Noto Sans Arabic", "Noto Sans Thai", "Noto Sans Devanagari", Roboto, sans-serif;
}

:lang(ko) {
  word-break: keep-all;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding-inline: 20px;
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding-inline: 20px;
}

/* Draft Switcher Top Ribbon (Review Only) */
.draft-switcher-bar {
  background: #191F28;
  color: #E2E8F0;
  font-size: 0.78rem;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.draft-switcher-bar .draft-tag {
  background: rgba(255, 212, 59, 0.16);
  color: var(--brand-primary);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
}

.draft-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.draft-nav-links a {
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
  font-weight: 600;
  font-size: 0.74rem;
  transition: background 0.15s, color 0.15s;
}

.draft-nav-links a:hover,
.draft-nav-links a.active {
  background: var(--brand-primary);
  color: var(--text-primary);
  font-weight: 800;
}

/* Sticky Brand Header (360px safe) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(250, 248, 245, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.14rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.brand-bi-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-bi-lockup .brand-name {
  font-weight: 850;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-bi-lockup .brand-colon {
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.brand-bi-lockup .brand-sub-text {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 0.96em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub-pill {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand-mint-dark);
  background: var(--brand-mint-soft);
  border: 1px solid rgba(46, 196, 182, 0.35);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-canvas);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.back-home-btn:hover {
  background: var(--brand-yellow-soft);
}

.back-home-btn .back-label-short {
  display: none;
}

.lang-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  max-width: 144px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

#hp-cur-lang-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .brand-sub-pill {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-header-inner {
    padding: 10px 14px;
    gap: 6px;
  }
  .brand-logo {
    font-size: 0.96rem;
    gap: 6px;
  }
  .header-actions {
    gap: 5px;
  }
  .back-home-btn {
    height: 31px;
    padding-inline: 9px;
    font-size: 0.76rem;
    gap: 3px;
  }
  .back-home-btn .back-label-full {
    display: none;
  }
  .back-home-btn .back-label-short {
    display: inline;
  }
  .lang-trigger-btn {
    height: 31px;
    padding-inline: 9px;
    font-size: 0.77rem;
    gap: 4px;
    max-width: 108px;
  }
}

.lang-trigger-btn:hover {
  border-color: var(--brand-primary-dark);
  background: var(--bg-cream);
}

/* AI Multilingual Notice Strip (Visible when previewing 22 non-ko/en locales) */
.ai-lang-strip {
  display: none;
  background: var(--brand-mint-soft);
  border-bottom: 1px solid rgba(46, 196, 182, 0.35);
  padding: 9px 16px;
  font-size: 0.81rem;
  color: var(--brand-mint-dark);
}

.ai-lang-strip.visible {
  display: block;
}

.ai-lang-strip-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-lang-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-lang-chip {
  background: #FFFFFF;
  border: 1px solid rgba(15, 118, 110, 0.28);
  color: var(--brand-mint-dark);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

/* Badges & Pills */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}

.pill-mint {
  background: var(--brand-mint-soft);
  color: var(--brand-mint-dark);
  border: 1px solid rgba(46, 196, 182, 0.38);
}

.pill-coral {
  background: var(--brand-coral-soft);
  color: var(--brand-coral-dark);
  border: 1px solid rgba(255, 107, 74, 0.3);
}

.pill-gold {
  background: var(--brand-yellow-soft);
  color: #8C5800;
  border: 1px solid rgba(245, 159, 0, 0.35);
}

/* Store CTA Buttons (Both Google Play & App Store Displayed) */
.store-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
}

.btn-store-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 22px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 0.96rem;
  cursor: pointer;
  border: none;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.15s ease;
  flex: 1 1 215px;
  max-width: 280px;
}

.btn-store-cta:active {
  transform: scale(0.985);
}

.btn-store-primary {
  background: var(--brand-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-gold);
}

.btn-store-primary:hover {
  background: #FFCA1A;
}

.btn-store-dark {
  background: var(--bg-dark-slate);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(25, 31, 40, 0.16);
}

.btn-store-dark:hover {
  background: #252E3D;
}

.btn-store-surface {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card);
}

.btn-store-surface:hover {
  border-color: #CFCAC0;
  background: var(--bg-cream);
}

.store-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.18;
  text-align: start;
}

.store-btn-sub {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.78;
}

.store-btn-main {
  font-size: 0.96rem;
  font-weight: 800;
}

/* Section Layout & Cards */
.section-block {
  padding: 36px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 22px;
}

.section-title {
  font-size: clamp(1.36rem, 3.2vw, 1.78rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.32;
  margin-top: 8px;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
}

.hp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.bento-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bento-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 820px) {
  .bento-grid-3, .bento-grid-2 {
    grid-template-columns: 1fr;
  }
}

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.icon-box-gold { background: var(--brand-yellow-soft); color: #9C6500; }
.icon-box-coral { background: var(--brand-coral-soft); color: var(--brand-coral); }
.icon-box-mint { background: var(--brand-mint-soft); color: var(--brand-mint-dark); }
.icon-box-dark { background: #EEF2F6; color: var(--bg-dark-slate); }

.detail-link-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.detail-link-btn:hover {
  background: var(--brand-yellow-soft);
  border-color: rgba(245, 159, 0, 0.45);
}

/* Comparison Matrix Table */
.compare-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 14px 16px;
  text-align: start;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table th.col-legacy {
  background: #F4F5F7;
  color: var(--text-secondary);
  font-weight: 700;
  width: 34%;
}

.compare-table th.col-hp {
  background: var(--brand-yellow-soft);
  color: var(--text-primary);
  font-weight: 800;
  width: 42%;
}

.compare-table td.col-topic {
  font-weight: 800;
  color: var(--text-primary);
  width: 24%;
  background: #FCFBF9;
}

.compare-table td.col-legacy {
  color: #6B7280;
}

.compare-table td.col-hp {
  background: rgba(255, 248, 219, 0.42);
  font-weight: 700;
  color: var(--text-primary);
}

@media (max-width: 600px) {
  .compare-table th, .compare-table td {
    padding: 11px 10px;
    font-size: 0.81rem;
  }
}

/* Progressive Disclosure: Accordion */
.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  padding: 16px 18px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: start;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
}

.accordion-trigger:hover {
  background: rgba(250, 248, 245, 0.7);
}

.accordion-chevron {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.accordion-item.open .accordion-chevron {
  transform: rotate(180deg);
  color: var(--text-primary);
}

.accordion-panel {
  display: none;
  padding: 0 18px 16px;
  font-size: 0.89rem;
  color: var(--text-secondary);
  line-height: 1.62;
  border-top: 1px dashed rgba(230, 227, 220, 0.7);
  padding-top: 12px;
}

.accordion-item.open .accordion-panel {
  display: block;
}

/* Viral Share Booster Card */
.viral-booster-card {
  background: linear-gradient(135deg, #FFFDF7 0%, #FFF6D6 100%);
  border: 1px solid rgba(245, 159, 0, 0.36);
  border-radius: var(--radius-xl);
  padding: 26px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-viral-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 14px;
  background: var(--text-primary);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.91rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s, opacity 0.15s;
}

.btn-viral-share:hover {
  opacity: 0.92;
}

/* Sticky Bottom Install Bar */
.sticky-install-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 85;
  background: rgba(25, 31, 40, 0.95);
  backdrop-filter: blur(10px);
  color: #FFFFFF;
  padding: 11px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sticky-install-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sticky-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sticky-copy-text {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-btns {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.btn-sticky-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 11px;
  font-size: 0.8rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-sticky-gold {
  background: var(--brand-primary);
  color: var(--text-primary);
}

.btn-sticky-outline {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 34px 0 40px;
  margin-top: 24px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.footer-links a,
.footer-links button {
  background: none;
  border: none;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-primary);
  cursor: pointer;
}

.footer-disclaimer {
  max-width: 660px;
  margin: 10px auto 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Modal System */
.hp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(25, 31, 40, 0.56);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.hp-modal-backdrop.open {
  display: flex;
}

.hp-modal-card {
  background: var(--bg-surface);
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 26px 24px;
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-float);
  position: relative;
  animation: modalPop 0.18s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hp-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.hp-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
}

.hp-modal-close-x {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-hairline);
  background: var(--bg-canvas);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.hp-modal-body {
  font-size: 0.91rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.hp-modal-diagram {
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
}

.hp-modal-foot {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-modal-secondary {
  padding: 11px 18px;
  border-radius: 13px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.btn-modal-primary {
  padding: 11px 18px;
  border-radius: 13px;
  border: none;
  background: var(--brand-primary);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
}

/* 24-Locale Grid inside Language Modal */
.lang-region-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-muted);
  margin: 14px 0 7px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lang-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 7px;
}

.lang-option-btn {
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-canvas);
  font-size: 0.83rem;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.lang-option-btn:hover {
  border-color: var(--brand-primary-dark);
  background: var(--bg-cream);
}

.lang-option-btn.active {
  background: var(--brand-yellow-soft);
  border-color: var(--brand-primary-dark);
  color: var(--text-primary);
}

.lang-live-tag {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--brand-mint-soft);
  color: var(--brand-mint-dark);
  font-weight: 800;
}

/* Level 1 Toast */
.hp-toast {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 260;
  background: var(--bg-dark-slate);
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  max-width: 92vw;
  text-align: center;
}

.hp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
