/* static/css/layout.css
   Shared design system — nav, footer, background, tokens
   Based on the index.html design language (KamiBOTS v2)
   ────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════
   DESIGN TOKENS (dark default)
   ═══════════════════════════════════════ */
:root {
  --ka:  #6d5aed;
  --ka2: #4cc9f0;
  --kg:  rgba(109, 90, 237, .12);
  --kg2: rgba(76, 201, 240, .08);
  --kgl: rgba(255, 255, 255, .04);
  --kgb: rgba(15, 23, 42, .80);
  --kgr: rgba(15, 23, 42, .55);
  --kbd: #06060a;
  --kbs: #0a0a10;
  --kt:  #ececf1;
  --kt2: #7a7a8c;
  --kr:  20px;
  --ks:  0 4px 24px rgba(0, 0, 0, .2);
  --ksm: 0 20px 60px rgba(0, 0, 0, .25);
}

html[data-theme="light"] {
  --ka:  #4f46e5;
  --ka2: #0ea5e9;
  --kg:  rgba(79, 70, 229, .08);
  --kg2: rgba(14, 165, 233, .06);
  --kgl: rgba(255, 255, 255, .65);
  --kgb: rgba(0, 0, 0, .06);
  --kgr: rgba(0, 0, 0, .03);
  --kbd: #f5f5f7;
  --kbs: #ffffff;
  --kt:  #1a1a2e;
  --kt2: #6b6b80;
  --ks:  0 4px 24px rgba(0, 0, 0, .04);
  --ksm: 0 20px 60px rgba(0, 0, 0, .06);
}


/* ═══════════════════════════════════════
   BASE
   ═══════════════════════════════════════ */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Sora', sans-serif;
  background: var(--kbd);
  color: var(--kt);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono {
  font-family: 'Fira Code', monospace;
}

::selection {
  background: rgba(109, 90, 237, .3);
}

a {
  color: inherit;
}


/* ═══════════════════════════════════════
   BLUEPRINT GRID BACKGROUND
   ═══════════════════════════════════════ */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--kgr) 1px, transparent 1px),
    linear-gradient(90deg, var(--kgr) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 70%);
}


/* ═══════════════════════════════════════
   AMBIENT GLOW ORBS
   ═══════════════════════════════════════ */
.ambient {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform;
}

.ambient-1 {
  width: 600px;
  height: 600px;
  background: var(--ka);
  opacity: .06;
  top: -200px;
  left: -100px;
  animation: amb1 25s ease-in-out infinite;
}

.ambient-2 {
  width: 500px;
  height: 500px;
  background: var(--ka2);
  opacity: .05;
  bottom: -150px;
  right: -100px;
  animation: amb2 30s ease-in-out infinite;
}

.ambient-3 {
  width: 400px;
  height: 400px;
  background: var(--ka);
  opacity: .04;
  top: 50%;
  right: 15%;
  animation: amb3 20s ease-in-out infinite;
}

@keyframes amb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(80px, 60px) scale(1.1); }
  66%       { transform: translate(-30px, 90px) scale(.95); }
}

@keyframes amb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-60px, -40px) scale(1.05); }
  66%       { transform: translate(40px, -80px) scale(.9); }
}

@keyframes amb3 {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(-50px, -50px); }
}


/* ═══════════════════════════════════════
   LAYOUT HELPERS
   ═══════════════════════════════════════ */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

@media (min-width: 640px) {
  .wrap { padding: 0 40px; }
}

.sec {
  padding: 80px 0;
}

@media (min-width: 768px) {
  .sec { padding: 100px 0; }
}


/* ═══════════════════════════════════════
   GLASSMORPHISM COMPONENT
   ═══════════════════════════════════════ */
.g {
  background: var(--kgl);
  border: 1px solid var(--kgb);
  border-radius: var(--kr);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: var(--ks);
  transition:
    transform .5s cubic-bezier(.22, 1, .36, 1),
    box-shadow .5s ease,
    border-color .4s ease;
}

.g:hover {
  transform: translateY(-4px);
  box-shadow: var(--ksm);
  border-color: rgba(109, 90, 237, .15);
}


/* ═══════════════════════════════════════
   SCROLL REVEAL SYSTEM
   ═══════════════════════════════════════ */
.rv {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity .7s cubic-bezier(.22, 1, .36, 1),
    transform .7s cubic-bezier(.22, 1, .36, 1);
}

.rv.vis { opacity: 1; transform: none; }

.d1 { transition-delay: .08s; }
.d2 { transition-delay: .16s; }
.d3 { transition-delay: .24s; }
.d4 { transition-delay: .32s; }
.d5 { transition-delay: .40s; }
.d6 { transition-delay: .48s; }


/* ═══════════════════════════════════════
   FLOATING GLASS NAVIGATION
   ═══════════════════════════════════════ */
.topnav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 800px;
  background: var(--kgl);
  border: 1px solid var(--kgb);
  border-radius: 16px;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .3s, border-color .3s, box-shadow .3s;
}

.topnav.scrolled {
  box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
}

/* Nav links */
.topnav a.nl {
  font-size: 13px;
  font-weight: 500;
  color: var(--kt2);
  text-decoration: none;
  transition: color .25s;
  position: relative;
}

