/* ============ Mordel Studio ============ */
:root {
  --ink: #0a0a0a;
  --ink-2: #151413;
  --paper: #f7f1e6;
  --paper-dim: #bdb6a9;
  --red: #e8282b;
  --red-dark: #b81d20;
  --display: 'Londrina Solid', 'Impact', sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --cut: polygon(0 3%, 4% 0, 52% 2%, 97% 0, 100% 5%, 99% 60%, 100% 96%, 95% 100%, 40% 98%, 3% 100%, 0 94%, 1% 40%);
  --cut-2: polygon(2% 0, 60% 3%, 100% 0, 98% 48%, 100% 100%, 42% 97%, 0 100%, 2% 52%);
  --star: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  --star-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cpath d='M13 1 L15.5 10.5 L25 13 L15.5 15.5 L13 25 L10.5 15.5 L1 13 L10.5 10.5 Z' fill='%23e8282b' stroke='%230a0a0a' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 13 13, auto;
  --star-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 26 26'%3E%3Cpath d='M13 1 L15.5 10.5 L25 13 L15.5 15.5 L13 25 L10.5 15.5 L1 13 L10.5 10.5 Z' fill='%23f7f1e6' stroke='%23e8282b' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, pointer;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: var(--star-cursor);
  -webkit-font-smoothing: antialiased;
}
a, button, .game__media, .hero__mark { cursor: var(--star-pointer); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: var(--paper); }

.red { color: var(--red); }

