/* ==========================================================================
   RPG4YOU — Game Developer Portfolio
   Design system + components. Dark RPG/fantasy theme.
   No external dependencies (system font stack, inline SVG assets).
   ========================================================================== */

/* ----- Design tokens ---------------------------------------------------- */
:root {
  /* Palette */
  --bg:            #0b0817;
  --bg-2:          #0f0b22;
  --surface:       #161130;
  --surface-2:     #1d1640;
  --border:        #2a2153;
  --border-soft:   rgba(124, 92, 255, 0.18);

  --text:          #f3f0ff;
  --muted:         #b0a8d4;
  --muted-2:       #7d76a8;

  --accent-purple: #7c5cff;
  --accent-purple-2:#9a7bff;
  --accent-gold:   #f4c14e;
  --accent-gold-2: #ffe7a3;
  --accent-teal:   #2dd4bf;

  --danger:        #ff6b6b;

  /* Effects */
  --glow-purple: 0 0 0 1px var(--border-soft), 0 18px 50px -22px rgba(124, 92, 255, 0.55);
  --glow-gold:   0 0 28px -6px rgba(244, 193, 78, 0.55);
  --shadow-card: 0 12px 36px -18px rgba(0, 0, 0, 0.85);
  --ring:        0 0 0 3px rgba(124, 92, 255, 0.45);

  /* Layout */
  --maxw: 1140px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --nav-h: 68px;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Type */
  --font-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-display: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 12% -8%, rgba(124, 92, 255, 0.20), transparent 60%),
    radial-gradient(900px 560px at 100% 0%, rgba(45, 212, 191, 0.12), transparent 55%),
    radial-gradient(800px 700px at 80% 110%, rgba(244, 193, 78, 0.08), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
  letter-spacing: 0.2px;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p  { margin: 0 0 var(--space-4); }

a { color: var(--accent-teal); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-gold); }

ul { margin: 0; padding: 0; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

/* ----- Utilities -------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-24); }
.section--tight { padding-block: var(--space-16); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent-gold);
  color: #1a1206;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-weight: 700;
  z-index: 200;
}
.skip-link:focus { left: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-gold);
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: linear-gradient(90deg, var(--accent-gold), transparent);
}

.section__head { max-width: 720px; margin-bottom: var(--space-12); }
.section__head p { color: var(--muted); font-size: 1.05rem; margin-bottom: 0; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .eyebrow::before { display: none; }

.text-gold { color: var(--accent-gold); }
.text-teal { color: var(--accent-teal); }
.text-purple { color: var(--accent-purple-2); }
.muted { color: var(--muted); }

.icon {
  width: 1.15em; height: 1.15em;
  display: inline-block;
  vertical-align: -0.18em;
  fill: currentColor;
}

/* ----- Buttons ---------------------------------------------------------- */
.btn {
  --btn-bg: var(--accent-purple);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: .3px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent-purple-2), var(--accent-purple));
  color: #fff;
  box-shadow: 0 12px 30px -12px rgba(124, 92, 255, 0.8);
}
.btn--primary:hover { color: #fff; box-shadow: 0 16px 36px -12px rgba(124, 92, 255, 0.95); }

.btn--gold {
  background: linear-gradient(135deg, var(--accent-gold-2), var(--accent-gold));
  color: #221603;
  box-shadow: var(--glow-gold);
}
.btn--gold:hover { color: #221603; }

.btn--ghost {
  background: rgba(124, 92, 255, 0.07);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { color: var(--text); border-color: var(--accent-purple); background: rgba(124, 92, 255, 0.16); }

.btn--sm { padding: 8px 16px; font-size: 0.86rem; }

/* ----- Header / nav ----------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(11, 8, 23, 0.72);
  border-bottom: 1px solid var(--border-soft);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
}
.nav__brand { display: inline-flex; align-items: center; }
.nav__brand img { height: 34px; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
}
.nav__links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--text);
  background: rgba(124, 92, 255, 0.12);
}
.nav__cta { margin-left: var(--space-2); }

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px; height: 44px;
  border-radius: 11px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav__toggle .icon { width: 24px; height: 24px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded="true"] .icon-open { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 820px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    padding: var(--space-6) var(--gutter) var(--space-8);
    background: rgba(13, 9, 28, 0.98);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .nav__menu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav__links { flex-direction: column; align-items: stretch; }
  .nav__links a { padding: 12px 14px; font-size: 1.05rem; }
  .nav__cta { margin: var(--space-2) 0 0; }
  .nav__cta .btn { width: 100%; justify-content: center; }
}

/* ----- Hero ------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7rem);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-12);
  align-items: center;
}
.hero__title { margin-bottom: var(--space-6); }
.hero__title .accent {
  background: linear-gradient(120deg, var(--accent-gold-2), var(--accent-gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  font-size: 1.18rem;
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: var(--space-8);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-top: var(--space-12);
}
.hero__stat .num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent-teal);
}
.hero__stat .label { font-size: 0.85rem; color: var(--muted-2); letter-spacing: .5px; }

/* Animated d20 emblem */
.hero__art { display: flex; justify-content: center; }
.emblem {
  width: min(360px, 80%);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
}
.emblem::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.35), transparent 68%);
  filter: blur(8px);
  animation: pulse 6s ease-in-out infinite;
}
.emblem svg { width: 78%; position: relative; animation: float 7s ease-in-out infinite; }
.emblem .ring {
  position: absolute;
  inset: 0;
  border: 1px dashed var(--border-soft);
  border-radius: 50%;
  animation: spin 28s linear infinite;
}
.emblem .ring--2 { inset: 12%; border-style: dotted; animation-duration: 40s; animation-direction: reverse; }

