/* --- variables (dark by default) --- */
body:not(.light) {
  --bg: #05070f;
  --fg: #eaf1ff;
  --muted: #a1b2cc;
  --panel: rgba(18, 24, 40, 0.55);
  --stroke: rgba(255, 255, 255, 0.1);
  --glow: #b4c7ff;
  --accent: #7dd3fc;
  --accent-2: #b3e1ff;
  --orb-a: conic-gradient(from 180deg, #7dd3fc, #e879f9, #7dd3fc);
  --orb-b: conic-gradient(from 0deg, #a7f3d0, #60a5fa, #a7f3d0);
}

/* light mode overrides */
body.light {
  --bg: #f4f4f8;
  --fg: #0b0b0b;
  --muted: #4a4a4a;
  --panel: rgba(255, 255, 255, 0.65);
  --stroke: rgba(0, 0, 0, 0.08);
  --glow: #2563eb;
  --accent: #60a5fa;
  --accent-2: #93c5fd;
  --orb-a: conic-gradient(from 180deg, #60a5fa, #fbbf24, #60a5fa);
  --orb-b: conic-gradient(from 0deg, #34d399, #60a5fa, #34d399);
}

/* reset */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, sans-serif;

  /* fixed background (no blocks) */
  background: radial-gradient(
      1500px 900px at 20% -10%,
      #1b2550 0%,
      transparent 60%
    ),
    radial-gradient(1500px 900px at 90% 110%, #251a55 0%, transparent 60%),
    var(--bg);
  background-size: cover;
  /* scale to fill viewport */
  background-repeat: no-repeat;
  /* no tiling */
  background-attachment: fixed;
  /* stays still on scroll */
  transition: background 0.4s ease, color 0.4s ease;
}

/* ambient orbs */
.bg.orb {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2200px;
  /* for ultra wide screens */
  height: 2200px;
  pointer-events: none;
  filter: blur(120px);
  opacity: 0.35;
  z-index: -2;
}

.orb-a {
  background: var(--orb-a);
  mix-blend-mode: screen;
}

.orb-b {
  background: var(--orb-b);
  mix-blend-mode: screen;
}

/* hero */
.hero {
  padding: 64px 24px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-inner {
  width: min(1200px, 92%);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(56px, 4vw, 128px);
  line-height: 0.9;
  text-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.sub {
  margin: 10px 4px 0;
  color: var(--muted);
  max-width: 720px;
  font-size: clamp(14px, 1.6vw, 18px);
}

/* theme switch (responsive) */
.theme-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  transform: scale(1);
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch .switch {
  width: 56px;
  height: 30px;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  background: linear-gradient(180deg, #e9e9ee, #cfcfd6);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.65), 0 6px 14px rgba(0, 0, 0, 0.15);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.theme-switch .switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(
      100% 100% at 30% 30%,
      rgba(255, 255, 255, 0.9),
      rgba(255, 255, 255, 0.55) 40%,
      rgba(255, 255, 255, 0.2) 60%
    ),
    #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease;
}

.theme-switch input:checked + .switch {
  background: linear-gradient(180deg, #2b2e36, #16181d);
}

.theme-switch input:checked + .switch::after {
  transform: translateX(26px);
  background: radial-gradient(
      100% 100% at 30% 30%,
      rgba(255, 255, 255, 0.35),
      rgba(255, 255, 255, 0.15) 40%,
      rgba(255, 255, 255, 0.06) 60%
    ),
    #2b2e36;
}

.theme-label {
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0.85;
}

/* glass card */
.card {
  width: min(1200px, 92%);
  margin: 12px auto 24px;
  padding: 22px 22px 26px;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  backdrop-filter: blur(18px) saturate(120%);
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 60px rgba(0, 0, 0, 0.45);
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* workspace */
.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 980px) {
  .workspace {
    grid-template-columns: 1fr 1fr;
  }
}

.pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-weight: 600;
  color: var(--glow);
  letter-spacing: 0.2px;
}

textarea,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
  background: rgba(10, 14, 26, 0.75);
  color: var(--fg);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

body.light textarea,
body.light pre {
  background: rgba(255, 255, 255, 0.88);
  color: var(--fg);
}

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

pre {
  min-height: 260px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
}

/* toolbar/buttons */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn-liquid {
  --shine: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0) 42%
  );
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(
      120% 180% at 50% 0%,
      rgba(255, 255, 255, 0.35),
      rgba(255, 255, 255, 0) 60%
    ),
    linear-gradient(
      135deg,
      var(--accent) 0%,
      var(--accent-2) 50%,
      var(--accent) 100%
    );
  color: #082030;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.35),
    0 12px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-liquid::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 12px;
  background: var(--shine);
  opacity: 0.85;
}

.btn-liquid:hover {
  filter: saturate(115%);
  transform: translateY(-1px);
}

/* footer */
.footer {
  width: min(1200px, 92%);
  margin: 0 auto 40px;
  padding: 12px 16px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  backdrop-filter: blur(18px) saturate(120%);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.footer .gh {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}

/* small screen tweaks */
@media (max-width: 768px) {
  .theme-switch {
    transform: scale(0.92);
  }
}

@media (max-width: 480px) {
  .theme-switch {
    transform: scale(0.85);
  }

  .brand-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}