/* =========================================================
   Mad Giant Studios — dark, minimal, premium
   ========================================================= */

:root {
  --bg:        #0a0a0b;
  --bg-2:      #111114;
  --surface:   #16161a;
  --surface-2: #1d1d22;
  --line:      #26262d;
  --text:      #f1efe9;
  --muted:     #8b8a85;
  --dim:       #5a5a5f;
  --accent:    #c9a96e;   /* warm gold */
  --accent-2:  #e6c98b;
  --danger:    #c0463a;

  --font-display: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --max:    1240px;
  --pad-x:  clamp(20px, 4vw, 56px);
  --radius: 14px;
  --ease:   cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: #111; }

/* Subtle film grain across the whole page */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 1;
  opacity: .5;
  mix-blend-mode: overlay;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 18px var(--pad-x);
  transition: background-color .35s var(--ease), backdrop-filter .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--line);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 80px; height: 80px;
  transition: transform .4s var(--ease);
}
.brand-mark:hover .brand-logo { transform: rotate(-6deg) scale(1.05); }

.nav {
  justify-self: center;
  display: flex;
  gap: clamp(18px, 3vw, 36px);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav a {
  color: var(--muted);
  position: relative;
  padding: 6px 0;
  transition: color .25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }

.brand-name {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
}
.brand-name span:first-child {
  font-size: 18px;
  color: var(--text);
}
.brand-name__sub {
  font-size: 11px;
  letter-spacing: .35em;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
}

/* Mobile nav toggle (hidden by default) */
.nav-toggle {
  display: none;
  width: 36px; height: 30px;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 4px;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--text);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px var(--pad-x) 120px;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: -10%;
  background:
    radial-gradient(60% 50% at 20% 30%, rgba(201,169,110,0.18) 0%, transparent 60%),
    radial-gradient(70% 60% at 80% 70%, rgba(180, 70, 60, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, #0a0a0b 0%, #0e0e10 100%);
  z-index: -2;
  filter: blur(20px);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.05); }
  100% { transform: translate3d(2%, 1%, 0)  scale(1.10); }
}
.hero__grain {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 60%, var(--bg) 100%);
  z-index: -1;
  pointer-events: none;
}

.hero__inner {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .35em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 28px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 6.6vw, 88px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 18ch;
  color: var(--text);
}
.hero__title .accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  transition: transform .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
  will-change: transform;
}
.btn--primary {
  background: var(--text);
  color: #0a0a0b;
  border-color: var(--text);
}
.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.btn--ghost {
  color: var(--text);
  background: transparent;
}
.btn--ghost:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

/* Scroll cue */
.hero__scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.hero__scroll span {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .3; transform: scaleY(.7); }
  50%      { opacity: 1;  transform: scaleY(1);  }
}

/* ---------- Generic Section ---------- */
.section {
  padding: clamp(80px, 12vw, 160px) var(--pad-x);
  position: relative;
}
.section__inner {
  max-width: var(--max);
  margin: 0 auto;
}
.section__head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: clamp(40px, 6vw, 72px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section__index {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .35em;
  color: var(--accent);
}
.section__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.about__lede {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.3;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.005em;
}
.about__lede em {
  color: var(--accent);
  font-style: italic;
}
.about__body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 52ch;
}
.about__body strong { color: var(--text); font-weight: 500; }

.stats {
  margin-top: clamp(56px, 8vw, 96px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--bg-2);
  padding: 36px 28px;
  text-align: left;
}
.stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat__label {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Games ---------- */
.games {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
}

.game {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 56px);
  position: relative;
  overflow: hidden;
}
.game::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .6;
}

.game__hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 48px) clamp(16px, 3vw, 32px);
  margin-bottom: 32px;
  border-radius: 14px;
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(201,169,110, 0.10) 0%, transparent 70%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--line);
  overflow: hidden;
}
.game__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 60% at 50% 50%, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.game__logo {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
  transition: transform .5s var(--ease);
}
.game__hero:hover .game__logo {
  transform: scale(1.03);
}
.game__tag {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  background: rgba(10, 10, 11, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(201,169,110, 0.4);
  background: rgba(201,169,110, 0.06);
}

.game__desc {
  color: var(--muted);
  max-width: 70ch;
  margin: 0 auto 36px;
  font-size: 16px;
  line-height: 1.75;
  text-align: center;
}

/* Lazy YouTube embed */
.video-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}
.video-frame__embed {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  cursor: pointer;
  background: #000;
}
.video-frame__embed img,
.video-frame__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-frame__embed img {
  object-fit: cover;
  transition: transform .8s var(--ease), opacity .4s var(--ease);
}
.video-frame__embed:hover img { transform: scale(1.03); opacity: .85; }

