@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Inter:wght@400;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
--bg: #0a0c10;
--surface: #111318;
--surface2: #181c24;
--border: rgba(255,255,255,0.07);
--border2: rgba(255,255,255,0.12);
--ec-teal: #1a7b8e;
--teal: #00d4a8;
--teal-dim: rgba(0,212,168,0.15);
--teal-glow: rgba(0,212,168,0.4);
--amber: #f5a623;
--amber-dim: rgba(245,166,35,0.15);
--coral: #ff6b6b;
--text: #e8e6e0;
--text-muted: #6b7280;
--mono: 'JetBrains Mono', monospace;
--display: 'Inter', sans-serif;
}

body {
background: var(--bg);
color: var(--text);
font-family: var(--display);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px;
overflow-x: hidden;
}

body::before {
content: '';
position: fixed;
inset: 0;
background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
background-size: 20px 40px;
pointer-events: none;
}

.scene { width: 100%; max-width: 900px; position: relative; }

.nodes {
display: flex;
align-items: stretch;
justify-content: space-between;
position: relative;
margin-bottom: 20px;
}

.node {
flex: 0 0 240px;
background: var(--surface);
border: 1px solid var(--border2);
border-radius: 16px;
padding: 24px 20px 20px;
position: relative;
z-index: 2;
opacity: 0;
transform: translateY(16px);
transition: border-color 0.3s, box-shadow 0.3s;
}
.node.visible { animation: nodeIn 0.5s cubic-bezier(0.16,1,0.3,1) forwards; }

.node-label { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 12px; opacity: 0.5; }
.node-title { font-family: var(--display); font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.node-sub   { font-size: 12px; color: var(--text-muted); font-family: var(--mono); margin-bottom: 16px; }

.node-laptop { border-color: rgba(0,212,168,0.2); }
.node-laptop .node-label { color: var(--teal); }
.node-laptop.active { border-color: rgba(0,212,168,0.5); box-shadow: 0 0 32px rgba(0,212,168,0.08); }

.node-cf { border-color: rgba(245,166,35,0.2); flex: 0 0 240px; }
.node-cf .node-label { color: var(--amber); }
.node-cf.active { border-color: rgba(245,166,35,0.5); box-shadow: 0 0 32px rgba(245,166,35,0.08); }

.node-remote { border-color: rgba(255,107,107,0.2); }
.node-remote .node-label { color: var(--coral); }
.node-remote.active { border-color: rgba(255,107,107,0.5); box-shadow: 0 0 32px rgba(255,107,107,0.08); }

.file-chip {
display: flex; align-items: center; gap: 8px;
background: var(--surface2); border: 1px solid var(--border);
border-radius: 8px; padding: 8px 12px;
font-family: var(--mono); font-size: 12px; color: var(--teal);
}
.file-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); flex-shrink: 0; box-shadow: 0 0 6px var(--teal); }

.id-badge {
background: var(--amber-dim); border: 1px solid rgba(245,166,35,0.3);
border-radius: 8px; padding: 10px 12px;
font-family: var(--mono); font-size: 13px; font-weight: 600;
color: var(--amber); text-align: center; letter-spacing: 0.06em; transition: all 0.3s;
}

.cf-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tag { font-family: var(--mono); font-size: 10px; padding: 3px 8px; border-radius: 4px; background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); }

