@font-face {
  font-family: "Lora";
  src: url("/assets/fonts/Lora-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("/assets/fonts/Lora-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "DK Rat Infested Mailbox";
  src: url("/assets/fonts/DK Rat Infested Mailbox.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #123127;
  --ink: #e7d6b5;
  --muted: #a8b592;
  --accent: #2e8b78;
  --ornament: #d4a64a;
  --deep: #071713;
  --panel: color-mix(in srgb, var(--paper), var(--deep) 32%);
  --panel-glass: color-mix(in srgb, var(--paper), transparent 34%);
  --line: color-mix(in srgb, var(--muted), transparent 48%);
  --shadow: rgba(0, 0, 0, 0.34);
  --font-title: Georgia, "Times New Roman", serif;
  --font-brand: "DK Rat Infested Mailbox", Georgia, serif;
  --font-ui: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
  background: var(--deep);
}

body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 16% 8%, color-mix(in srgb, var(--accent), transparent 62%), transparent 28rem),
    radial-gradient(circle at 84% 28%, color-mix(in srgb, var(--ornament), transparent 80%), transparent 24rem),
    linear-gradient(140deg, var(--deep), var(--paper) 48%, color-mix(in srgb, var(--paper), #000 24%));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 72%);
}

a {
  color: inherit;
}

/* ── Rail ─────────────────────────────────── */

.top-rail,
.foot-rail {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 28px));
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--panel), transparent 14%),
    color-mix(in srgb, var(--paper), transparent 42%)
  );
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 color-mix(in srgb, var(--ink), transparent 88%);
  backdrop-filter: blur(16px) saturate(1.18);
}

.top-rail {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 14px 10px 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ornament), transparent 34%), 0 8px 20px var(--shadow);
}

.brand strong {
  font-family: var(--font-title);
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  letter-spacing: 0.04em;
}

.foot-rail p,
.artifact-label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ── Main shell ───────────────────────────── */

.splash-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0;
  display: grid;
  align-items: center;
}

/* ── Hero ─────────────────────────────────── */

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  min-height: min(680px, calc(100vh - 130px));
  border-radius: clamp(24px, 4vw, 42px);
  padding: clamp(24px, 5vw, 64px);
  background:
    radial-gradient(circle at 68% 22%, color-mix(in srgb, var(--accent), transparent 88%), transparent 30rem);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 54ch;
}

h1 {
  position: relative;
  margin: 0 0 26px;
  font-family: var(--font-brand);
  font-size: clamp(4rem, 13vw, 9.4rem);
  line-height: 0.82;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-shadow:
    0 0 28px color-mix(in srgb, var(--accent), transparent 28%),
    0 0 60px color-mix(in srgb, var(--accent), transparent 52%),
    0 0 100px color-mix(in srgb, var(--ornament), transparent 68%),
    0 2px 0 color-mix(in srgb, var(--deep), transparent 28%);
}

.h1-i {
  color: var(--ornament);
}

h1::before,
h1::after {
  content: "SillyGosling";
  position: absolute;
  inset: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  pointer-events: none;
}

h1::before {
  color: #2E8B78;
  text-shadow: none;
  animation: glitch-a 4.8s steps(1) infinite;
}

h1::after {
  color: #D4A64A;
  text-shadow: none;
  animation: glitch-b 4.8s steps(1) infinite;
  animation-delay: -1.8s;
}

@keyframes glitch-a {
  0%, 86%, 100% { clip-path: inset(0 0 100% 0); transform: translateX(0); }
  88%            { clip-path: inset(14% 0 68% 0); transform: translateX(-5px); }
  90%            { clip-path: inset(52% 0 30% 0); transform: translateX(4px); }
  92%            { clip-path: inset(76% 0 10% 0); transform: translateX(-3px); }
  94%            { clip-path: inset(32% 0 54% 0); transform: translateX(5px); }
  96%            { clip-path: inset(0 0 100% 0); transform: translateX(0); }
}

@keyframes glitch-b {
  0%, 80%, 100% { clip-path: inset(0 0 100% 0); transform: translateX(0); }
  82%            { clip-path: inset(6% 0 82% 0);  transform: translateX(6px); }
  84%            { clip-path: inset(62% 0 22% 0); transform: translateX(-4px); }
  86%            { clip-path: inset(38% 0 46% 0); transform: translateX(3px); }
  88%            { clip-path: inset(0 0 100% 0);  transform: translateX(0); }
}

.lede {
  width: min(100%, 46ch);
  margin: 0;
  color: var(--ink);
  font-family: "Lora", Georgia, serif;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  line-height: 1.6;
  min-height: 1.6em;
}

.lede--sub {
  margin-top: 1rem;
  padding-left: 1.4em;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-style: italic;
  color: #A8B592;
}

.lede::after {
  content: '|';
  margin-left: 1px;
  color: var(--accent);
  animation: blink-cursor 0.65s step-end infinite;
}

.lede.typed::after {
  animation: blink-cursor 0.65s step-end infinite;
}

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

/* ── Artifact stage ───────────────────────── */

.artifact-stage {
  position: relative;
  z-index: 2;
  min-height: clamp(440px, 58vw, 620px);
  isolation: isolate;
}

.artifact-stage::before {
  content: "";
  position: absolute;
  inset: 12% 2% 4% 10%;
  z-index: -1;
  border-radius: 42% 58% 48% 52%;
  background:
    radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--accent), transparent 62%), transparent 50%),
    radial-gradient(circle at 38% 58%, color-mix(in srgb, var(--ornament), transparent 76%), transparent 58%);
  filter: blur(24px);
  animation: glow-pulse 8s ease-in-out infinite;
}

