/* ============================================================
   Bullish Path - Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  color-scheme: light;

  /* Typography */
  --font-head: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: clamp(1.75rem, 3vw, 2.5rem);
  --fs-3xl: clamp(2.25rem, 5vw, 3.75rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Radius + shadow */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.06);

  /* Light theme */
  --bg: #f7f5f0;
  --bg-elevated: #f1ede5;
  --surface: #ffffff;
  --surface-muted: #fcfaf6;
  --surface-strong: #f6f2eb;
  --border: #e5ddd0;
  --border-strong: #d7cbb7;
  --text: #1f2933;
  --text-soft: #52606d;
  --text-muted: #7b8794;
  --accent: #c9781a;
  --accent-strong: #aa6410;
  --accent-soft: rgba(201, 120, 26, 0.12);
  --accent-contrast: #ffffff;
  --success: #2f855a;
  --error: #c53030;
  --warning: #b7791f;
  --info: #8a5a17;
  --grad: linear-gradient(180deg, #d88a2a 0%, #c9781a 100%);
  --grad2: linear-gradient(180deg, #d88a2a 0%, #c9781a 100%);

  --nav-h: 76px;
  --container: 1180px;
  --transition: 180ms ease;

  /* Backward-compatible aliases used in page-level styles */
  --bg2: var(--surface-muted);
  --bg3: var(--surface-strong);
  --surface2: var(--surface-strong);
  --border2: var(--border-strong);
  --text2: var(--text-soft);
  --text3: var(--text-muted);
  --accent2: var(--accent);
  --radius: var(--radius-sm);
  --radius2: var(--radius-lg);
  --shadow: var(--shadow-sm);
  --shadow2: var(--shadow-md);
}

html[data-theme='dark'] {
  color-scheme: dark;

  --bg: #1d1a17;
  --bg-elevated: #26221f;
  --surface: #24201d;
  --surface-muted: #2a2522;
  --surface-strong: #312b27;
  --border: #3a332d;
  --border-strong: #4a4037;
  --text: #f5f1ea;
  --text-soft: #d3c8bc;
  --text-muted: #ac9f92;
  --accent: #e39a3a;
  --accent-strong: #f0ab4f;
  --accent-soft: rgba(227, 154, 58, 0.18);
  --accent-contrast: #16120f;
  --success: #68d391;
  --error: #fc8181;
  --warning: #f6ad55;
  --info: #f6ad55;
  --grad: linear-gradient(180deg, #e7a54c 0%, #d88a2a 100%);
  --grad2: linear-gradient(180deg, #e7a54c 0%, #d88a2a 100%);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 34px rgba(0, 0, 0, 0.2);

  --bg2: var(--surface-muted);
  --bg3: var(--surface-strong);
  --surface2: var(--surface-strong);
  --border2: var(--border-strong);
  --text2: var(--text-soft);
  --text3: var(--text-muted);
  --accent2: var(--accent);
  --radius: var(--radius-sm);
  --radius2: var(--radius-lg);
  --shadow: var(--shadow-sm);
  --shadow2: var(--shadow-md);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

body,
a,
button,
input,
textarea,
select,
.navbar,
.footer,
.card,
.site-toast,
.mobile-menu {
  transition:
    background-color var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

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

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

ul {
  list-style: none;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.section {
  padding: var(--space-20) 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.gold,
.badge.green,
.badge.cyan {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--accent-strong);
}

.section-title {
  font-family: var(--font-head);
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.section-sub {
  max-width: 42rem;
  margin-top: var(--space-3);
  color: var(--text-soft);
  font-size: var(--fs-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-outline {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn.is-loading {
  background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

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

.nav-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.nav-logo span {
  color: var(--accent);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.nav-links a {
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface-muted);
}

.nav-links a.active {
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav-cta {
  background: var(--accent-soft);
  color: var(--accent-strong) !important;
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--accent-contrast) !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 40px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.theme-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow-sm);
}

html[data-theme='dark'] .theme-toggle-thumb {
  transform: translateX(18px);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-8);
  box-shadow: none;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-6);
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
}

.ad-slot {
  margin: var(--space-10) 0;
  padding: var(--space-8);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
}

.ad-slot::before {
  content: '[ AD SLOT ]';
  display: block;
  margin-bottom: var(--space-2);
}

.footer {
  margin-top: var(--space-16);
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-10);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--border);
}

.footer-brand p {
  max-width: 20rem;
  margin-top: var(--space-4);
  color: var(--text-soft);
}

.footer-col h4 {
  margin-bottom: var(--space-4);
  color: var(--text-muted);
  font-family: var(--font-head);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-col a {
  display: block;
  padding: 0.25rem 0;
  color: var(--text-soft);
}

.footer-col a:hover {
  color: var(--accent-strong);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-6);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.footer-socials {
  display: flex;
  gap: var(--space-3);
}

.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text-soft);
}

.footer-socials a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.form-status {
  min-height: 24px;
  margin-top: var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.form-status.is-success {
  color: var(--success);
}

.form-status.is-error {
  color: var(--error);
}

.form-status.is-info {
  color: var(--info);
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 14%, transparent) !important;
}

.site-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  max-width: min(360px, calc(100vw - 32px));
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

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

.site-toast.is-success {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}

.site-toast.is-error {
  border-color: color-mix(in srgb, var(--error) 35%, var(--border));
}

.site-toast.is-info {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 1px;
  background: var(--border-strong);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-8);
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 0.35rem;
  left: -22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}

.timeline-item.done::before {
  background: var(--success);
}

.timeline-item h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
}

.timeline-item p {
  margin-top: var(--space-2);
  color: var(--text-soft);
  font-size: var(--fs-sm);
}

.progress-bar {
  overflow: hidden;
  height: 6px;
  margin-top: var(--space-2);
  border-radius: 999px;
  background: var(--bg-elevated);
}

.progress-bar .fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 999;
  padding: var(--space-8);
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a,
.mobile-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 600;
}

.mobile-menu a.active {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.page-header {
  padding: calc(var(--nav-h) + var(--space-12)) 0 var(--space-12);
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  text-align: center;
}

.page-header h1 {
  margin-top: var(--space-4);
  font-family: var(--font-head);
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.page-header p {
  max-width: 40rem;
  margin: var(--space-4) auto 0;
  color: var(--text-soft);
  font-size: var(--fs-lg);
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--surface-muted);
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--surface-muted);
  border-radius: 999px;
  background: var(--border-strong);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.45s ease both;
}

.fade-up-1 {
  animation-delay: 0.06s;
}

.fade-up-2 {
  animation-delay: 0.12s;
}

.fade-up-3 {
  animation-delay: 0.18s;
}

.fade-up-4 {
  animation-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: inline-flex;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .section {
    padding: var(--space-16) 0;
  }

  .section-sm {
    padding: var(--space-10) 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .theme-toggle-label {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 1.25rem, var(--container));
  }

  .card-grid,
  .card-grid-2 {
    grid-template-columns: 1fr;
  }

  .site-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}
