@font-face {
  font-family: "Minecraft";
  src: url("fonts/MinecraftRegular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Minecraft";
  src: url("fonts/MinecraftBold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Starified Small Caps";
  src: url("fonts/StarifiedSmallCaps.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0041-005A, U+0061-007A;
}

:root {
  color-scheme: dark;

  --bg: #0b0a12;
  --surface: #13111c;
  --surface-2: #1a1726;
  --line: #262236;
  --line-strong: #3a3450;
  --text: #eeecf6;
  --muted: #a5a1bb;
  --faint: #6f6a88;
  --star: #ffd75e;
  --pastel: #fde68a;
  --star-ink: #1c1504;
  --live: #4ade80;
  --dev: #f5b83d;

  --font-display: "Minecraft", Arial, Helvetica, sans-serif;
  --font-small-caps: "Starified Small Caps", "Minecraft", Arial, Helvetica, sans-serif;
  --font-body: "Minecraft", Arial, Helvetica, sans-serif;
  --mc-shadow: 0.1em 0.1em 0 #3b3a3d;

  --radius: 18px;
  --gutter: 20px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: 6px;
  min-height: 48px;
}
::-webkit-scrollbar-thumb:hover { background: var(--pastel); }
::-webkit-scrollbar-thumb:active { background: var(--star); }
::-webkit-scrollbar-corner { background: var(--bg); }
::-webkit-scrollbar-button { display: none; }

@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: var(--line-strong) var(--bg); scrollbar-width: thin; }
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 75% -5%, rgba(132, 98, 255, 0.16), transparent 70%),
    radial-gradient(ellipse 50% 35% at 0% 10%, rgba(255, 215, 94, 0.05), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--star);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
}

.sky-twinkles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  contain: strict;
}

.sky-twinkles i {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  opacity: 0.2;
  animation: star-twinkle 3s ease-in-out infinite;
}

@keyframes star-twinkle {
  50% { opacity: 0.85; }
}

.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}

.topbar.scrolled {
  background: rgba(11, 10, 18, 0.94);
  border-bottom-color: var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.home {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  text-shadow: var(--mc-shadow);
  transition: color 0.15s;
}

.home-icon {
  position: relative;
  top: -3px;
  font-size: 30px;
  color: var(--star);
  text-shadow: 0.1em 0.1em 0 #3f3517;
}

.home:hover { color: var(--star); }

.nav { display: flex; gap: 4px; }

.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  text-shadow: var(--mc-shadow);
  transition: color 0.15s, background-color 0.15s;
}

.nav a:hover { color: var(--text); background: var(--surface-2); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  padding-block: 88px 72px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 60px;
  line-height: 1.2;
  text-shadow: var(--mc-shadow);
}

.star-word {
  color: var(--star);
  text-shadow: 0.1em 0.1em 0 #3f3517;
}

.lede {
  margin-top: 20px;
  max-width: 34em;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.hero .actions { margin-top: 32px; }

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  gap: 52px;
  min-height: 300px;
}

.live-total {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.28);
  background: rgba(11, 10, 18, 0.85);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  animation: live-in 0.4s ease-out;
}

.live-total.pulse { animation: live-glow 1.2s ease-out; }

.live-dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--live);
  animation: live-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.live-number { color: var(--live); }

.reels {
  display: inline-flex;
  height: 1em;
  line-height: 1;
  vertical-align: top;
  user-select: none;
}

.reel {
  display: block;
  height: 1em;
  overflow: hidden;
}

.reel-strip {
  display: block;
  white-space: pre;
  text-align: center;
  will-change: transform;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.live-number.bump { animation: live-bump 0.6s ease-out; }

@keyframes live-ping {
  75%, 100% { transform: scale(2.6); opacity: 0; }
}

@keyframes live-bump {
  30% { color: #b9f8cf; }
}

@keyframes live-glow {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); border-color: rgba(74, 222, 128, 0.28); }
  20% { box-shadow: 0 0 22px 2px rgba(74, 222, 128, 0.45); border-color: rgba(74, 222, 128, 0.8); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); border-color: rgba(74, 222, 128, 0.28); }
}

@keyframes live-in {
  from { opacity: 0; transform: translateY(6px); }
}

.platform {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 55%, rgba(253, 230, 138, 0.26), transparent 62%),
    radial-gradient(circle at 50% 50%, rgba(253, 230, 138, 0.14), transparent 70%);
}

.render {
  width: auto;
  height: 330px;
  max-width: 100%;
  object-fit: contain;
  animation: bob 6s ease-in-out infinite;
  will-change: transform;
}

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

.twinkle {
  position: absolute;
  width: 18px;
  height: 18px;
  animation: twinkle 3.2s ease-in-out infinite;
}

.twinkle::before,
.twinkle::after {
  content: "";
  position: absolute;
  background: var(--star);
}

.twinkle::before { left: 6px; top: 0; width: 6px; height: 18px; }
.twinkle::after { left: 0; top: 6px; width: 18px; height: 6px; }

.t1 { top: 28%; right: 12%; }
.t2 { bottom: 16%; left: 8%; transform: scale(0.6); animation-delay: 1.1s; }
.t3 { top: 34%; left: 2%; transform: scale(0.4); animation-delay: 2s; }

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, filter 0.15s, background-color 0.15s, border-color 0.15s;
}

.btn:hover { transform: translateY(-1px); }

button.btn { cursor: pointer; }

.btn-primary { background: var(--star); color: var(--star-ink); }
.btn-primary:hover { filter: brightness(1.08); }

