/* ============================================================
   Desync Studios — style.css
   Minimal, dark, dashed line-art aesthetic drawn from the logo.
   ============================================================ */

:root {
  --bg: #0b0b0e;
  --bg-soft: #101014;
  --ink: #f2f2ef;
  --dim: #8a8a92;
  --line: rgba(242, 242, 239, 0.28);
  --line-strong: rgba(242, 242, 239, 0.6);
  --accent-a: #4de3c1; /* glitch cyan-green */
  --accent-b: #e34d7a; /* glitch magenta-red */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-a);
  color: var(--bg);
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(to bottom, rgba(11, 11, 14, 0.92), rgba(11, 11, 14, 0));
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.nav-brand-dim {
  color: var(--dim);
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--dim);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px dashed transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  position: relative;
}

.hero-logo {
  position: relative;
  width: min(320px, 58vw);
  margin-bottom: 1.5rem;
}

.logo {
  width: 100%;
  height: auto;
  display: block;
}

/* glitch layers: accent-tinted canvas copies of the logo (built by script.js) */
.logo-ghost {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  pointer-events: none;
}

.hero-logo.glitching .logo-ghost-a {
  opacity: 0.9;
  animation: glitch-shift-a 0.5s steps(1, end) both;
}

.hero-logo.glitching .logo-ghost-b {
  opacity: 0.9;
  animation: glitch-shift-b 0.5s steps(1, end) both;
}

.hero-logo.glitching .logo {
  animation: logo-jolt 0.5s steps(1, end) both;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1.1;
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.6vw, 1.25rem);
  font-weight: 400;
  letter-spacing: 0.85em;
  margin-right: -0.85em;
  color: var(--dim);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.hero-tagline {
  margin-top: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--dim);
}

.hero-scroll {
  position: absolute;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
}

.hero-scroll-line {
  display: block;
  width: 1px;
  height: 56px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line-strong) 0 5px,
    transparent 5px 10px
  );
  animation: scroll-pulse 2.4s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---------- glitch effect ---------- */
@keyframes glitch-shift-a {
  0%   { transform: translate(-14px, -5px); clip-path: inset(5% 0 60% 0); }
  25%  { transform: translate(10px, 3px);   clip-path: inset(45% 0 28% 0); }
  50%  { transform: translate(-8px, 4px);   clip-path: inset(70% 0 5% 0); }
  75%  { transform: translate(12px, -3px);  clip-path: inset(20% 0 58% 0); }
  100% { transform: translate(0, 0);        clip-path: inset(0 0 100% 0); }
}

@keyframes glitch-shift-b {
  0%   { transform: translate(13px, 5px);   clip-path: inset(55% 0 8% 0); }
  25%  { transform: translate(-11px, -3px); clip-path: inset(10% 0 65% 0); }
  50%  { transform: translate(9px, -4px);   clip-path: inset(30% 0 40% 0); }
  75%  { transform: translate(-12px, 2px);  clip-path: inset(62% 0 12% 0); }
  100% { transform: translate(0, 0);        clip-path: inset(0 0 100% 0); }
}

@keyframes logo-jolt {
  0%   { transform: translate(5px, 0); }
  30%  { transform: translate(-4px, 2px); }
  60%  { transform: translate(3px, -2px); }
  100% { transform: translate(0, 0); }
}

/* ---------- sections ---------- */
.section {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) 1.5rem;
  border-top: 1px dashed var(--line);
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 2.25rem;
}

.section-num {
  color: var(--dim);
  margin-right: 0.75em;
}

.section-num::after {
  content: " /";
}

.lead {
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 300;
  max-width: 34em;
  margin-bottom: 1.25rem;
}

.dim {
  color: var(--dim);
}

/* ---------- games ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.game-card {
  position: relative;
  border: 1px dashed var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.game-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.game-card-art {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(77, 227, 193, 0.06), transparent 70%),
    var(--bg-soft);
  border-bottom: 1px dashed var(--line);
}

.game-card-glyph {
  font-family: var(--font-mono);
  font-size: 3rem;
  color: var(--dim);
  opacity: 0.6;
}

.game-card-info {
  padding: 1.25rem 1.4rem 1.5rem;
}

.game-card-info h3 {
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.game-card-info p {
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent-a);
  border: 1px dashed rgba(77, 227, 193, 0.45);
  border-radius: 999px;
  padding: 0.25em 0.9em;
}

/* title link stretched over the whole card */
.game-card-link {
  color: inherit;
  text-decoration: none;
}

.game-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.game-card:hover .game-card-link {
  color: var(--accent-a);
}

.game-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* sits above the stretched link so it stays independently clickable */
.steam-link {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px dashed transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.steam-link:hover {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

.game-card-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-style: dashed;
  opacity: 0.7;
}

.blink {
  animation: blink 1.1s steps(1, end) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- contact ---------- */
.contact-link {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--line-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-link:hover {
  color: var(--accent-a);
  border-bottom-color: var(--accent-a);
}

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 0.7em 1.5em;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.discord-btn:hover {
  color: var(--accent-a);
  border-color: var(--accent-a);
  transform: translateY(-2px);
}

.discord-icon {
  width: 1.3em;
  height: auto;
  flex-shrink: 0;
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.footer .ok {
  color: var(--accent-a);
}

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-scroll-line,
  .blink {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}
