:root {
  --blue: #00c8ff;
  --pink: #ff1493;
  --yellow: #ffd700;
  --green: #00ff88;
  --purple: #9b59ff;
  --bg: #040415;
  --bg-card: #0b0b28;
  --bg-card-hover: #10103a;
  --bg-glass: rgba(11, 11, 40, 0.7);
  --border: rgba(0, 200, 255, 0.15);
  --border-glow: rgba(0, 200, 255, 0.4);
  --text: #ddddf5;
  --text-muted: #6b6b9a;
  --text-dim: #4a4a7a;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-glow: 0 0 30px rgba(0, 200, 255, 0.15);
  --shadow-pink: 0 0 30px rgba(255, 20, 147, 0.15);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'SF Mono', 'Fira Code', 'Fira Mono', 'Droid Sans Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@view-transition {
  navigation: auto;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(0, 200, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(155, 89, 255, 0.06) 0%, transparent 50%);
}

/* ─── Typography ─────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--yellow); }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(0, 200, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--green);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: #050520;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  line-height: 1.7;
  margin: 1.5rem 0;
}

pre code .code-comment { color: #6b6b9a; }

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--text);
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li { margin-bottom: 0.35rem; }

.gradient-text {
  background: linear-gradient(135deg, var(--blue) 0%, var(--pink) 50%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2rem;
}

/* ─── Site Header ────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-logo img {
  height: 44px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.4));
  transition: filter 0.3s;
}
.nav-logo img:hover {
  filter: drop-shadow(0 0 16px rgba(0, 200, 255, 0.7));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover {
  color: var(--blue);
  background: rgba(0, 200, 255, 0.08);
}

.nav-links form {
  width: auto;
  margin: 0;
}

.nav-links button {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.nav-links button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ─── Page Wrapper / Layout ──────────────────────── */

.page-wrapper {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.page-wrapper:has(aside) {
  grid-template-columns: 220px 1fr;
}

@media (max-width: 768px) {
  .page-wrapper:has(aside) {
    grid-template-columns: 1fr;
  }
}

/* ─── Docs Sidebar ───────────────────────────────── */

.docs-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.docs-sidebar-section {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 0.75rem 0.75rem 0.25rem;
  display: block;
}

.docs-sidebar a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  display: block;
  transition: color 0.2s, background 0.2s;
}
.docs-sidebar a:hover {
  color: var(--blue);
  background: rgba(0, 200, 255, 0.07);
}

.docs-content {
  min-width: 0;
}

.docs-content h1 { margin-bottom: 0.5rem; }
.docs-content h2 { margin-top: 2.5rem; margin-bottom: 0.75rem; }
.docs-content h3 { margin-top: 1.75rem; color: var(--blue); }
.docs-content p { color: var(--text-muted); }
.docs-content ul li { color: var(--text-muted); }

/* ─── Hero ───────────────────────────────────────── */

.hero {
  text-align: center;
  padding: clamp(3rem, 8vw, 7rem) 1rem clamp(3rem, 6vw, 5rem);
}

.hero-logo {
  width: clamp(160px, 30vw, 260px);
  height: auto;
  margin: 0 auto 2rem;
  display: block;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 40px rgba(0, 200, 255, 0.3));
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Buttons ────────────────────────────────────── */

.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: white;
  font-family: var(--font);
  font-weight: 800;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 200, 255, 0.3);
  animation: glow-pulse 3s ease-in-out infinite;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 200, 255, 0.5);
  color: white;
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-weight: 800;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  border: 2px solid var(--border-glow);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-2px);
}

/* ─── Section Labels ─────────────────────────────── */

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  margin-bottom: 1rem;
  background: rgba(0, 200, 255, 0.1);
  border: 1px solid rgba(0, 200, 255, 0.25);
  color: var(--blue);
}

/* ─── Sections ───────────────────────────────────── */

.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

/* ─── Feature Grid ───────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color 0.3s, background 0.3s, transform 0.2s, box-shadow 0.3s;
}
.feature-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.feature-card h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ─── Showcase / Code Section ────────────────────── */

.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .showcase { grid-template-columns: 1fr; }
}

.file-tree {
  background: #050520;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 2;
}

.file-tree .dir  { color: var(--yellow); font-weight: 700; }
.file-tree .file { color: var(--text); }
.file-tree .special { color: var(--pink); font-weight: 700; }
.file-tree .dynamic { color: var(--blue); }
.file-tree .comment { color: var(--text-dim); font-style: italic; }
.file-tree .indent { padding-left: 1.5rem; display: block; }
.file-tree .indent2 { padding-left: 3rem; display: block; }
.file-tree .indent3 { padding-left: 4.5rem; display: block; }

/* ─── CTA Section ────────────────────────────────── */

.cta-section {
  text-align: center;
  padding: clamp(3rem, 6vw, 5rem) 1rem;
  border-top: 1px solid var(--border);
}

.cta-section h2 { margin-bottom: 1rem; }
.cta-section p { margin-bottom: 2rem; }

