/* Bricxt Squad — Dark Cinematic Theme */
:root {
  --bg: #0b0b0c;
  --bg-alt: #101013;
  --panel: #121218;
  --text: #e6e6e6;
  --muted: #9b9ba1;
  --accent: #dd1d3a; /* deep red accent */
  --accent-soft: rgba(221, 29, 58, 0.25);
  --ok: #3ddc97;
  --warn: #ffb020;
  --err: #ff4d4f;
  --border: #1e1e26;
  --shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03) inset;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
  line-height: 1.6;
}

img, svg, video { max-width: 100%; display: block; }
a { color: #f1f1f1; text-decoration: none; }
.muted { color: var(--muted); }

.disclaimer-banner {
  width: 100%;
  background: linear-gradient(90deg, rgba(221,29,58,0.12), transparent);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 12px;
  letter-spacing: 0.2px;
}
.disclaimer-banner span { color: var(--accent); font-weight: 600; margin-right: 6px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(10,10,12,0.8), rgba(10,10,12,0.4));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-mark {
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.brand-sub { font-size: 12px; color: var(--muted); }
.brand.small .brand-sub { display: none; }

.nav {
  display: flex;
  gap: 16px;
  align-items: center;
}
.nav a {
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.nav a:hover {
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}
.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: radial-gradient(100% 100% at 20% 20%, rgba(221,29,58,0.6), rgba(221,29,58,0.2));
  border: 1px solid var(--border);
}

.hero {
  padding: 56px 24px 24px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60% 60% at 10% 10%, rgba(221,29,58,0.08), transparent 60%),
    radial-gradient(30% 30% at 90% 20%, rgba(221,29,58,0.05), transparent 60%);
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.hero-title {
  font-size: 42px;
  line-height: 1.15;
  margin: 0 0 8px 0;
  text-shadow: 0 10px 30px rgba(221,29,58,0.15);
}
.hero-subtitle {
  color: var(--muted);
  margin-bottom: 20px;
}
.hero-ctas { display: flex; gap: 12px; margin-bottom: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, rgba(221,29,58,0.8), rgba(221,29,58,0.5));
  box-shadow: 0 10px 20px rgba(221,29,58,0.25);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary {
  background: rgba(255,255,255,0.05);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1px solid rgba(221,29,58,0.35);
  color: #fff;
}
.btn-outline:hover {
  background: rgba(221,29,58,0.1);
}

.hero-terminal {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #0b0b0c, #0f0f14);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #0e0e11;
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; }
.dot.amber { background: #ffbd2e; }
.dot.green { background: #28c840; }
.term-title { color: var(--muted); font-size: 12px; margin-left: auto; }
.terminal-body {
  padding: 16px;
  min-height: 140px;
  color: #e1ffee;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 100% 24px;
}

.grid {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 24px;
  display: grid;
  gap: 16px;
}
.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.split {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: start;
}
.card, .panel {
  background: linear-gradient(180deg, var(--panel), #0e0e12);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.panel-glow {
  position: relative;
}
.panel-glow::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 60px 10px var(--accent-soft);
  opacity: 0.2;
}
.section {
  max-width: 1100px;
  margin: 36px auto 64px;
  padding: 0 24px;
}
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.link { color: #fff; opacity: 0.9; }
.link:hover { color: #fff; opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.checklist { padding-left: 18px; }
.checklist li { margin-bottom: 10px; }

.scanlines {
  position: relative;
  height: 120px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  overflow: hidden;
}
.scanlines::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(180deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 3px);
  animation: scan 6s linear infinite;
}
@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.glitch {
  position: relative;
  display: inline-block;
  text-shadow: 0 0 1px rgba(255,255,255,0.4);
}
.glitch::before, .glitch::after {
  content: attr(data-glitch);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  opacity: 0.08;
}
.glitch::before { transform: translate(1px, 0); color: #ff003c; mix-blend-mode: screen; }
.glitch::after { transform: translate(-1px, 0); color: #00e5ff; mix-blend-mode: screen; }

.site-footer {
  border-top: 1px solid var(--border);
  background: #0a0a0c;
  padding: 24px;
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}
.footer-nav {
  display: flex;
  gap: 12px;
}

/* Layout helpers for subpages */
.page {
  max-width: 1100px;
  margin: 24px auto 64px;
  padding: 0 24px;
}
.page-title {
  margin: 0 0 8px 0;
  font-size: 32px;
}
.page-subtitle {
  margin: 0 0 18px 0;
  color: var(--muted);
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .btn { padding: 8px 12px; }

/* Forms */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: #0f0f13;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  outline: none;
}
textarea { min-height: 120px; resize: vertical; }
.field { margin-bottom: 14px; }

/* Tabs (for Tools) */
.tabs { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.tab-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tab-section-title {
  margin-top: 8px;
  margin-bottom: 2px;
  padding: 6px 8px;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--muted);
  border-left: 2px solid rgba(221,29,58,0.35);
}
.tab-list button {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f0f13;
  color: var(--text);
  cursor: pointer;
}
.tab-list button.active {
  background: rgba(221,29,58,0.14);
  border-color: rgba(221,29,58,0.5);
}
.tab-panel {
  background: linear-gradient(180deg, var(--panel), #0e0e12);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width: 980px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; position: absolute; right: 16px; top: 64px; background: #0b0b0d; padding: 12px; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
  .nav-toggle { display: inline-block; }
  .feature-grid { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: 1fr; }
  .hero-title { font-size: 34px; }
}

/* Utility */
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
  color: var(--muted);
}

.sheet-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}
.code-block {
  position: relative;
  background: #0c0c10;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  overflow: visible; /* allow tooltip to overflow the box */
  z-index: 1; /* establish stacking context below tooltip */
}
.code-block pre {
  margin: 34px 0 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 64px;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(221,29,58,0.15);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}
.copy-btn:hover { background: rgba(221,29,58,0.28); }

@media (max-width: 720px) {
  .sheet-grid { grid-template-columns: 1fr; }
}

/* Cheat-sheet tooltip for copyable snippets */
.tip-icon {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(221,29,58,0.5);
  background: rgba(221,29,58,0.12);
  color: #fff;
  font-size: 12px;
  cursor: help;
  user-select: none;
}
.tip-icon::after {
  content: attr(data-tip);
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, 70vw);
  background: rgba(10,10,12,0.96);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  display: none;
  z-index: 999; /* ensure tooltip renders above surrounding blocks */
}
.tip-icon:hover::after {
  display: block;
}

/* Challenges */
.challenge.completed {
  background: linear-gradient(180deg, #0e1a14, #0a130f);
  border-color: rgba(61, 220, 151, 0.5);
  box-shadow: 0 0 0 1px rgba(61, 220, 151, 0.2) inset, 0 10px 30px rgba(0,0,0,0.4);
}
.challenge.failed {
  background: linear-gradient(180deg, #1a0e10, #130a0b);
  border-color: rgba(221, 29, 58, 0.5);
  box-shadow: 0 0 0 1px rgba(221, 29, 58, 0.2) inset, 0 10px 30px rgba(0,0,0,0.4);
}