.video-frame__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 84px; height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .92);
  color: #0a0a0b;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.video-frame__embed:hover .video-frame__play {
  transform: translate(-50%, -50%) scale(1.08);
  background: var(--accent);
}
.video-frame__play svg { margin-left: 4px; }

/* ---------- Team ---------- */
.team__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 36px);
}
.member {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 24px 32px;
  transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.member:hover {
  transform: translateY(-4px);
  border-color: rgba(201,169,110, 0.5);
}
.member__photo {
  width: 168px; height: 168px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  position: relative;
}
.member__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.member:hover .member__photo img { transform: scale(1.05); }

.member__name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.member__nickname {
  margin-top: 6px;
  font-style: italic;
  color: var(--accent);
  font-size: 15px;
}
.member__role {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--muted);
}

.member__linkedin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .25em;
  text-transform: uppercase;
  transition: color .25s var(--ease), border-color .25s var(--ease),
              background .25s var(--ease), transform .25s var(--ease);
}
.member__linkedin svg { transition: transform .25s var(--ease); }
.member__linkedin:hover,
.member__linkedin:focus-visible {
  color: var(--accent);
  border-color: rgba(201, 169, 110, 0.5);
  background: rgba(201, 169, 110, 0.08);
  transform: translateY(-1px);
}
.member__linkedin:hover svg { transform: scale(1.08); }
.member__linkedin:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.18);
}

/* ---------- Contact ---------- */
.contact {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}

.contact__lede {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.3;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
  margin-bottom: 20px;
}

.contact__body {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 28px;
  max-width: 42ch;
}

.contact__email {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  color: var(--accent);
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(201, 169, 110, 0.4);
  padding-bottom: 4px;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.contact__email:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  position: relative;
  overflow: hidden;
}
.contact__form::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .5;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--dim);
}
.field input:hover,
.field textarea:hover {
  border-color: var(--muted);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.10);
}
.field textarea {
  resize: vertical;
  min-height: 130px;
  font-family: var(--font-body);
}

.contact__submit {
  align-self: flex-start;
  margin-top: 8px;
}

.contact__note {
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 0;
}
.contact__note.is-success {
  background: rgba(201, 169, 110, 0.08);
  border: 1px solid rgba(201, 169, 110, 0.4);
  color: var(--accent-2);
}
.contact__note.is-error {
  background: rgba(192, 70, 58, 0.08);
  border: 1px solid rgba(192, 70, 58, 0.4);
  color: #e88a7a;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px var(--pad-x) 48px;
  background: var(--bg-2);
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.site-footer__logo { width: 88px; height: 88px; opacity: .9; }
.site-footer__tag { color: var(--text); font-size: 15px; }
.site-footer__copy { color: var(--dim); font-size: 13px; letter-spacing: .08em; }

/* Footer social icons */
.socials {
  list-style: none;
  display: flex;
  gap: 14px;
  margin: 4px 0 4px;
  padding: 0;
}
.social {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: color .25s var(--ease), border-color .25s var(--ease),
              background .25s var(--ease), transform .25s var(--ease);
}
.social:hover,
.social:focus-visible {
  color: var(--accent);
  border-color: rgba(201, 169, 110, 0.5);
  background: rgba(201, 169, 110, 0.06);
  transform: translateY(-2px);
}
.social:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.18);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .site-header { grid-template-columns: auto 1fr; }
  .brand-name { display: none; }

  /* Keep logo + hamburger above the dropdown panel */
  .brand-mark,
  .nav-toggle {
    position: relative;
    z-index: 2;
  }

  .nav-toggle { display: flex; justify-self: end; grid-column: 2; }
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;

    background: rgba(10, 10, 11, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 92px 0 18px;

    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);

    transform: translateY(-100%);
    transition: transform .45s var(--ease);
    z-index: -1;
  }
  .nav.is-open { transform: translateY(0); z-index: 1; }

  .nav a {
    width: 100%;
    text-align: center;
    padding: 14px var(--pad-x);
  }
  .nav a::after { display: none; }
  .nav a:hover,
  .nav a:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.03); }

  .about__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 28px 24px; }

  .team__grid { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; }

  .contact__grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

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