/* RootKit Studios — palette, type and cut-paper shapes from the brand identity (Sep 2026) */

:root {
  --red: #FF4028;
  --ink: #1D1E19;
  --canvas: #F3F1DF;
  --face: #FCF8ED;
  /* Only the four brand colours. Rules are a tint of near-black, never a new colour. */
  --rule: rgb(29 30 25 / .22);
  --rule-dark: rgb(252 248 237 / .22);

  --display: "Winky Sans", "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;

  --gutter: clamp(16px, 5vw, 72px);
  --max: 1180px;
  --cut: clamp(24px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h3 { font-size: 1.5rem; }
p { margin: 0; max-width: 62ch; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

.eyebrow {
  font: 600 0.75rem/1 var(--body);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--face); padding: .6rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 5;
  background: var(--ink);
  color: var(--face);
  --logo-red: var(--face);
  --logo-ink: var(--face);
  --logo-face: var(--face);
  --logo-hole: var(--ink);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 18px;
}
.site-head .brand svg { width: 180px; height: auto; } /* brand minimum for wide arrangement */
.site-head nav ul { display: flex; gap: clamp(.9rem, 2.5vw, 2rem); list-style: none; margin: 0; padding: 0; }
.site-head nav a {
  font: 600 .95rem/1 var(--body); text-decoration: none;
  padding-block: .4rem; border-bottom: 2px solid transparent;
}
.site-head nav a:hover { border-color: var(--red); }

@media (max-width: 640px) {
  .site-head { position: static; }
  .site-head .wrap { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .site-head nav ul { gap: 1.1rem; flex-wrap: wrap; }
}

/* ---------- hero: the opening signature ---------- */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--face);
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.hero::before, .hero::after {
  content: ""; position: absolute; background: var(--red); pointer-events: none;
}
.hero::before { /* top-left cut */
  left: 0; top: 0; width: min(36vw, 420px); height: min(30vw, 260px);
  clip-path: polygon(0 0, 100% 0, 72% 32%, 30% 26%, 0 72%);
}
.hero::after { /* bottom-right cut */
  right: 0; bottom: 0; width: min(40vw, 460px); height: min(28vw, 240px);
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 40% 84%, 66% 42%);
}
.hero .wrap {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.25fr 1fr; align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.hero h1 { font-size: clamp(2.7rem, 6.2vw, 4.7rem); }
.hero h1 em {
  font-style: normal; color: var(--ink);
  background: linear-gradient(to bottom, transparent 0 24%, var(--red) 24% 100%);
  padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  clip-path: polygon(0 6%, 100% 0, 99% 100%, 1% 94%);
}
.hero p { margin-top: 1.4rem; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--face); }
.hero .cta { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: .8rem; }

.btn {
  display: inline-block; text-decoration: none;
  font: 600 1rem/1 var(--body);
  padding: 1rem 1.4rem;
  background: var(--red); color: var(--ink);
  clip-path: polygon(0 6%, 100% 0, 98% 100%, 2% 94%);
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; clip-path: none; }

/* Rut, inlined so his head can move */
.rut-stage {
  justify-self: center; width: min(100%, 380px);
  background: var(--canvas); color: var(--ink);
  padding: 2.2rem 2rem 1.4rem;
  clip-path: polygon(0 5%, 58% 0, 100% 3%, 97% 100%, 4% 96%);
  cursor: pointer;
}
.rut-stage svg { width: 100%; height: auto; overflow: visible; }
.rut-stage .rut-head { transition: transform .45s cubic-bezier(.16, 1, .3, 1); transform-box: fill-box; }
.rut-stage.curious .rut-head { transform: translateY(-5px); }
.rut-stage:hover .rut-head,
.rut-stage.hiding .rut-head { transform: translateY(14px); transition-duration: .2s; }
.rut-stage svg { transition: transform .6s cubic-bezier(.16, 1, .3, 1); transform-origin: 50% 100%; }
.hero .rut-caption { margin-top: .8rem; font-size: .85rem; color: var(--ink); text-align: center; max-width: none; }
@media (prefers-reduced-motion: reduce) {
  .rut-stage .rut-head, .rut-stage svg { transition: none; }
}

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .rut-stage { width: min(80%, 280px); }
}

/* ---------- cut-paper panels ---------- */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { margin-top: 1rem; font-size: 1.15rem; }

.panel-red { background: var(--red); color: var(--ink); }

/* uneven slanted edge between sections */
.cut-top { clip-path: polygon(0 var(--cut), 64% 0, 100% calc(var(--cut) * .6), 100% 100%, 0 100%); margin-top: calc(var(--cut) * -1); padding-top: calc(clamp(4rem, 9vw, 7rem) + var(--cut)); }
.cut-bottom { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 28% 100%, 0 calc(100% - var(--cut) * .4)); padding-bottom: calc(clamp(4rem, 9vw, 7rem) + var(--cut)); }