@keyframes float { 0%,100% { transform: translateY(-8px); } 50% { transform: translateY(8px); } }
@keyframes pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes spin  { to { transform: rotate(360deg); } }

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .emblem { width: min(260px, 64%); }
}

/* ----- Cards / game grid ------------------------------------------------ */
.grid-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--space-6);
}

.card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-card), var(--glow-purple);
}
.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .card__media img { transform: scale(1.05); }
.card__badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(11, 8, 23, 0.82);
  border: 1px solid var(--border-soft);
  color: var(--accent-gold);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.card__body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); flex: 1; }
.card__title { margin: 0; font-size: 1.18rem; }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.78rem; color: var(--muted-2); }
.card__desc { color: var(--muted); font-size: 0.95rem; margin: 0; flex: 1; }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-2); }

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--accent-purple-2);
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid var(--border-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

/* Filter chips */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--space-8);
}
.chip {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(124, 92, 255, 0.07);
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { color: var(--text); border-color: var(--accent-purple); }
.chip[aria-pressed="true"] {
  color: #221603;
  background: linear-gradient(135deg, var(--accent-gold-2), var(--accent-gold));
  border-color: transparent;
}

/* Loading / empty / error states */
.state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: var(--space-12);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.state--error { color: var(--danger); border-color: rgba(255, 107, 107, 0.4); }
.skeleton { position: relative; overflow: hidden; }
.skeleton .card__media,
.skeleton .sk-line {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.sk-line { height: 12px; border-radius: 6px; margin: 10px var(--space-6); }
.sk-line.sk-title { height: 18px; width: 60%; margin-top: var(--space-6); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ----- About / feature columns ----------------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-8);
}
.feature__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  margin-bottom: var(--space-4);
  background: rgba(124, 92, 255, 0.14);
  color: var(--accent-purple-2);
  border: 1px solid var(--border-soft);
}
.feature__icon .icon { width: 26px; height: 26px; }
.feature h3 { margin-bottom: var(--space-2); }
.feature p { color: var(--muted); margin: 0; font-size: 0.95rem; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.skill-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.skill-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Timeline */
.timeline { list-style: none; position: relative; padding-left: var(--space-8); }
.timeline::before {
  content: "";
  position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--accent-purple), var(--accent-teal));
}
.timeline li { position: relative; margin-bottom: var(--space-8); }
.timeline li::before {
  content: "";
  position: absolute; left: calc(-1 * var(--space-8) + 1px); top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 0 4px rgba(244, 193, 78, 0.18);
}
.timeline .when { font-family: var(--font-display); font-weight: 700; color: var(--accent-teal); font-size: 0.85rem; letter-spacing: .5px; }
.timeline h3 { margin: 4px 0 6px; }
.timeline p { color: var(--muted); margin: 0; }

/* ----- Staff / team ----------------------------------------------------- */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}
.staff-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-8);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.staff-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-card), var(--glow-purple);
}
.staff-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: 1px;
  color: #10081f;
  background: linear-gradient(135deg, var(--accent-gold-2), var(--accent-gold));
  box-shadow: var(--glow-gold);
}
.staff-avatar--purple {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-purple-2), var(--accent-purple));
  box-shadow: 0 0 24px -6px rgba(124, 92, 255, 0.65);
}
.staff-name { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.staff-roles {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.staff-roles li {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--accent-teal);
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.28);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ----- TTRPG / document cards ------------------------------------------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}
.doc-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-8);
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.doc-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-card), var(--glow-purple);
}
.doc-card__head { display: flex; align-items: center; gap: var(--space-3); }
.doc-card__icon {
  flex: none;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(244, 193, 78, 0.14);
  color: var(--accent-gold);
  border: 1px solid rgba(244, 193, 78, 0.3);
}
.doc-card__icon .icon { width: 26px; height: 26px; }
.doc-card__title { margin: 0; font-size: 1.2rem; }
.doc-card__sub { color: var(--muted-2); font-size: 0.82rem; }
.doc-card__desc { color: var(--muted); font-size: 0.95rem; margin: 0; flex: 1; }
.doc-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-2); }
.notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(244, 193, 78, 0.1);
  border: 1px solid rgba(244, 193, 78, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ----- CTA / contact band ----------------------------------------------- */
.cta-band {
  position: relative;
  text-align: center;
  background: linear-gradient(135deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  box-shadow: var(--glow-purple);
}
.cta-band h2 { margin-bottom: var(--space-4); }
.cta-band p { color: var(--muted); max-width: 56ch; margin-inline: auto; margin-bottom: var(--space-8); }
.cta-band .hero__actions { justify-content: center; }

.socials { display: inline-flex; gap: var(--space-3); margin-top: var(--space-8); }
.socials a {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .15s ease;
}
.socials a:hover { color: var(--accent-gold); border-color: var(--accent-purple); transform: translateY(-3px); }
.socials .icon { width: 22px; height: 22px; }

/* ----- Footer ----------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: rgba(8, 6, 18, 0.6);
  padding-block: var(--space-12);
  margin-top: var(--space-16);
}
.footer__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
}
.footer__brand img { height: 30px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: var(--space-6); list-style: none; }
.footer__nav a { color: var(--muted); font-size: 0.92rem; }
.footer__nav a:hover { color: var(--accent-gold); }
.footer__legal { color: var(--muted-2); font-size: 0.85rem; width: 100%; margin-top: var(--space-4); }

/* ----- 404 -------------------------------------------------------------- */
.notfound {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
}
.notfound .code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 22vw, 11rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(120deg, var(--accent-purple-2), var(--accent-teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----- Reveal on scroll ------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ----- Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
