/* ═══════════════════════════════════════════════════════════════════
   ArkSeed — shared design system
   Used across careers / login / profile / apply / insiders pages.
   index.html has its own (large) inline styles for the marketing
   homepage; this file is JUST the cross-page primitives.
═══════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ── */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { box-sizing: border-box; margin: 0; padding: 0; }
*, *::before, *::after { -webkit-tap-highlight-color: rgba(109,40,217,0.08); }

:root {
  --bg: #f9f8f6;
  --surface: #ffffff;
  --surface-2: #f4f3f0;          /* subtle elevated tint */
  --border: rgba(0,0,0,0.07);
  --border-strong: rgba(0,0,0,0.12);
  --ink: #18181b;
  --text: #52525b;
  --muted: #6b6b70;
  --accent: #6d28d9;
  --accent-hover: #5b21b6;
  --accent-soft: rgba(109,40,217,0.08);
  --accent-line: rgba(109,40,217,0.25);
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 100px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.06);
  --shadow-lift: 0 12px 32px rgba(109,40,217,0.08);
  --transition: 0.2s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  min-height: 100vh;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Subtle paper-grain (matches homepage) */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
}

/* Keyboard focus rings */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; top: -100px; left: 12px; z-index: 1000;
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus { top: 12px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-up { opacity: 1 !important; transform: none !important; }
}

/* ═══════════════════════════════════
   NAV (shared across all sub-pages)
═══════════════════════════════════ */
.app-nav {
  display: flex; align-items: center;
  padding: 16px 0;
  /* Align nav content to the same 1180px centered column as the page.
     On wide viewports, that pushes the brand and nav-end inward to match
     where the page content actually starts/ends. On narrow viewports
     this falls back to a 32px gutter. Safe-area-inset is honored. */
  padding-left: max(32px, calc((100vw - 1180px) / 2), env(safe-area-inset-left));
  padding-right: max(32px, calc((100vw - 1180px) / 2), env(safe-area-inset-right));
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(249,248,246,0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 100;
}
.app-nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.app-nav .brand img { height: 26px; width: auto; }
.app-nav .brand-name { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.4px; }
.app-nav .nav-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
/* Ghost-button styling — sits between a plain link and the primary CTA.
   Outlined accent pill that lights up on hover, with an arrow that nudges
   right. Compact enough to live next to Sign in / Sign out without
   competing with them. */
.app-nav .nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-size: 13px; font-weight: 500;
  text-decoration: none; font-family: inherit; cursor: pointer;
  padding: 7px 14px; border-radius: 100px;
  background: transparent;
  border: 1px solid var(--accent-line);
  letter-spacing: -0.1px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.app-nav .nav-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 4px 14px -8px rgba(109,40,217,0.45);
}
.app-nav .nav-link.is-active { color: var(--accent); border-color: var(--accent); }

/* Match the pill radius on auth buttons sitting inside the nav so the
   shapes harmonize. Only scoped to .nav-end to avoid affecting the
   default .btn-sm radius elsewhere. */
.app-nav .nav-end .btn { border-radius: var(--radius-pill); }

@media (max-width: 640px) {
  .app-nav { padding: 12px 18px; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .app-nav .brand img { height: 22px; }
  .app-nav .brand-name { font-size: 15px; }
  .app-nav .nav-end { gap: 14px; }
  .app-nav .nav-link { font-size: 12.5px; padding: 7px 12px; }
  .app-nav .nav-link.hide-on-mobile { display: none; }
  .app-nav .nav-end .btn-sm { padding: 8px 14px; font-size: 12.5px; min-height: 36px; }
}

/* ═══════════════════════════════════
   PAGE LAYOUT
═══════════════════════════════════ */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 32px 96px;
}
.page-tight { max-width: 720px; }
.page-wide  { max-width: 1320px; }

@media (max-width: 640px) {
  .page { padding: 40px 20px 72px; }
}

