@font-face {
  font-family: 'Fraunces';
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  src: url('fonts/fraunces.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  src: url('fonts/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  src: url('fonts/jetbrains-mono.woff2') format('woff2');
}

:root {
  --bg: #12161B;
  --bg-elevated: #1A1F26;
  --text: #EEF1F4;
  --text-muted: #8B96A0;
  --accent: #5B83FF;
  --accent-hover: #7B9AFF;
  --border: #2A3138;
  --border-hover: #39424B;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.45);
  --live: #3DDB96;
  --live-bg: rgba(61,219,150,.14);
  --work: #F0A94A;
  --work-bg: rgba(240,169,74,.14);
  --stop: #E2685A;
  --stop-bg: rgba(226,104,90,.14);
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --grad-a: #FF8A3D;
  --grad-b: #FF2F8F;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center;
}

.topbar {
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(18,22,27,.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; position: relative; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--text); }
.wordmark:hover { color: var(--text); text-decoration: none; }
.wordmark img { width: 20px; height: 20px; }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-link { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav-link:hover { color: var(--text); text-decoration: none; }

.nav-cta-group { display: flex; align-items: center; gap: 12px; }
.nav-login, .nav-signup {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: 0.15s;
  white-space: nowrap;
}
.nav-login {
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.nav-login:hover { color: var(--text); border-color: var(--border-hover); text-decoration: none; }
.nav-signup {
  background: var(--text);
  color: var(--bg);
}
.nav-signup:hover { background: var(--accent); color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.nav-toggle:hover { border-color: var(--border-hover); }

.nav-panel {
  display: none;
  flex-direction: column;
  gap: 4px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 50;
}
.nav-panel[data-open="true"] { display: flex; }
.nav-panel .nav-link { padding: 10px 12px; border-radius: 8px; }
.nav-panel .nav-link:hover { background: var(--bg); text-decoration: none; }

@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}
@media (max-width: 480px) {
  .nav-login, .nav-signup { padding: 7px 12px; font-size: 0.82rem; }
  .nav-cta-group { gap: 8px; }
}

.site-footer { padding: 32px 0; border-top: 1px solid var(--border); margin-top: 64px; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  color: var(--text-muted); font-size: 0.85rem;
}
.footer-inner .wordmark { color: var(--text); font-size: 0.95rem; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-social { color: var(--text-muted); }
.footer-social:hover { color: var(--accent); }

@media (max-width: 560px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .container { padding: 0 16px; }
}

/* ---------- legal pages ---------- */
.legal-main { padding: 56px 0 96px; }
.legal-main h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 8px; }
.legal-updated { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 40px; }
.legal-main section { max-width: 680px; margin-bottom: 28px; }
.legal-main h2 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; margin-bottom: 8px; }
.legal-main p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.65; }
.legal-back { display: inline-block; margin-bottom: 32px; font-size: 0.9rem; }

/* ---------- blog ---------- */
.blog-main { padding: 56px 0 96px; }
.blog-main h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 40px; }
.blog-back { display: inline-block; margin-bottom: 32px; font-size: 0.9rem; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.blog-card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}
.blog-card:hover { border-color: var(--border-hover); text-decoration: none; }
.blog-card-date { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 8px; }
.blog-card-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.blog-card-excerpt { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }

.article-header { max-width: 720px; margin-bottom: 40px; }
.article-header h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 4.5vw, 2.6rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 10px; }
.article-date { color: var(--text-muted); font-size: 0.85rem; }

.article-body { max-width: 720px; }
.article-body p { color: var(--text-muted); font-size: 1rem; line-height: 1.75; margin-bottom: 20px; }
.article-body h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; color: var(--text); margin: 40px 0 14px; letter-spacing: -0.01em; }
.article-body h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; color: var(--text); margin: 28px 0 10px; }
.article-body h4 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; color: var(--text); margin: 20px 0 8px; }
.article-body ul, .article-body ol { color: var(--text-muted); font-size: 1rem; line-height: 1.75; margin: 0 0 20px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body li strong { color: var(--text); }
.article-body p strong { color: var(--text); }
.article-body pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 8px 0 28px;
  overflow-x: auto;
  line-height: 1.6;
}
.article-body code { font-family: var(--font-mono); font-size: 0.9em; color: var(--text); }

/* ---------- motion utilities ----------
   Progressive enhancement: elements are fully visible by default. The `js-motion`
   class is added to <html> by an inline head script only when JS runs and the
   visitor has not asked for reduced motion, so a no-JS page is never blank. */
.js-motion [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js-motion [data-reveal].revealed { opacity: 1; transform: none; }

/* Cursor-tracking spotlight. `--mx`/`--my` are written by shared.js on pointer move. */
.spotlight { position: relative; }
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%), rgba(91,131,255,0.13), transparent 72%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.spotlight:hover::after { opacity: 1; }

.text-gradient {
  background-image: linear-gradient(100deg, var(--grad-a), var(--grad-b) 55%, var(--accent-hover));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- command strip ---------- */
.cmd-block { display: flex; flex-direction: column; gap: 8px; }
.cmd {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px 11px 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  transition: border-color 0.2s;
}
.cmd:hover { border-color: var(--border-hover); }
/* min-width:0 is required: without it the flex item refuses to shrink below the
   nowrap text's min-content width, which widens the whole column on narrow screens. */
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.cmd code::-webkit-scrollbar { display: none; }
.cmd-prompt { color: var(--text-muted); user-select: none; }
.cmd-copy {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s;
}
.cmd-copy:hover { color: var(--text); border-color: var(--border-hover); }
.cmd-copy[data-copied="true"] { color: var(--live); border-color: var(--live); }

.topbar { transition: background 0.25s ease, box-shadow 0.25s ease; }
.topbar.topbar-scrolled {
  background: rgba(18,22,27,.94);
  box-shadow: 0 8px 30px rgba(0,0,0,.42);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spotlight::after { display: none; }
}
