/* Page styles: approach.html + ai-factory.html */

/* ---------- Framework diagram (approach) ---------- */
.framework { position: relative; display: grid; gap: 14px; }
.fw-roof {
  position: relative; text-align: center; padding: 22px 20px; border-radius: var(--radius);
  background: var(--grad); color: #fff; box-shadow: 0 18px 40px -18px rgba(79, 70, 229, 0.6);
}
.fw-roof h3 { color: #fff; margin: 0 0 4px; }
.fw-roof p { margin: 0; color: rgba(255, 255, 255, 0.86); font-size: 0.95rem; }
.fw-pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.fw-pillar {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; box-shadow: var(--shadow-sm); overflow: hidden;
}
.fw-pillar::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 1s var(--ease) 0.2s; }
.fw-pillar.is-in::before { transform: scaleX(1); }
.fw-pillar h3 { font-size: 1.15rem; margin-bottom: 12px; }
.fw-pillar ul { list-style: none; display: grid; gap: 8px; font-size: 0.93rem; color: var(--muted); }
.fw-pillar li { display: flex; gap: 8px; align-items: flex-start; }
.fw-pillar li svg { width: 16px; height: 16px; flex: none; margin-top: 4px; color: var(--brand); }
.fw-base {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; text-align: center;
  padding: 18px 20px; border-radius: var(--radius); background: var(--dark); color: #fff;
}
.fw-base svg { width: 22px; height: 22px; color: #a5b4fc; }
.fw-base b { font-family: var(--font-display); font-size: 1.05rem; }
.fw-base span { color: var(--dark-muted); font-size: 0.93rem; }
.fw-links { position: absolute; inset: 0; pointer-events: none; }
@media (max-width: 1020px) { .fw-pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .fw-pillars { grid-template-columns: 1fr; } }

/* ---------- Horizontal timeline ---------- */
.timeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 22px; left: 22px; right: 22px; height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-3), var(--brand-2)); opacity: 0.35;
}
.tl-item { position: relative; padding-top: 60px; }
.tl-item .dot {
  position: absolute; top: 0; left: 0; width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--brand); box-shadow: 0 0 0 6px var(--bg);
}
.section-soft .tl-item .dot { box-shadow: 0 0 0 6px var(--soft); }
.tl-item .when { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); }
.tl-item h4 { margin: 6px 0 8px; }
.tl-item p { color: var(--muted); font-size: 0.94rem; margin: 0; }
@media (max-width: 1020px) {
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline::before { top: 0; bottom: 0; left: 22px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
  .tl-item { padding: 0 0 28px 70px; min-height: 60px; }
}

/* ---------- Rhythm cards ---------- */
.rhythm .card { display: flex; flex-direction: column; }
.rhythm .freq { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.raci-key { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 0.85rem; color: var(--muted); }
.raci-key b { color: var(--ink); }
.raci td.c { text-align: center; font-weight: 700; font-family: var(--font-display); }
.raci th.c { text-align: center; }
.raci .A { color: var(--brand-ink); }
.raci .R { color: #0891b2; }

/* ---------- Factory hero flow illustration ---------- */
.factory-visual { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 18px; }
.factory-visual svg { width: 100%; height: auto; }
.fv-label { font: 600 11px var(--font-body); fill: #5b6478; }
.fv-title { font: 700 13px var(--font-display); fill: #0a0f1f; }
.fv-move { animation: fvmove 6s linear infinite; }
.fv-move.m2 { animation-delay: -2s; }
.fv-move.m3 { animation-delay: -4s; }
@keyframes fvmove {
  0% { transform: translateX(0); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateX(400px); opacity: 0; }
}

/* ---------- Stage detail ---------- */
.stage-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.stage-detail .card h4 { display: flex; gap: 10px; align-items: center; }
.stage-detail .owner { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; margin-top: 16px; }
.stage-detail .owner svg { width: 22px; height: 22px; flex: none; }
.stage-detail .owner small { display: block; font-weight: 500; color: var(--muted); }
@media (max-width: 900px) { .stage-detail { grid-template-columns: 1fr; } }

/* Ships-with chips */
.ships { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.ships .chip { cursor: default; }

/* ---------- Sizing calculator ---------- */
.sizer { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 960px) { .sizer { grid-template-columns: 1fr; } }
.measure { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--surface); margin: 0 0 12px; }
.measure legend { font-weight: 700; color: var(--ink); font-family: var(--font-display); padding: 0; margin-bottom: 4px; float: left; width: 100%; }
.measure .hint { clear: both; font-size: 0.85rem; color: var(--muted); margin: 0 0 10px; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .seg { grid-template-columns: 1fr; } }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line-2); font-size: 0.86rem; color: var(--ink-2); transition: all 0.2s; background: var(--surface);
}
.seg span b { font-family: var(--font-display); font-size: 0.78rem; color: var(--muted); }
.seg label:hover span { border-color: var(--ink); }
.seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
.seg input:checked + span b { color: var(--brand); }
.seg input:focus-visible + span { outline: 3px solid rgba(79, 70, 229, 0.45); outline-offset: 2px; }

.result {
  position: sticky; top: calc(var(--header-h) + 20px); border-radius: var(--radius-lg); padding: 28px;
  background: var(--dark); color: var(--dark-muted); overflow: hidden;
}
.result::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 240px at 100% 0%, rgba(124, 58, 237, 0.5), transparent 60%); pointer-events: none; }
.result > * { position: relative; }
.result .label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #a5b4fc; }
.result .score { font-family: var(--font-display); color: #fff; font-size: 3.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 8px 0 4px; }
.result .score small { font-size: 1.1rem; color: var(--dark-muted); font-weight: 600; letter-spacing: 0; }
.result .band { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 700; margin: 10px 0 14px; }
.result .commit { color: #fff; font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.result .meter { display: grid; grid-template-columns: 4fr 5fr 4fr; gap: 4px; margin: 18px 0 8px; }
.result .meter i { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); transition: background 0.4s; }
.result .meter i.on { background: var(--grad); }
.result .meter-l { display: grid; grid-template-columns: 4fr 5fr 4fr; gap: 4px; font-size: 0.72rem; color: var(--dark-muted); }
.result .pulse { animation: bandpop 0.5s var(--ease); }
@keyframes bandpop { 0% { transform: scale(0.92); opacity: 0.4; } 100% { transform: scale(1); opacity: 1; } }
.result .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.result button { cursor: pointer; }

.worked { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto; gap: 8px; align-items: stretch; }
.worked .w { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; text-align: center; }
.worked .w b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); }
.worked .w small { color: var(--muted); font-size: 0.75rem; display: block; line-height: 1.3; }
.worked .eq { background: var(--grad); color: #fff; border: 0; }
.worked .eq b, .worked .eq small { color: #fff; }
@media (max-width: 760px) { .worked { grid-template-columns: repeat(3, minmax(0, 1fr)); } .worked .eq { grid-column: span 3; } }

/* ---------- Autonomy ladder ---------- */
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; }
.rung {
  border-radius: 16px 16px 8px 8px; padding: 18px 16px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end;
  transform-origin: bottom; transform: scaleY(0.2); opacity: 0; transition: transform 0.9s var(--ease), opacity 0.6s; transition-delay: var(--d, 0ms);
}
.ladder.is-in .rung { transform: none; opacity: 1; }
.rung b { font-family: var(--font-display); font-size: 1.4rem; display: block; }
.rung span { font-size: 0.86rem; line-height: 1.35; opacity: 0.92; }
.rung.l0 { height: 120px; background: #a5b4fc; color: var(--ink); }
.rung.l1 { height: 160px; background: #818cf8; }
.rung.l2 { height: 200px; background: #6366f1; }
.rung.l3 { height: 240px; background: #4f46e5; }
.rung.l4 { height: 280px; background: #3730a3; }
@media (max-width: 760px) {
  .ladder { grid-template-columns: 1fr; }
  .rung { height: auto !important; transform: scaleX(0.4); transform-origin: left; flex-direction: row; gap: 14px; align-items: center; justify-content: flex-start; border-radius: 12px; }
  .rung.l0 { width: 60%; } .rung.l1 { width: 70%; } .rung.l2 { width: 80%; } .rung.l3 { width: 90%; } .rung.l4 { width: 100%; }
}
.controls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .controls-grid { grid-template-columns: 1fr; } }
.controls-grid div { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--dark-2); border: 1px solid var(--dark-line); color: #fff; font-weight: 600; font-size: 0.93rem; }
.controls-grid svg { width: 20px; height: 20px; color: #a5b4fc; flex: none; }
.human-note { margin-top: 20px; padding: 18px 20px; border-radius: var(--radius-sm); background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #fecaca; display: flex; gap: 12px; }
.human-note svg { width: 22px; height: 22px; flex: none; color: #fca5a5; }
.human-note b { color: #fff; }

/* ---------- Capacity visual ---------- */
.capacity { display: grid; gap: 14px; }
.cap-bar { display: grid; grid-template-columns: 4fr 1fr; height: 64px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.cap-bar .committed { background: var(--ink); color: #fff; display: flex; align-items: center; padding: 0 20px; font-weight: 600; }
.cap-bar .reserve { background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cap-bar .committed b, .cap-bar .reserve b { font-family: var(--font-display); font-size: 1.5rem; margin-right: 8px; }
.cap-grow { display: flex; align-items: flex-end; gap: 22px; margin-top: 10px; }
.cap-grow .col { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.cap-grow .stack { display: flex; flex-direction: column-reverse; gap: 4px; }
.cap-grow .stack i { width: 44px; height: 14px; border-radius: 4px; background: var(--brand); opacity: 0.85; display: block; }
.cap-grow .stack i.new { background: var(--brand-2); }