/* ─── Badges ─────────────────────────────────────── */

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.badge-blue   { background: rgba(0, 200, 255, 0.15); color: var(--blue); border: 1px solid rgba(0,200,255,0.3); }
.badge-pink   { background: rgba(255, 20, 147, 0.15); color: var(--pink); border: 1px solid rgba(255,20,147,0.3); }
.badge-yellow { background: rgba(255, 215, 0, 0.15); color: var(--yellow); border: 1px solid rgba(255,215,0,0.3); }
.badge-green  { background: rgba(0, 255, 136, 0.15); color: var(--green); border: 1px solid rgba(0,255,136,0.3); }

/* ─── Reference Table ────────────────────────────── */

.ref-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.ref-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: rgba(0, 200, 255, 0.06);
  border-bottom: 2px solid var(--border-glow);
  color: var(--blue);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ref-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:hover td { background: rgba(0, 200, 255, 0.03); }

.ref-table td:first-child {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--green);
  white-space: nowrap;
}

/* ─── Callout ────────────────────────────────────── */

.callout {
  background: rgba(0, 200, 255, 0.06);
  border: 1px solid rgba(0, 200, 255, 0.2);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.callout.pink {
  background: rgba(255, 20, 147, 0.06);
  border-color: rgba(255, 20, 147, 0.2);
  border-left-color: var(--pink);
}

.callout strong { color: var(--text); }

/* ─── Sparkle ────────────────────────────────────── */

.sparkle {
  display: inline-block;
  color: var(--yellow);
  animation: sparkle 2s ease-in-out infinite;
}

/* ─── Footer ─────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-inner p {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

.footer-inner a {
  color: var(--text-muted);
  font-weight: 700;
}
.footer-inner a:hover { color: var(--blue); }

/* ─── Forms ──────────────────────────────────────── */

form { width: 100%; }

label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

label small {
  color: var(--text-dim);
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  display: block;
  margin-bottom: 1.25rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
}

textarea { resize: vertical; min-height: 180px; }

button[type="submit"],
button.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 2rem;
  font-family: var(--font);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 200, 255, 0.35);
  opacity: 0.9;
}

/* ─── Tasks ──────────────────────────────────────── */

.tasks-app ul { margin: 0; padding: 0; }
.tasks-app ul li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  list-style: none;
}

.tasks-app ul li header, .tasks-app ul li footer {
  width: 24px;
  height: 100%;
  flex-shrink: 0;
}

.tasks-app ul li header {
  margin-right: 0.75rem;
}

.tasks-app ul li header button {
  border: none;
  background: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  color: var(--text-muted);
  transition: color 0.2s;
}
.tasks-app ul li header button:hover { color: var(--green); }

.tasks-app ul li footer { display: flex; flex-direction: column; gap: 0.25rem; }
.tasks-app ul li footer { 
  display: flex;
  flex-direction: row;
  width: auto;
}
.tasks-app ul li footer button {
  border: solid 1px var(--pink);
  width: 30px;
  height: 30px;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  color: var(--pink);
  transition: color 0.2s;
}
.tasks-app ul li footer button:hover { color: var(--pink); }

.tasks-app ul li section {
  padding-right: 0.75rem;
  width: 100%;
  color: var(--text);
}

.tasks-app .done section {
  text-decoration: line-through;
  color: var(--text-dim);
}

/* task add form */
.tasks-app > form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tasks-app > form textarea {
  margin: 0;
  min-height: auto;
  height: 2.75rem;
  resize: none;
  flex: 1;
}

.tasks-app > form button {
  flex-shrink: 0;
  width: auto;
  padding: 0 1.5rem;
  height: 2.75rem;
}

/* ─── Blog ───────────────────────────────────────── */

article h1 { margin-bottom: 0.5rem; }
article { max-width: 720px; }

article h2, article h3 { margin-top: 2rem; }
article p, article li { color: var(--text-muted); }
article pre { margin: 1.5rem 0; }
article blockquote {
  border-left: 3px solid var(--pink);
  padding-left: 1rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 1.5rem 0;
}

/* ─── Sign in / up pages ─────────────────────────── */

.auth-form {
  max-width: 420px;
  margin: 4rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-glow);
}

.auth-form h1 { margin-bottom: 0.5rem; font-size: 1.8rem; }
.auth-form p { margin-bottom: 1.5rem; }

/* ─── Animations ─────────────────────────────────── */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50%       { opacity: 0.6; transform: scale(1.3) rotate(20deg); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 200, 255, 0.3); }
  50%       { box-shadow: 0 4px 40px rgba(255, 20, 147, 0.4); }
}

/* ─── Responsive ─────────────────────────────────── */

@media (max-width: 768px) {
  .nav-inner { padding: 0.6rem 1rem; }
  .nav-logo img { height: 36px; }
  .nav-links { gap: 0.1rem; }
  .nav-links a { font-size: 0.8rem; padding: 0.3rem 0.5rem; }

  .page-wrapper { padding: 1.5rem 1rem; }

  .hero { padding: 3rem 1rem 2rem; }
  .hero-logo { width: 160px; }

  .docs-sidebar { position: static; }

  .feature-grid { grid-template-columns: 1fr; }
  .showcase { grid-template-columns: 1fr; }
}
