/* ============================================================
   EmojiKeyboard — design system
   Concept: a physical keyboard tray. Emoji sit on raised
   "keycaps"; category chips act like function keys.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --tray:#E7E9F0;
  --tray-deep:#D9DCE6;
  --key:#FFFFFF;
  --key-edge:#C7CBDA;
  --ink:#1B1D28;
  --ink-soft:#565A6E;
  --ink-faint:#8A8FA3;
  --line:#DADDE7;
  --brand:#6C5CE7;
  --brand-ink:#4B3FC9;
  --brand-soft:#EDEAFF;
  --radius-lg:22px;
  --radius-md:16px;
  --radius-sm:10px;
  --shadow-key: 0 1px 0 var(--key-edge), 0 4px 10px rgba(27,29,40,0.06);
  --shadow-key-hover: 0 1px 0 var(--key-edge), 0 8px 18px rgba(27,29,40,0.10);
  --shadow-panel: 0 10px 30px rgba(27,29,40,0.06);
}

:root[data-theme="dark"]{
  --tray:#15161F;
  --tray-deep:#0F1017;
  --key:#20222E;
  --key-edge:#0B0C12;
  --ink:#F1F1F6;
  --ink-soft:#B4B6C6;
  --ink-faint:#7B7E92;
  --line:#2B2D3B;
  --brand:#8B7DFF;
  --brand-ink:#B4AAFF;
  --brand-soft:#2A2650;
  --shadow-key: 0 1px 0 var(--key-edge), 0 4px 10px rgba(0,0,0,0.35);
  --shadow-key-hover: 0 1px 0 var(--key-edge), 0 8px 18px rgba(0,0,0,0.45);
  --shadow-panel: 0 10px 30px rgba(0,0,0,0.3);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:var(--tray);
  color:var(--ink);
  font-family:'Inter',-apple-system,sans-serif;
  line-height:1.6;
  transition:background .2s ease, color .2s ease;
}
h1,h2,h3,.brand,.display{
  font-family:'Fredoka',sans-serif;
  font-weight:600;
  color:var(--ink);
  margin:0;
}
p{color:var(--ink-soft); margin:0 0 1em;}
a{color:inherit; text-decoration:none;}
.container{max-width:1100px; margin:0 auto; padding:0 20px;}
.max-prose{max-width:680px;}

/* ---------- Header ---------- */
.site-header{
  position:sticky; top:0; z-index:60;
  background:var(--tray);
  border-bottom:1px solid var(--line);
}
.header-row{display:flex; align-items:center; gap:16px; padding:14px 20px;}
.brand{display:flex; align-items:center; gap:9px; font-size:19px; flex-shrink:0;}
.brand-mark{
  width:34px;height:34px;border-radius:10px;
  background:var(--key); box-shadow:var(--shadow-key);
  display:flex; align-items:center; justify-content:center;
  font-size:18px; flex-shrink:0;
}
.header-search{
  flex:1; display:flex; align-items:center; gap:10px;
  background:var(--key); border:1px solid var(--line);
  border-radius:100px; padding:11px 18px; max-width:560px;
  box-shadow:var(--shadow-key);
}
.header-search input{
  border:none; outline:none; background:none; flex:1;
  font-family:'Inter'; font-size:15px; color:var(--ink);
}
.header-search input::placeholder{color:var(--ink-faint);}
.header-search .kbd-icon{color:var(--ink-faint); font-size:16px;}
.icon-btn{
  width:40px; height:40px; border-radius:12px; background:var(--key);
  border:1px solid var(--line); box-shadow:var(--shadow-key);
  display:flex; align-items:center; justify-content:center;
  font-size:17px; cursor:pointer; flex-shrink:0; color:var(--ink);
}
.icon-btn:hover{box-shadow:var(--shadow-key-hover); transform:translateY(-1px);}
.nav-links{display:flex; gap:4px; list-style:none; margin:0; padding:0; flex-shrink:0;}
.nav-links a{
  font-size:13.5px; font-weight:600; color:var(--ink-soft); padding:9px 13px;
  border-radius:100px; white-space:nowrap;
}
.nav-links a:hover, .nav-links a.active{color:var(--ink); background:var(--key); box-shadow:var(--shadow-key);}
@media (max-width:900px){ .nav-links{display:none;} }

/* ---------- Category strip ---------- */
.cat-strip{
  position:sticky; top:65px; z-index:55;
  background:var(--tray); border-bottom:1px solid var(--line);
  padding:10px 0;
}
.cat-scroll{display:flex; gap:8px; overflow-x:auto; padding:2px 20px; scrollbar-width:none;}
.cat-scroll::-webkit-scrollbar{display:none;}
.cat-chip{
  display:flex; align-items:center; gap:7px; flex-shrink:0;
  background:var(--key); border:1px solid var(--line);
  border-radius:100px; padding:9px 15px 9px 11px;
  font-size:13.5px; font-weight:600; color:var(--ink-soft);
  box-shadow:var(--shadow-key); cursor:pointer; transition:all .12s;
}
.cat-chip .dot{width:8px; height:8px; border-radius:50%; flex-shrink:0;}
.cat-chip.active{color:var(--ink); border-color:var(--cat-color, var(--brand)); background:var(--key);}
.cat-chip:hover{transform:translateY(-1px); box-shadow:var(--shadow-key-hover);}

