/* ============================================================================
 * page.css — layout & component styles specific to the DMCI landing page
 * (hero, REPL, pipeline stepper, mechanics demos, dashboard, resources).
 * Generic primitives live in style.css.
 * ==========================================================================*/

/* ---- Hero -------------------------------------------------------------- */
.hero { position: relative; padding: calc(var(--nav-h) + 64px) 0 80px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); font-weight: 700; line-height: 1.02; margin: 18px 0 0; }
.hero .lead { margin-top: 24px; max-width: 56ch; }
.hero em { font-style: normal; color: var(--c-heading); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-stats { display: flex; gap: 36px; margin-top: 46px; flex-wrap: wrap; }
.hero-stats .num { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.hero-stats .lbl { font-size: .82rem; max-width: 18ch; }
.hero-visual { position: relative; min-height: 420px; }
.hero-viz { position: relative; width: 100%; height: 100%; min-height: 440px; }
.hero-scroll { position: absolute; left: 50%; transform: translateX(-50%); bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--c-faint); font-family: var(--font-mono); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; }

/* ---- "vs" cards -------------------------------------------------------- */
.vs-grid .card-accent { border-color: var(--c-accent); background: linear-gradient(160deg, var(--c-accent-soft), transparent 70%); box-shadow: var(--shadow-glow); }
.vs-grid .card-accent p { color: var(--c-text); }
.step-num, .mech-num { font-family: var(--font-display); font-weight: 700; }
.step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--grad-soft); color: var(--c-accent2); border: 1px solid var(--c-border); font-size: .95rem; margin-bottom: 10px; }
.mech-num { font-size: 2.4rem; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; display: block; margin-bottom: 6px; line-height: 1; }
.mech-block .order-2 { order: 2; }
@media (max-width: 900px) { .mech-block .order-2 { order: 0; } }

/* ---- REPL -------------------------------------------------------------- */
.repl-split { align-items: start; }
.repl { background: var(--c-bg-1); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.repl-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--c-border); background: var(--c-bg-soft); }
.repl-head .code-title { margin-left: 4px; }
.repl-editor { width: 100%; border: none; background: transparent; color: var(--c-text); font-family: var(--font-mono); font-size: .92rem; line-height: 1.6; padding: 16px 18px; resize: vertical; min-height: 92px; outline: none; }
.repl-inputs { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 18px 14px; align-items: center; }
.repl-input { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .82rem; color: var(--c-muted); }
.repl-input input { width: 64px; background: var(--c-bg-3); border: 1px solid var(--c-border); border-radius: 7px; color: var(--c-text); font-family: var(--font-mono); font-size: .82rem; padding: 4px 8px; text-align: right; }
.repl-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--c-border); background: var(--c-bg-soft); }
.repl-result { font-family: var(--font-mono); font-size: .95rem; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.repl-result .val { color: var(--c-accent2); font-weight: 600; font-size: 1.15rem; }
.repl-result .err { color: var(--c-bad); font-size: .82rem; }
.repl-result .arrow { color: var(--c-faint); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--font-mono); font-size: .76rem; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--c-border); background: var(--c-bg-soft); color: var(--c-muted); cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--c-heading); border-color: var(--c-border-strong); background: var(--c-bg-3); }
.feature-table td { padding: 8px 12px; }
.feature-table td:first-child { color: var(--c-accent2); }

