/*
  Global design system for Owen Dixon's portfolio.
  This file defines shared typography, surfaces, navigation, buttons, and motion.
*/
:root {
  --bg-main: #070912;
  --bg-elevated: #0f1428;
  --bg-soft: #141a37;
  --ink: #edf1ff;
  --ink-muted: #a9b3d8;
  --line: rgba(139, 161, 255, 0.24);
  --line-strong: rgba(139, 161, 255, 0.42);
  --neon-blue: #4ea0ff;
  --neon-purple: #966bff;
  --neon-cyan: #49e4ff;
  --success: #4ade80;
  --danger: #fb7185;
  --radius: 18px;
  --radius-soft: 14px;
  --shadow-lg: 0 28px 70px rgba(3, 6, 20, 0.52);
  --shadow-soft: 0 14px 34px rgba(2, 6, 17, 0.42);
  --header-h: 76px;
  --fs-body: clamp(0.99rem, 0.2vw + 0.94rem, 1.07rem);
  --fs-small: clamp(0.82rem, 0.15vw + 0.78rem, 0.9rem);
  --fs-h1: clamp(2.2rem, 4.7vw, 4.35rem);
  --fs-h2: clamp(1.45rem, 2.75vw, 2.24rem);
  --fs-h3: clamp(1.08rem, 2.05vw, 1.36rem);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overscroll-behavior-y: none;
  overscroll-behavior-x: none;
}

body {
  font-family: "Sora", "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(112, 66, 255, 0.13), transparent 31%),
    radial-gradient(circle at 88% 14%, rgba(62, 178, 255, 0.11), transparent 29%),
    linear-gradient(148deg, #06070f 0%, #0a0d1d 45%, #070913 100%);
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: 1.67;
  overflow-x: hidden;
  overscroll-behavior: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow layers add depth without distracting from content. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(86px);
}

body::before {
  width: 360px;
  height: 360px;
  top: -120px;
  left: -80px;
  background: rgba(134, 90, 255, 0.32);
  animation: driftA 16s ease-in-out infinite;
}

body::after {
  width: 430px;
  height: 430px;
  right: -130px;
  bottom: -150px;
  background: rgba(78, 160, 255, 0.24);
  animation: driftB 19s ease-in-out infinite;
}

@keyframes driftA {
  0%,
  100% { transform: translate(0, 0); }
  50% { transform: translate(34px, 22px); }
}

@keyframes driftB {
  0%,
  100% { transform: translate(0, 0); }
  50% { transform: translate(-38px, -16px); }
}

a {
  color: var(--neon-cyan);
}

/* Header + nav */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1200;
  border-bottom: 1px solid transparent;
  transition: background 0.28s ease, border-color 0.28s ease, backdrop-filter 0.28s ease;
}

.site-header.scrolled {
  background: rgba(7, 9, 19, 0.8);
  backdrop-filter: blur(14px);
  border-color: var(--line);
}

.nav-wrap {
  min-height: var(--header-h);
}

.logo {
  font-size: 1.05rem;
  letter-spacing: 0.11em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  position: relative;
}

.logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: linear-gradient(130deg, var(--neon-blue), var(--neon-purple));
  box-shadow: 0 0 12px rgba(78, 160, 255, 0.8);
  vertical-align: middle;
  transition: transform 0.25s ease;
}

.logo:hover .logo-dot {
  transform: scale(1.28);
}

/* Hidden game trigger blends into branding but remains discoverable. */
.secret-trigger {
  width: 14px;
  height: 14px;
  margin-left: 14px;
  border-radius: 4px;
  border: 1px solid rgba(150, 107, 255, 0.55);
  background: linear-gradient(145deg, rgba(73, 228, 255, 0.2), rgba(150, 107, 255, 0.2));
  box-shadow: 0 0 12px rgba(150, 107, 255, 0.32);
  opacity: 0.42;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.secret-trigger:hover,
.secret-trigger:focus-visible {
  opacity: 1;
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 0 16px rgba(73, 228, 255, 0.42);
}

.nav-toggle {
  color: var(--ink);
  font-size: 1.42rem;
}

.site-nav-list {
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.site-nav-list a {
  position: relative;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 12px;
  transition: color 0.22s ease, background 0.22s ease;
}

.site-nav-list a::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 3px;
  height: 2px;
  border-radius: 8px;
  background: linear-gradient(120deg, var(--neon-blue), var(--neon-purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-nav-list a:hover,
.site-nav-list a:focus-visible,
.site-nav-list a.active {
  color: var(--ink);
  background: rgba(118, 138, 236, 0.12);
}

.site-nav-list a:hover::after,
.site-nav-list a:focus-visible::after,
.site-nav-list a.active::after {
  transform: scaleX(1);
}

main {
  padding-top: calc(var(--header-h) + 26px);
}

.section-shell {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(16, 21, 45, 0.84), rgba(9, 12, 28, 0.92));
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.section-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(78, 160, 255, 0.04), transparent 45%, rgba(150, 107, 255, 0.05));
  pointer-events: none;
}

.kicker {
  display: inline-block;
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--neon-cyan);
  margin-bottom: 0.7rem;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.72rem;
  line-height: 1.15;
  color: #f0f4ff;
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--fs-h3);
  letter-spacing: -0.012em;
}

