/* Web development page: live site assembler, code-editor modules, terminal build log, status page. Prefix wb-. */
:root { --wb-ink: #111827; --wb-muted: #5b6474; --wb-line: rgba(17, 24, 39, .12); --wb-dark: #0d1117; --wb-green: #22c55e; }

/* ---- Live site assembler ---- */
.wb-builder { display: grid; grid-template-columns: 340px 1fr; gap: 36px; align-items: center; margin-top: 28px; }
.wb-controls { background: #fff; border: 1px solid var(--wb-line); border-radius: 18px; padding: 22px; box-shadow: 0 18px 40px -28px rgba(17, 24, 39, .35); }
.wb-label { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wb-muted); }
.wb-label:not(:first-child) { margin-top: 18px; }
.wb-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-toggles button { font: inherit; font-size: 14px; min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--wb-line); background: #fff; color: var(--wb-muted); cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.wb-toggles i { width: 26px; height: 15px; border-radius: 8px; background: #d5d9e0; position: relative; transition: background .2s; }
.wb-toggles i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: transform .2s; }
.wb-toggles button[aria-pressed="true"] { color: var(--wb-ink); border-color: var(--wb-brand); }
.wb-toggles button[aria-pressed="true"] i { background: var(--wb-brand); }
.wb-toggles button[aria-pressed="true"] i::after { transform: translateX(11px); }
.wb-swatches { display: flex; gap: 10px; }
.wb-swatches button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--wb-line); cursor: pointer; transition: box-shadow .2s; }
.wb-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--c); }
.wb-seg { display: inline-flex; padding: 4px; border-radius: 10px; background: #f1f3f6; }
.wb-seg button { font: inherit; font-size: 14px; min-height: 36px; padding: 4px 16px; border: 0; border-radius: 8px; background: transparent; color: var(--wb-muted); cursor: pointer; }
.wb-seg button[aria-pressed="true"] { background: #fff; color: var(--wb-ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.wb-explode { display: block; width: 100%; margin-top: 20px; font: inherit; font-weight: 600; font-size: 15px; min-height: 46px; border-radius: 12px; border: 0; background: var(--wb-brand); color: #fff; cursor: pointer; transition: filter .2s; }
.wb-explode:hover { filter: brightness(1.08); }

.wb-stage { perspective: 1400px; display: grid; justify-items: center; min-height: 480px; align-content: center; }
.wb-window { width: 100%; max-width: 600px; border-radius: 14px; background: #fff; box-shadow: 0 40px 70px -40px rgba(17, 24, 39, .55), 0 0 0 1px var(--wb-line); transform: rotateY(-14deg) rotateX(6deg); transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2, .8, .2, 1), max-width .6s ease; }
.wb-builder.is-phone .wb-window { max-width: 270px; border-radius: 30px; padding: 10px; background: var(--wb-ink); }
.wb-builder.is-phone .wb-bar { display: none; }
.wb-builder.is-phone .wb-page { border-radius: 20px; }
.wb-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--wb-line); }
.wb-bar i { width: 10px; height: 10px; border-radius: 50%; background: #f87171; }
.wb-bar i:nth-child(2) { background: #fbbf24; }
.wb-bar i:nth-child(3) { background: #34d399; }
.wb-bar span { margin-left: 12px; flex: 1; font-size: 12px; color: var(--wb-muted); background: #f1f3f6; border-radius: 6px; padding: 4px 10px; }
.wb-page { display: grid; gap: 8px; padding: 12px; background: #fff; border-radius: 0 0 14px 14px; transform-style: preserve-3d; }
.wb-block { position: relative; border-radius: 8px; background: #f3f4f7; padding: 10px 12px; min-height: 40px; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2, .8, .2, 1), box-shadow .5s; animation: wb-pop .45s ease; }
@keyframes wb-pop { from { opacity: 0; transform: scaleY(.6); } }
.wb-tag { position: absolute; right: 8px; top: 6px; font-size: 11px; font-weight: 600; color: var(--wb-muted); background: rgba(255, 255, 255, .85); padding: 1px 7px; border-radius: 5px; z-index: 1; }
.wb-art { display: flex; gap: 6px; height: 100%; }
.wb-art i { display: block; border-radius: 4px; background: #dfe3ea; }
.b-nav { min-height: 30px; padding: 8px 12px; }
.b-nav .wb-art i { height: 10px; width: 34px; }
.b-nav .wb-art i:first-child { width: 22px; background: var(--wb-brand); margin-right: auto; }
.b-hero { min-height: 110px; background: linear-gradient(135deg, var(--wb-brand), color-mix(in srgb, var(--wb-brand) 55%, #000)); }
.b-hero .wb-art { flex-direction: column; justify-content: center; }
.b-hero .wb-art i { background: rgba(255, 255, 255, .85); height: 12px; width: 55%; }
.b-hero .wb-art i:nth-child(2) { width: 38%; opacity: .7; height: 8px; }
.b-hero .wb-art i:nth-child(3) { width: 70px; height: 20px; border-radius: 10px; background: #fff; margin-top: 6px; }
.b-hero .wb-art i:nth-child(4) { display: none; }
.b-cards .wb-art i, .b-gallery .wb-art i { flex: 1; height: 54px; background: #fff; border: 1px solid var(--wb-line); }
.b-cards .wb-art i::before { content: ""; display: block; width: 16px; height: 16px; margin: 8px; border-radius: 4px; background: color-mix(in srgb, var(--wb-brand) 30%, #fff); }
.b-gallery .wb-art i { height: 64px; border: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--wb-brand) 35%, #fff), #e6e9ef); }
.b-form .wb-art { flex-direction: column; gap: 5px; }
.b-form .wb-art i { height: 12px; background: #fff; border: 1px solid var(--wb-line); }
.b-form .wb-art i:last-child { width: 80px; height: 18px; background: var(--wb-brand); border: 0; }
.b-text .wb-art { flex-direction: column; gap: 5px; }
.b-text .wb-art i { height: 7px; }
.b-text .wb-art i:nth-child(2n) { width: 70%; }
.b-footer { background: var(--wb-ink); min-height: 34px; }
.b-footer .wb-art i { height: 8px; width: 40px; background: #3a4150; }
.wb-builder.is-phone .wb-art i { min-width: 0; }
.wb-builder.is-phone .b-cards .wb-art, .wb-builder.is-phone .b-gallery .wb-art { flex-wrap: wrap; }
.wb-builder.is-phone .b-cards .wb-art i, .wb-builder.is-phone .b-gallery .wb-art i { flex: 1 1 40%; }
.wb-builder.is-phone .b-nav .wb-art i:not(:first-child) { display: none; }
/* Exploded layers: each block lifts off the page in 3D. */
.wb-builder.is-exploded .wb-window { transform: rotateY(-38deg) rotateX(12deg) scale(.88); background: rgba(255, 255, 255, .5); }
.wb-builder.is-exploded .wb-block { transform: translateZ(calc(40px + var(--k) * 14px)); box-shadow: 0 0 0 1px var(--wb-line), -14px 16px 24px -12px rgba(17, 24, 39, .4); }
.wb-score { margin: 18px 0 0; font-size: 14px; color: var(--wb-muted); text-align: center; }
.wb-score b { color: var(--wb-ink); font-size: 18px; }

/* ---- Code-editor modules ---- */
.wb-code { margin-top: 28px; border-radius: 16px; background: var(--wb-dark); color: #c9d1d9; overflow: hidden; box-shadow: 0 34px 60px -34px rgba(13, 17, 23, .8); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.wb-ed-bar { display: flex; overflow-x: auto; background: #161b22; border-bottom: 1px solid #30363d; scrollbar-width: none; }
.wb-ed-bar button { flex: none; font: inherit; font-size: 13px; min-height: 44px; padding: 0 18px; border: 0; border-right: 1px solid #30363d; background: transparent; color: #8b949e; cursor: pointer; }
.wb-ed-bar button[aria-selected="true"] { background: var(--wb-dark); color: #f0f6fc; box-shadow: 0 -2px 0 #f78166 inset; }
.wb-ed-body { padding: 18px 0; min-height: 250px; }
.wb-ed-file ol { margin: 0; padding: 0 0 0 0; list-style: none; counter-reset: ln; font-size: 14px; line-height: 1.9; }
.wb-ed-file li { counter-increment: ln; padding-right: 16px; white-space: pre-wrap; }
.wb-ed-file li::before { content: counter(ln); display: inline-block; width: 48px; padding-right: 16px; text-align: right; color: #484f58; }
.wb-ed-file .ln { opacity: 0; animation: wb-type .35s ease forwards; animation-delay: calc(.2s + var(--i) * .35s); }
@keyframes wb-type { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.wb-ed-file .c { color: #8b949e; }
.wb-ed-file .k { color: #ff7b72; }
.wb-ed-file .f { color: #d2a8ff; }
.wb-ed-file .s { color: #a5d6ff; }
.wb-ed-file .ok { margin-left: 10px; color: #3fb950; }
.wb-ed-foot { display: flex; justify-content: space-between; padding: 6px 16px; background: #1f6feb; color: #fff; font-size: 12px; }

/* ---- Terminal build log ---- */
.wb-term { max-width: 820px; margin: 28px auto 0; border-radius: 14px; background: var(--wb-dark); color: #c9d1d9; overflow: hidden; box-shadow: 0 34px 60px -34px rgba(13, 17, 23, .8); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.wb-term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #161b22; }
.wb-term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #f87171; }
.wb-term-bar i:nth-child(2) { background: #fbbf24; }
.wb-term-bar i:nth-child(3) { background: #34d399; }
.wb-term-bar span { flex: 1; text-align: center; font-size: 12px; color: #8b949e; margin-right: 50px; }
.wb-term-lines { list-style: none; margin: 0; padding: 18px 20px 6px; font-size: 14px; line-height: 1.8; min-height: 260px; }
.wb-term-lines li { opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.wb-term-lines li.on { opacity: 1; transform: none; }
.wb-term-lines .p { color: #3fb950; }
.wb-term-lines .st { color: #8b949e; }
.wb-term-lines b { color: #f0f6fc; }
.wb-term-lines .tx { color: #8b949e; }
.wb-term-lines .ok { color: #3fb950; white-space: nowrap; }
.wb-term-lines .live { color: #3fb950; font-weight: 700; margin-top: 6px; }
.wb-term-lines li.on:last-child::after { content: "▌"; margin-left: 4px; animation: wb-blink 1s steps(1) infinite; }
@keyframes wb-blink { 50% { opacity: 0; } }
.wb-term-replay { display: block; margin: 6px 20px 18px auto; font: inherit; font-size: 13px; min-height: 40px; padding: 6px 16px; border-radius: 8px; border: 1px solid #30363d; background: #21262d; color: #c9d1d9; cursor: pointer; }
.wb-term-replay:hover { background: #30363d; }

/* ---- Status page ---- */
.wb-up { max-width: 860px; margin: 28px auto 0; border: 1px solid var(--wb-line); border-radius: 16px; background: #fff; overflow: hidden; }
.wb-up-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; background: #ecfdf3; color: #166534; font-size: 16px; }
.wb-up-head .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--wb-green); box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: wb-ping 2s infinite; }
@keyframes wb-ping { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.wb-up ol { list-style: none; margin: 0; padding: 0; }
.wb-up li { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--wb-line); }
.wb-up h3 { margin: 0 0 2px; font-size: 16px; }
.wb-up p { margin: 0; font-size: 14px; color: var(--wb-muted); }
.wb-up-bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 28px; }
.wb-up-bars i { border-radius: 2px; background: #e5e7eb; transform: scaleY(.3); transform-origin: bottom; transition: transform .3s ease, background .3s; transition-delay: calc(var(--i) * 200ms + var(--b) * 18ms); }
.wb-up.in .wb-up-bars i { background: var(--wb-green); transform: none; }

@media (max-width: 960px) {
    .wb-builder { grid-template-columns: 1fr; }
    .wb-stage { min-height: 0; order: -1; }
}
@media (max-width: 560px) {
    .wb-window { transform: none; }
    .wb-builder.is-exploded .wb-window { transform: rotateX(40deg) rotateZ(-8deg) scale(.82); }
    .wb-builder.is-exploded .wb-block { transform: translateZ(calc(14px + var(--k) * 12px)); }
    .wb-ed-file ol, .wb-term-lines { font-size: 12.5px; }
    .wb-ed-file li::before { width: 30px; padding-right: 10px; }
    .wb-term-lines .tx { display: block; padding-left: 4ch; }
    .wb-up li { grid-template-columns: 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .wb-ed-file .ln { animation: none; opacity: 1; }
    .wb-up-bars i, .wb-window, .wb-block { transition: none; }
}