.topnav a.nl:hover { color: var(--kt); }

.topnav a.nl::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--ka);
  border-radius: 2px;
  transition: width .25s ease;
}

.topnav a.nl:hover::after { width: 100%; }

.nav-links {
  display: none;
  align-items: center;
  gap: 24px;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ═══════════════════════════════════════
   THEME TOGGLE PILL
   ═══════════════════════════════════════ */
.theme-pill {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  background: var(--kgb);
  position: relative;
  transition: background .3s;
  flex-shrink: 0;
}

.theme-pill .dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ka);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  box-shadow: 0 2px 8px rgba(109, 90, 237, .3);
}

html[data-theme="dark"]  .theme-pill .dot { transform: translateX(18px); }
html[data-theme="light"] .theme-pill .dot { transform: translateX(0); }

.theme-pill .ico {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  transition: opacity .25s;
  pointer-events: none;
}

.theme-pill .ico-sun  { left: 6px; }
.theme-pill .ico-moon { right: 6px; }

html[data-theme="light"] .theme-pill .ico-sun  { opacity: 1; }
html[data-theme="light"] .theme-pill .ico-moon { opacity: .35; }
html[data-theme="dark"]  .theme-pill .ico-sun  { opacity: .35; }
html[data-theme="dark"]  .theme-pill .ico-moon { opacity: 1; }


/* ═══════════════════════════════════════
   PROFILE DROPDOWN
   ═══════════════════════════════════════ */
.prof-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid var(--kgb);
  background: transparent;
  cursor: pointer;
  transition: background .2s;
  color: var(--kt);
}

.prof-btn:hover { background: var(--kg); }

.prof-btn img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  object-fit: cover;
}

.prof-btn svg {
  width: 14px;
  height: 14px;
  color: var(--kt2);
}

.prof-drop {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 220px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--kbs);
  border: 1px solid var(--kgb);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  z-index: 200;
}

.prof-drop.open {
  display: block;
  animation: dropIn .2s cubic-bezier(.22, 1, .36, 1);
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.prof-drop a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--kt);
  text-decoration: none;
  transition: background .15s;
}

.prof-drop a:hover { background: var(--kg); }

.prof-drop a svg {
  width: 15px;
  height: 15px;
  color: var(--kt2);
}


/* ═══════════════════════════════════════
   MOBILE MENU
   ═══════════════════════════════════════ */
.mob-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.22, 1, .36, 1);
}

.mob-menu.open { max-height: 400px; }

.mob-menu a {
  display: block;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--kt2);
  text-decoration: none;
  transition: color .2s, background .2s;
}

.mob-menu a:hover {
  color: var(--kt);
  background: var(--kg);
}

.hamburger {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--kgb);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background .2s;
}

.hamburger:hover { background: var(--kg); }

.hamburger svg {
  width: 18px;
  height: 18px;
  color: var(--kt2);
}

@media (min-width: 768px) {
  .hamburger { display: none; }
}


/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform .2s, box-shadow .3s, opacity .2s;
}

.btn:active { transform: scale(.97); }

.btn-p {
  background: linear-gradient(135deg, var(--ka), color-mix(in srgb, var(--ka2) 40%, var(--ka)));
  color: #fff;
  box-shadow: 0 8px 30px rgba(109, 90, 237, .25);
}

.btn-p:hover { box-shadow: 0 12px 40px rgba(109, 90, 237, .35); }

.btn-g {
  background: var(--kgl);
  color: var(--kt);
  border: 1px solid var(--kgb);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-g:hover {
  border-color: rgba(109, 90, 237, .2);
  background: var(--kg);
}


/* ═══════════════════════════════════════
   SECTION HEADER
   ═══════════════════════════════════════ */
.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-head .tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--ka);
}

.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-top: 12px;
  letter-spacing: -.02em;
}

.section-head p {
  color: var(--kt2);
  margin-top: 12px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  font-size: 14px;
  line-height: 1.7;
}


/* ═══════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--kgb), transparent);
  margin: 0 auto;
  max-width: 600px;
}


/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.foot {
  text-align: center;
  padding: 48px 24px;
  position: relative;
  z-index: 2;
}

.foot p {
  font-size: 12px;
  color: var(--kt2);
}

.foot .links {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.foot .links a {
  font-size: 12px;
  font-weight: 500;
  color: var(--kt2);
  text-decoration: none;
  transition: color .2s;
}

.foot .links a:hover { color: var(--ka); }


/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-box {
  background: var(--kbs);
  border: 1px solid var(--kgb);
  border-radius: 24px;
  padding: 36px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
  animation: modalIn .3s cubic-bezier(.22, 1, .36, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.92) translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.modal-box h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 16px 0 10px;
}

.modal-box p {
  font-size: 13px;
  color: var(--kt2);
  line-height: 1.7;
  margin-bottom: 24px;
}


/* ═══════════════════════════════════════
   BODY PADDING FOR FIXED NAV
   ═══════════════════════════════════════ */
.nav-spacer {
  height: 80px;
}

/* Login button shown desktop-only inside nav */
.nav-login-desktop {
  display: none;
}

@media (min-width: 768px) {
  .nav-login-desktop { display: inline-flex !important; }
}
