/* boot-theme.css: the Lani boot screen redesign. Load it after boot.css.
   Only what differs from boot.css is here. Light-theme colours sit under html[data-theme="light"]. */

/* Icon images (the nuclei in boot-animation.js now load image files) */

.boot-node-icon {
    flex-shrink: 0;
}
.boot-node-icon img {
    display: block;
    width: 12px;
    height: 12px;
    max-width: none;
    object-fit: contain;
    pointer-events: none;
}

/* Both themes */

:root {
    --boot-spark-out: 0.83s;
    --boot-spark-back: 1.49s;
    --boot-spark-tail: 140px;
    --boot-spark-under: on;
    --boot-spark-dwell: 0.55s;
    --boot-spark-return: follow;
    --boot-tile-off: return;
    --boot-spark-trail: #a58bfa;
    --boot-spark-trail-back: icon;
}

.boot-node {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(14px);
    transition: border-color 3s, box-shadow 3s, --boot-node-grow 3s;
    background: rgba(0, 0, 0, 0.11);
}

.boot-node.active {
    transition: border-color 0.95s, box-shadow 0.95s, --boot-node-grow 0.95s;
    box-shadow: 0 0 29px 7px rgba(0, 180, 234, 0.5), inset 0 0 14.5px 7px rgba(0, 180, 234, 0.5);
    --boot-node-grow: 1.3;
}

.boot-node.ready {
    box-shadow: 0 0 19.3px 4.7px rgba(0, 180, 234, 0.333), inset 0 0 9.7px 4.7px rgba(0, 180, 234, 0.333);
}

.boot-node.active .boot-node-icon {
    transform: rotate(-45deg) scale(5);
    transition: opacity 0.95s, transform 0.95s;
}

.boot-node-icon {
    font-size: 12px;
    opacity: 0.3;
    transition: opacity 3s, transform 3s;
}

.boot-core-ring:nth-child(1) {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 180px;
    height: 180px;
    margin: -90px 0 0 -90px;
    border-width: 2px;
    border-color: rgba(0, 180, 234, 1);
    color: rgba(0, 180, 234, 1);
    box-shadow: 0 0 1px 0.5px currentColor, inset 0 0 1px 0.5px currentColor;
    transform: rotateX(72deg);
    animation: boot-ring1-smooth 26s linear infinite reverse;
}

.boot-core-ring:nth-child(2) {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 136px;
    height: 136px;
    margin: -68px 0 0 -68px;
    border-width: 0.5px;
    border-color: rgba(237, 26, 119, 1);
    color: rgba(237, 26, 119, 1);
    box-shadow: 0 0 1px 0.5px currentColor, inset 0 0 1px 0.5px currentColor;
    animation: boot-ring2-turning 15s linear infinite reverse;
}

.boot-core-ring:nth-child(3) {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    border-style: solid;
    border-color: transparent;
    animation: spin 19s linear infinite;
}

.boot-core-ring:nth-child(3)::before {
    content: "";
    position: absolute;
    inset: -1px;
    background-color: rgba(255, 255, 255, 1);
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2052%2052%22%3E%3Crect%20x%3D%220.5%22%20y%3D%220.5%22%20width%3D%2251%22%20height%3D%2251%22%20rx%3D%2225.5%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221%22%20stroke-dasharray%3D%223.506%204.505%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2052%2052%22%3E%3Crect%20x%3D%220.5%22%20y%3D%220.5%22%20width%3D%2251%22%20height%3D%2251%22%20rx%3D%2225.5%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221%22%20stroke-dasharray%3D%223.506%204.505%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat;
}

.boot-electron {
    left: 0;
    top: 0;
}

.boot-electron:nth-child(5) {
    animation: none;
    --boot-dot-ring: 2;
    --boot-dot-lap: 9.5s;
    --boot-dot-dir: 1;
}

.boot-electron:nth-child(5) .boot-electron-dot {
    left: 50%;
    top: 50%;
    margin: -2.5px 0 0 -2.5px;
    width: 5px;
    height: 5px;
    transform: scale(var(--boot-dot-k, 1));
    transform-origin: 2.5px 2.5px;
    animation: none;
}

