/* ==========================================================================
   LECASTLE — Modern Design System  (self-contained, no framework dependency)
   Theme is driven by `html.dark`. Default (no class) = light.
   ========================================================================== */

:root {
  --brand-1: #6366f1;   /* indigo  */
  --brand-2: #8b5cf6;   /* violet  */
  --brand-3: #06b6d4;   /* cyan    */
  --brand-4: #ec4899;   /* pink    */
  --grad: linear-gradient(120deg, var(--brand-1), var(--brand-2) 45%, var(--brand-3));
  --grad-soft: linear-gradient(120deg, rgba(99,102,241,.16), rgba(139,92,246,.14) 50%, rgba(6,182,212,.14));

  /* light theme */
  --bg: #f6f7fb;
  --bg-2: #eef0f7;
  --surface: rgba(255,255,255,.72);
  --surface-solid: #ffffff;
  --border: rgba(17,24,39,.10);
  --text: #0f172a;
  --text-dim: #475569;
  --text-faint: #64748b;
  --shadow: 0 10px 30px -12px rgba(30,27,75,.25), 0 2px 8px -4px rgba(30,27,75,.15);
  --shadow-lg: 0 30px 60px -20px rgba(30,27,75,.35);
  --ring: rgba(99,102,241,.35);
  --nav-bg: rgba(255,255,255,.7);
  --input-bg: #ffffff;
  --code-bg: #f1f5f9;
}

html.dark {
  --bg: #070711;
  --bg-2: #0c0c1c;
  --surface: rgba(23,23,42,.55);
  --surface-solid: #14142a;
  --border: rgba(255,255,255,.09);
  --text: #f1f3ff;
  --text-dim: #b7bcda;
  --text-faint: #8a90b8;
  --shadow: 0 10px 40px -12px rgba(0,0,0,.6), 0 2px 10px -4px rgba(0,0,0,.5);
  --shadow-lg: 0 40px 80px -24px rgba(0,0,0,.7);
  --ring: rgba(139,92,246,.5);
  --nav-bg: rgba(10,10,24,.62);
  --input-bg: rgba(12,12,28,.7);
  --code-bg: rgba(255,255,255,.06);
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

h1,h2,h3,h4 { font-family: "Space Grotesk", "Inter", system-ui, sans-serif; line-height: 1.12; letter-spacing: -.02em; margin: 0; }

a { color: inherit; text-decoration: none; }

/* ---------- Aurora animated background ---------- */
.aurora {
  position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
  background: var(--bg);
}
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: .55; mix-blend-mode: normal;
}
.aurora::before {
  background: radial-gradient(circle at 30% 30%, var(--brand-1), transparent 60%);
  top: -18vmax; left: -10vmax; animation: floatA 22s ease-in-out infinite;
}
.aurora::after {
  background: radial-gradient(circle at 70% 70%, var(--brand-3), transparent 60%);
  bottom: -20vmax; right: -12vmax; animation: floatB 26s ease-in-out infinite;
}
.aurora i {
  position: absolute; width: 42vmax; height: 42vmax; border-radius: 50%;
  filter: blur(80px); opacity: .4;
  background: radial-gradient(circle, var(--brand-4), transparent 60%);
  top: 40%; left: 55%; animation: floatC 30s ease-in-out infinite;
}
html.dark .aurora::before { opacity: .4; }
html.dark .aurora::after  { opacity: .4; }
html.dark .aurora i       { opacity: .28; }
@keyframes floatA { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(8vmax,6vmax) scale(1.15)} }
@keyframes floatB { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-7vmax,-5vmax) scale(1.1)} }
@keyframes floatC { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-6vmax,7vmax) scale(1.2)} }
/* subtle grid overlay */
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}
@media (prefers-reduced-motion: reduce){ .aurora::before,.aurora::after,.aurora i{animation:none} }

/* ---------- Layout ---------- */
.container { width: min(1160px, 92vw); margin-inline: auto; }
.container-sm { width: min(560px, 92vw); margin-inline: auto; }
.section { padding: 84px 0; }
.center { text-align: center; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-family:"Space Grotesk",sans-serif; font-size: 1.15rem; letter-spacing: -.02em; }
.brand .logo-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 6px 18px -6px var(--brand-1); flex: none;
}
.brand .logo-mark i { font-size: 15px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Logo wordmark — Anton, uppercase, single unified "LECASTLE" */
.brand-word {
  font-family: "Anton", "Space Grotesk", sans-serif;
  font-weight: 400;               /* Anton ships one heavy weight */
  text-transform: uppercase;
  letter-spacing: .045em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  line-height: 1;
}
/* solid variant for use on the gradient auth aside (white on colour) */
.brand-word.solid {
  background: none;
  -webkit-text-fill-color: currentColor; color: currentColor;
}
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a.navlink {
  padding: 8px 14px; border-radius: 10px; color: var(--text-dim); font-weight: 600; font-size: .93rem;
  transition: .18s;
}
.nav-links a.navlink:hover { color: var(--text); background: var(--grad-soft); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer;
  transition: .18s;
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  --_pad: 12px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: var(--_pad); border-radius: 999px; font-weight: 700; font-size: .96rem;
  cursor: pointer; border: 1px solid transparent; transition: transform .16s, box-shadow .16s, background .16s;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 12px 30px -10px var(--brand-1); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -10px var(--brand-2); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); backdrop-filter: blur(8px); }