.artifact-card {
  position: absolute;
  margin: 0;
  border-radius: 30px;
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--paper), transparent 18%),
    color-mix(in srgb, var(--deep), transparent 28%)
  );
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.38),
    0 4px 12px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.artifact-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.04);
}

.artifact-card--goose {
  right: 10%;
  top: 8%;
  width: clamp(220px, 28vw, 360px);
  aspect-ratio: 2 / 3;
  animation: float-goose 4.5s ease-in-out infinite;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 78%, transparent 100%);
}

.artifact-card--rail-left,
.artifact-card--rail-right {
  width: clamp(130px, 18vw, 220px);
  aspect-ratio: 2 / 3;
  opacity: 0.74;
}

.artifact-card--rail-left {
  left: 1%;
  top: 18%;
  animation: drift-left 6s ease-in-out infinite;
  animation-delay: -1.8s;
}

.artifact-card--rail-right {
  right: 0;
  bottom: 4%;
  animation: drift-right 7.5s ease-in-out infinite;
  animation-delay: -3.2s;
}

/* ── Animations ───────────────────────────── */

@keyframes float-goose {
  0%, 100% { transform: rotate(2deg) translateY(0px); }
  50%       { transform: rotate(2deg) translateY(-9px); }
}

@keyframes drift-left {
  0%, 100% { transform: rotate(-9deg) translate(0px, 0px); }
  50%       { transform: rotate(-9deg) translate(-5px, -4px); }
}

@keyframes drift-right {
  0%, 100% { transform: rotate(9deg) translate(0px, 0px); }
  50%       { transform: rotate(9deg) translate(6px, -5px); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 1;    filter: blur(24px); }
  50%       { opacity: 0.68; filter: blur(34px); }
}

/* ── Orb rail ─────────────────────────────── */

.orb-rail {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0.4rem;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 20px;
  padding: 24px 0 8px;
}

.orb-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--muted);
  opacity: 0;
  transform: translateY(12px);
  animation: orb-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: color 200ms ease;
}

.orb-link:nth-child(1) { animation-delay: 0.1s; }
.orb-link:nth-child(2) { animation-delay: 0.22s; }
.orb-link:nth-child(3) { animation-delay: 0.34s; }
.orb-link:nth-child(4) { animation-delay: 0.46s; }
.orb-link:nth-child(5) { animation-delay: 0.58s; }

.orb-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--deep), var(--paper) 22%);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 color-mix(in srgb, var(--ink), transparent 86%);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms ease,
    background 220ms ease;
}

.orb-icon svg {
  width: 26px;
  height: 26px;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  opacity: 0.7;
}

.orb-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 220ms ease;
}

/* Hover — lift + brand glow */

.orb-link:hover { color: var(--ink); }
.orb-link:hover .orb-icon svg { opacity: 1; transform: scale(1.08); }

.orb-link--github:hover .orb-icon {
  transform: translateY(-5px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(200, 220, 240, 0.18),
    inset 0 1px 0 color-mix(in srgb, var(--ink), transparent 78%);
}

.orb-link--steam:hover .orb-icon {
  transform: translateY(-5px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(27, 154, 247, 0.28),
    inset 0 1px 0 color-mix(in srgb, var(--ink), transparent 78%);
}

.orb-link--reddit:hover .orb-icon {
  transform: translateY(-5px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(255, 69, 0, 0.28),
    inset 0 1px 0 color-mix(in srgb, var(--ink), transparent 78%);
}

.orb-link--users:hover .orb-icon {
  transform: translateY(-5px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 28px color-mix(in srgb, var(--accent), transparent 52%),
    inset 0 1px 0 color-mix(in srgb, var(--ink), transparent 78%);
}

.orb-link--email:hover .orb-icon {
  transform: translateY(-5px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 28px color-mix(in srgb, var(--ornament), transparent 58%),
    inset 0 1px 0 color-mix(in srgb, var(--ink), transparent 78%);
}

@keyframes orb-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Footer ───────────────────────────────── */

.foot-rail {
  margin-top: 0;
  margin-bottom: 14px;
  padding: 11px 16px;
  text-align: center;
}

.foot-rail p {
  margin: 0;
}

/* ── Reduced motion ───────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .orb-link {
    opacity: 1;
    transform: none;
  }
}

/* ── Breakpoints ──────────────────────────── */

@media (max-width: 860px) {
  .top-rail {
    border-radius: 24px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 28px 20px 24px;
  }

  h1 {
    font-size: clamp(3.4rem, 21vw, 6.4rem);
  }

  .artifact-stage {
    min-height: 430px;
  }

  .artifact-card--goose {
    right: 14%;
    top: 4%;
  }

  .artifact-card--rail-left {
    left: 0;
    top: 24%;
  }

  .artifact-card--rail-right {
    right: 2%;
    bottom: 2%;
  }
}

@media (max-width: 520px) {
  .top-rail,
  .foot-rail,
  .splash-shell {
    width: min(100% - 18px, 1180px);
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .artifact-stage {
    min-height: 360px;
  }

  .artifact-card--goose {
    width: min(58vw, 270px);
    right: 4%;
  }

  .artifact-card--rail-left,
  .artifact-card--rail-right {
    width: min(36vw, 150px);
  }
}