.cut-top.cut-bottom { clip-path: polygon(0 var(--cut), 64% 0, 100% calc(var(--cut) * .6), 100% calc(100% - var(--cut)), 28% 100%, 0 calc(100% - var(--cut) * .4)); }

/* ---------- featured game ---------- */
.feature {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
.feature figure { margin: 0; }
.feature .shot {
  background: var(--ink);
  padding: 10px;
  clip-path: polygon(0 2%, 100% 0, 99% 100%, 1% 97%);
}
.feature .shot img { width: 100%; height: auto; aspect-ratio: 1260 / 1000; object-fit: cover; }
.feature figcaption { margin-top: .7rem; font-size: .85rem; color: var(--ink); }
.feature h3 { font-size: clamp(2rem, 4vw, 2.9rem); }
.feature .ar { font-family: "Noto Naskh Arabic", "Segoe UI", serif; font-size: 1.35rem; margin-top: .4rem; }
.feature p + p { margin-top: 1rem; }
.feature .lede { margin-top: 1.2rem; font-size: 1.15rem; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.tags li {
  font: 600 .8rem/1 var(--body); padding: .5rem .7rem;
  background: var(--ink); color: var(--face);
}
.tags li.hot { background: var(--red); color: var(--ink); }

.acts { margin: 1.6rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.acts li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.acts b { font-family: var(--display); font-weight: 750; font-size: 1.05rem; }
.feature .links { margin-top: 1.8rem; display: flex; gap: .8rem; flex-wrap: wrap; }

@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
}

/* ---------- what we do ---------- */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.skill { padding: 1.8rem 2rem 2rem 0; border-bottom: 1px solid var(--rule); }
.skill:nth-child(odd) { border-right: 1px solid var(--rule); }
.skill:nth-child(even) { padding-left: 2rem; padding-right: 0; }
.skill h3 { margin: .3rem 0 .7rem; font-size: 1.7rem; }
.skill .proof { margin-top: .9rem; font-size: .9rem; color: var(--ink); }
.skill .proof a { font-weight: 600; }
@media (max-width: 760px) {
  .skills { grid-template-columns: 1fr; }
  .skill, .skill:nth-child(even) { padding: 1.6rem 0; border-right: 0; }
}

/* ---------- team ---------- */
.team-section { background: var(--ink); color: var(--face); }
.team-section .section-head p { color: var(--face); }
.team { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.person {
  background: var(--canvas); color: var(--ink); padding: 2rem;
  display: grid; grid-template-columns: auto 1fr; gap: 1.3rem; align-items: start;
}
.person:first-child { clip-path: polygon(0 0, 100% 3%, 100% 100%, 0 97%); }
.person:last-child { clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%); }
.person img { width: 84px; height: 84px; object-fit: cover; background: var(--red); clip-path: polygon(6% 0, 100% 5%, 94% 100%, 0 94%); }
.person h3 { font-size: 1.8rem; }
.person .role { font: 600 .78rem/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--ink); margin-top: .5rem; }
.person p { margin-top: .9rem; color: var(--ink); font-size: .98rem; }
.person .links { margin-top: 1rem; display: flex; gap: 1.1rem; flex-wrap: wrap; font-weight: 600; font-size: .92rem; }
@media (max-width: 820px) {
  .team { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .person { grid-template-columns: 1fr; padding: 1.6rem; }
}

/* ---------- contact + footer ---------- */
.contact { text-align: left; }
.contact h2 { max-width: 20ch; }
.contact p { margin-top: 1rem; font-size: 1.15rem; }
.contact .cta { margin-top: 2rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.contact .btn { background: var(--ink); color: var(--face); }

.site-foot { background: var(--canvas); padding-block: 3rem; }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; }
.site-foot svg { width: 200px; height: auto; }
.site-foot small { font-size: .85rem; }

/* ---------- in-page game player ---------- */
.play-note { margin-top: .8rem; font-size: .88rem; }

.player {
  width: min(100vw - 32px, 1200px);
  max-height: calc(100vh - 32px);
  padding: 0; border: 0;
  background: var(--ink); color: var(--face);
}
.player::backdrop { background: rgb(29 30 25 / .82); }
.player-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem .9rem .7rem 1.1rem;
}
.player-bar h2 { font-size: 1.3rem; }
.player-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.player-actions button, .player-actions a {
  font: 600 .88rem/1 var(--body); color: var(--face); text-decoration: none;
  background: transparent; border: 0; box-shadow: inset 0 0 0 2px var(--rule-dark);
  padding: .6rem .8rem; cursor: pointer;
}
.player-actions button:hover, .player-actions a:hover { box-shadow: inset 0 0 0 2px var(--face); }
.player-actions [data-close] { background: var(--red); color: var(--ink); box-shadow: none; }
.player-frame { background: var(--ink); aspect-ratio: var(--ratio, 16 / 9); max-height: calc(100vh - 110px); margin-inline: auto; }
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 560px) {
  .player-bar { flex-direction: column; align-items: flex-start; }
}
.skill:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }

