/* ==========================================
   vegeketo.com - main.css
   Version: 1.0
   Design tokens + responsive layout
   ========================================== */

/* ----- Design tokens ----- */
:root {
  /* Light mode */
  --bg-primary: #fdfcf7;
  --bg-elevated: #ffffff;
  --bg-soft: #f7f3ec;
  --bg-purple-soft: #efeaf8;
  --bg-orange-soft: #fef0e8;

  --text-primary: #2a2542;
  --text-secondary: #6b6480;
  --text-muted: #888780;
  --text-on-purple: #5a4e8f;

  --accent: #8b7ec8;
  --accent-deep: #5a4e8f;
  --accent-light: #c9bfe0;
  --gray-warm: #a8a196;

  --cta: #ff7e5f;
  --cta-hover: #ff6a45;
  --success: #5cb85c;
  --warning: #f0ad4e;
  --danger: #d9534f;
  --info: #378add;

  --border: #ede5d5;
  --border-strong: #d4cce8;

  /* Typography */
  --font-sans: 'Pretendard', 'Hiragino Sans', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Noto Serif KR', 'Noto Serif JP', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Shadow (subtle) */
  --shadow-sm: 0 1px 2px rgba(60, 60, 80, 0.04);
  --shadow-md: 0 4px 16px rgba(80, 60, 30, 0.06);
  --shadow-lg: 0 10px 40px rgba(60, 80, 40, 0.08);

  /* Z-index */
  --z-nav: 100;
  --z-modal: 1000;
  --z-toast: 2000;

  /* Layout */
  --container-max: 1180px;
  --content-max: 720px;
  --tab-bar-h: 64px;
}

/* Dark mode (사용자 설정 따름) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1825;
    --bg-elevated: #252337;
    --bg-soft: #2a2742;
    --bg-purple-soft: #3a3460;
    --bg-orange-soft: #3a2a25;

    --text-primary: #f5f3ff;
    --text-secondary: #c9bfe0;
    --text-muted: #8a8298;
    --text-on-purple: #c9bfe0;

    --accent: #afa9ec;
    --accent-deep: #afa9ec;
    --accent-light: #5a4e8f;

    --border: #3a3550;
    --border-strong: #5a4e8f;

    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
  }
}

/* ----- Reset ----- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-y: scroll !important;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

/* ----- Layout ----- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ----- Header (desktop) ----- */
.site-header {
  background: var(--bg-elevated);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: baseline;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--accent-deep);
  flex-shrink: 0;
}
.brand-dot { color: var(--gray-warm); }

.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
  flex: 0 0 auto;
}
.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}
.nav-link.active { color: var(--accent-deep); }
.nav-link:hover { color: var(--accent-deep); text-decoration: none; }

.search-box {
  position: relative;
  flex: 1;
  max-width: 260px;
  margin-left: auto;
}
.search-input {
  width: 100%;
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--bg-purple-soft);
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-secondary);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border: 0.5px solid transparent;
  white-space: nowrap;
}
.btn-cta {
  background: var(--cta);
  color: white;
}
.btn-cta:hover {
  background: var(--cta-hover);
  text-decoration: none;
}
.btn-outline {
  background: var(--bg-elevated);
  color: var(--accent-deep);
  border-color: var(--accent-light);
}
.btn-outline:hover {
  background: var(--bg-purple-soft);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent-deep);
  color: white;
}
.btn-primary:hover { background: var(--accent); text-decoration: none; }

.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

/* ----- Mobile bottom tab bar ----- */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 0.5px solid var(--border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: var(--z-nav);
}
.mobile-tab-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
}
.tab-item.active {
  color: var(--accent-deep);
  font-weight: 500;
}
.tab-icon {
  font-size: 18px;
  line-height: 1;
}
.tab-item:not(.active) .tab-icon { opacity: 0.5; }

