/* reyoy · dark, single accent, mobile first */

:root {
  --bg: #0a0b10;
  --bg-2: #10121a;
  --panel: #14161f;
  --panel-2: #1a1d28;
  --line: #262a38;
  --text: #eef0f6;
  --muted: #949cb2;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --accent-text: #ffffff;
  --radius: 14px;
  --wrap: 1140px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 12% -8%, rgba(124, 92, 255, 0.20), transparent 62%),
    radial-gradient(680px 380px at 92% 4%, rgba(29, 155, 240, 0.14), transparent 60%);
  z-index: 0;
}

header, main, footer { position: relative; z-index: 1; }

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.18; margin: 0 0 0.5em; letter-spacing: -0.02em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  z-index: 50;
}
.skip:focus { left: 0; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: rgba(10, 11, 16, 0.72); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: -0.03em; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #1d9bf0);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10) inset;
}
.brand-name { font-size: 20px; }
.head-nav { display: flex; gap: 18px; font-size: 14px; }
.head-nav a { color: var(--muted); text-decoration: none; }
.head-nav a:hover { color: var(--text); }

/* Hero */
.hero { padding: 36px 0 20px; text-align: center; }
.eyebrow {
  display: inline-block; margin: 0 0 14px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: #c3b6ff;
  background: var(--accent-soft); border: 1px solid rgba(124,92,255,0.30);
  padding: 5px 12px; border-radius: 999px;
}
.hero h1 { font-size: clamp(30px, 6.4vw, 54px); font-weight: 800; margin-bottom: 12px; }
.lede { margin: 0 auto; max-width: 620px; color: var(--muted); font-size: clamp(15px, 2.4vw, 18px); }

/* Tool */
.tool { padding: 22px 0 8px; }
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.field-row > .field { margin-bottom: 0; }
.field-row label { min-height: 34px; }
label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }

input[type="url"], input[type="text"], textarea {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 13px; font: inherit; font-size: 15px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
input[type="file"] { width: 100%; font-size: 13px; color: var(--muted); }
input:focus, textarea:focus, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input[type="url"]:focus, input[type="text"]:focus, textarea:focus { border-color: var(--accent); outline-offset: 0; }

.row { display: flex; gap: 9px; align-items: center; }
.row input[type="url"] { flex: 1 1 auto; min-width: 0; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); min-height: 19px; }
.hint.error { color: #ff8f8f; }
.hint.ok { color: #6ee7a8; }

.btn {
  border: 1px solid transparent; border-radius: 11px; padding: 11px 16px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--panel-2); color: var(--text); white-space: nowrap;
  transition: filter 0.15s ease, background 0.15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn-big { width: 100%; padding: 14px 18px; font-size: 16px; }

/* Manual mode */
.manual { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); margin-bottom: 16px; }
.manual > summary { cursor: pointer; padding: 11px 14px; font-size: 14px; font-weight: 600; color: var(--text); margin: 0; list-style: none; }
.manual > summary::-webkit-details-marker { display: none; }
.manual > summary::before { content: "+ "; color: var(--accent); font-weight: 700; }
.manual[open] > summary::before { content: "- "; }
.manual-body { padding: 4px 14px 14px; }

/* Chips and swatches */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: #d5cbff; }

.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.swatch {
  height: 42px; border-radius: 10px; border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--line) inset; cursor: pointer; padding: 0;
  position: relative; overflow: hidden;
}
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.custom-row { margin-top: 10px; align-items: center; gap: 12px; }
.custom-label { margin: 0; }
input[type="color"] {
  width: 52px; height: 34px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg-2); cursor: pointer;
}

input[type="range"] { width: 100%; accent-color: var(--accent); }

.toggles { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--text); font-weight: 500; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 17px; height: 17px; }

.export-block { border-top: 1px solid var(--line); padding-top: 16px; }
.bar { display: block; height: 7px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.bar[hidden] { display: none; }
.bar span { display: block; height: 100%; width: 0%; background: var(--accent); transition: width 0.12s linear; }

/* Preview */
.preview { display: flex; flex-direction: column; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.preview-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; min-height: 320px;
}
#canvas {
  display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto;
  border-radius: 10px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

/* Ads. The reserved space only appears once a real publisher id is configured,
   so the placeholder build never shows an empty labelled box. */
.ad-wrap { margin: 28px auto; display: none; }
.ad-wrap.ad-ready { display: block; }
.ad-slot {
  min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: 14px; padding: 12px; overflow: hidden;
}
.ad-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #5c6479; margin-bottom: 6px; }
.ad-slot ins { width: 100%; }
.ad-slot:not(.ad-live) ins { display: none !important; }

/* How it works */
.how, .faq { padding: 26px 0; }
.how h2, .faq h2 { font-size: clamp(22px, 4vw, 30px); margin-bottom: 20px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; margin-bottom: 10px;
  background: var(--accent-soft); color: #c9bcff; font-weight: 700; font-size: 14px;
  border: 1px solid rgba(124,92,255,0.30);
}
.steps h3 { font-size: 17px; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }

/* FAQ */
.faq-list { display: grid; gap: 10px; }
.faq-list details { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 0; }
.faq-list summary { cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 15px; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; float: right; color: var(--accent); font-weight: 700; }
.faq-list details[open] summary::after { content: "-"; }
.faq-list p { margin: 0; padding: 0 16px 15px; color: var(--muted); font-size: 15px; }

/* Content pages */
.doc { padding: 30px 0 10px; max-width: 760px; }
.doc h1 { font-size: clamp(26px, 5vw, 38px); }
.doc h2 { font-size: 20px; margin-top: 30px; }
.doc p, .doc li { color: #c3c9da; font-size: 16px; }
.doc ul { padding-left: 20px; }
.doc .updated { color: var(--muted); font-size: 14px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 34px; padding: 26px 0 40px; }
.foot-inner { display: grid; gap: 12px; }
.foot-made { margin: 0; font-size: 15px; font-weight: 600; }
.foot-made a { text-decoration: none; }
.foot-made a:hover { text-decoration: underline; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.foot-nav a { color: var(--muted); text-decoration: none; }
.foot-nav a:hover { color: var(--text); }
.foot-note { margin: 4px 0 0; font-size: 12.5px; color: #6d7488; max-width: 720px; line-height: 1.55; }

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 52px 0 26px; }
}

@media (min-width: 980px) {
  .tool-grid { grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr); align-items: start; }
  .swatches { grid-template-columns: repeat(9, 1fr); }
  .panel { padding: 22px; }
  #canvas { max-height: 68vh; }
  .stage { min-height: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