.btn-ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-lg { --_pad: 16px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- Cards / glass ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}
.card { border-radius: 20px; padding: 26px; }
.card-hover { transition: transform .2s, box-shadow .2s, border-color .2s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(139,92,246,.35); }

/* ---------- Badges / pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid var(--border); font-size: .84rem; font-weight: 600; color: var(--text-dim);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; text-align: left; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text-dim); }
.input {
  width: 100%; padding: 13px 15px; border-radius: 13px; border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text); font-size: .98rem; font-family: inherit;
  transition: border-color .16s, box-shadow .16s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--ring); }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.input-icon .input { padding-left: 42px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 70px 0 40px; }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 4.1rem); font-weight: 800; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--text-dim); max-width: 620px; margin: 22px auto 0; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }

/* shorten box */
.shorten-box { margin: 40px auto 0; max-width: 680px; padding: 14px; }
.shorten-row { display: flex; gap: 10px; }
.shorten-row .input { border-radius: 14px; }
@media (max-width: 560px){ .shorten-row { flex-direction: column; } }

/* ---------- Feature grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .grid-3,.grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px){ .grid-3,.grid-4,.grid-2 { grid-template-columns: 1fr; } }

.feature .ficon {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 22px;
  color: #fff; background: var(--grad); box-shadow: 0 10px 24px -10px var(--brand-1); margin-bottom: 16px;
}
.feature h3 { font-size: 1.18rem; margin-bottom: 8px; }
.feature p { color: var(--text-dim); font-size: .96rem; margin: 0; }

/* ---------- Steps ---------- */
.step-num {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-weight: 800;
  font-family: "Space Grotesk"; font-size: 1.1rem; color: var(--brand-2);
  background: var(--grad-soft); border: 1px solid var(--border); margin-bottom: 14px;
}

/* ---------- Stats ---------- */
.stat { text-align: center; }
.stat .num { font-family: "Space Grotesk"; font-weight: 800; font-size: clamp(1.9rem,4vw,2.8rem); }
.stat .lbl { color: var(--text-dim); font-size: .92rem; margin-top: 4px; }

/* ---------- Section heading ---------- */
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.sec-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800; }
.sec-head p { color: var(--text-dim); margin-top: 14px; font-size: 1.05rem; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden; border-radius: 28px; padding: 56px 40px; text-align: center;
  background: var(--grad); color: #fff; box-shadow: var(--shadow-lg);
}
.cta-band h2 { font-size: clamp(1.7rem,3.5vw,2.5rem); font-weight: 800; }
.cta-band p { opacity: .92; max-width: 520px; margin: 16px auto 0; }
.cta-band::after {
  content: ""; position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background: radial-gradient(circle at 20% 20%, #fff, transparent 40%), radial-gradient(circle at 80% 80%, #fff, transparent 45%);
}
.cta-band .btn { position: relative; z-index: 1; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1.05fr .95fr; }
@media (max-width: 940px){ .auth-wrap { grid-template-columns: 1fr; } .auth-aside { display: none; } }
.auth-aside {
  position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px;
  background: var(--grad); color: #fff;
}
.auth-aside::after{ content:""; position:absolute; inset:0; opacity:.3;
  background: radial-gradient(circle at 15% 15%, #fff, transparent 40%), radial-gradient(circle at 85% 70%, #fff, transparent 45%); }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { font-size: 2.1rem; font-weight: 800; }
.auth-aside .alist { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.auth-aside .alist div { display: flex; gap: 12px; align-items: flex-start; font-size: 1.02rem; }
.auth-aside .alist i { margin-top: 3px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; }

.alert { padding: 12px 15px; border-radius: 12px; font-size: .92rem; font-weight: 600; display:flex; gap:9px; align-items:center; }
.alert-error { background: rgba(239,68,68,.12); color: #ef4444; border: 1px solid rgba(239,68,68,.3); }
.alert-success { background: rgba(34,197,94,.12); color: #16a34a; border: 1px solid rgba(34,197,94,.3); }

.divider { display:flex; align-items:center; gap:14px; color: var(--text-faint); font-size:.85rem; margin: 4px 0; }
.divider::before,.divider::after { content:""; height:1px; flex:1; background: var(--border); }

.link-accent { color: var(--brand-2); font-weight: 600; }
.link-accent:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(10px); margin-top: 60px; }
.footer-inner { padding: 54px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 820px){ .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
.footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 14px; font-family:"Inter"; }
.footer a { color: var(--text-dim); display: block; padding: 5px 0; font-size: .94rem; transition: color .15s; }
.footer a:hover { color: var(--brand-2); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 34px; padding-top: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-faint); font-size: .88rem; }

/* ---------- misc ---------- */
.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-3{margin-top:14px}.mt-4{margin-top:22px}.mt-6{margin-top:38px}
.mb-2{margin-bottom:8px}.mb-4{margin-bottom:22px}
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

.code-chip { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--code-bg); padding: 3px 9px; border-radius: 8px; font-size: .9em; }

/* mobile nav drawer */
@media (max-width: 820px){
  .nav-toggle { display: grid; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--nav-bg); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
    padding: 12px 6vw 18px; gap: 4px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a.navlink { padding: 12px 14px; }
  .nav-links .btn { width: 100%; margin-top: 6px; }
}