/* ---- Pipeline stepper -------------------------------------------------- */
.pipeline { background: var(--c-panel); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 26px; }
.pipe-input { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.pipe-input input { flex: 1; min-width: 220px; background: var(--c-bg-1); border: 1px solid var(--c-border); border-radius: 10px; color: var(--c-text); font-family: var(--font-mono); font-size: .9rem; padding: 11px 14px; outline: none; }
.pipe-input input:focus { border-color: var(--c-accent); }
.pipe-stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pipe-stage { background: var(--c-bg-1); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px; min-height: 230px; position: relative; transition: border-color .25s; }
.pipe-stage h5 { font-family: var(--font-display); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-faint); margin: 0 0 12px; display: flex; align-items: center; gap: 7px; }
.pipe-stage h5 .n { width: 18px; height: 18px; border-radius: 5px; background: var(--grad-soft); color: var(--c-accent2); display: grid; place-items: center; font-size: .7rem; }
.pipe-stage pre { font-size: .78rem; padding: 0; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.pipe-token { padding: 1px 4px; border-radius: 4px; transition: background .15s; }
.pipe-token.hot { background: var(--c-accent-soft); color: var(--c-heading); }
.anf-line { padding: 2px 6px; border-radius: 5px; font-family: var(--font-mono); font-size: .78rem; }
.anf-line .nm { color: var(--c-accent2); }
.anf-line .op { color: var(--c-pink); }
.anf-line.res { color: var(--c-faint); border-top: 1px dashed var(--c-border); margin-top: 4px; padding-top: 6px; }
.graph-node { transition: all .2s; cursor: default; }
@media (max-width: 760px) { .pipe-stages { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pipe-stages { grid-template-columns: 1fr; } }

/* ---- Gradient-fit demo ------------------------------------------------- */
.fit { background: var(--c-panel); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 26px; }
.fit-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 20px; }
.fit-prog { font-family: var(--font-mono); font-size: .9rem; background: var(--c-bg-1); border: 1px solid var(--c-border); border-radius: 10px; padding: 10px 14px; color: var(--c-text); }
.fit-prog .k { color: var(--c-accent); font-weight: 600; }
.fit-controls { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.fit-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.fit-readout { display: flex; flex-direction: column; gap: 14px; }
.fit-readout .big { font-family: var(--font-mono); }
.readout-card { background: var(--c-bg-1); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px 18px; }
.readout-card .lbl { font-size: .76rem; color: var(--c-faint); text-transform: uppercase; letter-spacing: .08em; }
.readout-card .v { font-family: var(--font-mono); font-size: 1.5rem; color: var(--c-heading); margin-top: 4px; }
.readout-card .v small { font-size: .8rem; color: var(--c-muted); }
.bar-track { height: 8px; background: var(--c-bg-3); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.bar-fill { height: 100%; background: var(--grad); width: 0; transition: width .1s linear; }
@media (max-width: 760px) { .fit-grid { grid-template-columns: 1fr; } }

/* ---- Two-mode diagram -------------------------------------------------- */
.twomode { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mode-card { background: var(--c-panel); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 22px; position: relative; overflow: hidden; }
.mode-card.active { border-color: var(--c-accent); box-shadow: var(--shadow-glow); }
.mode-card h4 { display: flex; align-items: center; gap: 10px; }
.mode-card .badge { font-family: var(--font-mono); font-size: .7rem; padding: 3px 8px; border-radius: 6px; background: var(--c-bg-3); color: var(--c-muted); }
.mode-svg { width: 100%; height: auto; margin: 10px 0; }
.mode-foot { font-size: .86rem; color: var(--c-muted); }
.twomode-ctrls { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.flow-dot { fill: var(--c-warn); }
@media (max-width: 820px) { .twomode { grid-template-columns: 1fr; } }
.mini-stats { display: flex; gap: 26px; margin-top: 22px; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats b { font-family: var(--font-display); font-size: 1.5rem; color: var(--c-heading); background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.mini-stats span { font-size: .78rem; color: var(--c-faint); }
.code-distribute h3 { margin-bottom: 18px; }

/* ---- Tagged value inspector -------------------------------------------- */
.tagged { background: var(--c-bg-1); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; }
.tag-types { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.tag-chip { font-family: var(--font-mono); font-size: .76rem; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--c-border); background: var(--c-bg-soft); color: var(--c-muted); cursor: pointer; transition: all .15s; }
.tag-chip.active { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.tensor { display: flex; gap: 4px; flex-wrap: wrap; margin: 14px 0; }
.cell { width: 38px; height: 44px; border-radius: 7px; display: grid; place-items: center; font-family: var(--font-mono); font-size: .82rem; border: 1px solid var(--c-border); background: var(--c-bg-3); color: var(--c-muted); transition: all .25s; position: relative; }
.cell.tag-on { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.cell.payload { background: var(--c-accent2-soft); border-color: var(--c-accent2); color: var(--c-accent2); }
.cell.grad { box-shadow: 0 0 0 2px var(--c-warn); }
.cell .idx { position: absolute; top: -16px; font-size: .58rem; color: var(--c-faint); }
.tensor-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .8rem; color: var(--c-muted); margin-top: 10px; }
.tensor-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tagged-desc { font-size: .88rem; color: var(--c-muted); margin-top: 14px; min-height: 40px; }
.tagged-desc b { color: var(--c-heading); }

/* ---- Heap viz ---------------------------------------------------------- */
.heap { background: var(--c-bg-1); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; }
.heap-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.heap-stage { min-height: 220px; }
.heap-status { font-size: .84rem; font-family: var(--font-mono); margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: var(--c-bg-soft); border: 1px solid var(--c-border); }
.heap-status.ok { color: var(--c-good); border-color: rgba(52,210,154,.35); }
.heap-status.broken { color: var(--c-bad); border-color: rgba(255,107,125,.35); }

/* ---- Soft-if ----------------------------------------------------------- */
.softif { background: var(--c-bg-1); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; }
.softif-row { display: flex; align-items: center; gap: 14px; margin: 14px 0; }
.softif-row label { font-family: var(--font-mono); font-size: .82rem; color: var(--c-muted); min-width: 60px; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 5px; border-radius: 4px; background: var(--c-bg-3); outline: none; flex: 1; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--c-accent); cursor: pointer; box-shadow: 0 2px 8px -2px var(--c-accent); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%; background: var(--c-accent); cursor: pointer; }

/* ---- Theory grid ------------------------------------------------------- */
.thm-grid .card { position: relative; }
.thm-tag { font-family: var(--font-mono); font-size: .72rem; color: var(--c-accent2); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.region-svg { width: 100%; height: auto; border-radius: var(--radius); background: var(--c-bg-1); border: 1px solid var(--c-border); cursor: crosshair; touch-action: none; }
.region-readout { font-family: var(--font-mono); font-size: .82rem; margin-top: 12px; display: flex; gap: 18px; flex-wrap: wrap; }
.region-readout b { color: var(--c-heading); }

/* ---- Dashboard --------------------------------------------------------- */
.dash-block { margin-bottom: 44px; }
.dash-head { margin-bottom: 22px; }
.dash-head h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-head .muted { max-width: 80ch; }
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 16px; padding: 30px; background: var(--c-panel); border: 1px solid var(--c-border); border-radius: var(--radius-lg); }
@media (max-width: 760px) { .stat-band { grid-template-columns: 1fr 1fr; gap: 24px; } }

/* ---- Trade-offs -------------------------------------------------------- */
.check-list, .cross-list { list-style: none; padding: 0; margin: 8px 0 0; }
.check-list li, .cross-list li { position: relative; padding-left: 30px; margin-bottom: 12px; color: var(--c-muted); }
.check-list li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-good); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/14px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/14px no-repeat; }
.cross-list li::before { content: "×"; position: absolute; left: 4px; top: -1px; color: var(--c-warn); font-weight: 700; font-size: 1.2rem; }
.pull-quote { margin: 40px auto 0; max-width: 760px; text-align: center; font-family: var(--font-display); font-size: clamp(1.2rem, 2.4vw, 1.6rem); line-height: 1.45; color: var(--c-heading); font-weight: 500; border: none; padding: 0 20px; position: relative; }
.pull-quote::before { content: '"'; display: block; font-size: 3rem; color: var(--c-accent); line-height: .5; margin-bottom: 14px; }

/* ---- Resources --------------------------------------------------------- */
.link-card { text-decoration: none; color: inherit; display: block; }
.link-card h4 { color: var(--c-heading); transition: color .15s; }
.link-card:hover h4 { color: var(--c-accent2); }
.cite-block { margin-top: 30px; background: var(--c-bg-1); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.cite-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--c-border); background: var(--c-bg-soft); }
.cite-head h4 { margin: 0; }
.cite-block pre { font-size: .8rem; color: var(--c-muted); }

/* ---- reduced-motion safety for hero canvas ----------------------------- */
@media (prefers-reduced-motion: reduce) { .hero-scroll svg circle { animation: none; } }

/* ---- responsive overrides ---------------------------------------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-visual { min-height: 300px; order: -1; }
  .hero-viz { min-height: 300px; }
  .hero { padding-top: calc(var(--nav-h) + 36px); }
}
@media (max-width: 600px) {
  .hero h1 { font-size: clamp(2.1rem, 9vw, 3rem); }
  .hero .lead { font-size: 1.06rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: 22px; }
  .stat-band { grid-template-columns: 1fr; gap: 16px; }
  .mini-stats { gap: 18px; flex-wrap: wrap; }
  .fit-top, .fit-controls { width: 100%; }
  .fit-controls { margin-left: 0; }
  .hero-visual { min-height: 240px; }
  .hero-viz { min-height: 240px; }
}
