/* =========================================================
   DATAWEAVE STUDIO — "THE FORGE" edition
   Depends on core.css for tokens, nav, buttons, reveal,
   cursor, grain, marquee, footer.
   ========================================================= */

/* ── section shell (shared with portfolio vocabulary) ──── */
.section { padding: clamp(72px, 11vh, 150px) 0; position: relative; }
.section.tight { padding-top: 0; }
.sec-head { margin-bottom: clamp(40px, 6vh, 72px); max-width: 760px; }
.sec-head h2 { margin-top: 18px; padding-bottom: 0.06em; }
.sec-head .sub { color: var(--bone-2); margin-top: 18px; max-width: 560px; font-size: 16px; }
.divider { height: 1px; background: var(--line-2); }

/* ── HERO ──────────────────────────────────────────────── */
#hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column;
  justify-content: center; gap: clamp(28px, 5vh, 54px);
  padding-top: calc(var(--nav-h) + clamp(28px, 6vh, 64px));
  padding-bottom: clamp(40px, 7vh, 80px); overflow: hidden;
}
#hero-seam {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0.9;
}
#hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(70% 50% at 80% 30%, var(--ember-2), transparent 70%),
    linear-gradient(180deg, rgba(12,10,8,0.4), transparent 30%, transparent 70%, rgba(12,10,8,0.6));
}
.hero-inner { position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(46px, 9.5vw, 132px); font-weight: 800; letter-spacing: -0.05em;
  line-height: 0.86; text-transform: uppercase; color: var(--bone);
}
.hero-title .dim { color: transparent; -webkit-text-stroke: 1.4px var(--bone-3); }
.hero-title .dot { color: var(--flux); }
.hero-sub { max-width: 580px; margin-top: 26px; }
.hero-sub b { color: var(--bone); font-weight: 500; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: clamp(28px, 4vh, 44px); padding-top: 20px; border-top: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: 11px; color: var(--bone-4); letter-spacing: 0.08em;
}
.hero-foot .v { color: var(--flux); }

/* ── LIVE TRANSPILER (the forge itself) ───────────────── */
.forge-box {
  position: relative; z-index: 2; border: 1px solid var(--line);
  background: var(--ink-1); border-radius: 4px; overflow: hidden;
  box-shadow: 0 60px 120px -60px rgba(0,0,0,0.95);
}
.forge-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 18px; background: var(--ink-2); border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.forge-bar-l { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.forge-bar-l .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--bone-4); text-transform: uppercase; }
.preset-row { display: flex; gap: 6px; }
.preset {
  font-family: var(--font-mono); font-size: 11px; color: var(--bone-3);
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 2px; background: transparent;
  transition: color .25s, border-color .25s, background .25s;
}
.preset:hover { color: var(--bone); border-color: var(--line); }
.preset.active { color: var(--flux); border-color: var(--line-flux); background: var(--ember-2); }
.run-btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 500; color: var(--ink); background: var(--flux);
  padding: 8px 16px; border-radius: 2px; transition: transform .25s var(--ease), background .25s;
}
.run-btn:hover { background: var(--flux-2); transform: translateY(-1px); }
.run-btn svg { width: 11px; height: 11px; fill: currentColor; }

