/* ========== COMPONENTS ========== */

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  user-select: none;
}

.btn-lg {
  padding: 13px 26px;
  font-size: 16px;
  border-radius: 10px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--text-tertiary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

/* ---- Section Header ---- */

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 400;
  letter-spacing: -1px;
  margin-bottom: 16px;
  color: var(--text);
}

.section-header h2 em {
  font-style: italic;
  color: var(--accent);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 16px;
}

/* ---- Navigation ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

/* Fallback for browsers without color-mix */
@supports not (background-color: color-mix(in srgb, red 50%, blue)) {
  [data-theme="dark"] .nav,
  :root:not([data-theme]) .nav {
    background-color: rgba(10, 10, 11, 0.88);
  }
  [data-theme="light"] .nav {
    background-color: rgba(250, 250, 249, 0.88);
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme]) .nav {
      background-color: rgba(250, 250, 249, 0.88);
    }
  }
}

.nav.nav-scrolled {
  box-shadow: 0 1px 0 var(--border), 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-mark {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--accent) 0%, #e06b1e 100%);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.logo-icon {
  height: 30px !important;
  width: auto !important;
  flex-shrink: 0;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

[data-theme="light"] .logo-icon {
  filter: brightness(0) !important;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .logo-icon {
    filter: brightness(0) !important;
  }
}

.logo-text {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.3px;
}

[data-theme="light"] .logo-text {
  color: var(--text);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .logo-text {
    color: var(--text);
  }
}

.logo-lockup {
  height: 36px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.nav .logo-lockup {
  height: 36px;
}

.footer .logo-lockup {
  height: 32px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  flex: 1;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: block;
}

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

.nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  background: transparent;
  border: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}

/* ---- Theme toggle switch ---- */

.theme-toggle {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 100px;
  outline: none;
}

.theme-toggle:focus-visible .theme-toggle-track {
  box-shadow: 0 0 0 2px var(--accent);
}

.theme-toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

[data-theme="light"] .theme-toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-tertiary);
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
  display: grid;
  place-items: center;
  font-size: 9px;
  line-height: 1;
}

.theme-toggle-thumb::after {
  content: '🌙';
  font-size: 9px;
  line-height: 1;
}

[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(18px);
  background: #fff;
}

[data-theme="light"] .theme-toggle-thumb::after {
  content: '☀️';
}

/* Mobile nav */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
  .nav .logo-icon { height: 26px; }
  .logo-text { font-size: 15px; }
  .footer .logo-lockup { height: 30px; }
}

/* ---- Footer ---- */

.footer {
  background-color: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 64px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .logo {
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.7;
  max-width: 220px;
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.15s;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom p {
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ---- Terminal dots (reusable) ---- */

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }
