/* ============================================
   FOUNDRY — Design System
   Apple-inspired: clean, calm, confident
   ============================================ */

:root {
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-dark: #000000;
  --bg-dark-elevated: #1d1d1f;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-on-dark: #f5f5f7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10), 0 24px 64px rgba(0,0,0,0.12);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Inter", sans-serif;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 17px;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

::selection { background: rgba(0, 113, 227, 0.18); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---------- Typography ---------- */
.display {
  font-size: clamp(44px, 7vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.headline {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}
.title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.subhead {
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.4;
  color: var(--text-secondary);
}
.eyebrow {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.gradient-text {
  background: linear-gradient(108deg, #0090f7 2%, #5f5cf0 36%, #b252e0 65%, #f64f59 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Layout ---------- */
.container { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.container-wide { width: min(1320px, calc(100% - 48px)); margin: 0 auto; }
section { padding: 110px 0; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 52px;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(251, 251, 253, 0.78);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease);
}
.nav-inner {
  width: min(1120px, calc(100% - 44px));
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo .logo-mark {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #0090f7, #5f5cf0 60%, #b252e0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: color 0.25s var(--ease);
}
.nav-links a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 980px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.28s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.02); }
.btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}
.btn-secondary:hover { background: rgba(0, 0, 0, 0.09); }
.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: #333; transform: scale(1.02); }
.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-lg { padding: 16px 32px; font-size: 18px; }
.btn-ghost { color: var(--accent); padding: 12px 8px; }
.btn-ghost:hover { text-decoration: underline; }
.btn:disabled { opacity: 0.45; pointer-events: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 980px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
}
.badge-red { background: rgba(255, 69, 58, 0.1); color: #d70015; }
.badge-green { background: rgba(48, 209, 88, 0.12); color: #1d8a3e; }
.badge-orange { background: rgba(255, 159, 10, 0.13); color: #c0760a; }
.badge-blue { background: rgba(0, 113, 227, 0.1); color: var(--accent); }
.badge-gray { background: rgba(0, 0, 0, 0.05); color: var(--text-secondary); }

/* ---------- Forms ---------- */
.input, .select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  appearance: none;
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}
.input::placeholder { color: var(--text-tertiary); }
label.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-light { border-color: rgba(255,255,255,0.3); border-top-color: #fff; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(29, 29, 31, 0.92);
  backdrop-filter: blur(20px);
  color: #fff;
  padding: 13px 22px;
  border-radius: 980px;
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeUp 0.45s var(--ease);
  max-width: min(520px, 90vw);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 720px) {
  section { padding: 72px 0; }
  .nav-links a:not(.btn) { display: none; }
}
