/* ============================================================
   Spiracle KB — Shared design system (base)
   Used by the Support Home and Single Topic templates.
   Fonts bundled locally (Inter + JetBrains Mono, SIL OFL 1.1).
   ============================================================ */

/* ---------- Fonts (local) ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #FBFBFD;
  --surface: #FFFFFF;
  --surface-2: #F4F4F7;
  --line: #ECECF1;
  --line-strong: #E2E2E8;
  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #7A8599;
  --brand: #4F46E5;
  --brand-2: #6366F1;
  --brand-soft: #EEF0FF;
  --brand-ink: #3730A3;
  --emerald: #059669;
  --emerald-soft: #ECFDF5;
  --amber: #B45309;
  --amber-soft: #FEF6E7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow: 0 4px 14px -2px rgba(15, 23, 42, .06), 0 2px 6px -1px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, .14), 0 8px 24px -8px rgba(15, 23, 42, .08);
  --maxw: 1300px;
}

/* ---------- Reset ---------- */
body.spirale-app *, body.spirale-app *::before, body.spirale-app *::after { box-sizing: border-box; }
body.spirale-app { margin: 0; padding: 0; }
body.spirale-app { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.spirale-app {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0F172A;
  background: #FBFBFD;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
body.spirale-app img, body.spirale-app svg { display: block; max-width: 100%; }
body.spirale-app a { color: inherit; text-decoration: none; }
body.spirale-app button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
body.spirale-app input, body.spirale-app textarea { font: inherit; }
body.spirale-app :focus-visible { outline: 2px solid #4F46E5; outline-offset: 2px; border-radius: 6px; }
body.spirale-app #bbp_topic_submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border: 0; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 16px -4px rgba(79, 70, 229, .45);
  transition: transform .12s ease, background .15s, box-shadow .15s;
}
body.spirale-app #bbp_topic_submit:hover { background: #4338CA; }
body.spirale-app #bbp_topic_submit:active { transform: translateY(1px); }
body.spirale-app #bbp_topic_submit::after {
  content: "";
  width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2 11 13M22 2l-7 20-4-9-9-4 20-7z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- Layout helpers ---------- */
.spirale-app .container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.spirale-app .stack { display: flex; flex-direction: column; }
.spirale-app .row { display: flex; align-items: center; }
.spirale-app .between { justify-content: space-between; }
.spirale-app .gap-8 { gap: 8px; } .spirale-app .gap-12 { gap: 12px; } .spirale-app .gap-16 { gap: 16px; } .spirale-app .gap-24 { gap: 24px; }
.spirale-app .wrap { flex-wrap: wrap; }
.spirale-app .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* ---------- Top bar ---------- */
.spirale-app .topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 251, 253, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.spirale-app .topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.spirale-app .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.spirale-app .brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, .45);
}
.spirale-app .brand-mark svg { width: 16px; height: 16px; }
.spirale-app .brand-name { font-size: 15px; }
.spirale-app .brand-name b { font-weight: 700; }
.spirale-app .brand-name span { color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.spirale-app .brand-img { max-height: 38px; width: auto; }

.spirale-app .nav { display: flex; align-items: center; gap: 4px; }
.spirale-app .nav a {
  padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--ink-2); transition: background .15s, color .15s;
}
.spirale-app .nav a:hover { background: var(--surface-2); color: var(--ink); }
.spirale-app .nav .is-active { color: var(--ink); }

.spirale-app .nav-cta { display: flex; align-items: center; gap: 8px; }
.spirale-app .btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  transition: transform .12s ease, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
}
.spirale-app .btn-ghost { color: var(--ink-2); }
.spirale-app .btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.spirale-app .btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.spirale-app .btn-primary:hover { background: #1E293B; }
.spirale-app .btn-brand { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -4px rgba(79, 70, 229, .45); }
.spirale-app .btn-brand:hover { background: #4338CA; }
.spirale-app .btn-outline { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.spirale-app .btn-outline:hover { border-color: #CBD2DD; background: #fff; }

.spirale-app .mobile-toggle { display: none; }

/* ---------- Footer ---------- */
.spirale-app footer {
  background: #0B0F1A; color: #CBD2DD;
  padding: 64px 0 32px;
  border-top: 1px solid #1E293B;
}
.spirale-app .foot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; }
.spirale-app .foot-brand .brand-name { color: #fff; }
.spirale-app .foot-brand .brand-name span { color: #94A3B8; }
.spirale-app .foot-brand p { color: #94A3B8; font-size: 14px; margin: 14px 0 18px; max-width: 280px; }
.spirale-app .socials { display: flex; gap: 8px; }
.spirale-app .social {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: #1E293B; color: #CBD2DD;
  transition: all .15s;
}
.spirale-app .social:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }
.spirale-app .social svg { width: 16px; height: 16px; }
.spirale-app .social i { font-size: 16px; line-height: 1; }
.spirale-app .foot-col h5 { color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 16px; }
.spirale-app .foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.spirale-app .foot-col a { color: #94A3B8; font-size: 14px; transition: color .15s; }
.spirale-app .foot-col a:hover { color: #fff; }
.spirale-app .foot-bottom {
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid #1E293B;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: #64748B; font-size: 13px;
}
.spirale-app .foot-bottom a { color: #94A3B8; }
.spirale-app .foot-bottom a:hover { color: #fff; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .spirale-app .reveal { opacity: 0; transform: translateY(8px); animation: spirale-reveal .6s cubic-bezier(.2,.7,.2,1) forwards; }
  .spirale-app .reveal.d1 { animation-delay: .05s; }
  .spirale-app .reveal.d2 { animation-delay: .1s; }
  .spirale-app .reveal.d3 { animation-delay: .15s; }
  .spirale-app .reveal.d4 { animation-delay: .16s; }
  @keyframes spirale-reveal { to { opacity: 1; transform: none; } }
}

/* ---------- Shared responsive ---------- */
@media (max-width: 960px) {
  .spirale-app .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

/* Nav collapses into a hamburger on tablet and narrower */
@media (max-width: 900px) {
  .spirale-app .nav { display: none; }
  .spirale-app .nav-cta .btn-ghost { display: none; }
  .spirale-app .nav-cta .mobile-toggle { display: inline-grid; }
}

@media (max-width: 720px) {
  .spirale-app .foot-grid { grid-template-columns: 1fr; }
}