.terminal { background: #0d0f13; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 11px; overflow: hidden; }
.terminal-bar { display: flex; gap: 5px; margin-bottom: 8px; }
.terminal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border2); }
.terminal-line { color: var(--text-muted); margin-bottom: 3px; min-height: 16px; }
.terminal-line .prompt { color: var(--coral); }
.terminal-line .cmd { color: var(--text); }
.terminal-line .success { color: #4ade80; }
.cursor { display: inline-block; width: 7px; height: 12px; background: var(--coral); vertical-align: middle; margin-left: 2px; animation: blink 1s step-end infinite; }
.cursor.hidden { opacity: 0; }

/* Packet — NO transition in CSS, all transition set in JS */
.packet {
position: absolute;
top: 0; left: 0;
width: 36px; height: 36px;
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-family: var(--mono); font-size: 8px; font-weight: 700;
opacity: 0;
z-index: 10;
pointer-events: none;
}

.command-strip {
background: var(--surface); border: 1px solid var(--border2);
border-radius: 12px; padding: 20px 28px;
display: flex; align-items: center; gap: 16px;
margin-bottom: 32px; opacity: 0; transform: translateY(8px);
transition: opacity 0.4s, transform 0.4s;
}
.command-strip.visible { opacity: 1; transform: none; }

.steps { display: flex; justify-content: space-between; opacity: 0; transition: opacity 0.4s 0.2s; }
.steps.visible { opacity: 1; }
.step { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--text-muted); flex: 0 0 240px; }
.step span { display: block; font-size: 10px; margin-top: 4px; opacity: 0.5; }

.track-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; }
.track-line { stroke: var(--border2); stroke-width: 1; stroke-dasharray: 4 4; fill: none; opacity: 0.5; }
.track-active { stroke: var(--teal); stroke-width: 1.5; fill: none; stroke-dasharray: 200; stroke-dashoffset: 200; filter: drop-shadow(0 0 4px var(--teal-glow)); }
.track-active.animate { animation: drawLine 0.6s ease forwards; }
.track-active-2 { stroke: var(--amber); stroke-width: 1.5; fill: none; stroke-dasharray: 200; stroke-dashoffset: 200; filter: drop-shadow(0 0 4px rgba(245,166,35,0.5)); }
.track-active-2.animate { animation: drawLine 0.6s ease forwards; }

.replay-btn {
margin-top: 32px; background: transparent; border: 1px solid var(--border2);
color: var(--text-muted); font-family: var(--mono); font-size: 12px;
padding: 10px 24px; border-radius: 8px; cursor: pointer; letter-spacing: 0.08em;
transition: all 0.2s; display: flex; align-items: center; gap: 8px;
}
.replay-btn:hover { border-color: var(--teal); color: var(--teal); }

.intro {
display: flex; flex-direction: column; align-items: center;
text-align: center; max-width: 660px; margin-bottom: 56px;
}
.intro-logo {
display: flex; align-items: center; gap: 10px; margin-bottom: 32px;
}
.intro-logo img { width: 200px;}
.intro-logo-name {
font-family: var(--display); font-size: 15px; font-weight: 700;
color: var(--amber); letter-spacing: 0.06em;
}
.intro-headline {
font-family: var(--display); font-size: 38px; font-weight: 800;
line-height: 1.13; letter-spacing: -0.025em; margin-bottom: 16px;
}
.intro-sub {
font-family: var(--display); font-size: 18px; color: var(--text-muted); line-height: 1.7;
}

.footer-headline {
font-family: var(--display); font-size: 18px; font-weight: 600;
line-height: 1.13; letter-spacing: -0.025em; margin-bottom: 16px;
margin-top: 60px;
text-align: center;
}

.footer-headline a {
color: var(--amber);
text-decoration: none;
}

.footer-message {
font-family: var(--text-muted); font-size: 12px;
line-height: 1.7;
margin-top: 40px;
text-align: center;
}

.footer-message a {
color: var(--ec-teal);
text-decoration: none;
}

.footer-message img {
width: 20px;
vertical-align: middle;
}

.node-step { display: none; font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.node-step strong { display: block; color: var(--text); font-size: 11px; margin-bottom: 3px; font-weight: 600; }

@media (max-width: 640px) {
body { justify-content: flex-start; padding: 32px 16px; }
.intro { margin-bottom: 36px; }
.intro-headline { font-size: 26px; }
.intro-sub { font-size: 15px; }
.command-strip { padding: 14px 16px; margin-bottom: 20px; }
#headlineText { font-size: 14px !important; }
#headlineCursor { height: 17px !important; }
.nodes { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 0; }
.node { flex: none; width: 100%; }
.track-svg, .packet { display: none; }
.steps { display: none; }
.node-step { display: block; }
.replay-btn { margin-top: 20px; }
}

@keyframes nodeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink  { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes drawLine { to { stroke-dashoffset: 0; } }