p {
  margin: 0 0 1.02rem;
  color: var(--ink-muted);
  max-width: 68ch;
}

.lede {
  font-size: clamp(1.06rem, 0.4vw + 0.98rem, 1.16rem);
  line-height: 1.7;
  color: #c1cbeb;
  max-width: 64ch;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  padding: 0.86rem 1.22rem;
  border-radius: 12px;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(125deg, var(--neon-blue), var(--neon-purple));
  box-shadow: 0 0 0 1px rgba(155, 177, 255, 0.25), 0 12px 26px rgba(78, 160, 255, 0.24);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(155, 177, 255, 0.45), 0 16px 34px rgba(78, 160, 255, 0.32);
}

.btn-secondary {
  color: var(--ink);
  border: 1px solid rgba(118, 138, 236, 0.5);
  background: rgba(118, 138, 236, 0.1);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(73, 228, 255, 0.62);
  background: rgba(73, 228, 255, 0.14);
}

.card-soft {
  position: relative;
  height: 100%;
  border: 1px solid rgba(118, 138, 236, 0.22);
  background: linear-gradient(146deg, rgba(17, 24, 49, 0.9), rgba(9, 14, 31, 0.9));
  border-radius: var(--radius-soft);
  padding: 1.45rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.26s cubic-bezier(.2,.8,.2,1), border-color 0.26s ease, box-shadow 0.26s ease;
}

.card-soft:hover {
  transform: translateY(-6px);
  border-color: rgba(73, 228, 255, 0.4);
  box-shadow: 0 22px 42px rgba(2, 7, 18, 0.48);
}

.badge-chip {
  display: inline-block;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.34rem 0.6rem;
  border: 1px solid rgba(120, 139, 240, 0.36);
  color: var(--ink);
  background: rgba(120, 139, 240, 0.12);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.62s ease, transform 0.62s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  margin-top: 3.6rem;
  border-top: 1px solid var(--line);
  background: rgba(8, 10, 21, 0.78);
}

.footer-inner {
  padding: 1.35rem 0;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hidden sprite now pulses lightly to improve discoverability balance. */
.hidden-sprite {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #84f2ff, #4e7fff);
  opacity: 0.15;
  box-shadow: 0 0 0 rgba(78, 127, 255, 0);
  transform: translateY(8px);
  animation: spritePulse 4.2s ease-in-out infinite;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

@keyframes spritePulse {
  0%,
  100% {
    opacity: 0.12;
    box-shadow: 0 0 0 rgba(78, 127, 255, 0);
  }
  50% {
    opacity: 0.28;
    box-shadow: 0 0 10px rgba(78, 127, 255, 0.2);
  }
}

.hidden-sprite:hover {
  opacity: 0.98;
  transform: translateY(0) scale(1.04);
  box-shadow: 0 0 14px rgba(78, 127, 255, 0.84);
}

::selection {
  background: rgba(110, 126, 255, 0.42);
  color: #f8f9ff;
}

/* Unlock overlay used for hidden game transition feedback. */
.unlock-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 20%, rgba(78, 160, 255, 0.18), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(150, 107, 255, 0.2), transparent 45%),
    rgba(6, 7, 14, 0.9);
  backdrop-filter: blur(4px);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.unlock-overlay.show {
  opacity: 1;
}

.unlock-panel {
  border: 1px solid rgba(122, 146, 255, 0.46);
  background: linear-gradient(150deg, rgba(17, 22, 46, 0.95), rgba(8, 12, 26, 0.95));
  box-shadow: 0 0 32px rgba(78, 160, 255, 0.2);
  color: #e8eeff;
  border-radius: 14px;
  padding: 1rem 1.2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

@media (max-width: 991px) {
  .site-nav-list {
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem;
    background: rgba(10, 13, 27, 0.97);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-top: 0.4rem;
  }
}

@media (max-width: 767px) {
  .section-shell {
    padding: 1.35rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    margin-bottom: 0.55rem;
  }

  .footer-inner {
    gap: 0.7rem;
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    line-height: 1.1;
  }

  p {
    max-width: 100%;
  }
}
