:root {
  --bg: #f7f9fb;
  --bg-raised: #ffffff;
  --bg-inset: #eef2f6;
  --border: #dfe6ec;
  --border-soft: #e9eef3;
  --text: #24313d;
  --text-muted: #64758a;

  --accent: #7497af;
  --accent-dark: #4f7191;
  --accent-darker: #385669;
  --accent-light: #e7eef3;
  --accent-soft: #d3e0e8;

  --danger: #c0392b;
  --danger-soft: #fbe4e1;

  --gradient-accent: linear-gradient(135deg, #86a7bd, var(--accent-dark));
  --gradient-hero: radial-gradient(560px circle at 10% 10%, rgba(116, 151, 175, 0.16), transparent 60%),
                   radial-gradient(480px circle at 90% 0%, rgba(116, 151, 175, 0.12), transparent 60%),
                   radial-gradient(520px circle at 80% 100%, rgba(116, 151, 175, 0.14), transparent 60%),
                   #fbfcfd;

  --shadow-sm: 0 1px 3px rgba(36, 49, 61, 0.06);
  --shadow-md: 0 10px 26px rgba(36, 49, 61, 0.08);
  --shadow-lg: 0 20px 46px rgba(36, 49, 61, 0.13);
  --shadow-accent: 0 10px 22px rgba(79, 113, 145, 0.28);

  --radius: 16px;
  --radius-lg: 22px;
  --font-ui: 'Nunito', system-ui, sans-serif;
  --font-display: 'Fredoka', var(--font-ui);
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}
.logo-image {
  height: 42px;
  width: auto;
  display: block;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
}

::selection { background: var(--accent-soft); color: var(--accent-darker); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-soft); border-radius: 999px; border: 2px solid var(--bg-raised); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

a { color: var(--accent-dark); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 249, 251, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo:hover { text-decoration: none; color: var(--accent-dark); }
.logo-mark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  background: var(--accent);
  padding: 5px 7px;
  border-radius: 8px;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav a { color: var(--text-muted); font-weight: 700; font-size: 0.96rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }

.btn-newsletter {
  background: var(--accent);
  color: #ffffff !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 800 !important;
  box-shadow: var(--shadow-accent);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  display: inline-block;
}
.btn-newsletter:hover { text-decoration: none; background: var(--accent-dark); transform: translateY(-2px); }

/* ---------- Hero band ---------- */

.hero-band {
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
  padding-bottom: 30px;
}

.hero-inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 20px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-darker);
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }

.hero-inner h1 {
  font-family: var(--font-display);
  font-size: 2.9rem;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  line-height: 1.14;
  color: var(--text);
}
.highlight {
  position: relative;
  color: var(--accent-darker);
  white-space: nowrap;
}
.highlight::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 0.06em;
  height: 0.32em;
  background: var(--accent-soft);
  border-radius: 6px;
  z-index: -1;
}

.hero-inner p {
  color: var(--text-muted);
  font-size: 1.13rem;
  margin: 0;
  max-width: 60ch;
}
.hero-inner strong { color: var(--accent-darker); }

.hero-wave {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: -6px;
}
.hero-wave path { fill: var(--bg); }

/* ---------- Main / sandbox layout ---------- */

main { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }

.sandbox {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}

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

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease;
}
.panel:hover { box-shadow: var(--shadow-lg); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-inset);
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 9px;
}
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
}

.panel-actions { display: flex; align-items: center; gap: 8px; }

select#examples {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
select#examples:hover { border-color: var(--accent); }

.btn-primary, .btn-ghost {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease, background 0.12s ease;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: var(--bg-raised);
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--accent-darker); border-color: var(--accent); background: var(--accent-light); }

/* ---------- Editor ---------- */

.editor-wrap {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--bg-raised);
}

#gutter {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
  color: #c1cbd6;
  padding: 14px 10px;
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre;
  border-right: 1px solid var(--border-soft);
  min-width: 34px;
  background: var(--bg-inset);
}

#code-editor {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
  padding: 14px;
  tab-size: 4;
}

/* ---------- Output ---------- */

.tabs { display: flex; gap: 4px; }
.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.86rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab-btn.active { background: var(--bg-raised); color: var(--accent-darker); box-shadow: var(--shadow-sm); }
.tab-btn:hover { color: var(--text); }