.boot-electron:nth-child(6) {
    animation: none;
    --boot-dot-ring: 1;
    --boot-dot-lap: 20s;
    --boot-dot-dir: -1;
}

.boot-electron:nth-child(6) .boot-electron-dot {
    bottom: auto;
    left: 50%;
    top: 50%;
    margin: -2.5px 0 0 -2.5px;
    width: 5px;
    height: 5px;
    transform: scale(var(--boot-dot-k, 1));
    transform-origin: 2.5px 2.5px;
    animation: none;
}

.boot-pulse-head {
    width: 8px;
    height: 8px;
    background: #ffffff;
    box-shadow: 0 0 6px #ffffff;
}

.boot-core-dot {
    width: 12px;
    height: 12px;
    animation: corePulse 2s ease-in-out infinite, boot-core-dot-grow 2s ease-in-out infinite;
    transform-origin: 0 0;
}

.boot-pulse.back .boot-pulse-head {
    background: #ffffff;
    box-shadow: 0 0 6px #ffffff;
}

/* Icon sizes, one icon against the others */

.boot-node[data-nucleus="llm"] .boot-node-icon {
    font-size: 22px;
}
.boot-node[data-nucleus="llm"] .boot-node-icon img {
    width: 22px;
    height: 22px;
}

.boot-node[data-nucleus="file"] .boot-node-icon {
    font-size: 25px;
}
.boot-node[data-nucleus="file"] .boot-node-icon img {
    width: 25px;
    height: 25px;
}

.boot-node[data-nucleus="storage"] .boot-node-icon {
    font-size: 25px;
}
.boot-node[data-nucleus="storage"] .boot-node-icon img {
    width: 25px;
    height: 25px;
}

.boot-node[data-nucleus="vector"] .boot-node-icon {
    font-size: 30px;
}
.boot-node[data-nucleus="vector"] .boot-node-icon img {
    width: 30px;
    height: 30px;
}

.boot-node[data-nucleus="graph"] .boot-node-icon {
    font-size: 24px;
}
.boot-node[data-nucleus="graph"] .boot-node-icon img {
    width: 24px;
    height: 24px;
}

.boot-node[data-nucleus="process"] .boot-node-icon {
    font-size: 30px;
}
.boot-node[data-nucleus="process"] .boot-node-icon img {
    width: 30px;
    height: 30px;
}

.boot-node[data-nucleus="keys"] .boot-node-icon {
    font-size: 27px;
}
.boot-node[data-nucleus="keys"] .boot-node-icon img {
    width: 27px;
    height: 27px;
}

.boot-node[data-nucleus="code"] .boot-node-icon {
    font-size: 23px;
}
.boot-node[data-nucleus="code"] .boot-node-icon img {
    width: 23px;
    height: 23px;
}

/* Icon placement, one icon at a time: waiting, and on its turn */

.boot-node[data-nucleus="llm"].active .boot-node-icon {
    transform: rotate(-45deg) translate(15px, 1px) scale(2.703);
}

.boot-node[data-nucleus="file"].active .boot-node-icon {
    transform: rotate(-45deg) translate(13px, 1px) scale(2.439);
}

.boot-node[data-nucleus="storage"].active .boot-node-icon {
    transform: rotate(-45deg) translate(13px, 0px) scale(2.381);
}

.boot-node[data-nucleus="vector"].active .boot-node-icon {
    transform: rotate(-45deg) translate(11px, 5px) scale(2.7);
}

.boot-node[data-nucleus="graph"].active .boot-node-icon {
    transform: rotate(-45deg) translate(2px, -3px) scale(2.5);
}

.boot-node[data-nucleus="process"].active .boot-node-icon {
    transform: rotate(-45deg) translate(15px, 1px) scale(2);
}

.boot-node[data-nucleus="keys"].active .boot-node-icon {
    transform: rotate(-45deg) translate(2px, 2px) scale(2.889);
}

.boot-node[data-nucleus="code"].active .boot-node-icon {
    transform: rotate(-45deg) translate(16px, 0px) scale(2.632);
}

/* Text */

.boot-phase-text {
    font-family: var(--font-sans);
    font-weight: 700;
    /* The designer's file says 31.5px; the nearest role on the type scale is read instead. */
    font-size: var(--fs-display-lg);
}

