/* ============================================================
   QRELLY v2.0 — DESIGN TOKENS
   Neomorphic soft-UI, single-hue lavender base, indigo→coral
   gradient signature, geometric display type.
   ============================================================ */
:root{
  --bg:#eef1fb;
  --sh-l:#ffffff;
  --sh-d:#c3c8e0;
  --ink:#181b2e;
  --ink-soft:#656a82;
  --ink-faint:#686b7b;
  --line:rgba(24,27,46,.08);

  --a1:#6a5cff;
  --a2:#c94766;
  --a3:#118058;
  --a4:#ffb648;
  --grad-brand:linear-gradient(135deg,var(--a1),var(--a2));

  --r-lg:28px; --r-md:18px; --r-sm:12px;
  --fn-display:'Space Grotesk',system-ui,sans-serif;
  --fn-body:'Inter',system-ui,sans-serif;
  --fn-mono:'JetBrains Mono',monospace;
  --ease:cubic-bezier(.16,1,.3,1);
  --max:520px;
}
:root[data-theme="dark"]{
  --bg:#14172a;
  --sh-l:#1f2340;
  --sh-d:#090b18;
  --ink:#f1f2fb;
  --ink-soft:#a4a8c4;
  --ink-faint:#7d81a0;
  --line:rgba(255,255,255,.08);
}

*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;min-width:0;}
html{-webkit-text-size-adjust:100%; overflow-x:hidden;}
body{
  overflow-x:hidden; max-width:100vw;
  background:var(--bg); color:var(--ink); font-family:var(--fn-body);
  min-height:100dvh;
  transition:background .35s var(--ease),color .35s var(--ease);
  font-size:15.5px; line-height:1.55;
}
h1,h2,h3,.disp{font-family:var(--fn-display); letter-spacing:-.02em;}
button{font-family:inherit; border:none; background:none; cursor:pointer; color:inherit;}
img{max-width:100%; display:block;}
a{color:var(--a1);}
@media (prefers-reduced-motion:reduce){*{animation-duration:.001s !important; transition-duration:.001s !important;}}

/* ---------- neomorphic primitives ---------- */
.raised{ background:var(--bg); box-shadow: 8px 8px 18px var(--sh-d), -8px -8px 18px var(--sh-l); }
.pressed{ background:var(--bg); box-shadow: inset 6px 6px 14px var(--sh-d), inset -6px -6px 14px var(--sh-l); }
.flat{ background:var(--bg); box-shadow: 4px 4px 10px var(--sh-d), -4px -4px 10px var(--sh-l); }

