:root {
  --bg-1: #fed5e8;
  --bg-2: #ffd85f;
  --ink: #121212;
  --frame: #0f2a56;
  --frame-2: #24b7ff;
  --paper: #fff9d7;
  --accent: #ff3f8e;
  --accent-2: #35d07f;
  --cursor-cute: url("cute-polar-bear/normal.cur");
  --cursor-cute-hover: url("cute-polar-bear/link.cur");
  --cursor-cute-text: url("cute-polar-bear/text.cur");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  cursor: var(--cursor-cute), auto;
  background-color: var(--bg-1);
  background-image:
    radial-gradient(circle at 18px 18px, rgba(255, 255, 255, 0.55) 8px, transparent 9px),
    radial-gradient(circle at 4px 4px, rgba(255, 64, 143, 0.35) 3px, transparent 4px),
    linear-gradient(45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%);
  background-size: 24px 24px, 24px 24px, 16px 16px, 16px 16px;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0.14;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.55) 0.6px, transparent 0.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0.6px, transparent 0.7px);
  background-size: 3px 3px, 4px 4px;
  animation: tv-static 0.18s steps(2) infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0.2;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255, 84, 166, 0.7) 0.2rem, transparent 0.22rem),
    radial-gradient(circle at 85% 30%, rgba(255, 84, 166, 0.55) 0.18rem, transparent 0.2rem),
    radial-gradient(circle at 24% 78%, rgba(255, 84, 166, 0.65) 0.16rem, transparent 0.18rem),
    radial-gradient(circle at 72% 72%, rgba(255, 84, 166, 0.55) 0.2rem, transparent 0.22rem);
  animation: hearts-drift 12s linear infinite;
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 2px,
    transparent 4px
  );
  z-index: 9;
}

.heart-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 11;
}

.heart {
  position: absolute;
  left: var(--heart-left, 50%);
  top: var(--heart-top, 50%);
  font-size: var(--heart-size, 20px);
  line-height: 1;
  color: #ff3f9a;
  transform: rotate(var(--heart-rot, 0deg));
  text-shadow:
    0 0 8px rgba(255, 94, 168, 0.6),
    1px 1px 0 rgba(255, 255, 255, 0.75);
  opacity: var(--heart-opacity, 0.9);
  animation: heart-float var(--heart-duration, 5.5s) ease-in-out infinite;
  animation-delay: var(--heart-delay, 0s);
}

.sticker-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.sticker {
  position: absolute;
  width: clamp(48px, 7vw, 90px);
  max-height: clamp(44px, 7vw, 82px);
  image-rendering: pixelated;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.35));
  animation: sticker-float 4.8s ease-in-out infinite;
}

.s1 {
  top: 5%;
  left: 2%;
  transform: rotate(-8deg);
}

.s2 {
  top: 16%;
  right: 2%;
  transform: rotate(7deg);
  animation-delay: -1.2s;
}

.s3 {
  top: 42%;
  left: 3%;
  transform: rotate(10deg);
  animation-delay: -2.1s;
}

.s4 {
  top: 50%;
  right: 2%;
  transform: rotate(-10deg);
  animation-delay: -3s;
}

.s5 {
  bottom: 9%;
  left: 1.5%;
  transform: rotate(-6deg);
  animation-delay: -1.8s;
}

.s6 {
  bottom: 7%;
  right: 1.5%;
  transform: rotate(9deg);
  animation-delay: -2.7s;
}

.hero,
.layout,
.footer {
  width: min(1100px, 94vw);
  margin-inline: auto;
}

.stream-banner {
  width: min(1100px, 94vw);
  margin-inline: auto;
  background: linear-gradient(160deg, #d7f1ff, #ffe8f5);
  text-align: left;
}

.stream-banner img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: left center;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
  background: #fff;
}

.viewer-layout {
  width: min(1100px, 94vw);
  margin: 1rem auto;
}

.viewer-shell {
  background:
    radial-gradient(circle at top right, rgba(80, 130, 255, 0.12), transparent 58%),
    var(--paper);
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 0.6rem;
}

