/* ============================================================
   CONTENT FACTORY — Refinery reskin.
   Ports the Content Factory app component system, but re-mapped to
   The Refinery's palette (dark near-black + petrol teal), fonts
   (Syne / Inter), and glass. Everything is scoped under .cf-scope so
   the CF app classes never collide with the main Refinery site
   (which also defines .btn / .eyebrow / .section / .card / .pill).

   Strategy: keep the CF class + CSS-variable NAMES so the ported
   markup / inline styles work verbatim — but give the variables
   Refinery VALUES. Restyle looks Refinery; markup stays 1:1 with the
   original React app.
   ============================================================ */

.cf-scope{
  /* --- CF variable names, Refinery values --- */
  --bg-void:#050609; --bg-obsidian:#090b0f; --bg-elev:#0e1116;
  --glass:rgba(14,17,22,.62); --glass-strong:rgba(9,11,15,.80);
  --glass-hairline:rgba(255,255,255,.10); --glass-blur:blur(18px) saturate(120%);
  /* teal — Refinery petrol teal */
  --teal-neon:#1f8f7d; --teal:#135b50; --teal-deep:#0f4a42; --teal-abyss:#0a3a34; --teal-ink:#072a26;
  --text-hi:#f4f6f9; --text-mid:#b9c0cb; --text-lo:#767e8c;
  --danger:#e23b54; --warn:#f4b740;
  --radius:16px; --radius-sm:10px;
  --shadow-glow:0 0 34px -10px rgba(31,143,125,.42);
  --shadow-drop:0 24px 60px -20px rgba(0,0,0,.82);
  --font-display:"Syne","Helvetica Neue",Arial,sans-serif;
  --font-body:"Inter","Helvetica Neue",Arial,sans-serif;
  --font-mono:ui-monospace,"SF Mono","SFMono-Regular",Menlo,monospace;

  position:relative; z-index:1;
  font-family:var(--font-body); color:var(--text-hi);
}

/* typographic base */
.cf-scope h1,.cf-scope h2,.cf-scope h3,.cf-scope .display{
  font-family:var(--font-display);letter-spacing:-.02em;line-height:1.04;font-weight:700;
}
.cf-scope .mono{font-family:var(--font-mono)}
.cf-scope .muted{color:var(--text-mid)}
.cf-scope a{color:inherit;text-decoration:none}
.cf-scope .eyebrow{
  font-family:var(--font-mono);font-size:11px;letter-spacing:.22em;text-transform:uppercase;
  color:var(--teal-neon);font-weight:600;display:inline-flex;align-items:center;gap:8px;
}
.cf-scope .eyebrow::before{content:none} /* kill Refinery gem accent inside CF */
.cf-scope .container{max-width:1180px;margin:0 auto;padding:0 24px;position:relative;z-index:2}

/* glass */
.cf-scope .glass{
  background:var(--glass);backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  border:1px solid var(--glass-hairline);border-radius:var(--radius);
  box-shadow:var(--shadow-drop),inset 0 1px 0 rgba(255,255,255,.04);
}
.cf-scope .glass-strong{background:var(--glass-strong);border:1px solid var(--glass-hairline)}