.forge-panes { display: grid; grid-template-columns: 1fr 1fr 1fr; min-height: 290px; background: var(--ink); position: relative; }
.pane { display: flex; flex-direction: column; border-right: 1px solid var(--line-2); position: relative; min-width: 0; }
.pane:last-child { border-right: none; }
.pane.out { background: linear-gradient(180deg, var(--ember-2), transparent 40%); }
.pane-h {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bone-4); padding: 10px 16px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 8px;
}
.pane.out .pane-h { color: var(--flux); }
.pane-h .pip { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pane-body {
  padding: 16px; flex: 1; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65;
  color: var(--bone-2); overflow-x: auto; white-space: pre; position: relative;
}
.pane-body.loading { opacity: 0.25; filter: blur(1px); transition: opacity .2s; }
.run-pulse {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; color: var(--flux); letter-spacing: 0.1em;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10;
  background: rgba(12,10,8,0.4); backdrop-filter: blur(2px); text-transform: uppercase;
}
.run-pulse.active { opacity: 1; }
.run-pulse .bars { display: flex; gap: 4px; }
.run-pulse .bars i { width: 3px; height: 16px; background: var(--flux); animation: forgePulse 0.8s ease-in-out infinite; }
.run-pulse .bars i:nth-child(2){ animation-delay: .12s } .run-pulse .bars i:nth-child(3){ animation-delay: .24s } .run-pulse .bars i:nth-child(4){ animation-delay: .36s }
@keyframes forgePulse { 0%,100%{ transform: scaleY(0.4); opacity: 0.5 } 50%{ transform: scaleY(1); opacity: 1 } }

/* syntax — forge palette */
.s-key  { color: var(--flux-3); }
.s-str  { color: var(--ice); }
.s-num  { color: var(--flux-2); }
.s-kw   { color: var(--flux); }
.s-com  { color: var(--bone-4); }

/* ── STATS ─────────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.stat { background: var(--ink); padding: 30px 24px; }
.stat .n { font-family: var(--font-disp); font-weight: 800; font-size: clamp(34px,5vw,56px); letter-spacing: -0.04em; color: var(--bone); line-height: 1; }
.stat .n .u { color: var(--flux); }
.stat .l { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--bone-3); text-transform: uppercase; margin-top: 12px; }

/* ── BENTO FEATURES ────────────────────────────────────── */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.bc { background: var(--ink); padding: 32px 28px; position: relative; overflow: hidden; transition: background .4s; }
.bc.span2 { grid-column: span 2; }
.bc.span3 { grid-column: 1 / -1; }
.bc::before { content: ''; position: absolute; top: 0; left: 0; width: 0; height: 2px; background: var(--flux); transition: width .5s var(--ease); }
.bc:hover { background: var(--ink-1); }
.bc:hover::before { width: 100%; }
/* featured VS Code row */
.bc.vscode-feat { background: linear-gradient(110deg, var(--ember-2), transparent 55%); }
.bc.vscode-feat::before { width: 100%; opacity: 0.5; }
.bc.vscode-feat:hover::before { opacity: 1; }
.bc-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--flux); letter-spacing: 0.02em; transition: gap .25s var(--ease); }
.bc-link:hover { gap: 11px; }
.bc-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--flux); }
.bc h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.025em; color: var(--bone); margin: 16px 0 12px; line-height: 1.1; }
.bc p { font-size: 14px; color: var(--bone-3); line-height: 1.6; }
.bc p code { font-family: var(--font-mono); font-size: 12.5px; color: var(--flux-2); background: var(--ember-2); padding: 1px 6px; border-radius: 2px; }
.bc-i { font-family: var(--font-mono); font-size: 11px; color: var(--bone-4); position: absolute; top: 32px; right: 28px; }

/* ── SCREENSHOT GALLERY ────────────────────────────────── */
.ss-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 22px; }
.ss-tab {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; color: var(--bone-3);
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 100px; background: transparent;
  transition: color .25s, border-color .25s, background .25s;
}
.ss-tab:hover { color: var(--bone); }
.ss-tab.active { color: var(--flux); border-color: var(--line-flux); background: var(--ember-2); }
.ss-frame { position: relative; border: 1px solid var(--line); background: var(--ink-2); overflow: hidden; box-shadow: 0 50px 100px -50px rgba(0,0,0,0.9); }
.ss-frame .bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); background: var(--ink-1); }
.ss-frame .bar i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.ss-frame .bar i:nth-child(1){ background:#3a2a20 } .ss-frame .bar i:nth-child(2){ background:#3a3324 } .ss-frame .bar i:nth-child(3){ background:#243226 }
.ss-frame .bar .u { margin-left: 12px; font-family: var(--font-mono); font-size: 10.5px; color: var(--bone-4); letter-spacing: 0.04em; }
.ss-frame img { width: 100%; display: block; aspect-ratio: 1920 / 1020; object-fit: cover; object-position: top; background: var(--ink-2); transition: opacity .25s, transform .25s; cursor: zoom-in; }
.ss-frame img.switching { opacity: 0; transform: scale(0.99); }

/* ── WORKFLOW ──────────────────────────────────────────── */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.fstep { background: var(--ink); padding: 30px 26px; position: relative; transition: background .35s; }
.fstep::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--flux); opacity: 0; transition: opacity .3s; }
.fstep:hover { background: var(--ink-1); }
.fstep:hover::before { opacity: 1; }
.fstep .num { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--bone-4); line-height: 1; margin-bottom: 16px; transition: color .3s; }
.fstep:hover .num { color: var(--flux); }
.fstep h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: var(--bone); margin-bottom: 10px; }
.fstep p { font-size: 13.5px; color: var(--bone-3); line-height: 1.6; }