/* ---------- more games ---------- */
.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2rem); }
.game { display: flex; flex-direction: column; background: var(--canvas); }
.game:nth-child(1) { clip-path: polygon(0 1%, 100% 0, 100% 99%, 0 100%); }
.game:nth-child(2) { clip-path: polygon(0 0, 100% 1.5%, 100% 100%, 0 98.5%); }
.game:nth-child(3) { clip-path: polygon(0 1.5%, 100% 0, 100% 98.5%, 0 100%); }
.game-shot { display: block; background: var(--ink); aspect-ratio: 16 / 10; overflow: hidden; }
.game-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.game-shot.tall img { object-position: 50% 70%; }
.game-shot:hover img { transform: scale(1.03); }
.game-body { padding: 1.4rem 1.4rem 1.6rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.game-body .kind { font: 600 .72rem/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--ink); }
.game-body h3 { font-size: 1.7rem; }
.game-body p { font-size: .98rem; color: var(--ink); }
.game-body .btn { align-self: flex-start; margin-top: auto; }
.game-body .credits { font-size: .88rem; color: var(--ink); border-top: 1px solid var(--rule); padding-top: .7rem; }
.games { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 620px) { .games { grid-template-columns: 1fr; } }

/* ---------- jam rank stamp ---------- */
.feature figure.ranked { position: relative; }
.rank {
  position: absolute; z-index: 1; top: -1.1rem; right: -0.9rem;
  margin: 0; padding: .7rem 1rem .75rem;
  display: grid; justify-items: center; line-height: 1;
  background: var(--red); color: var(--ink);
  clip-path: polygon(4% 0, 100% 6%, 96% 100%, 0 92%);
  transform: rotate(4deg);
}
.rank-num { font-family: var(--display); font-weight: 750; font-size: clamp(2.6rem, 6vw, 3.6rem); letter-spacing: -.02em; }
.rank-label { margin-top: .3rem; font: 600 .7rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; }
@media (max-width: 560px) { .rank { right: -.3rem; top: -.8rem; } }
.feature .zanga-note { margin-top: 1.4rem; }

/* RootKit's showcase stamp: same cut-paper stamp, sized for a card */



/* ---------- two flagships in Our hits ---------- */
.feature + .feature { margin-top: clamp(4rem, 9vw, 6.5rem); padding-top: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--rule); }
.feature.flip { grid-template-columns: 1fr 1.1fr; }
.feature.flip > figure { order: 2; }
.feature.flip .shot img { aspect-ratio: 16 / 9; }
.feature.flip .rank { right: auto; left: -0.9rem; transform: rotate(-4deg); }
.rank-wide .rank-num { font-size: clamp(1.7rem, 3.6vw, 2.3rem); margin-block: .25rem; }
.rank-wide .rank-label { margin-top: 0; }
@media (max-width: 860px) {
  .feature.flip { grid-template-columns: 1fr; }
  .feature.flip > figure { order: 0; }
}
@media (max-width: 560px) { .feature.flip .rank { left: -.3rem; } }

/* ---------- critique fixes ---------- */

/* phones: Rut gets small and sits under the buttons, so the games come sooner */
@media (max-width: 820px) {
  .rut-stage { width: min(56%, 200px); padding: 1.2rem 1rem .8rem; }
  .hero .rut-caption { display: none; }
  .hero .eyebrow { letter-spacing: .14em; }
}

/* covers: keep the interesting part in frame */
.game-shot.tall img { object-position: 50% 100%; }
.game-shot.golf img { object-position: 45% 50%; }

/* RootKit's stamp moves to the bottom so the game's title stays visible */
.feature.flip .rank { top: auto; bottom: -1rem; }

/* bigger tap targets for inline links */
.zanga-note a, .person .links a { display: inline-block; padding-block: .55rem; }

/* game player hint */
.player-hint { margin-top: .2rem; font-size: .8rem; color: var(--face); }

/* touch screens: games that need a keyboard say so instead of loading */
.btn.needs-computer { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; clip-path: none; cursor: default; }

/* games come sooner after the hero */
#games { padding-top: clamp(2.5rem, 5vw, 3.5rem); }
