/* ---------- Tokens ---------- */
:root{
  --blue-400:#5CADE6;
  --blue-500:#3E9BDC;
  --blue-600:#2B7FBE;
  --blue-700:#1B5C8F;
  --orange-400:#F7B84B;
  --orange-500:#F5A623;
  --orange-600:#DB8A0E;
  --navy-900:#0F1830;
  --navy-800:#151F38;

  --bg:#F3F0E7;
  --surface:#FFFFFF;
  --surface-2:#FFFFFF;
  --stone-card-bg:#FCFCFC;
  --text:#16233F;
  --text-soft:#5B6786;
  --border:#E6E1D3;
  --shadow: 0 18px 40px -18px rgba(16,27,51,.35);
  color-scheme: light;
}

html[data-theme="dark"]{
  --bg:#0A1120;
  --surface:#131C33;
  --surface-2:#0F1830;
  --stone-card-bg:#FCFCFC;
  --text:#EEF1F8;
  --text-soft:#93A0C2;
  --border:#232F52;
  --shadow: 0 20px 46px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  min-height:100vh;
  background:var(--bg);
  color:var(--text);
  font-family:'Inter', system-ui, sans-serif;
  transition:background .35s ease, color .35s ease;
  -webkit-font-smoothing:antialiased;
  position:relative;
  overflow-x:hidden;
}

/* soft mesh-style glow behind everything, sits fixed so it doesn't scroll away */
.bg-glow{
  position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(560px 420px at 12% -6%, rgba(62,155,220,.28), transparent 60%),
    radial-gradient(520px 420px at 92% 8%, rgba(245,166,35,.22), transparent 60%),
    radial-gradient(700px 600px at 50% 115%, rgba(62,155,220,.16), transparent 60%);
}
html[data-theme="dark"] .bg-glow{
  background:
    radial-gradient(560px 420px at 12% -6%, rgba(62,155,220,.22), transparent 60%),
    radial-gradient(520px 420px at 92% 8%, rgba(245,166,35,.14), transparent 60%),
    radial-gradient(700px 600px at 50% 115%, rgba(62,155,220,.12), transparent 60%);
}

/* ---------- Topbar ---------- */
.topbar{
  position:sticky; top:0; z-index:20;
  background:color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  max-width:920px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 24px;
}
.brand{
  font-family:'Space Grotesk', sans-serif;
  font-weight:700;
  font-size:1.3rem;
  letter-spacing:-.2px;
}
.brand .accent{color:var(--orange-500);}