/* ----- Hero ----- */
.hero {
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-soft) 100%);
  padding: 56px 20px 48px;
  text-align: center;
}
.hero-eyebrow {
  font-size: 11px;
  color: var(--accent-deep);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.hero-title {
  font-size: 36px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.hero-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.hero-social-proof {
  font-size: 12px;
  color: var(--text-muted);
}

/* ----- Sections ----- */
.section {
  padding: 56px 20px;
}
.section-tight { padding: 40px 20px; }
.section-soft { background: var(--bg-soft); }
.section-white { background: var(--bg-elevated); }
.section-purple-soft { background: var(--bg-purple-soft); }

.section-eyebrow {
  font-size: 11px;
  color: var(--accent-deep);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-align: center;
}
.section-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: -0.3px;
}

/* ----- Tools grid (3 cards) ----- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}
.tool-card {
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 18px;
  text-align: center;
  transition: all 0.15s;
}
.tool-card:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.tool-icon {
  font-size: 32px;
  margin-bottom: 10px;
  line-height: 1;
}
.tool-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.tool-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ----- Doctor section ----- */
.doctor-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  align-items: center;
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  max-width: 640px;
  margin: 0 auto;
}
.doctor-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-purple-soft), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}
.doctor-name {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.doctor-credentials {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}
.doctor-quote {
  font-style: italic;
  font-size: 13px;
  color: var(--accent-deep);
  line-height: 1.6;
  font-family: var(--font-serif);
}

/* ----- Signup CTA ----- */
.signup-cta {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-purple-soft) 100%);
  padding: 48px 20px;
  text-align: center;
}
.signup-cta-eyebrow {
  font-size: 11px;
  color: var(--accent-deep);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.signup-cta-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.signup-form {
  display: flex;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto 14px;
}
.signup-form input {
  flex: 1;
  border: 0.5px solid var(--accent-light);
  border-radius: var(--r-pill);
  padding: 11px 18px;
  font-size: 13px;
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.signup-form input:focus {
  outline: none;
  border-color: var(--accent-deep);
}
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--accent-light);
  border-radius: 3px;
  overflow: hidden;
  max-width: 280px;
}
.progress-fill {
  height: 100%;
  background: var(--accent-deep);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
}
.progress-label {
  font-size: 11px;
  color: var(--accent-deep);
  font-weight: 500;
  white-space: nowrap;
}

/* ----- Footer ----- */
.site-footer {
  background: var(--bg-elevated);
  border-top: 0.5px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--tab-bar-h);
}
.footer-links {
  margin-bottom: 8px;
}
.footer-links a {
  color: var(--text-secondary);
  margin: 0 8px;
}

/* ----- Responsive: Mobile ----- */
@media (max-width: 767px) {
  .nav-links { display: none; }
  .search-box { display: none; }
  .header-inner .btn { display: none; }
  
  .header-inner {
    padding: 12px 18px;
    justify-content: space-between;
  }
  
  .mobile-search-btn {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .mobile-tab-bar { display: block; }
  body { padding-bottom: var(--tab-bar-h); }
  
  .hero { padding: 40px 18px 36px; }
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 14px; }
  
  .section { padding: 36px 18px; }
  .section-title { font-size: 19px; }
  
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .tool-card { padding: 16px 10px; }
  .tool-icon { font-size: 24px; }
  .tool-name { font-size: 12px; }
  .tool-desc { font-size: 10px; }
  
  .doctor-card {
    grid-template-columns: 80px 1fr;
    gap: 16px;
    padding: 20px;
  }
  .doctor-avatar { width: 80px; height: 80px; font-size: 32px; }
  .doctor-name { font-size: 16px; }
  
  .signup-form input { font-size: 12px; padding: 9px 14px; }
}

/* ----- Mobile-only utility ----- */
.mobile-search-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  background: var(--bg-soft);
}

@media (max-width: 767px) {
  .mobile-search-btn { display: flex; }
}

/* ----- Accessibility ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}