:root {
  --font-display: "Press Start 2P", "Courier New", monospace;
  --font-body: "VT323", "Courier New", monospace;
  --border-w: 4px;
  --shadow-sm-1: 3px;
  --shadow-sm-2: 6px;
  --shadow-lg-1: 4px;
  --shadow-lg-2: 8px;
}

html[data-theme="dark"] {
  --bg: #0f1b2d;
  --surface: #17263f;
  --text: #e9edf5;
  --text-dim: #9fb0c9;
  --border: #e9edf5;
  --shadow-color: #060b14;
  --accent-red: #ff5a5f;
  --accent-blue: #3fa7ff;
  --accent-yellow: #ffd23f;
  --accent-green: #3ddc84;
  --scanline: rgba(255, 255, 255, 0.03);
  --scanline-blend: screen;
}

html[data-theme="light"] {
  --bg: #f6efe1;
  --surface: #fffaf0;
  --text: #1c1508;
  --text-dim: #5b4d38;
  --border: #1c1508;
  --shadow-color: #d8c9a8;
  --accent-red: #c8383d;
  --accent-blue: #1e6fbf;
  --accent-yellow: #b8860b;
  --accent-green: #2a9e5f;
  --scanline: rgba(0, 0, 0, 0.035);
  --scanline-blend: multiply;
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.25rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  align-items: safe center;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(1rem, 5vw, 3rem);
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    var(--scanline) 2px 4px
  );
  mix-blend-mode: var(--scanline-blend);
}

.floaties {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.floaty {
  position: absolute;
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-sm-1) var(--shadow-sm-1) 0 var(--shadow-color), var(--shadow-sm-2) var(--shadow-sm-2) 0 var(--border);
  animation: float ease-in-out infinite;
}

.floaty-img {
  width: clamp(28px, 4.5vw, 52px);
  height: clamp(28px, 4.5vw, 52px);
  object-fit: cover;
  image-rendering: pixelated;
}

.floaty-icon {
  width: clamp(24px, 4vw, 44px);
  height: clamp(24px, 4vw, 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.floaty-icon.c-red { color: var(--accent-red); }
.floaty-icon.c-blue { color: var(--accent-blue); }
.floaty-icon.c-yellow { color: var(--accent-yellow); }
.floaty-icon.c-green { color: var(--accent-green); }

.f1  { top: 3%;  left: 5%;   animation-duration: 6s;   }
.f2  { top: 9%;  right: 5%;  animation-duration: 5.2s; animation-delay: -1s; }
.f3  { top: 17%; left: 4%;   animation-duration: 6.6s; animation-delay: -3s; }
.f4  { top: 23%; right: 4%;  animation-duration: 5.8s; animation-delay: -0.5s; }
.f5  { top: 32%; left: 6%;   animation-duration: 6.2s; animation-delay: -2.4s; }
.f6  { top: 38%; right: 6%;  animation-duration: 7s;   animation-delay: -2.3s; }
.f7  { top: 46%; left: 4%;   animation-duration: 5.5s; animation-delay: -1.6s; }
.f8  { top: 52%; right: 4%;  animation-duration: 6.4s; animation-delay: -3.4s; }
.f9  { top: 60%; left: 6%;   animation-duration: 5.9s; animation-delay: -0.8s; }
.f10 { top: 66%; right: 6%;  animation-duration: 6.8s; animation-delay: -2.9s; }
.f11 { top: 74%; left: 5%;   animation-duration: 5.5s; animation-delay: -1.2s; }
.f12 { top: 80%; right: 5%;  animation-duration: 6.1s; animation-delay: -4s; }
.f13 { top: 88%; left: 7%;   animation-duration: 6.5s; animation-delay: -2s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@media (max-width: 700px) {
  .f5, .f6, .f7, .f8, .f9, .f10 { display: none; }

  .f1  { top: 0.4rem; left: 6%; }
  .f2  { top: 0.4rem; left: 26%; right: auto; }
  .f3  { top: 0.4rem; left: 46%; }
  .f4  { top: 0.4rem; left: 66%; right: auto; }

  .f11 { top: auto; bottom: 0.4rem; left: 10%; }
  .f12 { top: auto; bottom: 0.4rem; left: 42%; right: auto; }
  .f13 { top: auto; bottom: 0.4rem; left: 74%; }
}

@media (prefers-reduced-motion: reduce) {
  .floaty { animation: none; }
}

.card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-lg-1) var(--shadow-lg-1) 0 var(--shadow-color), var(--shadow-lg-2) var(--shadow-lg-2) 0 var(--border);
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.avatar {
  width: clamp(56px, 16vw, 72px);
  height: clamp(56px, 16vw, 72px);
  object-fit: cover;
  image-rendering: pixelated;
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-sm-1) var(--shadow-sm-1) 0 var(--shadow-color), var(--shadow-sm-2) var(--shadow-sm-2) 0 var(--border);
  margin-bottom: 1.25rem;
}

.name {
  font-family: var(--font-display);
  font-size: clamp(1rem, 5vw, 1.4rem);
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 2.2vw, 0.7rem);
  line-height: 1.8;
  color: var(--accent-yellow);
  margin: 0 0 1.25rem;
}

.bio {
  font-size: 1.3rem;
  color: var(--text);
  margin: 0 0 0.75rem;
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

.sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin: 0;
}

.links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-sm-1) var(--shadow-sm-1) 0 var(--shadow-color), var(--shadow-sm-2) var(--shadow-sm-2) 0 var(--border);
  transition: transform 0.1s ease;
}

.link-card:hover,
.link-card:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow-color), 4px 4px 0 var(--border);
}

.link-card .icon {
  flex-shrink: 0;
  color: var(--accent-blue);
}

.link-card .label {
  font-family: var(--font-display);
  font-size: 0.7rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--accent-green);
  text-align: center;
  margin: 2rem 0 1rem;
}

.fun-projects ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.project-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-sm-1) var(--shadow-sm-1) 0 var(--shadow-color), var(--shadow-sm-2) var(--shadow-sm-2) 0 var(--border);
  transition: transform 0.1s ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow-color), 4px 4px 0 var(--border);
}

.project-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.project-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
}

.footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 1.2rem;
}

.cursor {
  display: inline-block;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.theme-toggle {
  position: fixed;
  top: clamp(0.75rem, 3vw, 1.5rem);
  right: clamp(0.75rem, 3vw, 1.5rem);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--accent-yellow);
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-sm-1) var(--shadow-sm-1) 0 var(--shadow-color), var(--shadow-sm-2) var(--shadow-sm-2) 0 var(--border);
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow-color), 4px 4px 0 var(--border);
}

html[data-theme="light"] .theme-toggle .icon-moon,
html[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:focus-visible {
  outline: 3px dashed var(--accent-blue);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  :root {
    --border-w: 3px;
    --shadow-sm-1: 2px;
    --shadow-sm-2: 4px;
    --shadow-lg-1: 3px;
    --shadow-lg-2: 6px;
  }
}
