/* ============================================================
   Xen Productions — Tools stylesheet
   "Tron Legacy" glass chrome + the design tokens the embedded
   builder widgets expect (originally provided by the old Wix
   host). Keep these token names in sync with the tools.
   ============================================================ */

:root {
  /* Tokens consumed by the builder widgets */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --color-background-primary: rgba(9, 18, 28, 0.62);
  --color-background-secondary: rgba(140, 202, 236, 0.055);
  --color-border-tertiary: rgba(150, 210, 240, 0.12);
  --color-border-secondary: rgba(150, 210, 240, 0.24);
  --color-text-primary: #e7f4fb;
  --color-text-secondary: #a3c2d1;
  --color-text-tertiary: #647f8e;
  --border-radius-lg: 16px;
  --border-radius-md: 10px;

  /* Tron glass palette */
  --font-ui: "Rajdhani", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Orbitron", sans-serif;
  --bg: #02040a;
  --accent: #5ad6f0;
  --accent-bright: #b6ecff;
  --accent-glow: rgba(88, 206, 255, 0.35);
  --glow-soft: rgba(88, 206, 255, 0.16);
  --orange: #d9530a;
  --orange-bright: #ff8f3d;
  --orange-glow: rgba(217, 83, 10, 0.28);
  --glass-fill: rgba(128, 196, 232, 0.055);
  --glass-border: rgba(255, 168, 92, 0.30);   /* orange glass edge */
  --glass-hi: rgba(224, 248, 255, 0.16);
  --ink: #e7f4fb;
  --ink-soft: #a3c2d1;
  --ink-faint: #647f8e;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(58% 20% at 50% 44%, rgba(158, 232, 255, 0.13), transparent 72%),
    radial-gradient(130% 80% at 50% -12%, rgba(72, 150, 205, 0.15), transparent 55%),
    radial-gradient(120% 62% at 50% 120%, rgba(40, 122, 192, 0.14), transparent 60%),
    linear-gradient(180deg, #070d17 0%, #04070f 48%, #01030a 64%, #020509 100%),
    var(--bg);
  background-attachment: fixed;
}

/* Grey-stone grain — tactile texture in the empty space */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
}

/* Perspective grid floor receding to the horizon */
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: -2vh;
  height: 44vh;
  transform: perspective(340px) rotateX(64deg);
  transform-origin: bottom center;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(96, 214, 240, 0.22) 1px, transparent 1px),
    linear-gradient(rgba(96, 214, 240, 0.22) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: linear-gradient(to top, #000 2%, transparent 82%);
  mask-image: linear-gradient(to top, #000 2%, transparent 82%);
}

/* Keep page chrome above the atmosphere layers */
.tool-header, .tool-main, .tool-footer { position: relative; z-index: 1; }

/* ---- Header ---- */
.tool-header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 24px 22px;
  border-bottom: 1px solid rgba(150, 210, 240, 0.08);
}
.tool-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}
.tool-back:hover { color: var(--accent-bright); text-shadow: 0 0 14px var(--accent-glow); }
.tool-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 38px);
  letter-spacing: 0.04em;
  margin: 16px 0 8px;
  color: #f2fbff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2), 0 0 40px var(--accent-glow);
}
.tool-header h1 .accent {
  color: var(--orange-bright);
  -webkit-text-stroke: 1.2px var(--orange);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.tool-header p {
  margin: 0;
  max-width: 660px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}

/* ---- Main ---- */
.tool-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px 60px;
}

/* Scoped reset for the embedded widget (restores its original
   `* { margin:0; padding:0 }` without touching the page chrome).
   The widget's own explicit paddings load later and win. */
.tool-main * { margin: 0; padding: 0; }

/* Frosted-glass treatment for the builder's control panel + output */
.tool-main .controls {
  background: var(--glass-fill) !important;
  border: 1px solid var(--glass-border) !important;
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.5), inset 0 1px 0 var(--glass-hi);
}
.tool-main pre,
.tool-main .status,
.tool-main .wix-note,
.tool-main .code-bar {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Balance the builder with PROPORTIONAL columns so it scales the
   same on any screen. `minmax(0,…)` lets both tracks shrink below
   their content (so the code box scrolls internally instead of
   forcing horizontal page scroll). Stacks on phones. */
.tool-main .app {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  max-width: 760px;
  margin-inline: auto;
  gap: 20px;
  align-items: start;
}

/* Responsive: builder stacks on narrow screens. */
@media (max-width: 720px) {
  .tool-main .app {
    grid-template-columns: minmax(0, 1fr);
    max-width: 460px;
  }
}

/* ---- Footer ---- */
.tool-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 24px;
  border-top: 1px solid rgba(150, 210, 240, 0.08);
  color: var(--ink-faint);
  font-size: 14px;
  letter-spacing: 0.1em;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.tool-footer a { color: var(--ink-soft); text-decoration: none; }
.tool-footer a:hover { color: var(--accent-bright); }
