/* Decomp: phosphor terminal. */
:root {
  --bg: #04090a;
  --bg-2: #08130f;
  --surface: rgba(77, 255, 176, .04);
  --surface-2: rgba(77, 255, 176, .09);
  --border: rgba(77, 255, 176, .2);
  --text: #dcffee;
  --muted: #86b8a2;
  --accent: #4dffb0;
  --accent-2: #9be7ff;
  --accent-ink: #022014;
  --glow: rgba(77, 255, 176, .4);
  --font-display: "JetBrains Mono", ui-monospace, monospace;
  --radius: 10px;
}
body { background: radial-gradient(900px 600px at 70% 0%, rgba(77, 255, 176, .08), transparent 70%), var(--bg); }
h1, h2, h3 { letter-spacing: -.03em; }
code { font-family: var(--font-mono); font-size: .88em; color: var(--accent-2); }

.decomp-hero .hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.decomp-hero .fx-canvas { opacity: .32; mask-image: linear-gradient(90deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); }
.scanlines { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 3px); }
.glitch { position: relative; color: var(--accent); text-shadow: 0 0 24px var(--glow); }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: .7; }
.glitch::before { color: #ff5a5a; transform: translate(2px, 0); clip-path: inset(0 0 60% 0); animation: glitch 3.2s infinite steps(1); }
.glitch::after { color: #3df2ff; transform: translate(-2px, 0); clip-path: inset(55% 0 0 0); animation: glitch 2.6s infinite steps(1) reverse; }
@keyframes glitch { 0%, 92%, 100% { transform: none; opacity: 0; } 93% { transform: translate(3px, -1px); opacity: .8; } 96% { transform: translate(-3px, 1px); opacity: .8; } }

.term { border-radius: 12px; border: 1px solid var(--border); background: rgba(3, 12, 9, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 30px 80px -20px rgba(77, 255, 176, .25); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: rgba(77, 255, 176, .05); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; font: 500 .75rem/1 var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code { margin: 0; padding: 18px 20px; min-height: 520px; font: 400 .8rem/1.55 var(--font-mono); color: #c8f7e1; white-space: pre; overflow-x: auto; }
.code .c { color: #5f8f7a; font-style: italic; }
.code .k { color: #ffb86b; font-weight: 600; }
.code .n { color: #ffd479; font-style: normal; }
.code .ns { color: #7fd7ff; text-decoration: none; }
.type-cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: text-bottom; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.stat b { color: var(--accent); text-shadow: 0 0 18px var(--glow); }

.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; position: relative; z-index: 1; }
.step { padding: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); position: relative; }
.step .n { font: 700 .8rem/1 var(--font-mono); color: var(--accent); display: inline-block; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 16px; }
.step h3 { font-size: 1.3rem; }
.step p { color: var(--muted); font-size: .93rem; }
.step code { display: block; margin-top: 12px; font-size: .72rem; color: var(--muted); opacity: .9; }
.step:not(:last-child)::after { content: "\25B8"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 1.2rem; z-index: 2; text-shadow: 0 0 10px var(--glow); }
.flow { width: 100%; height: 20px; margin-top: 10px; }
.flow path { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 6 10; animation: flow 1.2s linear infinite; opacity: .6; }
@keyframes flow { to { stroke-dashoffset: -32; } }

.browser { --ratio: 1440 / 900; }
.browser .chrome { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #0b1814; border-bottom: 1px solid var(--border); }
.browser .chrome i { width: 9px; height: 9px; border-radius: 50%; background: #2c4a3e; }
.browser .chrome span { margin-left: 10px; padding: 4px 12px; border-radius: 6px; background: #04090a; font: 500 .72rem/1 var(--font-mono); color: var(--muted); }
.browser img { aspect-ratio: 1440 / 900; height: auto; object-position: top; }
.browser figcaption { background: linear-gradient(transparent, rgba(2, 10, 7, .92)); }

.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.meter { padding: 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.meter-top b { font: 600 1rem/1.2 var(--font-display); }
.meter-top span { font: 500 .8rem/1 var(--font-mono); color: var(--accent); }
.meter p { color: var(--muted); font-size: .88rem; margin: 12px 0 0; }
.bar { height: 10px; border-radius: 99px; background: rgba(77, 255, 176, .08); overflow: hidden; border: 1px solid var(--border); }
.bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 8px, #2bd98a 8px 10px); box-shadow: 0 0 14px var(--glow); transition: width 1.8s cubic-bezier(.2, .8, .2, 1) .2s; }
.meter.in .bar i { width: var(--v); }

.class-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.class-cloud span { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font: 500 .88rem/1 var(--font-mono); color: var(--accent-2); transition: background .2s, transform .2s; }
.class-cloud span::before { content: "class "; color: #ffb86b; }
.class-cloud span:hover { background: var(--surface-2); transform: translateY(-2px); }

.roadmap { padding: clamp(24px, 4vw, 40px); border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); }
.roadmap ol { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 4px; counter-reset: r; }
.roadmap li { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 12px 0 12px 38px; position: relative; border-bottom: 1px dashed var(--border); }
.roadmap li::before { content: ""; position: absolute; left: 6px; top: 16px; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--muted); }
.roadmap li.done::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--glow); }
.roadmap li.now::before { border-color: var(--accent); animation: pulse 1.6s infinite; }
.roadmap li span { color: var(--muted); font: 400 .82rem/1.4 var(--font-mono); }

.next-project { margin-top: 48px; display: flex; justify-content: flex-end; }
.next-project a { display: grid; gap: 4px; padding: 20px 26px; border-radius: 12px; border: 1px solid var(--border); text-decoration: none; transition: background .2s; }
.next-project a:hover { background: var(--surface-2); }
.next-project small { color: var(--muted); font: 500 .75rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .14em; }
.next-project b { font: 600 1.3rem/1.2 var(--font-display); }

@media (max-width: 900px) {
  .decomp-hero .hero-grid { grid-template-columns: 1fr; }
  .code { min-height: 0; font-size: .72rem; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .step:not(:last-child)::after { display: none; }
}
@media (max-width: 560px) { .pipeline { grid-template-columns: 1fr; } }
/* five steps are too narrow in one row on mid-size screens, so they wrap to 3 + 2 there */
@media (max-width: 1100px) and (min-width: 901px) { .pipeline { grid-template-columns: repeat(3, 1fr); } .step:not(:last-child)::after { display: none; } }

/* Code window tabs */
.term-tabs { display: flex; gap: 4px; margin-left: 12px; }
.term-tabs button { padding: 5px 10px; border-radius: 6px; border: 1px solid transparent; background: none; cursor: pointer; font: 600 .74rem/1 var(--font-mono); color: var(--muted); }
.term-tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--border); background: rgba(77, 255, 176, .08); }
.term-file { margin: 0; padding: 8px 20px 0; font: 500 .72rem/1.3 var(--font-mono); color: var(--muted); }
.term .code { min-height: 470px; }
.term-caption { margin: 0; padding: 10px 20px 14px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }

/* The live explorer */
.live { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: #0b1814; box-shadow: 0 40px 90px -30px rgba(77, 255, 176, .3); }
.live .chrome { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.live .chrome i { width: 10px; height: 10px; border-radius: 50%; background: #2c4a3e; }
.live .chrome span { margin-left: 10px; padding: 5px 12px; border-radius: 6px; background: #04090a; font: 500 .74rem/1 var(--font-mono); color: var(--muted); flex: 1; max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live .full { margin-left: auto; font: 600 .78rem/1 var(--font-mono); color: var(--accent); text-decoration: none; white-space: nowrap; }
.live-stage { position: relative; height: min(78vh, 760px); min-height: 520px; background: url("../../media/decomp/explorer-chapter.webp") top center / cover; }
.live-stage::before { content: ""; position: absolute; inset: 0; backdrop-filter: blur(6px) brightness(.45); -webkit-backdrop-filter: blur(6px) brightness(.45); transition: opacity .6s; }
.live-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .6s; background: #0d1117; }
.live-stage.ready iframe { opacity: 1; }
.live-stage.ready::before, .live-stage.ready .live-start { opacity: 0; pointer-events: none; }
.live-start { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 8px; padding: 26px 34px; border-radius: 16px; border: 1px solid var(--border); background: rgba(4, 12, 9, .85); color: var(--text); cursor: pointer; font: 600 1.1rem/1.2 var(--font-display); transition: transform .2s, opacity .4s, box-shadow .2s; }
.live-start span { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 1.3rem; box-shadow: 0 0 30px var(--glow); }
.live-start small { font: 500 .75rem/1 var(--font-mono); color: var(--muted); }
.live-start:hover { transform: translate(-50%, -50%) scale(1.04); box-shadow: 0 0 60px -10px var(--glow); }
.live-stage.loading:not(.ready) .live-start span { animation: pulse 1s infinite; }
.try-tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; margin-top: 18px; }
.try-tips p { margin: 0; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: .9rem; color: var(--muted); }
.try-tips b { color: var(--accent); }
@media (max-width: 700px) { .live-stage { height: 70vh; min-height: 460px; } .live .chrome span { display: none; } }

/* How this started */
.story-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); }
.story-text p { color: var(--muted); font-size: 1.02rem; }
.story-text p:first-child::first-letter { font: 700 2.6em/1 var(--font-display); float: left; margin: 4px 10px 0 0; color: var(--accent); }
.story-how { padding: 26px 28px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.story-how h3 { font-size: 1.2rem; color: var(--accent); margin-bottom: 14px; }
.story-how p:first-of-type::first-letter { font: inherit; float: none; margin: 0; color: inherit; }
@media (max-width: 860px) { .story-cols { grid-template-columns: 1fr; } }

/* "Try it here, or download it": the code download under the live explorer */
.code-get { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 22px; padding: 22px 24px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); }
.code-get > div { flex: 1 1 420px; display: grid; gap: 6px; }
.code-get b { font: 600 1.15rem/1.2 var(--font-display); color: var(--text); }
.code-get span { color: var(--muted); font-size: .93rem; }
.code-get .btn { flex-direction: column; gap: 4px; }
.code-get .btn small { font: 500 .72rem/1 var(--font-mono); opacity: .75; }

/* a meter with an explanation on hover, focus or tap */
.meter--tip { position: relative; cursor: help; }
.meter--tip:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.tip-i { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; border: 1px solid currentColor;
  font: 700 .65rem/1 var(--font-mono); vertical-align: 2px; opacity: .7; }
.meter--tip .tip { position: absolute; z-index: 5; left: 0; right: 0; bottom: calc(100% + 10px); padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-2); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); color: var(--muted); font-size: .86rem; line-height: 1.5;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .2s, transform .2s, visibility .2s; }
.meter--tip:hover .tip, .meter--tip:focus .tip, .meter--tip:focus-within .tip { opacity: 1; visibility: visible; transform: none; }