/* ---------- Tray / recent / favorites bar ---------- */
.tray-bar{padding:14px 0 0;}
.tray-row{display:flex; align-items:center; gap:10px; overflow-x:auto; padding-bottom:6px; scrollbar-width:none;}
.tray-row::-webkit-scrollbar{display:none;}
.tray-label{font-size:12.5px; font-weight:700; color:var(--ink-faint); flex-shrink:0; text-transform:uppercase; letter-spacing:.04em;}
.tray-empty{font-size:13px; color:var(--ink-faint); padding:6px 0;}

/* ---------- Keycap ---------- */
.keycap{
  position:relative;
  width:100%; aspect-ratio:1;
  background:var(--key);
  border:1px solid var(--key-edge);
  border-radius:14px;
  box-shadow:var(--shadow-key);
  display:flex; align-items:center; justify-content:center;
  font-size:27px; cursor:pointer;
  transition:transform .1s ease, box-shadow .1s ease;
}
.keycap:hover{transform:translateY(-2px); box-shadow:var(--shadow-key-hover);}
.keycap:active{transform:translateY(1px) scale(0.96); box-shadow:0 1px 0 var(--key-edge);}
.keycap .fav-toggle{
  position:absolute; top:2px; right:2px; width:18px; height:18px;
  border-radius:50%; background:transparent; border:none;
  font-size:10px; color:var(--ink-faint); display:flex; align-items:center; justify-content:center;
  opacity:0; transition:opacity .12s;
}
.keycap:hover .fav-toggle, .keycap .fav-toggle.active{opacity:1;}
.keycap .fav-toggle.active{color:#FFB020;}

.mini-key{
  width:52px; height:52px; flex-shrink:0;
  background:var(--key); border:1px solid var(--key-edge);
  border-radius:12px; box-shadow:var(--shadow-key);
  display:flex; align-items:center; justify-content:center;
  font-size:24px; cursor:pointer; transition:transform .1s;
}
.mini-key:hover{transform:translateY(-2px);}

/* ---------- Sections / grid ---------- */
section.cat-section{padding:28px 0 8px; scroll-margin-top:150px;}
.cat-section-head{display:flex; align-items:center; gap:10px; margin-bottom:14px;}
.cat-section-head .dot{width:10px; height:10px; border-radius:50%;}
.cat-section-head h2{font-size:19px;}
.cat-section-head .count{font-size:12.5px; color:var(--ink-faint); font-weight:600;}

.emoji-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(56px, 1fr));
  gap:8px;
}
@media (max-width:640px){
  .emoji-grid{grid-template-columns:repeat(auto-fill, minmax(46px, 1fr));}
  .keycap{font-size:22px; border-radius:12px;}
}

.empty-search{text-align:center; padding:60px 20px; color:var(--ink-faint);}
.empty-search .big{font-size:40px; margin-bottom:12px;}

/* ---------- Tone picker ---------- */
.tone-picker{display:flex; gap:6px; align-items:center;}
.tone-dot{
  width:22px; height:22px; border-radius:50%; cursor:pointer;
  border:2px solid transparent; flex-shrink:0;
}
.tone-dot.active{border-color:var(--brand);}
.tone-dot[data-tone="default"]{background:linear-gradient(135deg,#FFD93D,#FFC145);}
.tone-dot[data-tone="light"]{background:#F7DECE;}
.tone-dot[data-tone="medium-light"]{background:#E8B98B;}
.tone-dot[data-tone="medium"]{background:#C68954;}
.tone-dot[data-tone="medium-dark"]{background:#8D5B3C;}
.tone-dot[data-tone="dark"]{background:#5A3A28;}

/* ---------- Toast ---------- */
.toast{
  position:fixed; bottom:26px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:var(--tray);
  padding:12px 20px; border-radius:100px; font-size:14px; font-weight:600;
  opacity:0; transition:all .25s ease; pointer-events:none; z-index:200;
  box-shadow:0 10px 30px rgba(0,0,0,0.25);
  display:flex; align-items:center; gap:8px;
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0);}

/* ---------- Hero (about-ish intro) ---------- */
.hero-strip{padding:26px 0 6px;}
.hero-strip h1{font-size:26px; margin-bottom:6px;}
.hero-strip p{font-size:14.5px; max-width:560px;}

/* ---------- Footer ---------- */
footer{border-top:1px solid var(--line); padding:36px 0 24px; margin-top:50px;}
.footer-row{display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px;}
.footer-links{display:flex; gap:18px; flex-wrap:wrap;}
.footer-links a{font-size:13.5px; color:var(--ink-soft);}
.footer-links a:hover{color:var(--ink);}
.footer-note{font-size:12.5px; color:var(--ink-faint); margin-top:14px;}

/* ---------- Simple pages ---------- */
.legal-page h1{font-size:28px; margin-bottom:6px;}
.legal-page .updated{font-size:13px; color:var(--ink-faint); margin-bottom:26px;}
.legal-page h2{font-size:18px; margin:24px 0 8px;}
.legal-page p, .legal-page li{font-size:15px; color:var(--ink-soft);}
.glass-card{background:var(--key); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow-panel); padding:24px;}