/* ---------- shared top bar ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 20px 8px; position:sticky; top:0; z-index:30; background:var(--bg);
}
.brand{display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit;}
.brand-mark{
  width:38px; height:38px; border-radius:12px; display:grid; place-items:center;
  background:var(--grad-brand); box-shadow:4px 4px 10px var(--sh-d); flex:0 0 auto;
}
.brand-mark svg{width:20px;height:20px;}
.brand-name{font-family:var(--fn-display); font-weight:700; font-size:19px;}
.topbar-actions{display:flex; gap:8px; align-items:center;}
.icon-btn{ width:42px; height:42px; border-radius:14px; display:grid; place-items:center; font-size:17px; }
.icon-btn:active{box-shadow:inset 4px 4px 10px var(--sh-d), inset -4px -4px 10px var(--sh-l);}
.tag-new{
  display:inline-block; font-size:10px; font-weight:700; letter-spacing:.05em;
  padding:2px 7px; border-radius:6px; background:var(--a3); color:#fff; margin-left:2px;
  vertical-align:middle; text-transform:uppercase;
}

/* ---------- hamburger menu ---------- */
.menu-panel{
  position:fixed; inset:0 0 0 auto; width:min(320px,86vw); z-index:60;
  background:var(--bg); padding:20px; transform:translateX(105%);
  transition:transform .32s var(--ease); box-shadow:-14px 0 30px rgba(0,0,0,.18);
  overflow-y:auto;
}
.menu-panel.open{transform:translateX(0);}
.menu-scrim{
  position:fixed; inset:0; background:rgba(10,10,25,.35); z-index:55; opacity:0; pointer-events:none;
  transition:opacity .3s var(--ease); backdrop-filter:blur(2px);
}
.menu-scrim.open{opacity:1; pointer-events:auto;}
.menu-link{
  display:flex; align-items:center; gap:12px; padding:14px 14px; border-radius:16px;
  font-weight:600; font-size:15px; margin-bottom:6px;
}
.menu-link.current{color:#fff; background:var(--grad-brand);}
.menu-close{ width:38px; height:38px; border-radius:12px; display:grid; place-items:center; margin-left:auto; }

/* ---------- footer ---------- */
footer.site-footer{
  margin-top:60px; padding:32px 20px calc(28px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);
}
.footer-inner{max-width:var(--max); margin:0 auto;}
.footer-links{display:flex; flex-wrap:wrap; gap:6px 18px; margin-bottom:16px;}
.footer-links a{font-size:13px; color:var(--ink-soft); text-decoration:none;}
.footer-links a:hover{color:var(--a1);}
.footer-meta{font-size:12px; color:var(--ink-faint); line-height:1.7;}

/* ---------- content/prose pages (about, faq, privacy, terms...) ---------- */
main.page{max-width:var(--max); margin:0 auto; padding:10px 20px 40px;}
.prose-card{border-radius:var(--r-lg); padding:26px 22px; margin-top:14px;}
.eyebrow{
  display:inline-flex; align-items:center; gap:.5rem; border-radius:999px;
  padding:.3rem .9rem; font-size:.72rem; font-weight:700; color:var(--a1);
  background:rgba(106,92,255,.1); margin-bottom:14px;
}
.prose-card h1{font-size:clamp(26px,7vw,34px); margin-bottom:10px;}
.prose-card h2{font-size:19px; margin:26px 0 10px;}
.prose-card p{margin-bottom:12px; color:var(--ink-soft);}
.prose-card p.lead{font-size:16px; color:var(--ink); font-weight:500;}
.prose-card ul{padding-left:20px; margin-bottom:14px;}
.prose-card li{margin-bottom:7px; color:var(--ink-soft);}
.prose-card li strong{color:var(--ink);}
.prose-card hr{border:none; border-top:1px solid var(--line); margin:24px 0;}
.prose-card code{
  background:var(--bg); box-shadow: inset 3px 3px 6px var(--sh-d), inset -3px -3px 6px var(--sh-l);
  padding:2px 6px; border-radius:6px; font-family:var(--fn-mono); font-size:12.5px;
}
.notice{
  padding:14px 16px; border-radius:16px; font-size:13.5px; font-weight:500;
  background:rgba(34,197,139,.1); color:#0e9e6b; margin:16px 0;
}

.stats{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:20px 0;}
.stat{border-radius:18px; padding:16px; text-align:center;}
.stat-n{font-family:var(--fn-display); font-weight:700; font-size:24px; color:var(--a1);}
.stat-l{font-size:11.5px; color:var(--ink-faint); margin-top:4px;}

.commit-grid{display:grid; gap:12px; margin:18px 0;}
.commit-card{border-radius:20px; padding:18px; display:flex; gap:14px; align-items:flex-start;}
.commit-icon{font-size:24px; flex:0 0 auto;}
.commit-body strong{display:block; margin-bottom:4px; font-size:14.5px;}
.commit-body p{margin:0; font-size:13.5px;}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:13px 22px; border-radius:14px; font-weight:700; font-size:14.5px; text-decoration:none;
}
.btn-primary{color:#fff; background:var(--grad-brand); box-shadow:5px 5px 14px var(--sh-d);}
.btn-lg{padding:15px 28px; font-size:15.5px; border-radius:16px;}

/* ---------- FAQ accordion ---------- */
.faq-item{border-radius:18px; margin-bottom:10px; overflow:hidden;}
.faq-q{
  width:100%; display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px; font-weight:600; font-size:14.5px; text-align:left; gap:12px;
}
.faq-chev{transition:transform .25s var(--ease); flex:0 0 auto; color:var(--ink-faint);}
.faq-item.open .faq-chev{transform:rotate(180deg);}
.faq-a{max-height:0; overflow:hidden; transition:max-height .3s var(--ease);}
.faq-item.open .faq-a{max-height:600px;}
.faq-ai{padding:0 18px 16px; font-size:13.5px; color:var(--ink-soft); line-height:1.6;}
.faq-section-label{font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-faint); margin:24px 2px 10px;}

::selection{background:var(--a1); color:#fff;}

:focus-visible{outline:2.5px solid var(--a1); outline-offset:2px; border-radius:8px;}
button:focus-visible, a:focus-visible{outline:2.5px solid var(--a1); outline-offset:2px;}

.skip-link{
  position:absolute; left:12px; top:-60px; z-index:100; background:var(--a1); color:#fff;
  padding:10px 16px; border-radius:10px; font-weight:700; font-size:13px; text-decoration:none;
  transition:top .2s var(--ease);
}
.skip-link:focus{top:12px;}