/* film grain over everything */
.grain {
  position: fixed; inset: -50%;
  z-index: 100; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--display); font-weight: 900; font-size: 1.3rem;
  text-transform: uppercase; letter-spacing: .04em;
  padding: .7em 1.6em .6em;
  clip-path: var(--cut-2);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), background .2s;
}
.btn:hover { transform: rotate(-2deg) scale(1.05); }
.btn--red { background: var(--red); color: var(--paper); }
.btn--red:hover { background: var(--red-dark); }
.btn--paper { background: var(--paper); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 3px var(--paper); clip-path: none; }
.btn--ghost:hover { background: var(--paper); color: var(--ink); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px);
  transition: background .3s, padding .3s, transform .35s;
}
.nav.is-scrolled { background: rgba(10, 10, 10, .92); backdrop-filter: blur(6px); padding-block: 10px; }
.nav.is-hidden { transform: translateY(-100%); }
.nav__brand { display: flex; align-items: center; gap: 12px; }
.nav__mark { height: 34px; width: auto; transition: transform .4s; }
.nav__brand:hover .nav__mark { transform: rotate(-8deg) scale(1.1); }
.nav__word { height: 22px; width: auto; }
.nav__links { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav__links a {
  font-family: var(--display); font-weight: 900; font-size: 1.25rem;
  text-transform: uppercase; letter-spacing: .05em; position: relative;
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 4px;
  background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform .3s; clip-path: polygon(0 20%, 100% 0, 98% 100%, 2% 80%);
}
.nav__links a:hover::after { transform: scaleX(1); }
.nav__toggle { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 88px 16px 72px; overflow: hidden;
}
.hero::before { /* soft red glow spilling out of the portal */
  content: ''; position: absolute; width: 70vmin; height: 70vmin; top: 6%; left: 50%; margin-left: -35vmin;
  background: radial-gradient(circle, rgba(232, 40, 43, .16), transparent 62%);
  filter: blur(20px); pointer-events: none; animation: breathe 5s ease-in-out infinite;
}
/* sizes follow the screen height too, so the whole hero (button included) fits on first view */
.hero__mark { position: relative; width: min(400px, 66vw, 36svh); aspect-ratio: 836 / 747; }
.hero__mark img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__base { animation: rise .9s var(--i) cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes rise { from { transform: translateY(40px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* the red star inside the portal */
.hero__star {
  transform-origin: 50.9% 61.3%;
  filter: drop-shadow(0 0 10px rgba(232, 40, 43, .7));
  animation: ignite .9s calc(var(--i) + .6s) cubic-bezier(.2, 1.6, .4, 1) both, pulse 3.2s calc(var(--i) + 1.6s) ease-in-out infinite;
  transition: filter .4s;
}
@keyframes ignite { from { transform: scale(0) rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(232, 40, 43, .6)); }
  50% { transform: scale(1.07) rotate(4deg); filter: drop-shadow(0 0 26px rgba(232, 40, 43, .95)); }
}
.hero__mark:hover .hero__star { animation-duration: .9s, 1.1s; }

/* dark swirling void behind the star, only visible through the arch */
.hero__void {
  position: absolute; left: 30%; top: 22%; width: 42%; height: 72%;
  border-radius: 48% 48% 6% 6% / 34% 34% 6% 6%;
  background:
    radial-gradient(circle at 50% 54%, rgba(232, 40, 43, .55), transparent 45%),
    conic-gradient(from 0deg at 50% 54%, #1a0606, #3a0b0c, #120404, #2c0809, #1a0606);
  filter: blur(6px); opacity: .9;
  animation: fade 1s calc(var(--i) + .5s) both, swirl 14s linear infinite;
}
@keyframes swirl { to { filter: blur(6px) hue-rotate(-12deg); background-position: 0 0; } }
.hero__void::after {
  content: ''; position: absolute; inset: 10%;
  background: conic-gradient(from 90deg, transparent, rgba(232, 40, 43, .35), transparent 30%, rgba(232, 40, 43, .2), transparent 65%);
  border-radius: 50%; animation: spin 7s linear infinite; mix-blend-mode: screen;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* sparks rising out of the portal */
.hero__sparks { position: absolute; left: 34%; top: 24%; width: 34%; height: 70%; pointer-events: none; }
.spark {
  position: absolute; width: 6px; height: 6px; background: var(--red); clip-path: var(--star);
  animation: rise-spark var(--t, 3s) ease-out forwards;
}
@keyframes rise-spark {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx, 0), -140px) scale(1.2) rotate(180deg); opacity: 0; }
}
.spark--burst { animation: burst .9s cubic-bezier(.1, .8, .3, 1) forwards; width: 10px; height: 10px; }
@keyframes burst {
  0% { transform: translate(0, 0) scale(.5); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.4) rotate(270deg); opacity: 0; }
}

.hero__title { margin: 1.6svh 0 0; width: min(560px, 82vw, 54svh); animation: drop .8s calc(var(--i) + .35s) cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes drop { from { transform: translateY(-30px) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
.hero__tag {
  font-family: var(--display); font-weight: 900; font-size: clamp(1.5rem, min(4.5vw, 4.6svh), 3rem);
  text-transform: uppercase; letter-spacing: .03em; margin: 2.2svh 0 4px; line-height: 1;
  animation: fade .8s calc(var(--i) + 1s) both;
}
.hero__sub { max-width: 520px; color: var(--paper-dim); margin: 1svh auto 2.8svh; animation: fade .8s calc(var(--i) + 1.15s) both; }
.hero .btn { animation: fade .8s calc(var(--i) + 1.3s) both; }
@keyframes fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hero__scroll {
  position: absolute; bottom: 26px; left: 50%; width: 26px; height: 42px; margin-left: -13px;
  border: 3px solid var(--paper); border-radius: 14px; opacity: .6;
}
.hero__scroll span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  background: var(--red); border-radius: 2px; animation: scroll 1.6s infinite;
}
@keyframes scroll { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* stone fragments floating around the portal */
.hero__chips { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero > :not(.hero__chips) { position: relative; z-index: 1; }
.hero > .hero__scroll { position: absolute; }
.chip { position: absolute; transition: transform .6s cubic-bezier(.2, .8, .3, 1); }
.chip i {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(135deg, #f4efe5 0 48%, #8d887f 52% 100%);
  animation: float var(--f, 6s) ease-in-out infinite alternate;
}
.chip--red i { background: var(--red); clip-path: var(--star) !important; filter: drop-shadow(0 0 6px var(--red)); }
@keyframes float { from { transform: translateY(-8px) rotate(-8deg); } to { transform: translateY(10px) rotate(10deg); } }

/* intro: step through the portal */
.intro {
  position: fixed; inset: 0; z-index: 200; background: var(--ink);
  display: grid; place-items: center; pointer-events: none;
  animation: intro-out .45s 1.15s ease-in forwards;
}
.intro__star {
  width: 60px; height: 60px; background: var(--red); clip-path: var(--star);
  animation: intro-star 1.25s cubic-bezier(.6, 0, .4, 1) forwards;
}
@keyframes intro-star {
  0% { transform: scale(0) rotate(-90deg); }
  45% { transform: scale(1) rotate(0); }
  60% { transform: scale(.85) rotate(10deg); }
  100% { transform: scale(70) rotate(45deg); }
}
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }
/* hero animations wait for the intro (--i) */
.hero { --i: 1.1s; }

/* ---------- marquee ---------- */
.marquee {
  background: var(--red); color: var(--ink); overflow: hidden;
  transform: rotate(-2deg) scale(1.04); padding: 14px 0 10px;
  /* the tilt lifts the right end ~1.75vw; push it below the fold so it isn't visible at the top */
  margin: calc(2vw + 14px) 0 40px;
  position: relative; z-index: 2;
}
.marquee__track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 30s linear infinite; }
.marquee span { font-family: var(--display); font-weight: 900; font-size: clamp(1.6rem, 3.5vw, 2.6rem); text-transform: uppercase; white-space: nowrap; line-height: 1; }
.marquee i { width: 26px; height: 26px; background: var(--paper); clip-path: var(--star); flex: none; animation: spin 6s linear infinite; }
@keyframes marquee { to { transform: translateX(-33.333%); } }

/* ---------- sections ---------- */
section { position: relative; }
.section-head { padding: 0 clamp(16px, 6vw, 96px); margin-bottom: 40px; }
.kicker {
  display: inline-block; font-family: var(--display); font-size: 1.1rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--red);
}
.kicker--dark { color: var(--red-dark); }
h2 {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.8rem, 8vw, 6.5rem); line-height: .9; margin: 6px 0 0; letter-spacing: .01em;
}

/* ---------- games ---------- */
.games { padding: 90px 0 140px; }
.games__list { display: grid; gap: clamp(70px, 10vw, 130px); padding: 0 clamp(16px, 6vw, 96px); }
.game { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(28px, 5vw, 70px); align-items: center; }
.game:nth-child(even) { grid-template-columns: 1fr 1.25fr; }
.game:nth-child(even) .game__media { order: 2; }

.game__media {
  position: relative; display: block; aspect-ratio: 16 / 9;
  clip-path: var(--cut); background: var(--ink-2);
  transform: rotate(-1deg); transition: transform .5s cubic-bezier(.2, 1.2, .3, 1);
}
.game:nth-child(even) .game__media { transform: rotate(1deg); }
.game__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .8, .3, 1), filter .5s; filter: saturate(.9); }
.game:hover .game__media { transform: rotate(0) scale(1.015); }
/* a little portal star glints in the corner on hover */
.game__media::after {
  content: ''; position: absolute; right: 22px; top: 18px; width: 34px; height: 34px; z-index: 2;
  background: var(--red); clip-path: var(--star); filter: drop-shadow(0 0 8px var(--red));
  transform: scale(0) rotate(-90deg); transition: transform .5s cubic-bezier(.2, 1.6, .4, 1);
}
.game:hover .game__media::after { transform: scale(1) rotate(0); }
.game:hover .game__media img { transform: scale(1.06); filter: saturate(1.1); }

.game__stamp {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  font-family: var(--display); font-weight: 900; text-transform: uppercase; letter-spacing: .06em;
  background: var(--red); color: var(--paper); padding: .35em .9em .25em; font-size: 1.05rem;
  clip-path: var(--cut-2); transform: rotate(-4deg);
}
.game__stamp--dev { background: var(--paper); color: var(--ink); }
.game__stamp--proto { background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 2px var(--paper); }

.game__placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 60%, #2a1414, var(--ink-2) 70%);
}
.game__placeholder img { width: 38%; height: auto; opacity: .9; animation: breathe 3.5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.game__genre { color: var(--paper-dim); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; }
.game__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.game__platforms { display: flex; gap: 8px; }
.platform {
  display: grid; place-items: center; width: 42px; height: 40px;
  background: var(--ink-2); box-shadow: inset 0 0 0 2px #2c2a27; clip-path: var(--cut);
  transform: rotate(-3deg); transition: background .2s, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.platform:nth-child(even) { transform: rotate(2.5deg); }
.platform svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .5)); }
.platform:hover { background: #2a1010; box-shadow: inset 0 0 0 2px var(--red); transform: rotate(0) translateY(-3px) scale(1.08); }
.btn svg { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; margin-top: -.12em; }
.game__title { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(2.4rem, 5.5vw, 4.4rem); line-height: .9; margin: 8px 0 14px; }
.game__tagline { font-family: var(--display); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.2; color: var(--red); margin: 0 0 14px; }
.game__desc { color: #d9d2c5; margin: 0 0 22px; }
.game__facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 26px; padding: 0; list-style: none; }
.game__facts li { font-size: .9rem; }
.game__facts b { display: block; font-family: var(--display); font-weight: 400; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-dim); }
.game__links { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- about ---------- */
.about { background: var(--paper); color: var(--ink); padding: 120px 0; margin: 40px 0; }
.tear { position: absolute; left: 0; width: 100%; height: 60px; fill: var(--paper); }
.tear--top { top: -59px; }
.tear--bottom { bottom: -59px; }
.about__inner { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 6vw, 96px); }
.manifesto {
  font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 4.4vw, 3.6rem);
  line-height: 1.08; margin: 14px 0 80px; text-transform: none;
}
.manifesto .w { opacity: .14; transition: opacity .4s; }
.manifesto .w.on { opacity: 1; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pillar {
  background: var(--ink); color: var(--paper); padding: 34px 30px 30px;
  clip-path: var(--cut); transition: transform .4s cubic-bezier(.2, 1.4, .4, 1);
}
.pillar:nth-child(2) { transform: rotate(1.2deg); }
.pillar:nth-child(odd) { transform: rotate(-1deg); }
.pillar:hover { transform: rotate(0) translateY(-6px); }
.pillar__num { font-family: var(--display); font-weight: 900; font-size: 2.6rem; color: var(--red); line-height: 1; }
.pillar h3 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 1.8rem; line-height: 1; margin: 10px 0 10px; }
.pillar p { margin: 0; color: #cfc8bb; font-size: .98rem; }

/* ---------- contact ---------- */
.contact { text-align: center; padding: 160px 16px 120px; overflow: hidden; }
.contact__portal { width: 120px; margin: 0 auto 26px; animation: breathe 4s ease-in-out infinite; filter: drop-shadow(0 0 22px rgba(232, 40, 43, .35)); }
.contact__title { margin-top: 10px; }
.contact__sub { color: var(--paper-dim); margin: 16px auto 30px; max-width: 460px; }
.contact__mail {
  display: inline-block; font-family: var(--display); font-weight: 900;
  font-size: clamp(1.6rem, 5vw, 3.2rem); position: relative; padding: 0 4px;
}
.contact__mail::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 35%;
  background: var(--red); z-index: -1; transform: scaleX(.15); transform-origin: left;
  transition: transform .45s cubic-bezier(.2, 1, .3, 1); clip-path: polygon(0 10%, 100% 0, 99% 100%, 1% 85%);
}
.contact__mail:hover::after { transform: scaleX(1); }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; list-style: none; padding: 0; margin: 40px 0 0; }
.socials a {
  display: block; font-family: var(--display); font-weight: 900; text-transform: uppercase; letter-spacing: .05em;
  padding: .55em 1.2em .45em; background: var(--ink-2); box-shadow: inset 0 0 0 2px #2c2a27;
  clip-path: var(--cut-2); transition: background .2s, color .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.socials a:hover { background: var(--paper); color: var(--ink); transform: rotate(-3deg) translateY(-3px); }

/* ---------- footer ---------- */
.footer {
  /* three equal-width columns keep the copyright text exactly centered */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 26px clamp(16px, 4vw, 48px); border-top: 2px solid #1f1d1b; color: var(--paper-dim); font-size: .9rem;
}
.footer p { margin: 0; text-align: center; }
.footer__mark { height: 30px; width: auto; }
.footer__top { justify-self: end; }
.footer__top:hover { color: var(--red); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s, transform .8s cubic-bezier(.2, .8, .3, 1); }
.reveal.in { opacity: 1; transform: none; }
.pillar.reveal.in:nth-child(odd) { transform: rotate(-1deg); }
.pillar.reveal.in:nth-child(2) { transform: rotate(1.2deg); }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .game, .game:nth-child(even) { grid-template-columns: 1fr; }
  .game:nth-child(even) .game__media { order: 0; }
  .pillars { grid-template-columns: 1fr; }
  .nav__toggle {
    display: grid; gap: 6px; background: none; border: 0; padding: 8px;
  }
  .nav__toggle span { width: 28px; height: 3px; background: var(--paper); transition: transform .3s; }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }
  .nav__links {
    position: fixed; inset: 0; background: var(--ink); flex-direction: column;
    align-items: center; justify-content: center; gap: 30px; z-index: -1;
    opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  .nav__links a { font-size: 2.6rem; }
  .nav.is-open .nav__links { opacity: 1; pointer-events: auto; }
  .nav__word { display: none; }
  .footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer__top { justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .manifesto .w { opacity: 1; }
  .intro { display: none; }
  .hero { --i: 0s; }
}
