:root {
  --wii-blue: #34bfed;
  --wii-blue-deep: #1a9fd0;
  --bg: #eef0f2;
  --stripe: #e2e5e8;
  --tile-border: #c4c8cc;
  --text: #8a8f94;
  --text-strong: #5f6468;
  --bar-top: #f6f7f8;
  --bar-bottom: #d6d9dc;
  --bar-h: 170px;
  --dip: calc(var(--bar-h) * 62 / 170); /* where the SVG curve's line lands */
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image: repeating-linear-gradient(to bottom, transparent 0 3px, var(--stripe) 3px 4px);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; }
a { color: inherit; }

html.has-cursor, html.has-cursor * { cursor: none !important; }

/* ── Intro ─────────────────────────────────────────────── */
.intro {
  position: fixed; inset: 0; z-index: 50;
  background: #000; color: #fff;
  display: grid; place-items: center;
  text-align: center; padding: 24px;
  transition: opacity .6s ease;
}
.intro.gone { opacity: 0; pointer-events: none; }
.intro-inner { max-width: 760px; }
.intro-head { font-weight: 800; font-size: clamp(22px, 4vw, 38px); letter-spacing: .02em; margin: 0 0 1.2em; }
.intro-body { font-weight: 500; font-size: clamp(15px, 2.2vw, 22px); line-height: 1.6; margin: 0 0 1.4em; }
.intro-small { font-size: clamp(13px, 1.7vw, 17px); color: #cfcfcf; margin: 0 0 3em; }
.intro-press { font-size: clamp(15px, 2.2vw, 22px); margin: 0; animation: pulse 2.2s ease-in-out infinite; }
.a-btn {
  width: 1.35em; height: 1.35em; margin: 0 .15em;
  vertical-align: -.3em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
@keyframes pulse { 50% { opacity: .35; } }

/* ── Menu grid ─────────────────────────────────────────── */
.menu {
  position: fixed; inset: 0 0 var(--bar-h) 0;
  display: grid; place-items: center;
}
.pages-viewport {
  --grid-w: min(88vw, calc((100vh - var(--bar-h) - 64px) * 1.95));
  width: var(--grid-w);
  overflow: hidden;
  padding: 18px 0; margin: -18px 0;
}
.pages {
  display: flex;
  transition: transform .55s cubic-bezier(.5, 0, .2, 1);
}
.page {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 1.6vw, 22px);
  padding: 0 14px;
}

.tile {
  position: relative;
  aspect-ratio: 16 / 10.5;
  border-radius: 18px;
  border: 3px solid var(--tile-border);
  background: #fff;
  padding: 0;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  box-shadow: inset 0 0 0 2px #fff;
}
.tile:hover, .tile:focus-visible {
  transform: scale(1.06);
  border-color: var(--wii-blue);
  box-shadow: 0 0 0 3px rgba(52, 191, 237, .35), 0 0 22px rgba(52, 191, 237, .55);
  z-index: 2;
  outline: none;
}
.tile .scene { border-radius: 14px; }

.tile.empty {
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.55) 0 2px, transparent 2px 4px),
    linear-gradient(160deg, #e4e6e8, #d3d6d9);
  cursor: default;
}
.tile.empty:hover { transform: none; border-color: var(--tile-border); box-shadow: inset 0 0 0 2px #fff; }

.page-arrow {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 46px; height: 70px;
  border: 0; background: none; padding: 0;
  display: grid; place-items: center;
  z-index: 3;
}
.page-arrow[hidden] { display: none; }
.page-arrow.left { left: max(8px, calc((100vw - var(--grid-w, 88vw)) / 2 - 64px)); }
.page-arrow.right { right: max(8px, calc((100vw - var(--grid-w, 88vw)) / 2 - 64px)); }
.page-arrow svg { width: 34px; height: 52px; transition: transform .15s ease; }
.page-arrow path { fill: var(--wii-blue); stroke: #fff; stroke-width: 4; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); }
.page-arrow:hover svg, .page-arrow:focus-visible svg { transform: scale(1.18); }
.page-arrow:focus-visible { outline: none; }
.menu { --grid-w: min(88vw, calc((100vh - var(--bar-h) - 64px) * 1.95)); }

/* ── Bottom bar ────────────────────────────────────────── */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--bar-h);
  display: flex;
}
.bar-side { position: relative; flex: 0 0 260px; height: 100%; }
.bar-side.right .bar-shape { transform: scaleX(-1); }
.bar-shape { position: absolute; inset: 0; width: 100%; height: 100%; }
.bar-shape path[stroke] { vector-effect: non-scaling-stroke; }
.bar-mid {
  flex: 1;
  /* Centre the 3px border on the same line the SVG stroke is centred on. */
  margin-top: calc(var(--dip) - 1.5px);
  background: linear-gradient(var(--bar-top), var(--bar-bottom)) 0 calc(-1 * var(--dip)) / 100% var(--bar-h) no-repeat;
  border-top: 3px solid var(--wii-blue);
  position: relative;
  text-align: center;
}
.clock {
  margin-top: 4px;
  line-height: 1;
  font-size: 52px; font-weight: 300; color: #9a9fa4;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #fff;
}
.clock .colon { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.date {
  margin-top: 10px;
  line-height: 1;
  font-size: 26px; font-weight: 500; color: #8f9499;
  text-shadow: 0 1px 0 #fff;
}

.round-btn {
  position: absolute; top: 46px;
  width: 104px; height: 104px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff 55%, #eceef0);
  border: 3px solid #c9cdd1;
  box-shadow: 0 2px 6px rgba(0,0,0,.12), inset 0 -3px 6px rgba(0,0,0,.05);
  display: grid; place-items: center;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.bar-side.left .round-btn { left: 38px; }
.bar-side.right .round-btn { right: 38px; }
.round-btn:hover, .round-btn:focus-visible {
  border-color: var(--wii-blue);
  box-shadow: 0 0 0 3px rgba(52,191,237,.35), 0 0 18px rgba(52,191,237,.6);
  transform: scale(1.05);
  outline: none;
}
.round-label { font-weight: 800; font-size: 30px; color: #9ca1a6; letter-spacing: -.02em; }
.envelope { width: 50px; }
.envelope rect, .envelope path { fill: none; stroke: #9ca1a6; stroke-width: 3; stroke-linejoin: round; }
.round-btn:is(:hover, :focus-visible) .round-label { color: var(--wii-blue); }
.round-btn:is(:hover, :focus-visible) .envelope * { color: var(--wii-blue); stroke: var(--wii-blue); }

.music-btn {
  position: absolute; right: 18px; top: 50%; translate: 0 -50%;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid #c9cdd1; background: linear-gradient(#fff, #eef0f2);
  display: grid; place-items: center; padding: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.music-btn:hover, .music-btn:focus-visible { border-color: var(--wii-blue); box-shadow: 0 0 12px rgba(52,191,237,.6); outline: none; }
.music-btn svg { width: 24px; height: 24px; fill: none; stroke: #9ca1a6; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.music-btn .spk { fill: #9ca1a6; }
.music-btn .mute { display: none; }
.music-btn[aria-pressed="true"] .wave { display: none; }
.music-btn[aria-pressed="true"] .mute { display: inline; }

/* ── Channel view ──────────────────────────────────────── */
.channel-view {
  position: fixed; inset: 0; z-index: 20;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(to bottom, transparent 0 3px, var(--stripe) 3px 4px);
  display: grid;
  grid-template-rows: 1fr auto auto;
  padding: 3vh 4vw 4vh;
  gap: 2.4vh;
}
.channel-view[hidden] { display: none; }
.cv-stage {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--tile-border), 0 10px 30px rgba(0,0,0,.08);
  min-height: 0;
}
.cv-stage .scene { border-radius: 26px; }
.cv-info { text-align: center; max-width: 64ch; margin: 0 auto; }
.cv-info h2 { margin: 0 0 .25em; font-size: clamp(20px, 2.6vw, 30px); font-weight: 700; color: var(--text-strong); }
.cv-info p { margin: 0; font-size: clamp(14px, 1.6vw, 18px); line-height: 1.55; color: var(--text); }
.cv-buttons { display: flex; justify-content: center; gap: clamp(16px, 6vw, 120px); }
.wii-btn {
  min-width: min(300px, 40vw);
  padding: 18px 28px;
  border-radius: 18px;
  border: 3px solid #c9cdd1;
  background: linear-gradient(#fff, #eef0f2);
  box-shadow: 0 3px 8px rgba(0,0,0,.1);
  font-size: clamp(18px, 2.2vw, 26px); font-weight: 500;
  color: #6b7075;
  text-align: center; text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.wii-btn:hover, .wii-btn:focus-visible {
  border-color: var(--wii-blue);
  box-shadow: 0 0 0 3px rgba(52,191,237,.35), 0 0 20px rgba(52,191,237,.6);
  transform: scale(1.04);
  outline: none;
}

/* ── Cursor ────────────────────────────────────────────── */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 100;
  pointer-events: none;
  will-change: transform;
  display: none;
  filter: drop-shadow(2px 4px 3px rgba(0,0,0,.28));
}
html.has-cursor .cursor { display: block; }
.cursor.hidden { opacity: 0; }
.cursor svg { display: block; width: 64px; height: 76px; transform-origin: 23px 5px; }
.cursor .hand { fill: #fff; stroke: #1d1f21; stroke-width: 2.2; stroke-linejoin: round; }
.cursor .knuckle { stroke: #1d1f21; stroke-width: 1.6; stroke-linecap: round; fill: none; }
.cursor .p1 { font: 800 15px var(--font); fill: var(--wii-blue); text-anchor: middle; }
.cursor.press svg { transform: scale(.88); }

/* ── Scenes (shared by tiles and channel screen) ───────── */
.scene {
  position: absolute; inset: 0;
  container-type: size;
  overflow: hidden;
  font-family: var(--font);
}
.s-title { position: absolute; left: 0; right: 0; text-align: center; font-weight: 800; line-height: 1.05; margin: 0; }
.s-sub { position: absolute; left: 0; right: 0; text-align: center; font-weight: 500; margin: 0; }

/* Jev */
.sc-jev { background: linear-gradient(#bfe8fb, #eaf7fd 58%, #9aa3ab 58% 100%); }
.sc-jev .s-title { top: 9cqh; font-size: 12.5cqh; color: #234; }
.sc-jev .s-sub { top: 25cqh; font-size: 6cqh; color: #4b6676; }
.sc-jev .road-line {
  position: absolute; left: 0; right: 0; top: 78cqh; height: 2.4cqh;
  background: repeating-linear-gradient(90deg, #fff 0 8cqw, transparent 8cqw 15cqw);
}
.sc-jev .car { position: absolute; width: 30cqw; top: 51cqh; left: -32cqw; animation: drive 4.5s cubic-bezier(.3,.1,.25,1) infinite; }
.sc-jev .walker { position: absolute; width: 8cqw; left: 72cqw; top: 46cqh; }
.sc-jev .q {
  position: absolute; left: 82cqw; top: 36cqh; font-size: 16cqh; font-weight: 800; color: #e2463b;
  animation: qpop 4.5s ease infinite;
}
.sc-jev .beep { position: absolute; left: 30cqw; top: 38cqh; font-size: 7cqh; font-weight: 800; color: #e2463b; opacity: 0; }
@keyframes drive {
  0% { transform: translateX(0); }
  55%, 85% { transform: translateX(70cqw); }
  60% { transform: translateX(69cqw) rotate(-2deg); }
  100% { transform: translateX(70cqw); opacity: 0; }
}
@keyframes qpop { 0%, 52% { opacity: 0; transform: scale(.4); } 60%, 88% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

/* Tardy */
.sc-tardy {
  background:
    radial-gradient(circle at 20% 30%, #7aa8d8 0 18cqw, transparent 30cqw),
    radial-gradient(circle at 80% 75%, #c7a2e0 0 16cqw, transparent 30cqw),
    linear-gradient(135deg, #6c87b6, #a7b7d6);
}
.sc-tardy::before { content: ""; position: absolute; inset: 0; backdrop-filter: blur(6px); background: rgba(255,255,255,.12); }
.sc-tardy .card {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 62cqw; padding: 5cqh 4cqw;
  border-radius: 5cqh;
  background: rgba(255,255,255,.82);
  box-shadow: 0 2cqh 6cqh rgba(30,40,80,.25);
  text-align: center; color: #1d2433;
}
.sc-tardy .ev { font-size: 7cqh; font-weight: 700; margin: 0; }
.sc-tardy .cd { font-family: var(--mono); font-size: 22cqh; font-weight: 600; margin: 1cqh 0; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sc-tardy .join { display: inline-block; font-size: 5.5cqh; font-weight: 700; color: #fff; background: #2f6fed; padding: 1.4cqh 4cqw; border-radius: 99px; }
.sc-tardy .brand { position: absolute; left: 4cqw; top: 4cqh; font-size: 6cqh; font-weight: 800; color: #fff; z-index: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Updated Today */
.sc-ut { background: linear-gradient(180deg, #1c1f4a, #4a2c6b 45%, #b5525a 80%, #e07a4f); }
.sc-ut::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #ffb36b, #ff8a6b 45%, #ffc98a); opacity: 0; transition: opacity .9s ease; }
.sc-ut .sun { position: absolute; width: 34cqh; height: 34cqh; border-radius: 50%; left: 50%; top: 74cqh; translate: -50% 0; background: #ffc56b; box-shadow: 0 0 6cqh rgba(255,170,80,.6); }
.sc-ut .s-title { top: 11cqh; font-size: 13cqh; color: #fff; text-shadow: 0 .6cqh 1.6cqh rgba(80,30,60,.35); }
.sc-ut .s-sub { top: 28cqh; font-size: 6cqh; color: #fff6ee; }
.sc-ut .bars { position: absolute; left: 50%; translate: -50% 0; bottom: 12cqh; height: 30cqh; display: flex; align-items: center; gap: 1.6cqw; }
.sc-ut .bars i { display: block; width: 2.4cqw; height: 100%; background: #fff; border-radius: 99px; transform-origin: center; animation: eq 1.1s ease-in-out infinite; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* harness-homies */
.sc-hh { background: #20232a; }
.sc-hh .s-title { top: 5cqh; font-size: 9cqh; color: #f2f2f2; font-family: var(--mono); font-weight: 700; }
.sc-hh .wins { position: absolute; left: 5cqw; right: 5cqw; top: 22cqh; bottom: 6cqh; display: grid; grid-template-columns: 1fr 1fr; gap: 2.5cqw; }
.sc-hh .win { background: #2d313a; border-radius: 2.5cqh; padding: 2.6cqh 2.4cqw; font-family: var(--mono); font-size: 5.2cqh; color: #c7ccd6; position: relative; }
.sc-hh .win::before { content: ""; position: absolute; left: 2.4cqw; top: 2cqh; width: 7cqw; height: 1.6cqh; background: radial-gradient(circle, #ff6159 40%, transparent 45%) 0 50% / 33% 100% no-repeat, radial-gradient(circle, #ffbd2e 40%, transparent 45%) 50% 50% / 33% 100% no-repeat, radial-gradient(circle, #28c941 40%, transparent 45%) 100% 50% / 33% 100% no-repeat; }
.sc-hh .win b { display: block; margin-top: 2.6cqh; color: #8fd3ff; font-weight: 700; }
.sc-hh .win span::after { content: "▍"; color: #8fd3ff; animation: blink 1s steps(1) infinite; }

/* Forgot Chips */
.sc-chips { background: radial-gradient(ellipse at 50% 40%, #2f8a4e, #145a2c 75%); }
.sc-chips .s-title { top: 9cqh; font-size: 12cqh; color: #fff; text-shadow: 0 .6cqh 0 rgba(0,0,0,.25); }
.sc-chips .stacks { position: absolute; left: 0; right: 0; bottom: 14cqh; display: flex; justify-content: center; gap: 6cqw; align-items: flex-end; }
.sc-chips .stack { display: flex; flex-direction: column-reverse; align-items: center; }
.sc-chips .stack { padding-bottom: 2.6cqh; }
/* A chip is a striped edge (::before) under an elliptical face (::after); stacked 2.6cqh apart so only edges show below the top chip. */
.sc-chips .chip { position: relative; width: 20cqw; height: 8cqh; margin-top: -5.4cqh; }
.sc-chips .chip::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; bottom: -2.6cqh;
  border-radius: 0 0 10cqw 10cqw / 0 0 4cqh 4cqh;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--c), #000 25%) 0 2.2cqw, #f1f1f1 2.2cqw 3.2cqw);
}
.sc-chips .chip::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(ellipse, var(--c) 0 50%, rgba(255,255,255,.85) 51% 55%, var(--c) 56%);
  border: .5cqh dashed rgba(255,255,255,.9);
  box-shadow: inset 0 -.4cqh 0 rgba(0,0,0,.15);
}
.sc-chips .chip.drop { animation: drop 2.6s infinite; }
@keyframes drop {
  0% { transform: translateY(-38cqh); opacity: 0; animation-timing-function: cubic-bezier(.55,0,1,.45); }
  4% { opacity: 1; }
  32% { transform: translateY(0); animation-timing-function: ease-out; }
  38% { transform: translateY(-2.5cqh); animation-timing-function: ease-in; }
  44% { transform: translateY(0); }
  84% { transform: translateY(0); opacity: 1; animation-timing-function: ease-in; }
  100% { transform: translateY(-14cqh); opacity: 0; }
}

/* Blog */
.sc-blog { background: #fbfaf7; }
.sc-blog .pub { position: absolute; left: 6cqw; top: 6cqh; font-size: 5.4cqh; font-weight: 700; color: #ff3b5c; margin: 0; }
.sc-blog .s-title { left: 6cqw; right: 6cqw; top: 15cqh; font-size: 9cqh; color: #222; text-align: left; }
.sc-blog pre {
  position: absolute; left: 6cqw; right: 6cqw; top: 46cqh; margin: 0;
  text-align: left;
  font-family: var(--mono); font-size: 5.4cqh; line-height: 1.45; color: #555;
}
.sc-blog pre .del { position: relative; animation: fade 4s ease infinite; }
.sc-blog pre .del::after { content: ""; position: absolute; left: 0; top: 55%; height: .5cqh; background: #e2463b; animation: strike 4s ease infinite; width: 0; }
.sc-blog pre .del.d2, .sc-blog pre .del.d2::after { animation-delay: .5s; }
.sc-blog pre .del.d3, .sc-blog pre .del.d3::after { animation-delay: 1s; }
.sc-blog .badge { position: absolute; right: 6cqw; top: 6cqh; font-size: 5.4cqh; font-weight: 800; color: #fff; background: #e2463b; padding: .8cqh 2cqw; border-radius: 99px; opacity: 0; transform: translateY(-2cqh); transition: all .3s cubic-bezier(.3,1.6,.5,1); }
@keyframes strike { 0%, 15% { width: 0; } 35%, 100% { width: 100%; } }
@keyframes fade { 0%, 40% { opacity: 1; } 70%, 100% { opacity: .2; } }

/* GitHub / other projects */
.sc-gh { background: radial-gradient(circle at 50% 40%, #1b2230, #0d1117 70%); }
.sc-gh .mark { position: absolute; left: 50%; top: 16cqh; translate: -50% 0; width: 30cqh; fill: #f0f6fc; z-index: 1; transform-origin: 50% 90%; }
.sc-gh .s-title { top: 60cqh; font-size: 10cqh; color: #f0f6fc; z-index: 1; }
.sc-gh .repo {
  position: absolute; left: 50%; top: 18cqh; width: 26cqw; height: 34cqh; margin-left: -13cqw;
  border-radius: 2.5cqh; background: #161b22; border: .5cqh solid #30363d;
  background-image: linear-gradient(#58a6ff, #58a6ff), linear-gradient(#30363d, #30363d), linear-gradient(#30363d, #30363d);
  background-size: 50% 2.6cqh, 75% 1.8cqh, 60% 1.8cqh;
  background-position: 2cqw 3cqh, 2cqw 9cqh, 2cqw 14cqh;
  background-repeat: no-repeat;
  transition: transform .45s cubic-bezier(.3,1.4,.5,1);
  animation: float 4s ease-in-out infinite;
}
.sc-gh .r1 { transform: translateX(-30cqw) rotate(-8deg); }
.sc-gh .r2 { transform: translateX(30cqw) rotate(8deg); animation-delay: -1.3s; }
.sc-gh .r3 { transform: translateY(-4cqh) scale(.8); opacity: 0; }
@keyframes float { 50% { translate: 0 -2cqh; } }

/* DJ Nikhotine */
.sc-dj { background: radial-gradient(ellipse at 50% 110%, #3a1257, #12061f 70%); }
.sc-dj .beam {
  position: absolute; top: -10cqh; left: 50%; width: 16cqw; height: 130cqh; margin-left: -8cqw;
  transform-origin: 50% 0; opacity: .35; mix-blend-mode: screen;
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  animation: sweep 5s ease-in-out infinite alternate;
}
.sc-dj .b1 { background: linear-gradient(#ff3df2, transparent 80%); --a: -38deg; --b: 10deg; }
.sc-dj .b2 { background: linear-gradient(#3dd9ff, transparent 80%); --a: 30deg; --b: -15deg; animation-delay: -1.6s; }
.sc-dj .b3 { background: linear-gradient(#fff36b, transparent 80%); --a: -5deg; --b: 35deg; animation-delay: -3.1s; }
@keyframes sweep { from { transform: rotate(var(--a)); } to { transform: rotate(var(--b)); } }
.sc-dj .deck {
  position: absolute; left: 5cqw; top: 50%; translate: 0 -50%;
  width: 74cqh; height: 66cqh; border-radius: 3cqh;
  background: linear-gradient(160deg, #2c2c32, #18181c);
  box-shadow: 0 2cqh 5cqh rgba(0,0,0,.55), inset 0 .4cqh 0 rgba(255,255,255,.08);
}
.sc-dj .record {
  position: absolute; left: 4cqh; top: 5cqh; width: 56cqh; height: 56cqh; border-radius: 50%;
  background:
    radial-gradient(circle, #ff3df2 0 15%, #111 15.5% 17%, transparent 17.5%),
    radial-gradient(circle, transparent 0 30%, rgba(255,255,255,.05) 30.5% 31%, transparent 31.5% 46%, rgba(255,255,255,.05) 46.5% 47%, transparent 47.5% 62%, rgba(255,255,255,.05) 62.5% 63%, transparent 63.5%),
    conic-gradient(from 30deg, #111, #2a2a2a 8%, #111 20%, #111 50%, #262626 58%, #111 70%),
    #111;
  box-shadow: 0 0 0 .6cqh #0a0a0a;
}
.sc-dj .record .label { position: absolute; left: 50%; top: 50%; width: 3%; height: 3%; margin: -1.5%; border-radius: 50%; background: #eee; }
.sc-dj .record::after { content: ""; position: absolute; left: 50%; top: 37%; width: 5%; height: 5%; margin-left: -2.5%; border-radius: 50%; background: #fff; }
.sc-dj .pivot { position: absolute; left: 64cqh; top: 5cqh; width: 7cqh; height: 7cqh; margin-left: -3.5cqh; border-radius: 50%; background: radial-gradient(circle, #ddd 30%, #888 32% 60%, #555 62%); }
.sc-dj .arm {
  position: absolute; left: 64cqh; top: 8.5cqh; width: 1.6cqh; height: 40cqh; margin-left: -.8cqh;
  background: linear-gradient(90deg, #a9a9a9, #eee, #a9a9a9); border-radius: 1cqh;
  transform-origin: 50% 0; rotate: 0deg;
  transition: rotate .55s cubic-bezier(.4,0,.2,1);
}
.sc-dj .arm::after { content: ""; position: absolute; left: -1.6cqh; bottom: -3cqh; width: 4cqh; height: 6cqh; border-radius: .8cqh; background: #d9d9d9; rotate: 18deg; box-shadow: inset 0 -1.6cqh 0 #888; }
.sc-dj .s-title { left: auto; right: 3cqw; width: 42cqw; top: 26cqh; font-size: 9.5cqh; white-space: nowrap; color: #fff; text-align: left; text-shadow: 0 0 3cqh #ff3df2; }
.sc-dj .s-sub { left: auto; right: 3cqw; width: 42cqw; top: 42cqh; font-size: 6cqh; color: #e7c9ff; text-align: left; }

/* Folder (Writing) */
.sc-folder { background: linear-gradient(160deg, #f8f9fa, #e3e7ea); }
.sc-folder .folder { position: absolute; left: 50%; top: 10cqh; width: 46cqw; height: 58cqh; margin-left: -23cqw; perspective: 60cqw; }
.sc-folder .back { position: absolute; inset: 6cqh 0 0; background: #3fa6d6; border-radius: 2cqh; }
.sc-folder .back::before { content: ""; position: absolute; left: 0; top: -5cqh; width: 40%; height: 7cqh; background: #3fa6d6; border-radius: 2cqh 2cqh 0 0; }
.sc-folder .paper {
  position: absolute; left: 8%; right: 8%; top: 2cqh; height: 44cqh; padding: 3cqh 3cqw;
  background: #fff; border-radius: 1.4cqh; box-shadow: 0 .5cqh 1.5cqh rgba(0,0,0,.15);
  text-align: left; transition: transform .4s cubic-bezier(.3,1.4,.5,1);
}
.sc-folder .paper b { display: block; font-size: 4.6cqh; color: #333; margin-bottom: 2cqh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-folder .paper i { display: block; height: 1.6cqh; background: #dfe3e6; border-radius: 1cqh; margin-bottom: 1.6cqh; }
.sc-folder .paper i + i { width: 70%; }
.sc-folder .p1 { transform: rotate(-4deg); }
.sc-folder .p2 { transform: translate(4cqw, 4cqh) rotate(3deg); }
.sc-folder .front {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34cqh;
  background: linear-gradient(#6cc4ec, #49b0e0); border-radius: 2cqh;
  box-shadow: 0 -.4cqh 0 rgba(255,255,255,.5) inset;
  transform-origin: 50% 100%; transition: transform .4s ease;
}
.sc-folder .s-title { top: 74cqh; font-size: 11cqh; color: #5f6468; }

/* Medium */
.sc-medium { background: #fff; }
.sc-medium .mlogo { position: absolute; left: 7cqw; top: 50%; translate: 0 -50%; width: 32cqw; fill: #111; }
.sc-medium .s-title { left: auto; right: 6cqw; width: 42cqw; top: 22cqh; text-align: left; font-size: 12cqh; color: #111; font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
.sc-medium .s-sub { left: auto; right: 6cqw; width: 42cqw; top: 40cqh; text-align: left; font-size: 6cqh; color: #6b6b6b; }
.sc-medium .lines { position: absolute; right: 6cqw; width: 42cqw; top: 56cqh; }
.sc-medium .lines i { display: block; height: 2cqh; margin-bottom: 2.2cqh; background: #e6e6e6; border-radius: 1cqh; transform-origin: left; animation: write 4s ease-in-out infinite; }
.sc-medium .lines i:nth-child(2) { animation-delay: .4s; width: 90%; }
.sc-medium .lines i:nth-child(3) { animation-delay: .8s; }
.sc-medium .lines i:nth-child(4) { animation-delay: 1.2s; width: 60%; }
@keyframes write { 0% { transform: scaleX(0); } 30%, 85% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }

/* LinkedIn */
.sc-li { background: linear-gradient(160deg, #0a66c2, #004182); color: #fff; }
.sc-li .logo {
  position: absolute; left: 8cqw; top: 50%; translate: 0 -50%;
  width: 40cqh; height: 40cqh; border-radius: 7cqh; background: #fff;
  display: grid; place-items: center;
  color: #0a66c2; font: 800 30cqh/1 Arial, Helvetica, sans-serif; letter-spacing: -.04em;
  padding-bottom: 3cqh;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.3,1.6,.5,1);
}
.sc-li .logo::after { content: ""; position: absolute; inset: -20%; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.7) 50%, transparent 60%); animation: shine 3.5s ease-in-out infinite; }
@keyframes shine { 0%, 60% { transform: translateX(-80%); } 100% { transform: translateX(80%); } }
.sc-li .plus { position: absolute; left: calc(8cqw + 34cqh); top: 18cqh; font-size: 7cqh; font-weight: 800; color: #fff; background: #e2463b; padding: .6cqh 1.6cqw; border-radius: 99px; opacity: 0; transform: scale(.3); transition: transform .3s cubic-bezier(.3,1.6,.5,1), opacity .2s; }
.sc-li .s-title { left: auto; right: 6cqw; width: 50cqw; top: 33cqh; text-align: left; font-size: 11cqh; }
.sc-li .s-sub { left: auto; right: 6cqw; width: 50cqw; top: 52cqh; text-align: left; font-size: 6cqh; color: #d6e8fa; }

/* About (Disc Channel homage) */
.sc-about { background: radial-gradient(circle at 30% 50%, #fff, #e6eaee); }
.sc-about .disc {
  position: absolute; left: 10cqw; top: 50%; translate: 0 -50%;
  width: 66cqh; height: 66cqh; border-radius: 50%;
  background:
    radial-gradient(circle, #eef0f2 0 11%, #b9c0c7 11.5% 13%, transparent 13.5%),
    conic-gradient(from 20deg, #dfe6ec, #f9fbfc, #c9e7f5, #f2f4f6, #e4dcf2, #f9fbfc, #dfe6ec);
  box-shadow: 0 1.5cqh 4cqh rgba(0,0,0,.15), inset 0 0 0 .6cqh #d0d5da;
  display: grid; place-items: center;
  animation: spin 6s linear infinite;
}
.sc-about .disc span { translate: 0 -19cqh; font-weight: 800; font-size: 7cqh; color: var(--wii-blue); }
.sc-about .s-title { left: auto; right: 6cqw; width: 48cqw; top: 33cqh; text-align: left; font-size: 11cqh; color: #5f6468; }
.sc-about .s-sub { left: auto; right: 6cqw; width: 48cqw; top: 52cqh; text-align: left; font-size: 6cqh; color: #8a8f94; }

/* ── Hover flourishes (also play on the channel screen) ── */
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-jev .walker { animation: hop .45s ease-in-out infinite; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-jev .beep { animation: beep .9s steps(1) infinite; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-jev .lamp { animation: blink .3s steps(1) infinite; }
@keyframes hop { 50% { transform: translateY(-5cqh); } }
@keyframes beep { 0% { opacity: 1; transform: rotate(-6deg); } 50% { opacity: 1; transform: rotate(6deg) scale(1.1); } }

:is(.tile:hover, .tile:focus-visible) .sc-tardy .card { animation: shake .35s ease-in-out infinite; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-tardy .cd { color: #e2463b; }
@keyframes shake { 25% { rotate: -2deg; } 75% { rotate: 2deg; } }

/* Needle swings onto the record, then the record starts spinning. */
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-dj .arm { rotate: 24deg; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-dj .record { animation: spin 1.8s linear .55s infinite; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-dj .beam { animation-duration: 1.2s; opacity: .55; transition: opacity .4s .55s; }

.sc-ut .sun { transition: top .9s cubic-bezier(.3,.7,.2,1), box-shadow .9s, background-color .9s; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-ut::before { opacity: 1; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-ut .sun { top: 38cqh; background-color: #ffe7a1; box-shadow: 0 0 20cqh #ffd36b; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-ut .bars i { animation-duration: .5s !important; }

:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-hh .win { animation: ping 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * .4s); }
@keyframes ping { 0%, 40%, 100% { box-shadow: 0 0 0 0 transparent; } 20% { box-shadow: 0 0 0 .6cqh #8fd3ff, 0 0 4cqh #8fd3ff; } }

:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-chips .stack { animation: bounce .6s ease-in-out infinite; animation-delay: calc(var(--i) * .12s); }
@keyframes bounce { 40% { transform: translateY(-8cqh); } 60% { transform: translateY(0); } }

:is(.tile:hover, .tile:focus-visible) .sc-folder .front { transform: rotateX(38deg); }
:is(.tile:hover, .tile:focus-visible) .sc-folder .p1 { transform: translate(-6cqw, -9cqh) rotate(-9deg); }
:is(.tile:hover, .tile:focus-visible) .sc-folder .p2 { transform: translate(7cqw, -6cqh) rotate(8deg); }

:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-blog .badge { opacity: 1; transform: none; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-blog .del, :is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-blog .del::after { animation-duration: 1.6s; }

:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-medium .mlogo { animation: squish .9s ease-in-out infinite; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-medium .lines i { animation-duration: 1.6s; }
@keyframes squish { 50% { transform: scaleX(.92) scaleY(1.06); } }

:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-gh .mark { animation: wave .7s ease-in-out infinite; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-gh .r1 { transform: translate(-32cqw, -6cqh) rotate(-16deg); }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-gh .r2 { transform: translate(32cqw, -6cqh) rotate(16deg); }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-gh .r3 { transform: translateY(-14cqh) scale(.9); opacity: 1; }
@keyframes wave { 25% { rotate: -10deg; } 75% { rotate: 10deg; } }

:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-li .logo { transform: translateY(-50%) scale(1.08) rotate(-4deg); translate: 0 0; }
:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-li .plus { opacity: 1; transform: none; }



:is(.tile:hover, .tile:focus-visible, .cv-stage) .sc-about .disc { animation-duration: 1.2s; }

/* ── Folder + message board overlays ───────────────────── */
.folder-view, .msg-view {
  position: fixed; inset: 0; z-index: 15;
  display: grid; place-items: center;
  background: rgba(238, 240, 242, .82);
  backdrop-filter: blur(6px);
  padding: 16px;
}
.folder-view[hidden], .msg-view[hidden] { display: none; }
.folder-panel {
  width: min(900px, 100%);
  background: linear-gradient(#fdfdfd, #eef1f3);
  border: 3px solid var(--tile-border);
  border-radius: 30px;
  box-shadow: 0 20px 50px rgba(0,0,0,.12);
  padding: clamp(18px, 3vw, 32px);
  text-align: center;
}
.folder-panel h2 { margin: 0 0 .8em; font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; color: var(--text-strong); }
.folder-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 2vw, 24px); margin-bottom: clamp(18px, 3vw, 28px); }

.msg-view { z-index: 25; }
.msg-card {
  width: min(560px, 100%);
  background: #fffef8;
  border: 3px solid var(--tile-border);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.14);
  padding: 26px clamp(20px, 4vw, 40px) 26px;
  color: #555a5f;
}
.msg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 20px; font-weight: 500; color: var(--text); }
.msg-head .envelope { width: 44px; }
.msg-head .envelope * { stroke: var(--wii-blue); }
.msg-card h2 { margin: 0 0 10px; font-size: 26px; font-weight: 700; color: var(--text-strong); line-height: 35px; }
.msg-card p { margin: 0; font-size: 19px; line-height: 35px; }
.msg-card .msg-sign { text-align: right; font-weight: 700; color: var(--wii-blue-deep); }
.msg-buttons { display: flex; gap: 16px; margin-top: 22px; }
.msg-buttons .wii-btn { min-width: 0; flex: 1; padding: 14px; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 760px), (max-height: 520px) {
  :root { --bar-h: 116px; }
  body { overflow: auto; }
  .menu { position: static; display: block; place-items: normal; padding: 20px 16px calc(var(--bar-h) + 24px); }
  .pages-viewport { width: auto; margin: 0; padding: 0; overflow: visible; }
  .pages { display: block; transform: none !important; }
  .page { grid-template-columns: repeat(2, 1fr); padding: 0; gap: 12px; margin-bottom: 12px; }
  .page .tile.empty { display: none; }
  .page-arrow { display: none !important; }
  .bar-side { flex-basis: 116px; }
  .bar-shape { height: 100%; }
  .round-btn { width: 60px; height: 60px; top: 30px; }
  .bar-side.left .round-btn { left: 14px; }
  .bar-side.right .round-btn { right: 14px; }
  .round-label { font-size: 18px; }
  .envelope { width: 30px; }
  .clock { font-size: 28px; margin-top: 17px; }
  .date { font-size: 14px; margin-top: 3px; }
  /* Too narrow beside the clock on phones: sit on the blue line above it instead. */
  .music-btn { right: auto; left: 50%; top: -15px; translate: -50% 0; width: 30px; height: 30px; }
  .music-btn svg { width: 16px; height: 16px; }
  .cv-buttons .wii-btn { min-width: 0; flex: 1; padding: 14px; }
  .msg-buttons .wii-btn { font-size: 17px; padding: 12px 8px; white-space: nowrap; }
  .msg-card { padding: 20px; }
  /* Phones are portrait: keep the banner the same shape as a tile so scenes don't stretch. */
  .channel-view { padding: 16px 16px 20px; grid-template-rows: auto auto auto; align-content: center; gap: 20px; overflow-y: auto; }
  .cv-stage { aspect-ratio: 16 / 10.5; width: min(100%, calc((100dvh - 250px) * 16 / 10.5)); justify-self: center; border-radius: 20px; }
  .cv-stage .scene { border-radius: 20px; }
  .folder-grid { grid-template-columns: 1fr; }
}

/* Phones held sideways: short screen, plenty of width. */
@media (max-height: 520px) and (min-width: 600px) {
  .page { grid-template-columns: repeat(4, 1fr); }
  .folder-grid { grid-template-columns: repeat(2, 1fr); }
  .folder-panel { width: min(640px, 100%); padding: 16px; }
  .folder-panel h2 { margin-bottom: .5em; }
  .channel-view { gap: 10px; padding: 12px 16px; }
  .cv-stage { width: min(100%, calc((100dvh - 170px) * 16 / 10.5)); }
  .cv-info p { font-size: 13px; line-height: 1.4; }
  .wii-btn { padding: 10px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
