/* ==========================================================================
   stop&loss — 랜딩 페이지 스타일 (제품: Aegis 자동매매 프로그램)
   다크 모드 기본 / 모바일 퍼스트 (min-width 미디어쿼리)
   ========================================================================== */

/* ---------- 1. 변수 ---------- */
:root {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: #131c31;
  --surface-2: #1a2540;
  --border: #233150;
  --border-strong: #31456e;

  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;

  --primary: #38bdf8;
  --primary-strong: #0ea5e9;
  --accent: #a78bfa;
  --success: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .28);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .38);

  --header-h: 64px;
  --ease: 0.2s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  --font-mono: 'SFMono-Regular', 'Cascadia Code', Consolas, 'Courier New', monospace;
}

/* ---------- 2. 리셋 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ease);
}

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

button { cursor: pointer; }

code {
  font-family: var(--font-mono);
  font-size: .85em;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--primary);
  color: #06121f;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: top var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- 3. 레이아웃 ---------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow { max-width: 760px; }

.section {
  padding: 64px 0;
  scroll-margin-top: var(--header-h);
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 32px;
  text-align: center;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
}

.section-title {
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.section-desc {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.text-gradient {
  background: linear-gradient(100deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grid { display: grid; gap: 16px; }

/* ---------- 4. 헤더 / 내비게이션 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 17, 32, .78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease), background var(--ease);
}

.site-header.is-scrolled {
  background: rgba(11, 17, 32, .94);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark { color: var(--primary); }

/* 회사명(stop&loss) + 제품명(Aegis)을 2줄로 묶는다. */
.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-sub {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
}

.site-nav {
  position: fixed;
  top: var(--header-h);
  right: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(280px, 82vw);
  height: calc(100vh - var(--header-h));
  padding: 24px 20px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform var(--ease);
  overflow-y: auto;
}

.site-nav.is-open { transform: translateX(0); }

.nav-link {
  padding: 12px 8px;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
}
.nav-link:hover { color: var(--primary); background: var(--surface-2); }

.nav-cta {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--primary);
  color: #06121f;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-align: center;
  transition: background var(--ease);
}
.nav-cta:hover { background: var(--primary-strong); }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 40;
  background: rgba(2, 6, 16, .6);
}

body.nav-open { overflow: hidden; }

/* ---------- 5. 히어로 ---------- */
.hero {
  position: relative;
  padding: 56px 0 64px;
  overflow: hidden;
  scroll-margin-top: var(--header-h);
}

.hero-glow {
  position: absolute;
  top: -180px;
  left: 50%;
  width: 720px;
  height: 480px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(56, 189, 248, .22), rgba(167, 139, 250, .12) 55%, transparent 78%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
}

.hero-title {
  margin-top: 4px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.03em;
}

/* 제품명(Aegis) 배지 — 회사명과 제품명을 구분해 보여준다. */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 5px 14px 5px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 13px;
}

.hero-badge b {
  color: var(--text);
  font-weight: 800;
}

.hero-badge-label {
  padding: 2px 10px;
  background: rgba(56, 189, 248, .14);
  border-radius: 999px;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
}

.hero-desc {
  max-width: 620px;
  margin: 16px auto 0;
  color: var(--text-soft);
  font-size: 16px;
}

.hero-desc b { color: var(--text); font-weight: 700; }

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- 6. 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: #06121f;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--primary-strong); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-block { width: 100%; }

.btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- 7. 통계 스트립 ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 40px;
}

.stat {
  padding: 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.stat-value {
  display: block;
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.stat-label {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 8. 기능 카드 ---------- */
.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  font-size: 20px;
  line-height: 1;
}

.icon-blue    { background: rgba(56, 189, 248, .14); color: var(--primary); }
.icon-violet  { background: rgba(167, 139, 250, .14); color: var(--accent); }
.icon-emerald { background: rgba(52, 211, 153, .14); color: var(--success); }
.icon-amber   { background: rgba(251, 191, 36, .14); color: var(--warn); }

.card-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.card-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- 9. 전략 카드 ---------- */
.strategy {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.strategy:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.strategy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.strategy-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.strategy-code {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  align-self: flex-start;
}

.strategy-text {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14.5px;
}

.strategy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: auto;
  padding-top: 16px;
}

.strategy-meta li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.strategy-meta span { color: var(--muted); }
.strategy-meta b { color: var(--text-soft); font-weight: 600; }

.risk-low { color: var(--success); }
.risk-mid { color: var(--warn); }

.tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-blue    { background: rgba(56, 189, 248, .14); color: var(--primary); }
.tag-emerald { background: rgba(52, 211, 153, .14); color: var(--success); }
.tag-violet  { background: rgba(167, 139, 250, .14); color: var(--accent); }

.strategy-more {
  justify-content: center;
  background: linear-gradient(150deg, rgba(56, 189, 248, .1), rgba(167, 139, 250, .08));
  border-style: dashed;
  border-color: var(--border-strong);
  text-align: center;
}

.strategy-more .btn { margin-top: 16px; align-self: center; }

/* ---------- 10. 단계 ---------- */
.steps {
  display: grid;
  gap: 16px;
  counter-reset: step;
}

.step {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.step-num {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.step-title {
  font-size: 17px;
  font-weight: 700;
}

.step-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- 11. 모드 테이블 ---------- */
.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.mode-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14.5px;
}

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

.mode-table thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mode-table tbody tr:last-child th,
.mode-table tbody tr:last-child td { border-bottom: 0; }

.mode-table tbody th code { color: var(--primary); }
.mode-table td:last-child { color: var(--muted); }

.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-on   { background: rgba(52, 211, 153, .14); color: var(--success); }
.pill-half { background: rgba(251, 191, 36, .14); color: var(--warn); }
.pill-off  { background: rgba(248, 113, 113, .14); color: var(--danger); }

.ack-note {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
}

.ack-title {
  font-size: 16px;
  font-weight: 700;
}

.ack-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
}

.ack-text b { color: var(--text-soft); }

/* ---------- 12. FAQ ---------- */
.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--ease);
}

