:root {
  --bg-1: #eaf8ff;
  --bg-2: #d3efff;
  --bg-3: #f6fbff;
  --ink: #1d3557;
  --ink-soft: #4f6b8a;
  --ice: #5bc0eb;
  --ice-deep: #2b8fd6;
  --frost: #a9e4ff;
  --gold: #f6d77a;
  --blush: #ffb8c6;
  --card: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 40px -12px rgba(43, 143, 214, 0.35);
  --snow: 255, 255, 255;
  --radius: 22px;
  --font-display: "Mali", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg-1: #0b1a2e;
  --bg-2: #10284a;
  --bg-3: #0a1424;
  --ink: #e6f4ff;
  --ink-soft: #9db8d4;
  --ice: #7fd3ff;
  --ice-deep: #4fb5f5;
  --frost: #1e4672;
  --card: rgba(20, 42, 72, 0.62);
  --card-border: rgba(127, 211, 255, 0.18);
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--frost), transparent 60%),
    radial-gradient(900px 500px at -10% 40%, var(--bg-2), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-3));
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.4s, color 0.4s;
}

/* subtle paw-print wallpaper, echoing the bot cover */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%232b8fd6'%3E%3Cellipse cx='30' cy='38' rx='9' ry='7'/%3E%3Ccircle cx='20' cy='27' r='3.5'/%3E%3Ccircle cx='27' cy='22' r='3.5'/%3E%3Ccircle cx='35' cy='22' r='3.5'/%3E%3Ccircle cx='41' cy='28' r='3.5'/%3E%3Cellipse cx='88' cy='94' rx='9' ry='7'/%3E%3Ccircle cx='78' cy='83' r='3.5'/%3E%3Ccircle cx='85' cy='78' r='3.5'/%3E%3Ccircle cx='93' cy='78' r='3.5'/%3E%3Ccircle cx='99' cy='84' r='3.5'/%3E%3C/g%3E%3C/svg%3E");
  z-index: 0;
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

