/* ============================================================
   Spiracle KB — Support Home page styles (page-specific)
   Shared design system lives in base.css.
   ============================================================ */

/* ---------- Hero ---------- */
body.spirale-home .hero {
  position: relative; overflow: hidden;
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1200px 400px at 50% -120px, rgba(99, 102, 241, .14), transparent 60%),
    radial-gradient(900px 360px at 100% 0%, rgba(124, 58, 237, .08), transparent 60%),
    var(--bg);
}
body.spirale-home .hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(15,23,42,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,23,42,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 80%);
  pointer-events: none;
}
body.spirale-home .hero-inner { position: relative; text-align: center; max-width: 760px; margin: 0 auto; }
body.spirale-home .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  box-shadow: var(--shadow-sm);
}
body.spirale-home .eyebrow .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--emerald); box-shadow: 0 0 0 3px rgba(5,150,105,.18); }
body.spirale-home .hero h1 {
  font-size: clamp(36px, 5.5vw, 60px);
  line-height: 1.05; letter-spacing: -0.025em;
  font-weight: 800; margin: 22px 0 14px;
  color: var(--ink);
}
body.spirale-home .hero h1 .grad {
  background: linear-gradient(120deg, #4F46E5 0%, #7C3AED 50%, #4F46E5 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.spirale-home .hero p.lead {
  color: var(--ink-2); font-size: 18px; max-width: 560px; margin: 0 auto 32px;
}

/* ---------- Search ---------- */
body.spirale-home .search-wrap { position: relative; max-width: 620px; margin: 0 auto; }
body.spirale-home .search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
body.spirale-home .search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .14), var(--shadow);
}
body.spirale-home .search svg.lead { color: var(--ink-3); flex: none; }
body.spirale-home .search input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 15.5px; padding: 10px 0; color: var(--ink);
  width: 100%;
}
body.spirale-home .search input::placeholder { color: var(--ink-3); }
body.spirale-home .search kbd {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px; color: var(--ink-3);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 6px; border-radius: 6px;
}
body.spirale-home .search button {
  height: 40px; padding: 0 16px; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
}
body.spirale-home .search button:hover { background: #1E293B; }

body.spirale-home .popular {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap; margin-top: 18px; font-size: 13px; color: var(--ink-3);
}
body.spirale-home .popular .label { color: var(--ink-3); }
body.spirale-home .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  transition: all .15s;
}
body.spirale-home .chip:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }

/* ---------- Section header ---------- */
body.spirale-home section { padding: 72px 0; }
body.spirale-home .sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 32px; gap: 20px; flex-wrap: wrap;
}
body.spirale-home .sec-head .left { max-width: 560px; }
body.spirale-home .sec-kicker { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
body.spirale-home .sec-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 6px; color: var(--ink); }
body.spirale-home .sec-sub { color: var(--ink-2); font-size: 15.5px; }
body.spirale-home .sec-link { color: var(--brand); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
body.spirale-home .sec-link:hover { color: var(--brand-ink); }

/* ---------- Forum category cards ---------- */
body.spirale-home .cats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
body.spirale-home .cat {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
body.spirale-home .cat:hover { border-color: #D8DBE5; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
body.spirale-home .cat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
body.spirale-home .cat-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
}
body.spirale-home .cat-icon.amber { background: var(--amber-soft); color: var(--amber); }
body.spirale-home .cat-icon svg { width: 22px; height: 22px; }
body.spirale-home .badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2);
}
body.spirale-home .badge .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--ink-3); }
body.spirale-home .badge.live .dot { background: var(--emerald); box-shadow: 0 0 0 3px rgba(5,150,105,.18); }
body.spirale-home .badge.pro { background: #FFF7ED; color: #B45309; border-color: #FED7AA; }

body.spirale-home .cat h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 18px 0 6px; }
body.spirale-home .cat p.desc { color: var(--ink-2); font-size: 14.5px; margin: 0 0 14px; }
body.spirale-home .cat .meta { display: flex; gap: 18px; color: var(--ink-3); font-size: 13px; margin-bottom: 18px; flex-wrap: wrap; }
body.spirale-home .cat .meta b { color: var(--ink); font-weight: 600; }