.faq-item.is-open { border-color: var(--border-strong); }

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 15.5px;
  font-weight: 600;
  transition: color var(--ease);
}

.faq-q:hover { color: var(--primary); }

.faq-icon {
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--ease);
}

.faq-icon::after { transform: rotate(90deg); }

.faq-q[aria-expanded="true"] .faq-icon::after { transform: rotate(0deg); }

.faq-a {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 14.5px;
}

.faq-a b { color: var(--text-soft); }

/* ---------- 13. 폼 ---------- */
.contact-form {
  display: grid;
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.field { display: grid; gap: 8px; }

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

.req { color: var(--danger); }

.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.input::placeholder { color: #64748b; }

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .16);
}

.input.is-invalid { border-color: var(--danger); }

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.field-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-error {
  min-height: 0;
  color: var(--danger);
  font-size: 13px;
}

.field-error:empty { display: none; }

.char-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12.5px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-note {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 18, 31, .3);
  border-top-color: #06121f;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 14. 푸터 ---------- */
.site-footer {
  padding: 40px 0 32px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.footer-inner { display: grid; gap: 20px; }

.footer-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.footer-desc b { color: var(--text-soft); font-weight: 700; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  color: var(--text-soft);
  font-size: 14px;
}

.footer-nav a:hover { color: var(--primary); }

/* 상호 · 제품 등 회사 정보 */
.company-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  font-size: 12.5px;
}

.company-info li {
  display: flex;
  gap: 8px;
}

.company-info span { color: #64748b; }
.company-info b { color: var(--text-soft); font-weight: 600; }

.disclaimer {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.7;
}

.copyright {
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- 15. 토스트 ---------- */
.toast-stack {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14.5px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--ease), transform var(--ease);
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger); }

.toast-icon {
  flex: 0 0 auto;
  font-weight: 800;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon   { color: var(--danger); }

/* ---------- 16. 스크롤 등장 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 17. 반응형 ---------- */
@media (min-width: 640px) {
  .hero { padding: 80px 0 88px; }
  .hero-title { font-size: 44px; }
  .hero-desc { font-size: 17px; }
  .hero-actions { flex-direction: row; justify-content: center; }
  .stat-strip { grid-template-columns: repeat(4, 1fr); }
  .section { padding: 80px 0; }
  .section-title { font-size: 32px; }
  .contact-form { padding: 32px; }
  .footer-inner { gap: 24px; }
  .toast-stack { left: auto; right: 24px; bottom: 24px; width: 360px; }
}

@media (min-width: 900px) {
  :root { --header-h: 72px; }

  .nav-toggle { display: none; }
  .nav-backdrop { display: none; }

  .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    border: 0;
    transform: none;
    overflow: visible;
  }

  .nav-link { padding: 8px 12px; font-size: 14.5px; }
  .nav-cta { margin-top: 0; margin-left: 8px; padding: 10px 18px; font-size: 14.5px; }

  .brand-text { font-size: 21px; }

  .hero { padding: 104px 0 104px; }
  .hero-title { font-size: 56px; }
  .hero-badge { font-size: 14px; }
  .section { padding: 104px 0; }
  .section-title { font-size: 36px; }

  .grid-features { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .grid-strategies { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .steps { grid-template-columns: repeat(3, 1fr); }

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .company-info,
  .disclaimer,
  .copyright { grid-column: 1 / -1; }
}

/* ---------- 18. 접근성: 모션 최소화 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms;
    animation-iteration-count: 1;
    transition-duration: .01ms;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}