main, .nav, .footer { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.fill { fill: currentColor; stroke: none; }

/* NAV */
.nav {
  position: sticky;
  top: 14px;
  margin: 14px auto 0;
  width: min(1120px, calc(100% - 28px));
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: var(--shadow);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.brand img { border-radius: 50%; border: 2px solid var(--ice); object-fit: cover; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 14px; border-radius: 999px; color: var(--ink-soft); font-weight: 500; transition: 0.2s; }
.nav-links a:hover { background: rgba(91, 192, 235, 0.15); color: var(--ink); }
.nav-tools { display: flex; align-items: center; gap: 8px; }

.pill-toggle {
  display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--card-border);
  background: rgba(91, 192, 235, 0.12); cursor: pointer; font: 600 0.75rem var(--font-body); color: var(--ink-soft);
}
.pill-toggle span { padding: 5px 10px; border-radius: 999px; transition: 0.25s; }
html[lang="th"] .pill-toggle [data-lang="th"],
html[lang="en"] .pill-toggle [data-lang="en"] { background: linear-gradient(135deg, var(--ice), var(--ice-deep)); color: #fff; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--card-border);
  background: rgba(91, 192, 235, 0.12); color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { transform: rotate(-15deg); }
.icon-btn, .btn { transition: transform 0.25s, box-shadow 0.25s, background 0.25s; }
[data-theme="light"] .i-moon, [data-theme="dark"] .i-sun { display: none; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px; border-radius: 16px;
  font-weight: 600; border: 0; cursor: pointer; color: #fff; text-align: left;
}
.btn:hover { transform: translateY(-3px); }
.btn-sm { padding: 9px 18px; border-radius: 999px; font-size: 0.9rem; }
.btn-lg { padding: 14px 24px; }
.btn-lg b { display: block; font-size: 1.02rem; }
.btn-lg small { display: block; font-weight: 400; opacity: 0.88; font-size: 0.8rem; }
.btn-primary { background: linear-gradient(135deg, #6fd0ff, var(--ice-deep)); box-shadow: 0 10px 24px -8px rgba(43, 143, 214, 0.6); }
.btn-primary:hover { box-shadow: 0 16px 30px -8px rgba(43, 143, 214, 0.7); }
.btn-discord { background: linear-gradient(135deg, #7d8cff, #5865f2); box-shadow: 0 10px 24px -8px rgba(88, 101, 242, 0.6); }

/* HERO */
.hero {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 50px 0 70px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--card-border); font-size: 0.88rem; font-weight: 500; color: var(--ink-soft);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }

h1 { margin: 18px 0 10px; font-family: var(--font-display); line-height: 1; }
h1 .hello { display: block; font-size: clamp(1.1rem, 2.2vw, 1.5rem); font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
h1 .name {
  display: inline-block;
  font-size: clamp(4.5rem, 12vw, 8.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--ice-deep) 10%, #8fdcff 45%, var(--gold) 70%, var(--ice-deep) 95%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s ease-in-out infinite;
  filter: drop-shadow(0 6px 18px rgba(91, 192, 235, 0.35));
}
@keyframes shimmer { 50% { background-position: 100% 0; } }

.lead { font-size: 1.15rem; color: var(--ink-soft); min-height: 3.4em; max-width: 30em; margin: 0 0 28px; line-height: 1.6; }
.caret { color: var(--ice); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-art { position: relative; display: grid; place-items: center; }
.globe {
  position: relative;
  width: min(400px, 78vw);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(169,228,255,0.5));
  box-shadow: 0 30px 80px -20px rgba(43, 143, 214, 0.55), inset 0 0 0 2px rgba(255,255,255,0.8);
  animation: float 6s ease-in-out infinite;
}
.globe img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.globe-ring {
  position: absolute; inset: -18px; border-radius: 50%;
  border: 2px dashed rgba(91, 192, 235, 0.55);
  animation: spin 40s linear infinite;
}
.globe-shine {
  position: absolute; inset: 12px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,0.55), transparent 32%);
}
@keyframes float { 50% { transform: translateY(-14px) rotate(1deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

.bubble {
  position: absolute; padding: 10px 16px; border-radius: 18px; font-family: var(--font-display); font-weight: 600;
  background: var(--card); border: 1px solid var(--card-border); backdrop-filter: blur(10px); box-shadow: var(--shadow);
  animation: float 5s ease-in-out infinite;
}
.b1 { top: 6%; left: -2%; animation-delay: -1.5s; border-bottom-right-radius: 4px; }
.b2 { bottom: 8%; right: -2%; animation-delay: -3s; border-top-left-radius: 4px; }

/* SECTIONS */
.section { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 60px 0; }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0 0 6px; display: flex; align-items: center; gap: 12px; }
.section-head h2::before { content: "❄"; color: var(--ice); font-size: 0.7em; animation: spin 10s linear infinite; display: inline-block; }
.section-head p { margin: 0; color: var(--ink-soft); }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 26px; transition: transform 0.3s; position: relative; overflow: hidden; }
.feature::after {
  content: "🐾"; position: absolute; right: -6px; bottom: -10px; font-size: 4rem; opacity: 0.06; transform: rotate(-20deg);
}
.feature:hover { transform: translateY(-6px); }
.f-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem;
  background: linear-gradient(135deg, rgba(169,228,255,0.7), rgba(255,255,255,0.6)); margin-bottom: 14px;
}
.feature h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.2rem; }
.feature p { margin: 0; color: var(--ink-soft); line-height: 1.6; }

/* COMMANDS */
.cmd-panel { padding: 0; overflow: hidden; }
.cmd-search { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--card-border); }
.cmd-search .slash { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--ice-deep); }
.cmd-search input { flex: 1; border: 0; background: transparent; font: 500 1.05rem var(--font-body); color: var(--ink); outline: none; }
.cmd-search input::placeholder { color: var(--ink-soft); opacity: 0.7; }
kbd { font: 600 0.72rem var(--font-body); padding: 4px 8px; border-radius: 8px; border: 1px solid var(--card-border); color: var(--ink-soft); background: rgba(91,192,235,0.1); }
.cmd-tabs { display: flex; gap: 8px; padding: 14px 22px; flex-wrap: wrap; border-bottom: 1px solid var(--card-border); }
.cmd-tabs button {
  border: 1px solid var(--card-border); background: transparent; color: var(--ink-soft); padding: 7px 14px; border-radius: 999px;
  font: 500 0.88rem var(--font-body); cursor: pointer; transition: 0.2s;
}
.cmd-tabs button.active, .cmd-tabs button:hover { background: linear-gradient(135deg, var(--ice), var(--ice-deep)); color: #fff; border-color: transparent; }
.cmd-list { list-style: none; margin: 0; padding: 8px; max-height: 440px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.cmd-list li { padding: 14px 16px; border-radius: 14px; display: flex; gap: 14px; align-items: flex-start; animation: pop 0.35s both; }
.cmd-list li:hover { background: rgba(91,192,235,0.1); }
.cmd-list .c-icon { font-size: 1.2rem; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(169,228,255,0.45); flex-shrink: 0; }
.cmd-list code { font: 600 0.98rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ice-deep); }
.cmd-list p { margin: 3px 0 0; color: var(--ink-soft); font-size: 0.9rem; }
.cmd-list mark { background: rgba(246,215,122,0.6); color: inherit; border-radius: 4px; padding: 0 2px; }
.cmd-empty { text-align: center; padding: 30px; color: var(--ink-soft); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

/* STATUS */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { padding: 24px; }
.stat-num, .stat-top { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.stat-top { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; min-height: 2.52rem; }
.stat-label { color: var(--ink-soft); margin-top: 4px; font-size: 0.92rem; }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: #3ddc97; animation: ping 2s infinite; }
.pulse.off { background: #9aa9bb; animation: none; }

/* OWNER */
.owner { display: flex; align-items: center; gap: 22px; padding: 24px 28px; max-width: 640px; }
.owner-avatar { position: relative; flex-shrink: 0; }
.owner-avatar img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--frost); }
.presence { position: absolute; right: 2px; bottom: 2px; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--bg-1); background: #80848e; }
.presence[data-status="online"] { background: #23a55a; }
.presence[data-status="idle"] { background: #f0b232; }
.presence[data-status="dnd"] { background: #f23f43; }
.owner-info { flex: 1; min-width: 0; }
.owner-info h3 { margin: 0; font-family: var(--font-display); font-size: 1.35rem; }
.handle { margin: 2px 0 8px; color: var(--ink-soft); }
.role-tag { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: rgba(246,215,122,0.35); color: #9a6b00; }
[data-theme="dark"] .role-tag { color: var(--gold); }

/* FINAL CTA */
.cta-card { text-align: center; padding: 56px 24px; position: relative; overflow: hidden; }
.cta-card h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 8px; }
.cta-card p { color: var(--ink-soft); margin: 0 0 26px; }
.cta-paws { position: absolute; font-size: 9rem; opacity: 0.07; left: -10px; top: -30px; transform: rotate(-25deg); }

.footer { text-align: center; padding: 30px 20px 40px; color: var(--ink-soft); font-size: 0.92rem; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.footer .sep { color: var(--ice); }

/* Walking paw prints across the bottom of the screen */
.paw-trail { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.paw {
  position: absolute; width: 22px; height: 22px; opacity: 0;
  animation: pawFade 4s ease-out forwards;
}
.paw svg { width: 100%; height: 100%; fill: var(--ice); stroke: none; }
@keyframes pawFade { 10% { opacity: 0.55; } 60% { opacity: 0.4; } 100% { opacity: 0; } }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s, transform 0.7s; }
.reveal.in { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .cmd-list { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-tools { margin-left: auto; }
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 30px; min-height: auto; }
  .hero-art { order: -1; }
  .hero-ctas { justify-content: center; }
  .lead { margin-left: auto; margin-right: auto; }
}
@media (max-width: 560px) {
  .feature-grid, .stat-grid { grid-template-columns: 1fr; }
  .nav .btn-sm { display: none; }
  .owner { flex-direction: column; text-align: center; }
  kbd { display: none; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