.status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}
.status.ok { color: var(--accent-darker); }
.status.err { color: var(--danger); }

.tab-content {
  position: relative;
  flex: 1;
  background: var(--bg-raised);
  overflow: auto;
}

.tab-pane { display: none; height: 100%; }
.tab-pane.active { display: block; }

#console-output {
  margin: 0;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  height: 100%;
  overflow: auto;
}
#console-output .muted, .muted { color: var(--text-muted); }
#console-output .err-line { color: var(--danger); }
.small { font-size: 0.78rem; }

#canvas-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  height: 100%;
  background: var(--bg-inset);
}
#sandbox-canvas {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  max-width: 100%;
  height: auto;
}

#loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  text-align: center;
}
#loading-overlay.hidden { display: none; }
#loading-overlay p { margin: 0; font-weight: 700; }

.spinner {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Callout ---------- */

.callout {
  position: relative;
  overflow: hidden;
  margin-top: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  padding: 32px 34px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-accent);
}
.callout h2 { font-family: var(--font-display); font-weight: 600; margin: 0 0 6px; font-size: 1.4rem; color: #ffffff; }
.callout p { margin: 0; color: rgba(255, 255, 255, 0.85); max-width: 480px; }
.btn-callout {
  background: #ffffff;
  color: var(--accent-darker) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}
.btn-callout:hover { background: #ffffff; transform: translateY(-2px); box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2); }

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  padding: 34px 24px 110px;
  max-width: 1180px;
  margin: 0 auto;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent-soft);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 18px;
  padding-top: 20px;
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.footer-brand p {
  font-family: var(--font-ui);
  font-weight: 400;
  color: var(--text-muted);
  margin: 4px 0 0;
  width: 100%;
  font-size: 0.9rem;
}
.footer-links { display: flex; gap: 20px; align-items: center; }
.footer-links a { color: var(--text-muted); font-weight: 700; }
.footer-links a:hover { color: var(--text); }
.copyright { color: var(--text-muted); font-size: 0.82rem; margin: 0; }

/* ---------- AI chat (Byte) ---------- */

#ai-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 20px 11px 11px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition: transform 0.15s ease;
}
#ai-fab:hover { transform: translateY(-2px); }
.ai-fab-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.ai-panel {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 31;
  width: 344px;
  max-width: calc(100vw - 32px);
  height: 460px;
  max-height: calc(100vh - 100px);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.ai-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--gradient-accent);
}
.ai-panel-title { display: flex; align-items: center; gap: 10px; }
.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: #ffffff;
  flex-shrink: 0;
}
.ai-panel-header strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: #ffffff;
  display: block;
}
.ai-subtitle {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}
#ai-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  line-height: 1;
  flex-shrink: 0;
}
#ai-close:hover { background: rgba(255, 255, 255, 0.32); }

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-raised);
}

.msg {
  max-width: 85%;
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.msg.bot {
  align-self: flex-start;
  background: var(--accent-light);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.typing { color: var(--text-muted); font-style: italic; background: transparent; border: none; padding-left: 2px; }

.ai-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}
#ai-input {
  flex: 1;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 15px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  outline: none;
}
.bath-banner {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  margin-top: 80px;
}

.bath-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.bath-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05),
    rgba(0, 0, 0, 0.45)
  );
  color: white;
}

.bath-overlay h2 {
  margin: 0 0 8px;
  font-family: "Fredoka", sans-serif;
  font-size: 2.2rem;
}