#loading-text {
    font-family: var(--font-sans);
}

#boot-wait {
    font-family: var(--font-sans);
}

.boot-subsystem {
    font-family: var(--font-mono);
}

/* Light theme */

html[data-theme="light"] .boot-node {
    border-color: rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 0.23);
}

html[data-theme="light"] .boot-node.active {
    border-color: var(--accent);
    box-shadow: 0 0 29px 7px rgba(0, 180, 234, 0.5), inset 0 0 14.5px 7px rgba(0, 180, 234, 0.5);
}

html[data-theme="light"] .boot-node.ready {
    border-color: var(--accent);
    box-shadow: 0 0 19.3px 4.7px rgba(0, 180, 234, 0.333), inset 0 0 9.7px 4.7px rgba(0, 180, 234, 0.333);
}

html[data-theme="light"] .boot-core-ring:nth-child(1) {
    border-color: rgba(0, 195, 255, 0.39);
    color: rgba(0, 195, 255, 1);
    box-shadow: 0 0 1px 0.5px currentColor, inset 0 0 1px 0.5px currentColor;
}

html[data-theme="light"] .boot-core-ring:nth-child(3)::before {
    background-color: rgba(99, 99, 99, 0.36);
}

html[data-theme="light"] .boot-pulse-head {
    background: #212121;
    box-shadow: 0 0 6px #212121;
}

html[data-theme="light"] .boot-core-dot {
    background: #7b7b7b;
    box-shadow: 0 0 20px rgba(123, 123, 123, 0.8), 0 0 40px rgba(0, 180, 234, 0.4);
    animation: boot-core-glow-light 2s ease-in-out infinite, boot-core-dot-grow 2s ease-in-out infinite;
}

html[data-theme="light"] .boot-pulse.back .boot-pulse-head {
    background: #212121;
    box-shadow: 0 0 6px #212121;
}

/* Animations (and the one custom property that lets a tile grow smoothly) */

@property --boot-node-grow {
    syntax: "<number>";
    inherits: false;
    initial-value: 1;
}

@keyframes boot-ring1-smooth {
    0% { transform: rotateX(72deg) rotate(0deg); }
    5% { transform: rotateX(67.783deg) rotate(18deg); }
    10% { transform: rotateX(63.435deg) rotate(36deg); }
    15% { transform: rotateX(58.915deg) rotate(54deg); }
    20% { transform: rotateX(54.168deg) rotate(72deg); }
    25% { transform: rotateX(49.118deg) rotate(90deg); }
    30% { transform: rotateX(43.647deg) rotate(108deg); }
    35% { transform: rotateX(37.561deg) rotate(126deg); }
    40% { transform: rotateX(30.48deg) rotate(144deg); }
    45% { transform: rotateX(21.424deg) rotate(162deg); }
    50% { transform: rotateX(0deg) rotate(180deg); }
    55% { transform: rotateX(21.424deg) rotate(198deg); }
    60% { transform: rotateX(30.48deg) rotate(216deg); }
    65% { transform: rotateX(37.561deg) rotate(234deg); }
    70% { transform: rotateX(43.647deg) rotate(252deg); }
    75% { transform: rotateX(49.118deg) rotate(270deg); }
    80% { transform: rotateX(54.168deg) rotate(288deg); }
    85% { transform: rotateX(58.915deg) rotate(306deg); }
    90% { transform: rotateX(63.435deg) rotate(324deg); }
    95% { transform: rotateX(67.783deg) rotate(342deg); }
    100% { transform: rotateX(72deg) rotate(360deg); }
}

@keyframes boot-ring2-turning {
    from { transform: rotate(0deg) rotateY(60deg); }
    to { transform: rotate(360deg) rotateY(60deg); }
}

@keyframes boot-core-dot-grow {
    0%, 100% { scale: 1; }
    50% { scale: 1.583; }
}

@keyframes boot-core-glow-light {
    0%, 100% { box-shadow: 0 0 20px rgba(123, 123, 123, 0.8), 0 0 40px rgba(0, 180, 234, 0.4); }
    50% { box-shadow: 0 0 30px rgba(123, 123, 123, 1), 0 0 60px rgba(0, 180, 234, 0.6); }
}