/* buttons */
.cf-scope .btn{
  font-family:var(--font-body);font-weight:600;font-size:14px;border-radius:999px;padding:11px 22px;
  cursor:pointer;border:1px solid transparent;transition:.18s;display:inline-flex;align-items:center;gap:8px;
  text-transform:none;letter-spacing:0;line-height:1;
}
.cf-scope .btn-primary{background:var(--teal);color:#eaf3f1;border-color:var(--teal-neon)}
.cf-scope .btn-primary:hover{background:var(--teal-deep);border-color:var(--teal-neon);box-shadow:var(--shadow-glow)}
.cf-scope .btn-glass{background:var(--glass);border:1px solid var(--glass-hairline);color:var(--text-hi);backdrop-filter:var(--glass-blur)}
.cf-scope .btn-glass:hover{border-color:var(--teal-neon);box-shadow:var(--shadow-glow)}
.cf-scope .btn-ghost{background:transparent;color:var(--text-mid)}
.cf-scope .btn-ghost:hover{color:var(--text-hi)}
.cf-scope .btn:disabled{opacity:.4;cursor:not-allowed}

.cf-scope .tag{
  font-family:var(--font-mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;padding:3px 8px;
  border-radius:6px;background:rgba(31,143,125,.10);border:1px solid var(--glass-hairline);color:var(--teal-neon);
  display:inline-flex;align-items:center;gap:4px;
}
.cf-scope .pill{
  font-family:var(--font-mono);font-size:12px;padding:6px 12px;border-radius:999px;
  background:var(--glass);border:1px solid var(--glass-hairline);display:inline-flex;align-items:center;gap:6px;
}

/* banner */
.cf-scope .banner{
  padding:9px;text-align:center;font-family:var(--font-mono);font-size:12px;letter-spacing:.06em;
  background:linear-gradient(90deg,var(--teal-abyss),var(--teal-ink));color:var(--teal-neon);
  border:1px solid var(--glass-hairline);border-radius:12px;margin:14px 0 0;
}

/* hero */
.cf-scope .hero{padding:72px 0 52px;position:relative}
.cf-scope .hero h1{font-size:clamp(42px,6.5vw,92px);font-weight:700}
.cf-scope .grad{background:linear-gradient(120deg,var(--teal-neon),#3fd9a0 60%,var(--teal));-webkit-background-clip:text;background-clip:text;color:transparent}
.cf-scope .promptbar{display:flex;gap:10px;margin-top:28px;max-width:640px;flex-wrap:wrap}
.cf-scope .promptbar input{
  flex:1;min-width:0;background:var(--glass-strong);border:1px solid var(--glass-hairline);border-radius:999px;
  padding:15px 22px;color:var(--text-hi);font-size:15px;font-family:var(--font-body);
}
.cf-scope .promptbar input:focus{outline:none;border-color:var(--teal-neon);box-shadow:var(--shadow-glow)}

/* sections + grids */
.cf-scope .section{padding:52px 0}
.cf-scope .bento{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.cf-scope .card{padding:22px;border-radius:var(--radius);transition:.2s}
.cf-scope a.card,.cf-scope .card{border:1px solid var(--glass-hairline)}
.cf-scope .card:hover{transform:translateY(-3px);border-color:var(--teal-neon)}
.cf-scope .card h3{font-size:20px;margin-bottom:6px}
.cf-scope .presets{display:grid;grid-template-columns:repeat(6,1fr);gap:10px}
.cf-scope .preset{
  aspect-ratio:3/4;border-radius:12px;display:flex;align-items:flex-end;padding:10px;font-family:var(--font-mono);
  font-size:10px;letter-spacing:.05em;text-transform:uppercase;border:1px solid var(--glass-hairline);
  background:linear-gradient(180deg,rgba(19,91,80,.20),rgba(5,6,9,.72));transition:.2s;cursor:pointer;color:var(--text-hi);
}
.cf-scope .preset:hover{border-color:var(--teal-neon);box-shadow:var(--shadow-glow);transform:scale(1.02)}
.cf-scope .marquee{display:flex;gap:12px;flex-wrap:wrap}

/* pricing */
.cf-scope .plans{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;align-items:start}
.cf-scope .plan{padding:26px;position:relative}
.cf-scope .plan.feat{border-color:var(--teal);box-shadow:var(--shadow-glow)}
.cf-scope .plan .price{font-family:var(--font-display);font-size:44px;font-weight:700;margin:10px 0}
.cf-scope .plan ul{list-style:none;margin-top:16px;display:flex;flex-direction:column;gap:9px;padding:0}
.cf-scope .plan li{font-size:13px;color:var(--text-mid);display:flex;gap:8px}
.cf-scope .plan li::before{content:"▸";color:var(--teal-neon)}

/* studio */
.cf-scope .studio{display:grid;grid-template-columns:220px 1fr 340px;gap:16px;min-height:calc(100vh - 140px);padding:16px 0}
.cf-scope .rail{padding:16px;height:fit-content}
.cf-scope .rail .grp{font-family:var(--font-mono);font-size:10px;letter-spacing:.15em;text-transform:uppercase;color:var(--text-lo);margin:14px 0 8px}
.cf-scope .rail button,.cf-scope .rail a>button{
  width:100%;text-align:left;background:transparent;border:none;color:var(--text-mid);font-size:14px;
  padding:9px 11px;border-radius:10px;cursor:pointer;font-family:var(--font-body);
}
.cf-scope .rail button.on,.cf-scope .rail button:hover{background:rgba(31,143,125,.10);color:var(--text-hi)}
.cf-scope .composer{padding:22px;display:flex;flex-direction:column;gap:16px;height:fit-content}
.cf-scope .composer textarea{
  background:var(--bg-void);border:1px solid var(--glass-hairline);border-radius:14px;padding:16px;color:var(--text-hi);
  font-family:var(--font-body);font-size:15px;min-height:96px;resize:vertical;
}
.cf-scope .composer textarea:focus{outline:none;border-color:var(--teal-neon)}
.cf-scope .modelgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;max-height:260px;overflow:auto;padding-right:4px}
.cf-scope .modeltile{padding:12px;border-radius:12px;border:1px solid var(--glass-hairline);background:var(--glass);cursor:pointer;transition:.15s}
.cf-scope .modeltile:hover{border-color:var(--teal-neon)}
.cf-scope .modeltile.sel{border-color:var(--teal);background:rgba(31,143,125,.12);box-shadow:var(--shadow-glow)}
.cf-scope .modeltile .nm{font-weight:600;font-size:13px}
.cf-scope .modeltile .pv{font-family:var(--font-mono);font-size:10px;color:var(--text-lo)}
.cf-scope .modeltile.locked{opacity:.45}
.cf-scope .row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cf-scope .between{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.cf-scope .feed{padding:16px;display:flex;flex-direction:column;gap:10px;height:fit-content}
.cf-scope .job{padding:12px;border-radius:12px;border:1px solid var(--glass-hairline);background:var(--glass)}
.cf-scope .job .th{height:76px;border-radius:8px;background:linear-gradient(135deg,var(--teal-abyss),#05070a);margin-top:8px;display:grid;place-items:center;font-family:var(--font-mono);font-size:10px;color:var(--teal-neon)}
.cf-scope .status{font-family:var(--font-mono);font-size:10px;text-transform:uppercase;letter-spacing:.1em}
.cf-scope .status.queued{color:var(--warn)} .cf-scope .status.rendering{color:var(--teal-neon)} .cf-scope .status.done{color:var(--teal-neon)} .cf-scope .status.failed{color:var(--danger)}
.cf-scope .select{background:var(--bg-void);border:1px solid var(--glass-hairline);color:var(--text-hi);border-radius:10px;padding:8px 10px;font-family:var(--font-body);font-size:13px}

/* credit slider */
.cf-scope .credit-slider{-webkit-appearance:none;appearance:none;width:100%;height:8px;border-radius:999px;outline:none;cursor:pointer;background:linear-gradient(90deg,var(--teal-neon) var(--pct,50%),var(--glass-hairline) var(--pct,50%))}
.cf-scope .credit-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:24px;height:24px;border-radius:50%;background:var(--teal-neon);border:3px solid var(--bg-void);box-shadow:var(--shadow-glow);cursor:grab}
.cf-scope .credit-slider::-webkit-slider-thumb:active{cursor:grabbing}
.cf-scope .credit-slider::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:var(--teal-neon);border:3px solid var(--bg-void);box-shadow:var(--shadow-glow);cursor:grab}
.cf-scope input[type=range]{accent-color:var(--teal)}

.cf-scope .notice{font-family:var(--font-mono);font-size:11px;color:var(--warn);border:1px dashed rgba(244,183,64,.4);border-radius:10px;padding:8px 12px;background:rgba(244,183,64,.05)}

/* tables */
.cf-scope table{border-collapse:collapse}
.cf-scope input,.cf-scope textarea,.cf-scope select{font-family:var(--font-body)}

/* ---- CF internal sub-nav — LOCKED as a fixed bar directly beneath the
   Refinery top nav. The Refinery nav is position:fixed (out of flow, z-index
   100) so the sub-nav is fixed at top:var(--nav-h) and .cf-scope reserves
   space for BOTH bars. z-index sits below the Refinery nav (100) so its
   Services / AI flyouts always paint over the sub-nav. --------------------- */
.cf-subnav{
  position:fixed; top:var(--nav-h,74px); left:0; right:0; z-index:80;
  height:54px;
  background:rgba(6,8,11,.93);backdrop-filter:blur(16px) saturate(140%);-webkit-backdrop-filter:blur(16px) saturate(140%);
  border-bottom:1px solid rgba(255,255,255,.09);
}
.cf-subnav__inner{max-width:1180px;margin:0 auto;padding:0 24px;display:flex;align-items:center;gap:10px;height:54px}
.cf-subnav__brand{display:flex;align-items:center;gap:9px;font-family:var(--font-display);font-weight:700;font-size:15px;letter-spacing:-.02em;color:#f4f6f9;white-space:nowrap;flex:none}
.cf-subnav__brand .mark{width:24px;height:24px;border-radius:7px;background:linear-gradient(140deg,#135b50,#072a26);box-shadow:0 0 20px -6px rgba(31,143,125,.5);display:grid;place-items:center;color:#eaf3f1;font-weight:700;font-size:11px;font-family:var(--font-mono);flex:none}
.cf-subnav__links{display:flex;align-items:center;gap:2px;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:none}
.cf-subnav__links::-webkit-scrollbar{display:none}
.cf-subnav__links a{font-family:var(--font-body);font-size:13.5px;color:#b9c0cb;padding:8px 11px;border-radius:8px;white-space:nowrap;transition:.15s;flex:none}
.cf-subnav__links a:hover{color:#f4f6f9;background:rgba(31,143,125,.10)}
.cf-subnav__links a.active{color:#f4f6f9;background:rgba(31,143,125,.14)}
.cf-subnav__links a.cf-admin{color:#8a93a3}
.cf-subnav__links a.cf-admin::before{content:"⚙ "}
.cf-subnav__cta{display:flex;align-items:center;gap:8px;margin-left:auto;white-space:nowrap;flex:0 0 auto}
.cf-subnav__pill{font-family:var(--font-mono);font-size:12px;padding:6px 11px;border-radius:999px;background:rgba(14,17,22,.7);border:1px solid rgba(255,255,255,.1);color:#f4f6f9;text-transform:capitalize;flex:none}
.cf-subnav__pill.credits{color:#1f8f7d}
.cf-subnav__btn{font-family:var(--font-body);font-weight:600;font-size:13px;border-radius:999px;padding:8px 15px;background:#135b50;color:#eaf3f1;border:1px solid #1f8f7d;flex:none}
.cf-subnav__btn:hover{background:#0f4a42;box-shadow:0 0 24px -8px rgba(31,143,125,.5)}
.cf-subnav__burger{display:none;background:transparent;border:1px solid rgba(255,255,255,.14);color:#f4f6f9;font-size:15px;border-radius:8px;padding:6px 10px;line-height:1;flex:none}

/* Reserve vertical space for the two stacked fixed bars (nav + sub-nav). */
.cf-scope{padding-top:calc(var(--nav-h,74px) + 54px)}
.cf-scope .hero{padding-top:24px}
.cf-scope > section.section:first-child{padding-top:24px}
.cf-scope > .container:first-child{padding-top:8px}

/* responsive */
@media(max-width:1000px){
  .cf-scope .bento,.cf-scope .plans{grid-template-columns:1fr 1fr}
  .cf-scope .presets{grid-template-columns:repeat(3,1fr)}
  .cf-scope .studio{grid-template-columns:1fr}
}
/* Below this width the inline links can't sit beside the CTA without touching,
   so they collapse into the sub-nav burger dropdown. */
@media(max-width:1080px){
  .cf-subnav__links{
    position:fixed;top:calc(var(--nav-h,74px) + 54px);left:0;right:0;display:none;
    flex-direction:column;align-items:stretch;gap:2px;background:#0e1116;
    border-bottom:1px solid rgba(255,255,255,.1);padding:10px;z-index:79;
    max-height:calc(100vh - var(--nav-h,74px) - 54px);overflow-y:auto;
  }
  .cf-subnav__links.open{display:flex}
  .cf-subnav__links a{font-size:15px;padding:12px 13px}
  .cf-subnav__burger{display:inline-flex;align-items:center;justify-content:center}
}
@media(max-width:600px){
  /* keep only the primary CTA button; credits + plan pills move out of the way */
  .cf-subnav__cta .cf-subnav__pill{display:none}
}
@media(max-width:440px){
  .cf-subnav__brandtxt{display:none}
  .cf-subnav__inner{padding:0 16px}
}
@media(max-width:560px){
  .cf-scope .bento,.cf-scope .plans{grid-template-columns:1fr}
  .cf-scope .presets{grid-template-columns:repeat(2,1fr)}
  .cf-scope .modelgrid{grid-template-columns:1fr}
  .cf-scope .container{padding:0 16px}
  .cf-scope .hero{padding-top:20px}
  .cf-scope .section{padding:38px 0}
}

/* ---------- UNDER CONSTRUCTION / WAITLIST (content-factory.html) ----------
   The product pitch below the fold is unchanged; this block is the only route
   forward from the page, so it has to read as the primary action rather than a
   banner someone scrolls past. */
.cf-scope .banner--wip{
  background:linear-gradient(90deg,rgba(90,58,10,.55),rgba(28,20,6,.75));
  color:#f4c76a;border-color:rgba(244,199,106,.32);
}
.cf-scope .wip{
  margin-top:30px;max-width:760px;padding:26px 26px 22px;border-radius:var(--radius);
  background:var(--glass-strong);border:1px solid rgba(244,199,106,.26);
  box-shadow:0 26px 70px -30px rgba(0,0,0,.9);
}
.cf-scope .wip__head{display:flex;gap:14px;align-items:flex-start}
.cf-scope .wip__dot{
  width:10px;height:10px;border-radius:50%;background:#f4c76a;flex:0 0 auto;margin-top:8px;
  box-shadow:0 0 0 4px rgba(244,199,106,.16);animation:wipPulse 2.4s ease-in-out infinite;
}
@keyframes wipPulse{0%,100%{opacity:1}50%{opacity:.35}}
@media (prefers-reduced-motion: reduce){ .cf-scope .wip__dot{animation:none} }
.cf-scope .wip__title{font-size:24px;line-height:1.2;margin:0}
.cf-scope .wip__sub{margin-top:8px;color:var(--text-lo);font-size:14.5px;line-height:1.65;max-width:60ch}
.cf-scope .wip__form{margin-top:20px}
.cf-scope .wip__row{display:flex;gap:10px;flex-wrap:wrap}
.cf-scope .wip__row--sub{margin-top:10px}
.cf-scope .wip__row input{
  flex:1;min-width:190px;background:rgba(5,6,9,.6);border:1px solid var(--glass-hairline);
  border-radius:999px;padding:14px 20px;color:var(--text-hi);font-size:14.5px;font-family:var(--font-body);
}
.cf-scope .wip__row input:focus{outline:none;border-color:var(--teal-neon);box-shadow:var(--shadow-glow)}
.cf-scope .wip__note{margin-top:12px;color:#ffb4a2;font-size:13.5px}
.cf-scope .wip__fine{margin-top:12px;color:var(--text-lo);font-size:12.5px;opacity:.8}
.cf-scope .wip__done{margin-top:20px}
.cf-scope .wip__alt{
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  margin-top:20px;padding-top:18px;border-top:1px solid var(--glass-hairline);
}
/* Cards and presets that used to walk into the app. They keep every word and lose
   the affordance — no pointer, no hover lift, nothing that reads as clickable. */
.cf-scope .is-locked{cursor:default;opacity:.9}
.cf-scope .is-locked:hover{transform:none;border-color:var(--glass-hairline);box-shadow:none}
.cf-scope .sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0;
}