/* ── DOWNLOAD ──────────────────────────────────────────── */
.dl-card { position: relative; border: 1px solid var(--line); background: var(--ink-1); padding: clamp(32px, 5vw, 56px); overflow: hidden; }
.dl-card::before { content: ''; position: absolute; top: -120px; right: -100px; width: 360px; height: 360px; background: radial-gradient(circle, var(--ember), transparent 70%); pointer-events: none; }
.dl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 38px; flex-wrap: wrap; position: relative; }
.dl-head h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 700; letter-spacing: -0.035em; color: var(--bone); }
.dl-head p { font-size: 14.5px; color: var(--bone-2); line-height: 1.65; max-width: 460px; margin-top: 12px; }
.dl-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.version-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--line-flux); border-radius: 2px; font-family: var(--font-mono); font-size: 12px; color: var(--flux); background: var(--ember-2); letter-spacing: 0.04em; }
.rel-date { font-family: var(--font-mono); font-size: 11px; color: var(--bone-4); letter-spacing: 0.04em; }
.dl-platforms { display: flex; flex-direction: column; gap: 22px; position: relative; }
/* VS Code recommended block + honest desktop note */
.dl-vscode .dl-group-label { color: var(--flux); }
.dl-rec { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--flux); background: var(--ember-2); border: 1px solid var(--line-flux); border-radius: 2px; padding: 2px 7px; }
.dl-note { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--bone-3); margin: 0 0 16px; max-width: 640px; }
.dl-note em { color: var(--bone-2); font-style: normal; }
.dl-note .vs-ver { color: var(--flux); }
.dl-group-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-4); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.dl-group-label.current { color: var(--flux); }
.dl-group-label.current::after { content: "detected"; font-size: 9px; padding: 2px 7px; background: var(--ember-2); border: 1px solid var(--line-flux); border-radius: 2px; letter-spacing: 0.06em; }
.dl-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 2px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.03em; cursor: pointer; transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s; }
.dl-btn.primary { background: var(--flux); color: var(--ink); }
.dl-btn.primary:hover { background: var(--flux-2); transform: translateY(-2px); }
.dl-btn.ghost { background: transparent; color: var(--bone-2); border: 1px solid var(--line); }
.dl-btn.ghost:hover { border-color: var(--line-flux); color: var(--flux); }
.dl-btn-sub { display: block; font-size: 9px; opacity: 0.55; margin-top: 2px; font-weight: 400; letter-spacing: 0; }
.dl-sep { border: none; border-top: 1px solid var(--line-2); margin: 0; }
.skel { background: linear-gradient(90deg, var(--line-2) 0%, var(--line) 50%, var(--line-2) 100%); background-size: 200% 100%; animation: skel 1.5s ease infinite; }
@keyframes skel { 0%{ background-position: 200% 0 } 100%{ background-position: -200% 0 } }
.dl-error { font-family: var(--font-mono); font-size: 12px; color: var(--flux-2); padding: 16px 18px; background: var(--ember-2); border: 1px solid var(--line-flux); }
.dl-error a { color: var(--flux); }

/* ── LIGHTBOX ──────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 10000; background: rgba(8,6,4,0.95); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 30px; cursor: zoom-out; animation: lbIn .22s ease-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,0.7); }
.lightbox .x { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--ink-2); color: var(--bone); border-radius: 50%; font-size: 20px; display: grid; place-items: center; cursor: pointer; transition: border-color .2s; }
.lightbox .x:hover { border-color: var(--flux); color: var(--flux); }
.lightbox .hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-4); }
@keyframes lbIn { from{ opacity: 0 } to{ opacity: 1 } }
body.lb-open { overflow: hidden; }

/* ── back-to-portfolio brand variant ───────────────────── */
.brand .back { color: var(--bone-4); transition: transform .3s var(--ease), color .3s; display: inline-block; }
.brand:hover .back { transform: translateX(-3px); color: var(--flux); }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
  .forge-panes { grid-template-columns: 1fr; min-height: 0; }
  .pane { border-right: none; border-bottom: 1px solid var(--line-2); }
  .pane:last-child { border-bottom: none; }
  .bento { grid-template-columns: 1fr 1fr; }
  .bc.span2 { grid-column: span 2; }
  .bc:last-child { grid-column: 1 / -1; } /* fill the trailing odd cell at 2-col */
  .flow { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  :root { --nav-h: 60px; }
  .brand-txt .bx { display: none; }
  .brand-txt { font-size: 12px; }
  .bento, .flow, .stat-row { grid-template-columns: 1fr; }
  .bc.span2 { grid-column: span 1; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .forge-bar { gap: 12px; }
  .preset-row { flex-wrap: wrap; }
  .dl-head { flex-direction: column; }
  .dl-meta { align-items: flex-start; }
  .bc-i { position: static; display: block; margin-bottom: 10px; }
  .hero-foot { font-size: 10px; }
}