/* ═══════════════════════════════════
   TYPOGRAPHY PRIMITIVES
═══════════════════════════════════ */
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; line-height: 1.1; letter-spacing: -1px; }
h1 { font-size: clamp(34px, 4.6vw, 48px); letter-spacing: -1.4px; line-height: 1.05; }
h2 { font-size: clamp(24px, 2.8vw, 32px); letter-spacing: -0.8px; }
h3 { font-size: 18px; letter-spacing: -0.3px; }
h4 { font-size: 15px; letter-spacing: -0.2px; }
p  { color: var(--text); line-height: 1.6; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 500; color: var(--ink); }
small  { font-size: 12px; color: var(--muted); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; letter-spacing: 2.5px; text-transform: uppercase;
  font-weight: 500; color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow.eyebrow-line::before {
  content: ''; display: block; width: 22px; height: 1px; background: var(--accent);
}
.eyebrow.eyebrow-pill {
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.eyebrow-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}

.hero-sub { font-size: 16px; color: var(--text); max-width: 640px; line-height: 1.6; margin-top: 12px; }

/* ═══════════════════════════════════
   BUTTONS
═══════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  padding: 12px 22px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  text-decoration: none;
  min-height: 42px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.btn-primary { background: var(--accent); color: #fff; }
.btn.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.btn-secondary:hover:not(:disabled) { color: var(--accent); border-color: var(--accent-line); }
.btn.btn-ghost { background: transparent; color: var(--text); }
.btn.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--accent-soft); }
.btn.btn-danger { background: transparent; color: var(--danger); border-color: rgba(220,38,38,0.25); }
.btn.btn-danger:hover:not(:disabled) { background: rgba(220,38,38,0.05); border-color: rgba(220,38,38,0.5); }
.btn.btn-sm { font-size: 13px; padding: 9px 14px; min-height: 38px; }
.btn.btn-lg { font-size: 15px; padding: 14px 26px; min-height: 48px; }
.btn.btn-block { width: 100%; }
.btn .arrow { transition: transform var(--transition); }
.btn:hover .arrow { transform: translateX(2px); }

/* ═══════════════════════════════════
   FORMS
═══════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.field label { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--danger); }
.input, .textarea, .select {
  width: 100%; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 16px; color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }

.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-picker .tag {
  padding: 10px 16px; min-height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  font-size: 13px; font-weight: 400; color: var(--text);
  cursor: pointer; transition: all var(--transition); font-family: inherit;
  display: inline-flex; align-items: center;
}
.tag-picker .tag:hover { border-color: var(--accent-line); color: var(--accent); }
.tag-picker .tag.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ═══════════════════════════════════
   CARDS, BADGES, PILLS
═══════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  font-size: 11.5px; font-weight: 500; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.pill.pill-accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pill.pill-success { color: var(--success); border-color: rgba(22,163,74,0.25); background: rgba(22,163,74,0.07); }
.pill.pill-warn { color: var(--warn); border-color: rgba(217,119,6,0.25); background: rgba(217,119,6,0.07); }
.pill.pill-grey { color: var(--muted); border-color: var(--border); background: transparent; }

/* ═══════════════════════════════════
   FOOTER
═══════════════════════════════════ */
.app-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 40px 24px max(40px, calc(40px + env(safe-area-inset-bottom)));
  margin-top: 80px;
}
.app-footer img { height: 24px; width: auto; opacity: 0.7; margin-bottom: 14px; }
.app-footer p { font-size: 12.5px; color: var(--muted); }

/* ═══════════════════════════════════
   AVATAR — deterministic gradient from a seed
   Same candidate id = same colors everywhere.
═══════════════════════════════════ */
.avatar {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; letter-spacing: -0.5px;
  color: #fff;
  background: linear-gradient(135deg, var(--av-from, #6d28d9), var(--av-to, #a855f7));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15), inset 0 -10px 20px rgba(0,0,0,0.18);
  overflow: hidden;
}
.avatar::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22), transparent 55%);
  pointer-events: none;
}
.avatar.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.avatar-xl { width: 72px; height: 72px; font-size: 22px; }

/* ═══════════════════════════════════
   ATMOSPHERIC GLOW
   Reusable hero glow for sub-pages — soft, diffuse, no hard edges.
═══════════════════════════════════ */
.atmospheric-glow {
  position: absolute; pointer-events: none; filter: blur(6px);
  background:
    radial-gradient(ellipse at 50% 35%, rgba(124,58,237,0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 30% 60%, rgba(168,85,247,0.09) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(192,132,252,0.07) 0%, transparent 50%);
}

/* ═══════════════════════════════════
   PAPER CARD — adds the same noise to the surface as body::after
═══════════════════════════════════ */
.paper {
  position: relative;
}
.paper::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n2)'/%3E%3C/svg%3E");
  opacity: 0.022;
  z-index: 0;
}
.paper > * { position: relative; z-index: 1; }

/* ═══════════════════════════════════
   EDITORIAL TYPE
═══════════════════════════════════ */
.lead { font-size: 17px; line-height: 1.65; color: var(--text); }
.dropcap::first-letter {
  float: left; font-size: 60px; line-height: 0.9;
  margin: 4px 10px -4px 0;
  font-weight: 600; color: var(--accent); letter-spacing: -2px;
}

.numeral {
  display: inline-block;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  font-size: 11px; font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.numeral::after {
  content: ''; display: inline-block;
  width: 16px; height: 1px; background: var(--muted);
  vertical-align: 3px; margin-left: 8px;
  transition: width var(--transition), background var(--transition);
}

/* ═══════════════════════════════════
   STATUS DOT — pulsing accent dot
═══════════════════════════════════ */
.status-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 0 0 rgba(22,163,74,0.5);
  animation: statusPulse 2.2s ease infinite;
  vertical-align: 1px;
  margin-right: 6px;
}
@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* ═══════════════════════════════════
   UTILITIES
═══════════════════════════════════ */
.fade-up { opacity: 0; transform: translateY(12px); animation: fadeUp 0.4s ease both; }
.fade-up:nth-child(1) { animation-delay: 0.04s; }
.fade-up:nth-child(2) { animation-delay: 0.10s; }
.fade-up:nth-child(3) { animation-delay: 0.16s; }
.fade-up:nth-child(4) { animation-delay: 0.22s; }
.fade-up:nth-child(5) { animation-delay: 0.28s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Animated ellipsis (use as <span class="ellipsis"></span>) */
.ellipsis::after {
  content: ''; display: inline-block; width: 1em; text-align: left;
  animation: ellip 1.4s steps(4, end) infinite;
}
@keyframes ellip {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 500;
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty-state {
  text-align: center; padding: 80px 32px; color: var(--text);
}
.empty-state h3 { color: var(--ink); margin-bottom: 8px; }

.divider { height: 1px; background: var(--border); margin: 32px 0; border: 0; }

/* visible-only-to-screen-readers */
.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;
}
