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

:root {
  /* cloaked.agency brand */
  --grad-start: #4ca2bc;
  --grad-end: #03002e;
  --bg: #0a0a1a;
  --bg-card: #111128;
  --bg-card-hover: #161636;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --text-subtle: #5d5d7a;
  --accent: #4ca2bc;
  --accent-hover: #5dbdda;
  --accent-soft: rgba(76, 162, 188, 0.18);
  --warm: #e8613c;
  --border: rgba(76, 162, 188, 0.18);
  --border-strong: rgba(76, 162, 188, 0.35);
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  --radius: 18px;
  --radius-sm: 10px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

#theme-toggle:checked ~ .container {
  --bg: #f4f4f8;
  --bg-card: #ffffff;
  --bg-card-hover: #fbfbff;
  --text: #1a1a2e;
  --text-muted: #666680;
  --text-subtle: #999bb6;
  --border: rgba(76, 162, 188, 0.20);
  --border-strong: rgba(76, 162, 188, 0.45);
  --accent-soft: rgba(76, 162, 188, 0.10);
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
}
#theme-toggle:checked ~ .bg-layer { opacity: 0; }

html { font-size: 16px; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

.ui-toggle { display: none; }

.bg-layer {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(76, 162, 188, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 30%, rgba(232, 97, 60, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 95%, rgba(3, 0, 46, 0.50) 0%, transparent 45%);
  pointer-events: none; z-index: 0;
  transition: opacity var(--transition);
}

.bg-curve {
  position: fixed;
  top: 50%; left: 50%;
  width: min(140vw, 1400px);
  height: min(140vw, 1400px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.50;
  animation: bg-rotate 110s linear infinite;
}
@keyframes bg-rotate {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
#theme-toggle:checked ~ .bg-curve { opacity: 0.25; }

.container {
  position: relative; z-index: 1;
  width: 100%; max-width: 1180px;
  padding: 40px 28px 56px;
  display: flex; flex-direction: column;
  gap: 40px;
  transition: color var(--transition);
}

/* ── Top bar ────────────────────────────────────── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.profile-wrapper {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.profile {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-strong);
}
.profile-wrapper p {
  font-size: 0.95rem; font-weight: 500;
}

.theme-switch {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-card);
  transition: border-color var(--transition), background var(--transition);
}
.theme-switch:hover { border-color: var(--border-strong); }
.theme-switch__icon { color: var(--text-muted); display: inline-flex; }
.theme-switch__moon { opacity: 1; }
.theme-switch__sun { opacity: 0.4; }
#theme-toggle:checked ~ .container .theme-switch__moon { opacity: 0.4; }
#theme-toggle:checked ~ .container .theme-switch__sun { opacity: 1; }
.theme-switch__track {
  width: 32px; height: 18px; border-radius: 999px;
  background: var(--accent-soft); position: relative;
}
.theme-switch__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  transition: transform var(--transition);
}
#theme-toggle:checked ~ .container .theme-switch__thumb {
  transform: translateX(14px);
}

/* ── Hero ───────────────────────────────────────── */
.hero { text-align: center; max-width: 760px; margin: 16px auto 0; }
.title-label {
  font-size: 0.75rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.2rem);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -0.025em;
}
.emph {
  background: linear-gradient(135deg, var(--grad-start), var(--accent-hover));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.hero-sub {
  margin-top: 18px; color: var(--text-muted);
  font-size: 1.05rem; line-height: 1.55;
}

/* ── Card grid ──────────────────────────────────── */
.card-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.theme-card {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.theme-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.30);
}
.theme-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-card__preview {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(circle at 50% 60%, rgba(76, 162, 188, 0.18) 0%, transparent 70%),
    rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
#theme-toggle:checked ~ .container .theme-card__preview {
  background:
    radial-gradient(circle at 50% 60%, rgba(76, 162, 188, 0.12) 0%, transparent 70%),
    rgba(0, 0, 0, 0.02);
}
.preview-svg {
  width: 70%; max-width: 220px; height: auto;
  color: var(--accent);
}
.badge-new {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--mono);
  font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  padding: 4px 10px; border-radius: 999px;
}

.theme-card__body {
  padding: 24px;
  display: flex; flex-direction: column;
  gap: 8px; flex: 1;
}
.theme-card__eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem; letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
}
.theme-card h2 {
  font-size: 1.45rem; font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.theme-card__desc {
  color: var(--text-muted);
  font-size: 0.95rem; line-height: 1.55;
  flex: 1;
}
.theme-card__cta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  font-weight: 500; font-size: 0.9rem;
  color: var(--accent);
}
.theme-card:hover .theme-card__cta { color: var(--accent-hover); }
.theme-card__url {
  font-family: var(--mono);
  font-size: 0.72rem; color: var(--text-subtle);
  margin-top: 4px;
}

/* ── How-to ─────────────────────────────────────── */
.how-to {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex; flex-direction: column; gap: 12px;
}
.how-to h3 {
  font-size: 1.1rem; font-weight: 600;
  color: var(--text);
}
.how-to ol {
  margin-left: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.96rem;
}
.how-to li::marker {
  color: var(--accent);
  font-weight: 600;
}

/* ── Bottom bar ─────────────────────────────────── */
.bottom-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.modern-frontend-developer .emph { font-weight: 500; }
.learning-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500;
}

@media (max-width: 640px) {
  .container { padding: 24px 18px 40px; gap: 28px; }
  .theme-card__body { padding: 20px; }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 0.95rem; }
}