.theme-toggle{background:none; border:none; padding:0; cursor:pointer;}
.theme-toggle-track{
  display:flex; align-items:center;
  width:50px; height:27px; border-radius:999px;
  background:var(--blue-700);
  padding:3px;
  transition:background .3s ease;
}
html[data-theme="dark"] .theme-toggle-track{background:var(--navy-800); border:1px solid var(--border);}
.theme-toggle-thumb{
  width:21px; height:21px; border-radius:999px;
  background:var(--orange-500);
  display:flex; align-items:center; justify-content:center;
  color:var(--navy-900);
  transform:translateX(0);
  transition:transform .3s ease, background .3s ease;
  position:relative;
}
html[data-theme="dark"] .theme-toggle-thumb{ transform:translateX(23px); background:var(--blue-500); color:#0D1526;}
.theme-toggle-thumb svg{transition:opacity .2s ease;}
#themeIconSun{opacity:1; position:relative;}
#themeIconMoon{opacity:0; position:absolute;}
html[data-theme="dark"] #themeIconSun{opacity:0;}
html[data-theme="dark"] #themeIconMoon{opacity:1; position:relative;}

/* ---------- Hero ---------- */
.hero{
  max-width:640px;
  margin:0 auto;
  text-align:center;
  padding:14px 24px 0;
}
.hero-title{
  font-family:'Space Grotesk', sans-serif;
  font-size:clamp(1.4rem, 4.4vw, 2rem);
  line-height:1.15;
  margin:0;
  letter-spacing:-.5px;
}

/* ---------- Mascot card with on-stone password ---------- */
.mascot-card{
  container-type: inline-size;
  position:relative;
  width:min(320px, 78vw, 34vh);
  margin:14px auto 0;
  background:var(--stone-card-bg);
  border-radius:28px;
  overflow:hidden;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
}
.mascot{
  display:block;
  width:100%;
  height:auto;
}
.stone-password{
  position:absolute;
  left:8.5%; right:7.5%;
  top:84%; bottom:2.5%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#FFFFFF;
  text-shadow:
    0 1px 3px rgba(0,0,0,.75),
    0 0 8px rgba(0,0,0,.45),
    0 2px 0 rgba(0,0,0,.35);
  -webkit-text-stroke:.4px rgba(0,0,0,.25);
  font-family:'JetBrains Mono', monospace;
  font-weight:700;
  line-height:1.15;
  letter-spacing:.01em;
  word-break:break-word;
  overflow-wrap:break-word;
  font-size:clamp(.6rem, 5.6cqw, 1.3rem);
  padding:0 4px;
  user-select:all;
}
.copy-chip{
  position:absolute;
  top:12px; right:12px;
  width:36px; height:36px;
  border-radius:999px;
  border:1px solid rgba(22,35,63,.12);
  background:rgba(255,255,255,.85);
  backdrop-filter:blur(6px);
  color:var(--blue-700);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:color .2s ease, transform .15s ease, background .2s ease;
}
.copy-chip:hover:not(:disabled){color:var(--orange-600); transform:translateY(-1px);}
.copy-chip:disabled{opacity:.35; cursor:not-allowed;}
.copy-hint{
  height:16px;
  margin:6px 0 0;
  text-align:center;
  font-size:.82rem;
  color:var(--orange-600);
  font-weight:700;
}

/* ---------- Generator ---------- */
.generator{
  max-width:560px;
  margin:0 auto;
  padding:8px 24px 0;
  display:flex; flex-direction:column; align-items:center; gap:12px;
}

.buttons{
  width:100%;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.btn{
  border:none;
  border-radius:18px;
  padding:12px 14px;
  cursor:pointer;
  display:flex; flex-direction:column; gap:4px;
  color:#fff;
  font-family:'Inter', sans-serif;
  box-shadow:var(--shadow);
  transition:transform .15s ease, filter .15s ease;
}
.btn:hover{transform:translateY(-2px); filter:brightness(1.06);}
.btn:active{transform:translateY(0px) scale(.98);}
.btn-title{font-family:'Space Grotesk', sans-serif; font-weight:700; font-size:1.08rem;}
.btn-sub{font-size:.78rem; opacity:.9;}
.btn-blue{background:linear-gradient(150deg, var(--blue-400), var(--blue-700));}
.btn-orange{background:linear-gradient(150deg, var(--orange-400), var(--orange-600)); color:var(--navy-900);}
.btn-orange .btn-sub{color:var(--navy-900); opacity:.72;}

/* Options / switches */
.options{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:2px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:18px;
  padding:2px 18px;
  box-shadow:var(--shadow);
}
.switch-row{display:flex; align-items:center; gap:14px; padding:8px 0; cursor:pointer;}
.switch-row + .switch-row{border-top:1px solid var(--border);}
.switch input{position:absolute; opacity:0; width:1px; height:1px;}
.switch-track{
  display:block; width:42px; height:24px; border-radius:999px;
  background:var(--border); position:relative; transition:background .2s ease; flex-shrink:0;
}
.switch-thumb{
  position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:999px;
  background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); transition:transform .2s ease;
}
.switch input:checked + .switch-track{background:var(--blue-500);}
.switch input:checked + .switch-track .switch-thumb{transform:translateX(18px);}
.switch input:focus-visible + .switch-track{outline:2px solid var(--orange-500); outline-offset:2px;}
.switch-label{display:flex; flex-direction:column; gap:1px;}
.switch-title{font-weight:700; font-size:.92rem;}
.switch-desc{font-size:.78rem; color:var(--text-soft);}

/* ---------- Footer ---------- */
.site-footer{
  text-align:center;
  max-width:560px;
  margin:0 auto;
  padding:12px 24px 18px;
  font-size:.72rem;
  line-height:1.4;
  color:var(--text-soft);
}

/* ---------- Focus states ---------- */
button:focus-visible{outline:2px solid var(--orange-500); outline-offset:3px;}

/* ---------- Responsive ---------- */
@media (max-width:420px){
  .buttons{grid-template-columns:1fr;}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  *{transition:none !important; scroll-behavior:auto !important;}
}