.bath-overlay p {
  margin: 0;
  font-family: "Nunito", sans-serif;
  font-size: 1.05rem;
}
#ai-input:focus { border-color: var(--accent); }
.ai-form .btn-primary { background: var(--accent); color: #fff; box-shadow: none; padding: 9px 18px; }
.ai-form .btn-primary:hover { background: var(--accent-dark); transform: none; }



/* ==========================================
   ✦ NEW CODEFORME HERO ✦
   ========================================== */

.hero-band {
  position: relative !important;
  overflow: hidden !important;
  background: #7497af !important;
  color: #ffffff !important;
  min-height: 610px !important;
  padding: 105px 30px 135px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Main container */
.hero-inner {
  position: relative !important;
  z-index: 5 !important;
  width: 100% !important;
  max-width: 1150px !important;
  margin: 0 auto !important;
  text-align: center !important;
}

/* =========================
   TOP LABEL
========================= */

.hero-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 18px !important;
  margin-bottom: 30px !important;

  border: 1px solid rgba(255,255,255,0.35) !important;
  background: rgba(255,255,255,0.12) !important;
  border-radius: 50px !important;

  font-family: "Nunito", sans-serif !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 2px !important;
}

.label-dot {
  width: 8px !important;
  height: 8px !important;
  background: #ffffff !important;
  border-radius: 50% !important;
  display: inline-block !important;
}

/* =========================
   MASSIVE HEADLINE
========================= */

.hero-inner h1 {
  margin: 0 !important;
  padding: 0 !important;

  font-family: "Fredoka", sans-serif !important;
  font-size: clamp(70px, 10vw, 135px) !important;
  line-height: 0.88 !important;
  letter-spacing: -5px !important;
  font-weight: 700 !important;

  color: #ffffff !important;
}

/* Highlighted second line */
.hero-highlight {
  display: inline-block !important;

  color: #7497af !important;
  background: #ffffff !important;

  padding: 5px 28px 14px !important;
  margin-top: 14px !important;

  border-radius: 24px !important;

  transform: rotate(-1.5deg) !important;

  box-shadow:
    10px 10px 0 rgba(0,0,0,0.08) !important;
}

/* =========================
   DESCRIPTION
========================= */

.hero-description {
  max-width: 680px !important;
  margin: 42px auto 0 !important;

  font-family: "Nunito", sans-serif !important;
  font-size: 21px !important;
  line-height: 1.55 !important;
  font-weight: 500 !important;

  color: rgba(255,255,255,0.92) !important;
}

.hero-description strong {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* =========================
   CREDIT
========================= */

.hero-credit {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 14px !important;

  margin-top: 30px !important;

  font-family: "Nunito", sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;

  color: rgba(255,255,255,0.75) !important;
}

.hero-credit a {
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 800 !important;
}

.credit-line {
  width: 35px !important;
  height: 1px !important;
  background: rgba(255,255,255,0.45) !important;
}

/* =========================
   DECORATIVE CODE
========================= */

.hero-decoration {
  position: absolute !important;
  z-index: 1 !important;

  font-family: "JetBrains Mono", monospace !important;
  font-weight: 600 !important;

  color: rgba(255,255,255,0.10) !important;
  pointer-events: none !important;
  user-select: none !important;
}

.code-left {
  left: 5% !important;
  top: 18% !important;
  font-size: 130px !important;
  transform: rotate(-12deg) !important;
}

.code-right {
  right: 5% !important;
  bottom: 22% !important;
  font-size: 110px !important;
  transform: rotate(10deg) !important;
}

/* =========================
   BACKGROUND CIRCLES
========================= */

.hero-band::before {
  content: "" !important;
  position: absolute !important;

  width: 520px !important;
  height: 520px !important;

  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 50% !important;

  top: -260px !important;
  right: -100px !important;
}

.hero-band::after {
  content: "" !important;
  position: absolute !important;

  width: 400px !important;
  height: 400px !important;

  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 50% !important;

  bottom: -230px !important;
  left: -100px !important;
}

/* =========================
   WAVE
========================= */

.hero-wave {
  position: absolute !important;
  left: 0 !important;
  bottom: -1px !important;

  width: 100% !important;
  height: 85px !important;

  z-index: 10 !important;
}

.hero-wave path {
  fill: #ffffff !important;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

  .hero-band {
    min-height: 560px !important;
    padding: 80px 20px 115px !important;
  }

  .hero-inner h1 {
    font-size: clamp(58px, 16vw, 85px) !important;
    letter-spacing: -3px !important;
  }

  .hero-highlight {
    padding: 4px 16px 10px !important;
    border-radius: 17px !important;
  }

  .hero-description {
    font-size: 18px !important;
    margin-top: 32px !important;
  }

  .hero-label {
    font-size: 10px !important;
    letter-spacing: 1.3px !important;
  }

  .hero-decoration {
    display: none !important;
  }

  .hero-credit {
    font-size: 13px !important;
  }
}

