/* Home: the lab. A home-computer start-up screen in RanioLab's navy, with the
   logo's cyan/magenta glitch, then three doors that open on each world. */
:root {
  --ground: #08112a;
  --ground-2: #0b1633;
  --screen: #101e39;      /* the spider's own background, so it melts in */
  --frame: #2d4f96;
  --text: #e9f3ff;
  --muted: #9fb3d6;
  --cyan: #22e5e0;
  --magenta: #e042f5;
  --accent: var(--cyan);
  --line: rgba(159, 179, 214, 0.18);
  --head-bg: rgba(8, 17, 42, 0.78);
  --display: "IBM Plex Sans", system-ui, sans-serif;
}

/* The start-up screen */
.boot { padding-block: clamp(20px, 4vw, 48px) clamp(28px, 5vw, 64px); }
.screen {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 30% 20%, #152a52 0%, var(--screen) 55%, #0c1830 100%);
  border: clamp(14px, 3vw, 34px) solid var(--frame);
  border-radius: 18px;
  box-shadow: 0 0 0 2px #1b3570 inset, 0 30px 80px -30px rgba(34, 229, 224, 0.35);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); align-items: center;
  gap: clamp(8px, 3vw, 40px);
  padding: clamp(20px, 4vw, 56px);
}
.screen-text { display: grid; gap: 10px; min-width: 0; }
.boot-line { font-family: var(--mono); font-size: clamp(1.15rem, 0.9rem + 1vw, 1.75rem); line-height: 1.15; color: #9fd8ff; letter-spacing: 0.04em; text-transform: uppercase; }
.boot-line .cursor { margin-left: 4px; vertical-align: -0.12em; background: #9fd8ff; }
.boot-title {
  position: relative; margin-top: clamp(14px, 2.4vw, 30px);
  font-size: var(--step-4); font-weight: 700; letter-spacing: -0.02em; color: var(--text);
  text-shadow: -3px 0 0 rgba(224, 66, 245, 0.85), 3px 0 0 rgba(34, 229, 224, 0.85);
}
.boot-sub { max-width: 46ch; font-size: var(--step-1); color: var(--muted); line-height: 1.45; }
.boot-cta { margin-top: 12px; }
.boot-cta a {
  display: inline-block; font-family: var(--mono); font-size: 1.5rem; letter-spacing: 0.06em; text-decoration: none;
  color: var(--screen); background: var(--cyan); padding: 6px 16px 4px; border-radius: 2px;
  box-shadow: 4px 4px 0 var(--magenta); transition: transform .15s ease, box-shadow .15s ease;
}
.boot-cta a:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--magenta); }
.screen-spider {
  width: 100%; max-width: 420px; justify-self: center; aspect-ratio: 1;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
  animation: bob 5s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1.5deg); } }

/* Three doors */
.worlds {
  display: flex; gap: 10px; height: clamp(440px, 70vh, 680px);
  padding-left: var(--gutter); padding-right: var(--gutter-r); max-width: 1500px; margin-inline: auto;
}
.world {
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; border-radius: 14px; text-decoration: none; color: #fff;
  display: flex; align-items: flex-end; isolation: isolate;
  transition: flex-grow .55s cubic-bezier(.2,.8,.2,1);
}
.worlds:hover .world, .worlds:focus-within .world { flex-grow: 0.8; }
.worlds .world:hover, .worlds .world:focus-visible { flex-grow: 1.9; }
.world-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s ease; }
.world:hover .world-art { transform: scale(1.04); }
.world::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.world-copy { display: grid; gap: 8px; padding: clamp(18px, 2.6vw, 32px); width: 100%; }
.world-kicker { font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }
.world-name { font-size: var(--step-3); line-height: 1; }
.world-line { font-size: var(--step-1); max-width: 26ch; line-height: 1.3; }
.world-go { font-weight: 600; margin-top: 6px; display: inline-flex; gap: 8px; }
.world:hover .world-go span { transform: translateX(4px); }
.world-go span { transition: transform .2s ease; }

.w-bitter { background: #3b2a1b; }
.w-bitter .world-art { image-rendering: pixelated; }
.w-bitter::after { background: linear-gradient(to top, rgba(43, 28, 16, 0.92) 0%, rgba(43, 28, 16, 0.25) 55%, transparent 75%); }
.w-bitter .world-name { font-family: "Jersey 10", var(--mono); font-size: calc(var(--step-3) * 1.25); letter-spacing: 0.02em; color: #fff1d6; text-shadow: 3px 3px 0 #5c3a1e; }
.w-bitter .world-line { color: #ffe2a8; }

.w-cue { background: #080b0b; }
.w-cue::after { background: linear-gradient(to top, rgba(8, 11, 11, 0.95) 0%, rgba(8, 11, 11, 0.4) 50%, rgba(8, 11, 11, 0.1) 80%); }
.w-cue .world-name { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-style: italic; text-transform: uppercase; font-size: calc(var(--step-3) * 1.15); }
.w-cue .world-kicker { justify-self: start; font-family: "Barlow Condensed", sans-serif; font-weight: 700; background: #1db86c; color: #fff; padding: 2px 12px; transform: skewX(-12deg); }
.w-cue .world-line { color: #f5c451; font-family: "Barlow", sans-serif; }

.w-music {
  background:
    radial-gradient(80% 60% at 70% 30%, rgba(224, 66, 245, 0.45), transparent 70%),
    radial-gradient(70% 60% at 20% 80%, rgba(34, 229, 224, 0.35), transparent 70%),
    #0c1733;
}
.world-wave {
  position: absolute; inset: 18% 8% auto; height: 34%; z-index: -1;
  background: repeating-linear-gradient(to right, rgba(34, 229, 224, 0.9) 0 6px, transparent 6px 14px);
  -webkit-mask-image: linear-gradient(to top, #000, #000), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20 Q5 2 10 20 T20 20 T30 20 T40 20 T50 20 T60 20 T70 20 T80 20 T90 20 T100 20' stroke='black' stroke-width='14' fill='none'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20 C5 0 8 0 12 20 S20 40 25 20 S32 2 38 20 S44 36 50 20 S58 4 63 20 S70 38 76 20 S84 6 88 20 S96 34 100 20' stroke='black' stroke-width='16' fill='none'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  animation: wave 6s linear infinite;
}
@keyframes wave { to { background-position: 140px 0; } }
.w-music .world-name { font-family: "Abril Fatface", Georgia, serif; font-size: calc(var(--step-3) * 1.1); text-shadow: -2px 0 var(--magenta), 2px 0 var(--cyan); }
.w-music .world-line { color: #c8f8f6; }

/* How the lab works */
.notes { padding-block: clamp(56px, 8vw, 110px); }
.notes-title { font-family: var(--mono); font-weight: 400; font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); color: var(--cyan); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 28px; }
.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 40px); }
.notes-grid article { display: grid; gap: 10px; align-content: start; border-top: 2px solid var(--frame); padding-top: 18px; }
.note-tag { font-family: var(--mono); font-size: 1.25rem; color: var(--magenta); letter-spacing: 0.08em; }
.notes-grid h3 { font-size: var(--step-1); }
.notes-grid p:not(.note-tag) { color: var(--muted); }

@media (max-width: 860px) {
  .screen { grid-template-columns: minmax(0, 1fr); }
  .screen-spider { max-width: 240px; order: -1; justify-self: start; }
  .worlds { flex-direction: column; height: auto; }
  .world, .worlds:hover .world, .worlds .world:hover { flex: none; min-height: 420px; }
  .notes-grid { grid-template-columns: minmax(0, 1fr); }
}