body.spirale-home .cat-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; border-top: 1px dashed var(--line-strong);
  gap: 10px; flex-wrap: wrap;
}
body.spirale-home .cat-foot .count { font-size: 13px; color: var(--ink-3); }
body.spirale-home .cat-foot .count b { color: var(--ink); font-weight: 600; }
body.spirale-home .cat-foot .actions { display: flex; align-items: center; gap: 8px; }
body.spirale-home .cat-foot .btn-ask {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px;
  background: var(--ink); color: #fff;
  font-size: 12.5px; font-weight: 600;
  transition: background .15s;
}
body.spirale-home .cat-foot .btn-ask:hover { background: #1E293B; }
body.spirale-home .cat.amber-card .cat-foot .btn-ask { background: var(--amber); }
body.spirale-home .cat.amber-card .cat-foot .btn-ask:hover { background: #92400E; }
body.spirale-home .link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand); font-weight: 600; font-size: 13.5px;
}
body.spirale-home .cat.amber-card .link-arrow { color: var(--amber); }
body.spirale-home .link-arrow svg { transition: transform .15s; }
body.spirale-home .link-arrow:hover svg { transform: translateX(2px); }

/* ---------- Recent topics ---------- */
body.spirale-home .topics-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
body.spirale-home .tabs {
  display: flex; gap: 4px; padding: 8px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #FAFAFC, #fff);
  flex-wrap: wrap;
}
body.spirale-home .tab {
  padding: 8px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: all .15s;
}
body.spirale-home .tab:hover { background: var(--surface-2); color: var(--ink); }
body.spirale-home .tab.is-active { background: var(--ink); color: #fff; }
body.spirale-home .tab .count {
  margin-left: 6px; font-size: 12px; font-weight: 500;
  color: inherit; opacity: .65;
}

body.spirale-home .topic-list { list-style: none; padding: 0; margin: 0; }
body.spirale-home .topic {
  display: grid; grid-template-columns: 36px 1fr auto auto; gap: 16px;
  align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
body.spirale-home .topic:last-child { border-bottom: 0; }
body.spirale-home .topic:hover { background: #FAFAFC; }
body.spirale-home .avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
}
body.spirale-home .avatar.a2 { background: linear-gradient(135deg, #F59E0B, #EF4444); }
body.spirale-home .avatar.a3 { background: linear-gradient(135deg, #10B981, #06B6D4); }
body.spirale-home .avatar.a4 { background: linear-gradient(135deg, #EC4899, #8B5CF6); }
body.spirale-home .avatar.a5 { background: linear-gradient(135deg, #3B82F6, #06B6D4); }
body.spirale-home .avatar.a6 { background: linear-gradient(135deg, #14B8A6, #84CC16); }

body.spirale-home .topic-main { min-width: 0; }
body.spirale-home .topic-title {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  margin: 0 0 4px; letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.spirale-home .topic-title a:hover { color: var(--brand); }
body.spirale-home .topic-meta {
  font-size: 12.5px; color: var(--ink-3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
body.spirale-home .topic-meta a { color: var(--ink-2); font-weight: 500; }
body.spirale-home .topic-meta a:hover { color: var(--brand); }
body.spirale-home .topic-meta .sep { color: #CBD2DD; }
body.spirale-home .pill {
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
}
body.spirale-home .pill.solved { background: var(--emerald-soft); color: var(--emerald); border-color: #A7F3D0; }
body.spirale-home .pill.hot { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }

body.spirale-home .topic-stats { text-align: right; min-width: 86px; }
body.spirale-home .topic-stats .n { font-size: 15px; font-weight: 700; color: var(--ink); }
body.spirale-home .topic-stats .l { font-size: 11.5px; color: var(--ink-3); }
body.spirale-home .topic-time { font-size: 12.5px; color: var(--ink-3); min-width: 70px; text-align: right; }

body.spirale-home .topics-foot {
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  background: #FAFAFC; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3);
}

body.spirale-home .empty-state {
  padding: 40px 24px; text-align: center; color: var(--ink-3); font-size: 14px;
}

/* ---------- Resources ---------- */
body.spirale-home .res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
body.spirale-home .res {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); transition: all .18s;
}
body.spirale-home .res:hover { border-color: #D8DBE5; box-shadow: var(--shadow); transform: translateY(-2px); }
body.spirale-home .res-ic {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; color: var(--brand-ink); background: var(--brand-soft);
}
body.spirale-home .res-ic svg { width: 20px; height: 20px; }
body.spirale-home .res-ic.green { color: var(--emerald); background: var(--emerald-soft); }
body.spirale-home .res-ic.amber { color: var(--amber); background: var(--amber-soft); }
body.spirale-home .res-ic.rose { color: #E11D48; background: #FFE4E6; }
body.spirale-home .res h4 { font-size: 15.5px; font-weight: 600; margin: 4px 0 0; letter-spacing: -0.01em; }
body.spirale-home .res p { font-size: 13.5px; color: var(--ink-2); margin: 0; }
body.spirale-home .res .more {
  margin-top: auto; padding-top: 8px;
  font-size: 13px; font-weight: 600; color: var(--brand);
  display: inline-flex; align-items: center; gap: 6px;
}

/* ---------- Hero trust strip ---------- */
body.spirale-home .trust-strip {
  margin: 36px auto 0; max-width: 720px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
body.spirale-home .trust-cell { padding: 14px 16px; border-right: 1px solid var(--line); text-align: left; }
body.spirale-home .trust-cell:last-child { border-right: 0; }
body.spirale-home .trust-cell .n { font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -0.015em; }
body.spirale-home .trust-cell .n .unit { color: var(--ink-3); font-size: 13px; font-weight: 600; margin-left: 2px; }
body.spirale-home .trust-cell .l { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; font-weight: 500; }
@media (max-width: 560px) {
  body.spirale-home .trust-strip { grid-template-columns: 1fr 1fr; }
  body.spirale-home .trust-cell:nth-child(2) { border-right: 0; }
  body.spirale-home .trust-cell:nth-child(1), body.spirale-home .trust-cell:nth-child(2) { border-bottom: 1px solid var(--line); }
}

/* ---------- Slide-in New Topic drawer ---------- */
body.spirale-home .drawer-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11, 15, 26, .42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
body.spirale-home .drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

body.spirale-home .drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 101;
  width: min(560px, 100%);
  background: var(--bg);
  box-shadow: -24px 0 60px -12px rgba(15, 23, 42, .22);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.2, .7, .2, 1);
  display: flex; flex-direction: column;
}
body.spirale-home .drawer.is-open { transform: translateX(0); }
body.spirale-home .drawer-head {
  padding: 22px 26px 18px; border-bottom: 1px solid var(--line);
  background: var(--surface); position: relative;
}
body.spirale-home .drawer-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 4px; }
body.spirale-home .drawer-head p { margin: 0; font-size: 13px; color: var(--ink-2); }
body.spirale-home .drawer-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-2);
  transition: background .15s, color .15s;
}
body.spirale-home .drawer-close:hover { background: var(--surface-2); color: var(--ink); }

body.spirale-home .drawer-body { flex: 1; overflow-y: auto; padding: 22px 26px; }
body.spirale-home .drawer-foot {
  padding: 16px 26px; border-top: 1px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
body.spirale-home .drawer-foot .hint { font-size: 12px; color: var(--ink-3); }

/* form */
body.spirale-home .field { margin-bottom: 16px; }
body.spirale-home .field > label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
body.spirale-home .field > label .req { color: #DC2626; font-weight: 700; }
body.spirale-home .field > label .hint { color: var(--ink-3); font-weight: 500; font-size: 12px; margin-left: auto; }
body.spirale-home .field input[type="text"],
body.spirale-home .field input[type="email"],
body.spirale-home .field input[type="url"],
body.spirale-home .field select,
body.spirale-home .field textarea {
  width: 100%; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
body.spirale-home .field input:focus,
body.spirale-home .field select:focus,
body.spirale-home .field textarea:focus {
  outline: 0; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .14);
}
body.spirale-home .field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }

body.spirale-home .field .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) {
  body.spirale-home .field .row2 { grid-template-columns: 1fr; }
}

body.spirale-home .editor-bar {
  display: flex; gap: 2px; padding: 6px; border: 1px solid var(--line-strong);
  border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2);
}
body.spirale-home .editor-bar button {
  width: 30px; height: 30px; border-radius: 6px; color: var(--ink-2);
  display: grid; place-items: center; transition: background .12s, color .12s;
}
body.spirale-home .editor-bar button:hover { background: var(--surface); color: var(--ink); }
body.spirale-home .editor-bar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
body.spirale-home .editor-bar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
body.spirale-home .editor-note {
  margin-top: 8px; font-size: 12px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}
body.spirale-home .editor-note svg { color: var(--amber); flex: none; }

body.spirale-home .radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.spirale-home .radio-card {
  position: relative; display: block; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer;
  transition: all .15s; background: var(--surface);
}
body.spirale-home .radio-card input { position: absolute; opacity: 0; }
body.spirale-home .radio-card .rc-top { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
body.spirale-home .radio-card .rc-top .dot {
  width: 14px; height: 14px; border-radius: 999px;
  border: 2px solid var(--ink-3); flex: none; transition: all .15s;
}
body.spirale-home .radio-card .rc-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
body.spirale-home .radio-card:hover { border-color: #CBD2DD; }
body.spirale-home .radio-card input:checked ~ .rc-top .dot {
  border-color: var(--brand); background: radial-gradient(circle, var(--brand) 0 4px, transparent 5px);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .18);
}
body.spirale-home .radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
body.spirale-home .radio-card.pro:has(input:checked) { border-color: var(--amber); background: var(--amber-soft); }
body.spirale-home .radio-card.pro:has(input:checked) .rc-top .dot {
  border-color: var(--amber); background: radial-gradient(circle, var(--amber) 0 4px, transparent 5px);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, .18);
}

body.spirale-home .checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink-2); }
body.spirale-home .checkbox input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
body.spirale-home .checkbox a { color: var(--brand); font-weight: 500; }

body.spirale-home .rules-callout {
  margin: 6px 0 18px; padding: 12px 14px; border-radius: 10px;
  background: var(--brand-soft); border: 1px solid #DDE1FF;
  font-size: 12.5px; color: var(--brand-ink); display: flex; gap: 10px;
}
body.spirale-home .rules-callout svg { flex: none; color: var(--brand); margin-top: 1px; }
body.spirale-home .rules-callout b { color: var(--ink); }

body.spirale-home .drawer-msg {
  padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px;
  display: none;
}
body.spirale-home .drawer-msg.is-error { display: block; background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
body.spirale-home .drawer-msg.is-success { display: block; background: var(--emerald-soft); color: var(--emerald); border: 1px solid #A7F3D0; }

/* ---------- Home responsive ---------- */
@media (max-width: 960px) {
  body.spirale-home .cats { grid-template-columns: 1fr; }
  body.spirale-home .res-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  body.spirale-home section { padding: 56px 0; }
  body.spirale-home .hero { padding: 64px 0 48px; }
  body.spirale-home .topic { grid-template-columns: 32px 1fr; }
  body.spirale-home .topic-stats, body.spirale-home .topic-time { display: none; }
  body.spirale-home .sec-title { font-size: 26px; }
  body.spirale-home .res-grid { grid-template-columns: 1fr; }
  body.spirale-home .search kbd { display: none; }
  body.spirale-home .search button { padding: 0 12px; }
}