.btn-accent { background: var(--accent); color: #120d18; }
.btn-accent:hover { filter: brightness(1.1); }

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover { background: var(--surface-2); border-color: var(--faint); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  text-shadow: var(--mc-shadow);
}

.projects { padding-block: 24px 64px; }

.project-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s;
}

.project:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 24px 60px -30px var(--accent-soft);
}

.project:nth-child(even) .project-art { order: 2; }

.project-art {
  position: relative;
  display: block;
  min-height: 100%;
  overflow: hidden;
  background: var(--surface-2);
}

.project-art img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project:hover .project-art img { transform: scale(1.04); }

.project-art::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 30px;
  min-width: 0;
}

.project-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.project-title > div { min-width: 0; flex: 1 1 180px; }

.project-logo {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: contain;
}

.project-logo.round { border-radius: 50%; }

.project h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  text-shadow: var(--mc-shadow);
}

.tagline {
  margin-top: 2px;
  color: var(--accent);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.3;
}

.desc { color: var(--muted); max-width: 36em; font-size: 15px; line-height: 1.6; }

.status {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 6px 10px 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-small-caps);
  font-size: 20px;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
}

.status i {
  display: block;
  width: 3px;
  background: var(--line-strong);
}

.status i:nth-child(1) { height: 4px; }
.status i:nth-child(2) { height: 6px; }
.status i:nth-child(3) { height: 8px; }
.status i:nth-child(4) { height: 10px; margin-right: 7px; }

.status-stack {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.status-count {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(11, 10, 18, 0.7);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.project-art .status {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(11, 10, 18, 0.85);
  color: var(--text);
}

.status-live i { background: var(--live); }
.status-dev i:nth-child(-n+2) { background: var(--dev); }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-family: var(--font-small-caps);
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}

.facts dd {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
}

.facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts .fact-wide { grid-column: 1 / -1; }

.project-body .actions { margin-top: auto; }

.about { padding-block: 40px 88px; }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.about-text {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.6;
  max-width: 38em;
}

.contact {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact h3 {
  font-family: var(--font-small-caps);
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  margin-bottom: 12px;
}

.contact-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-inline: -12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 400;
  transition: background-color 0.15s;
}

.contact-links a:hover { background: var(--surface-2); }

.contact-links a::after {
  content: "";
  width: 42px;
  height: 12px;
  margin-left: auto;
  background: url("assets/arrow-right.png") center / contain no-repeat;
  opacity: 0.55;
  transition: transform 0.15s, opacity 0.15s;
}

.contact-links a:hover::after { transform: translateX(3px); opacity: 1; }

.contact-icon {
  width: 24px;
  height: 24px;
  flex: none;
}

.footer {
  border-top: 1px solid var(--line);
  padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px));
  color: var(--faint);
  font-size: 20px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.ip-popup {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 60px -20px var(--accent-soft);
}

.ip-popup::backdrop {
  background: rgba(5, 4, 10, 0.74);
}

.ip-popup[open] { animation: popup-in 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.ip-popup[open]::backdrop { animation: backdrop-in 0.24s ease-out; }
.ip-popup.closing { animation: popup-out 0.16s ease-in forwards; }
.ip-popup.closing::backdrop { animation: backdrop-out 0.16s ease-in forwards; }

@keyframes popup-in { from { opacity: 0; transform: translateY(10px) scale(0.95); } }
@keyframes popup-out { to { opacity: 0; transform: translateY(6px) scale(0.97); } }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }

.ip-popup-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 36px 28px 30px;
  text-align: center;
}

.ip-popup h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  text-shadow: var(--mc-shadow);
}

.ip-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 400 26px/1 var(--font-body);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.ip-close:hover { background: var(--surface-2); color: var(--text); }

.ip-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.ip-option {
  min-height: 64px;
  padding: 14px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.2;
  text-shadow: var(--mc-shadow);
  cursor: pointer;
  transition: transform 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s;
}

.ip-option:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ip-options-one { grid-template-columns: minmax(0, 1fr); }

a.ip-option {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.ip-option-soon { opacity: 0.6; }
.ip-option-soon:hover, .ip-option-soon.copied { opacity: 1; }

.ip-option.copied {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  text-shadow: 0.1em 0.1em 0 var(--accent-shadow);
}

.ip-addresses {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.4;
  color: var(--accent);
  text-shadow: 0.1em 0.1em 0 var(--accent-shadow);
  text-wrap: balance;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-block: 56px 40px;
  }

  .hero h1 { font-size: 50px; }

  .hero-art { order: -1; min-height: 0; gap: 36px; }
  .platform { width: 200px; }
  .render { height: 220px; }

  .project { grid-template-columns: minmax(0, 1fr); }
  .project:nth-child(even) .project-art { order: 0; }
  .project-art img { min-height: 0; aspect-ratio: 16 / 9; height: auto; }

  .about-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  :root { --gutter: 16px; }

  .nav { gap: 0; }
  .nav a { padding: 8px 6px; }
  .home-label { display: none; }
  .hero h1 { font-size: 40px; }
  .project h3 { font-size: 20px; }

  .project-body { padding: 22px 20px 24px; }

  .facts { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .facts div { display: flex; justify-content: space-between; gap: 16px; }
  .facts dt { flex: none; white-space: nowrap; }
  .facts dd { margin: 0; text-align: right; }

  .project-body .actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ip-popup[open], .ip-popup[open]::backdrop { animation: none; }
  .render, .twinkle, .sky-twinkles i, .live-total, .live-total.pulse, .live-dot::after, .live-number.bump { animation: none; }
  .project-art img, .btn { transition: none; }
}