.viewer-actions a {
  display: inline-block;
  text-decoration: none;
  border: 2px solid #000;
  background: linear-gradient(180deg, #f8ffff, #70d6ff);
  color: #000;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  box-shadow: 2px 2px 0 #000;
}

.viewer-meta {
  margin: 0 0 0.7rem;
  font-family: "Courier New", monospace;
  font-size: 0.86rem;
  background: #e8f3ff;
  border: 2px dashed #0b3f7e;
  padding: 0.45rem 0.6rem;
  overflow-wrap: anywhere;
}

.viewer-code-wrap {
  border: 3px solid #0a2c62;
  box-shadow: inset 0 0 0 2px #8ecfff;
  background: #0b1631;
  border-radius: 8px;
  overflow: auto;
  max-height: 72vh;
}

.viewer-code {
  margin: 0;
  padding: 0.7rem 0;
  min-width: 620px;
}

.viewer-code code {
  font-family: "Courier New", monospace;
  font-size: 0.87rem;
  color: #d8e9ff;
  display: block;
}

.code-line {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 0.8rem;
  padding: 0 0.8rem;
  line-height: 1.45;
}

.line-no {
  user-select: none;
  color: #7ea6dd;
  text-align: right;
}

.line-code {
  white-space: pre;
}

.viewer-raw-fallback {
  display: block;
  width: 100%;
  min-height: 62vh;
  margin-top: 0.7rem;
  border: 2px solid #3b5e9d;
  background: #fff;
}

.hero {
  margin-top: 1rem;
  text-align: center;
  background: linear-gradient(160deg, #ff9ec8, #ffe36e);
}

h1,
h2,
h3 {
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0.2rem 0;
}

h1 {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
}

marquee {
  margin: 0.5rem 0 0.25rem;
  font-weight: 700;
  color: #002450;
}

.tiny {
  font-size: 0.75rem;
  margin: 0;
  letter-spacing: 0.06em;
}

.frame {
  border: 4px solid var(--frame);
  box-shadow:
    0 0 0 4px var(--frame-2),
    6px 6px 0 rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--paper);
  position: relative;
  z-index: 10;
}

.badge-row {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.badge-row a,
.card a {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  border: 2px solid #000;
  padding: 0.35rem 0.65rem;
  background: linear-gradient(180deg, #f8ffff, #70d6ff);
  color: #000;
  box-shadow: 3px 3px 0 #000;
}

.badge-row a:hover,
.card a:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #000;
  background: linear-gradient(180deg, #fff8d0, #ffc866);
  cursor: var(--cursor-cute-hover), pointer;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
}

.sidebar {
  align-self: start;
  background: linear-gradient(180deg, #dff9ff, #ffd6ee);
}

.sidebar h2,
.sidebar h3 {
  margin-top: 0;
}

.sidebar ul {
  padding-left: 1rem;
  margin: 0.4rem 0 0;
}

.kawaii-widget {
  margin: 0.7rem 0 0.9rem;
  padding: 0.6rem;
  border: 2px dashed #87305d;
  background: linear-gradient(180deg, #ffeef8, #f4fbff);
}

.kawaii-widget h3 {
  margin: 0 0 0.3rem;
}

.kawaii-widget p {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
}

.kawaii-widget p.is-pop {
  animation: quote-pop 0.35s ease;
}

.kawaii-widget button {
  border: 2px solid #000;
  background: linear-gradient(180deg, #ffd9ec, #ff93bf);
  color: #000;
  font-family: "Courier New", monospace;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  box-shadow: 2px 2px 0 #000;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.button-grid span {
  background: #000;
  color: #fff;
  text-align: center;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  padding: 0.2rem;
}

.block {
  background:
    radial-gradient(circle at top right, rgba(255, 57, 147, 0.08), transparent 60%),
    var(--paper);
  position: relative;
}

.project-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 0.8rem;
}

.card {
  border: 2px dashed #00418a;
  background: #eaffff;
  padding: 0.8rem;
}

.card.alt {
  border-color: #87305d;
  background: #ffe9f6;
}

.card.note {
  border-color: #2a5c0a;
  background: #f3ffe1;
}

.card p {
  min-height: 3.6rem;
}

.notes-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 1rem;
}

.notes-summary p {
  margin: 0;
  background: #e4f7ff;
  border: 2px dashed #0b3f7e;
  padding: 0.5rem 0.6rem;
}

.notes-hub {
  border: 3px solid #1f3f7b;
  box-shadow: inset 0 0 0 2px #90d9ff;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fdff, #eefde6);
  padding: 0.8rem;
}

.notes-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.notes-tab {
  border: 2px solid #000;
  background: linear-gradient(180deg, #fff8d2, #ffd68f);
  color: #000;
  font-family: "Courier New", monospace;
  font-weight: 700;
  padding: 0.38rem 0.7rem;
  box-shadow: 2px 2px 0 #000;
}

.notes-tab:hover {
  background: linear-gradient(180deg, #f8ffff, #7dd8ff);
}

.notes-tab.is-active {
  background: linear-gradient(180deg, #ffbfdc, #ff78b2);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.notes-panel {
  border: 2px dashed #31629f;
  background: #fffef4;
  padding: 0.75rem;
}

.notes-panel h3 {
  margin-top: 0;
}

.notes-panel p {
  min-height: 0;
}

.note-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.note-file-grid a {
  border: 2px solid #000;
  background: linear-gradient(180deg, #e5f9ff, #9ce3ff);
  color: #000;
  text-decoration: none;
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
  box-shadow: 2px 2px 0 #000;
}

.note-file-grid a:hover {
  background: linear-gradient(180deg, #fff5c8, #ffc66a);
}

.repo-browser {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.repo-file-list {
  border: 2px dashed #31629f;
  background: #eef8ff;
  padding: 0.45rem;
  max-height: 420px;
  overflow: auto;
  align-self: start;
}

.repo-status {
  margin: 0;
  font-size: 0.9rem;
}

.repo-file-btn {
  width: 100%;
  text-align: left;
  border: 2px solid #000;
  background: linear-gradient(180deg, #ffffff, #bcecff);
  color: #000;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  padding: 0.42rem 0.5rem;
  margin-bottom: 0.35rem;
  box-shadow: 2px 2px 0 #000;
}

.repo-file-btn.is-active {
  background: linear-gradient(180deg, #ffd7ea, #ff8bbe);
}

.repo-file-link {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  border: 2px solid #000;
  background: linear-gradient(180deg, #ffffff, #bcecff);
  color: #000;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  padding: 0.42rem 0.5rem;
  margin-bottom: 0.35rem;
  box-shadow: 2px 2px 0 #000;
}

.repo-file-link:hover {
  background: linear-gradient(180deg, #fff5c8, #ffc66a);
}

.repo-file-link.is-featured {
  background: linear-gradient(180deg, #ffd7ea, #ff8bbe);
}

.repo-viewer {
  border: 2px dashed #31629f;
  background: #fffef4;
  padding: 0.45rem;
}

.repo-meta {
  margin: 0 0 0.55rem;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.repo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.repo-actions a {
  display: inline-block;
  text-decoration: none;
  border: 2px solid #000;
  background: linear-gradient(180deg, #f8ffff, #70d6ff);
  color: #000;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.3rem 0.55rem;
  box-shadow: 2px 2px 0 #000;
}

.repo-viewer .viewer-code {
  border: 2px solid #0a2c62;
  box-shadow: inset 0 0 0 1px #8ecfff;
  background: #0b1631;
  border-radius: 6px;
  max-height: 420px;
  overflow: auto;
  min-width: 0;
  padding: 0.65rem 0;
}

.repo-viewer .viewer-code code {
  color: #d8e9ff;
  display: block;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  white-space: pre;
}

.note-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.note-checklist span {
  border: 2px dashed #31629f;
  background: #f3f8ff;
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
}

.section-deco {
  position: absolute;
  display: inline-block;
  width: clamp(30px, 4.8vw, 52px);
  max-height: clamp(30px, 4.8vw, 52px);
  image-rendering: pixelated;
  border: 2px solid #000;
  background: #fff;
  padding: 0.15rem;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  margin: 0;
  animation: deco-bob 4.2s ease-in-out infinite;
  top: 12px;
}

.has-deco-right {
  padding-right: clamp(72px, 9vw, 112px);
}

.has-deco-left {
  padding-left: clamp(72px, 9vw, 112px);
}

.has-deco-right .section-deco {
  right: 12px;
}

.has-deco-left .section-deco {
  left: 12px;
}

.deco-program {
  transform: rotate(7deg);
}

.deco-notes {
  transform: rotate(-6deg);
  animation-delay: -1s;
}

.deco-other {
  transform: rotate(5deg);
  animation-delay: -1.8s;
}

.deco-meme {
  transform: rotate(-7deg);
  animation-delay: -2.4s;
}

.deco-about {
  transform: rotate(5deg);
  animation-delay: -1.3s;
}

.deco-contact {
  transform: rotate(-5deg);
  animation-delay: -2s;
}

.random-pic-wrap {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.7rem;
  justify-items: center;
}

.random-pic-wrap img {
  max-width: min(420px, 100%);
  max-height: 260px;
  object-fit: contain;
  border: 3px solid #000;
  background: #fff;
  padding: 0.3rem;
  box-shadow: 4px 4px 0 #000;
}

.random-pic-wrap button {
  border: 2px solid #000;
  background: linear-gradient(180deg, #fff8d2, #ffd68f);
  color: #000;
  font-family: "Courier New", monospace;
  font-weight: 700;
  padding: 0.42rem 0.8rem;
  box-shadow: 2px 2px 0 #000;
}

.random-pic-wrap button:hover {
  background: linear-gradient(180deg, #f8ffff, #7dd8ff);
}

.footer {
  text-align: center;
  background: linear-gradient(130deg, #dbffe8, #b8e8ff);
  margin-bottom: 1.2rem;
}

.blinkie-row {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.blinkie-row span {
  border: 2px solid #000;
  background: linear-gradient(180deg, #ffe578, #ffa55f);
  color: #000;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  box-shadow: 2px 2px 0 #000;
  animation: blinkie-pop 1.2s steps(2) infinite;
}

.blinkie-row span:nth-child(2) {
  animation-delay: -0.35s;
}

.blinkie-row span:nth-child(3) {
  animation-delay: -0.7s;
}

a {
  color: #052ca3;
}

a,
button,
[role="button"] {
  cursor: var(--cursor-cute-hover), pointer;
}

input,
textarea {
  cursor: var(--cursor-cute-text), text;
}

@keyframes tv-static {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-1px, 1px);
  }

  50% {
    transform: translate(1px, -1px);
  }

  75% {
    transform: translate(1px, 1px);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes sticker-float {
  0% {
    margin-top: 0;
  }

  50% {
    margin-top: -6px;
  }

  100% {
    margin-top: 0;
  }
}

@keyframes hearts-drift {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes blinkie-pop {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.15);
  }
}

@keyframes quote-pop {
  0% {
    transform: scale(0.97);
    opacity: 0.7;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes deco-bob {
  0% {
    margin-top: 0;
  }

  50% {
    margin-top: -4px;
  }

  100% {
    margin-top: 0;
  }
}

@keyframes heart-float {
  0% {
    transform: rotate(var(--heart-rot, 0deg)) translateY(0) scale(1);
    opacity: 0.9;
  }

  50% {
    transform: rotate(var(--heart-rot, 0deg)) translateY(-8px) scale(1.08);
    opacity: 1;
  }

  100% {
    transform: rotate(var(--heart-rot, 0deg)) translateY(0) scale(1);
    opacity: 0.9;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .stream-banner img {
    max-height: 140px;
  }

  .sticker {
    width: clamp(42px, 11vw, 68px);
    max-height: clamp(38px, 10vw, 64px);
    opacity: 0.8;
  }

  .s3,
  .s4 {
    display: none;
  }

  .notes-tab {
    flex: 1 1 42%;
    text-align: center;
  }

  .repo-browser {
    grid-template-columns: 1fr;
  }

  .viewer-code {
    min-width: 520px;
  }

  .repo-viewer .viewer-code {
    min-width: 0;
  }

  .section-deco {
    width: 34px;
    max-height: 34px;
    opacity: 0.9;
    position: static;
    margin: 0 0 0.35rem;
  }

  .has-deco-right,
  .has-deco-left {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .random-pic-wrap img {
    max-height: 210px;
  }
}
