@font-face {
  font-family: "Grandstander";
  src: url("../fonts/grandstander-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f8f5ec;
  --ink: #292724;
  --pencil: #656058;
  --coral: #c34430;
  --hero-background: #74716c;
  --peach: #f0b09c;
  --sage: #c7d1ba;
  --rule: #d5cfc2;
  --about: #ded7c7;
  --about-pencil: #5c574f;
  --peach-ink: #623b2e;
  --sage-ink: #3b4b37;
  --font: "DM Sans", sans-serif;
  --font-display: "Grandstander", sans-serif;
  /* Layout spacing follows a 4px rhythm at the default root size. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-11: 2.75rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-15: 3.75rem;
  --space-16: 4rem;
  --space-18: 4.5rem;
  --space-19: 4.75rem;
  --space-20: 5rem;
  --space-32: 8rem;
  color-scheme: light;
  scrollbar-color: var(--coral) var(--paper);
  scroll-behavior: smooth;
  scroll-padding-top: calc(5rem + var(--space-6));
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
::selection { color: var(--paper); background: var(--coral); }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: .25em; }
a:hover { color: var(--coral); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 6px; }
button, summary { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 750; line-height: 1.1; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: clamp(2.5rem, 4.5vw, 4rem); }
.wrap { width: min(100% - var(--space-32), 76rem); margin-inline: auto; }
.icon { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.accent-period { color: var(--coral); }
.skip-link { position: absolute; top: 1rem; left: 1rem; z-index: 10; padding: var(--space-3) var(--space-4); color: var(--paper); background: var(--ink); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); color: var(--paper); }

/* Supplied transparent logos stay unmodified. About uses dark ink;
   the hero, header and footer retain the original white artwork. */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--ink); color: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding-block: var(--space-1); }
.studio-brand { display: inline-flex; align-items: center; gap: var(--space-3); flex: 0 0 auto; font-size: 1.5rem; font-weight: 650; line-height: 1.2; text-decoration: none; }
.studio-logo { display: block; flex: 0 0 auto; width: 3rem; height: auto; }
.about-mark { filter: brightness(0); opacity: .84; }
.site-header a:hover, .site-header a:focus-visible { color: var(--peach); }
.site-header :focus-visible { outline-color: var(--peach); }
.main-nav { display: flex; align-items: center; gap: var(--space-10); }
.main-nav a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; font-size: .9375rem; font-weight: 600; text-decoration: none; }
.main-nav a:hover { text-decoration: underline; }
.main-nav a[aria-current="page"] { color: var(--peach); text-decoration: underline; }
.main-nav .icon { width: 1rem; height: 1rem; }

.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; min-height: clamp(22rem, 65svh, 42rem); padding-block: var(--space-20); background: var(--hero-background); }
/* The original transparent artwork repeats on a tilted layer. Multiplying it
   into the warm-gray surface keeps the illustrations quiet behind the white logo. */
.hero::before { content: ""; position: absolute; z-index: -1; inset: -100%; background: url("../images/hero-pattern.png") center / 40rem auto repeat; transform: rotate(-14deg); filter: grayscale(1); mix-blend-mode: multiply; opacity: .18; pointer-events: none; }
.hero.has-pattern-rows::before { display: none; }
.hero-pattern { position: absolute; z-index: -1; inset: 0; font-size: 1rem; filter: grayscale(1); mix-blend-mode: multiply; opacity: .18; pointer-events: none; }
.hero-pattern-shift { position: absolute; inset: 0; transform: translate3d(0, var(--hero-parallax, 0px), 0); }
.hero-pattern-field { position: absolute; top: 50%; left: 50%; display: flex; flex-direction: column; gap: .75em; width: calc(100% + 40em); transform: translate(-50%, -50%) rotate(-14deg); }
/* Crop each row from the same unchanged sprite sheet. The shorter first row
   repeats only its three drawings, removing its empty outer columns. */
/* Tight alpha bounds remove transparent padding. The field's shared gap keeps
   the space between painted row bands even without resizing any drawings. */
.hero-pattern-row { --tile-width: 40em; --tile-height: calc(40em * 458 / 2360); --crop-x: 0em; --crop-y: calc(-40em * 466 / 2360); flex: 0 0 var(--tile-height); height: var(--tile-height); overflow: hidden; }
.hero-pattern-row[data-pattern-row="0"] { --tile-width: calc(40em * 1460 / 2360); --tile-height: calc(40em * 397 / 2360); --crop-x: calc(-40em * 480 / 2360); --crop-y: calc(-40em * 22 / 2360); }
.hero-pattern-row[data-pattern-row="2"] { --tile-height: calc(40em * 467 / 2360); --crop-y: calc(-40em * 942 / 2360); }
.hero-pattern-row[data-pattern-row="3"] { --tile-height: calc(40em * 460 / 2360); --crop-y: calc(-40em * 1412 / 2360); }
.hero-pattern-track { display: flex; align-items: center; width: max-content; height: 100%; animation: hero-row-drift 64s linear infinite paused; }
.hero-pattern-row:nth-child(even) .hero-pattern-track { animation-direction: reverse; }
.hero-pattern-row[data-pattern-row="0"] .hero-pattern-track { animation-duration: 40s; }
.hero.is-pattern-moving .hero-pattern-track { animation-play-state: running; }
.hero-pattern-tile { flex: 0 0 var(--tile-width); width: var(--tile-width); height: var(--tile-height); background: url("../images/hero-pattern.png") var(--crop-x) var(--crop-y) / 40em auto no-repeat; }
@keyframes hero-row-drift { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--tile-width))); } }
.hero::after { content: ""; position: absolute; z-index: -1; inset: auto 0 0; height: var(--space-20); background: linear-gradient(transparent, var(--hero-background)); pointer-events: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-width: 0; }
.hero h1 { width: min(100%, 50rem); min-width: 0; }
.hero-logo { display: block; width: 100%; max-width: 100%; height: auto; }
.hero--games { min-height: clamp(14rem, 34svh, 24rem); }
/* Center the visible lettering optically, including the wave below the hero. */
.hero--games h1 { color: #fff; font-size: clamp(3.5rem, 8vw, 6rem); font-weight: 800; text-align: center; transform: translateY(calc(var(--space-4) + .08em)); }

.games { padding-block: var(--space-12) var(--space-14); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-8); margin-bottom: var(--space-8); }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; column-gap: var(--space-14); row-gap: var(--space-14); }
.game { display: flex; flex-direction: column; min-width: 0; }
.game > img, .game-art, .game-slideshow { flex: 0 0 auto; }
.game > img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; }
.game-art { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; aspect-ratio: 8 / 5; padding: var(--space-8); overflow: hidden; }
.art-coral { background: var(--peach); color: var(--peach-ink); }
.art-sage { background: var(--sage); color: var(--sage-ink); }
.art-border { position: absolute; inset: var(--space-3); border: 1.5px solid currentColor; opacity: .45; pointer-events: none; border-radius: 4px; }
.art-lettering { padding-bottom: var(--space-3); font-family: var(--font-display); font-size: clamp(2.25rem, 3.8vw, 3.75rem); font-weight: 700; letter-spacing: -.015em; line-height: 1.02; text-align: center; }
.art-lettering span { font-weight: 800; }
.art-label { position: absolute; bottom: var(--space-6); font-size: .75rem; font-weight: 500; letter-spacing: .025em; }
.game-title-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-6); }
.game h2, .game h3 { font-size: clamp(1.5rem, 2.3vw, 2rem); }
.game-description { flex-grow: 1; max-width: 55ch; margin-top: var(--space-3); color: var(--pencil); line-height: 1.7; }
.game-play { display: inline-flex; align-self: flex-start; align-items: center; gap: var(--space-5); min-height: 48px; margin-top: var(--space-4); padding-block: var(--space-2); border-bottom: 2px solid var(--ink); font-size: 1rem; font-weight: 700; text-decoration: none; }
.game-play:hover { border-color: var(--coral); }
.game-play .icon { width: 1.125rem; height: 1.125rem; }
.section-heading .games-all-link { flex-shrink: 0; margin-top: 0; margin-left: auto; }

/* The supplied title artwork starts the inline, uncropped slideshow. */
.game-slideshow { position: relative; aspect-ratio: 8 / 5; overflow: hidden; background: color-mix(in srgb, var(--ink) 75%, transparent); color: var(--paper); touch-action: pan-y pinch-zoom; }
.game-slideshow > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
/* Match the translucent frame on paper while masking screenshots beneath the cover. */
.game-slideshow > img:first-child { z-index: 1; opacity: 1; background: color-mix(in srgb, var(--ink) 75%, var(--paper)); pointer-events: none; transition: opacity 400ms ease-out; }
.game-slideshow.is-previewing > img:first-child { opacity: 0; }
.game-slideshow > img[hidden], .slideshow-controls[hidden] { display: none; }
.slideshow-controls { position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; transition: opacity 140ms ease-out; }
.game-slideshow:hover .slideshow-controls, .game-slideshow:has(:focus-visible) .slideshow-controls { opacity: 1; }
.slideshow-button { position: absolute; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--paper); cursor: pointer; pointer-events: auto; }
.slideshow-button::before { content: ""; position: absolute; inset: 4px; z-index: -1; border: 1px solid color-mix(in srgb, var(--paper) 40%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--ink) 64%, transparent); transition: background-color 160ms ease-out, border-color 160ms ease-out; }
.slideshow-button .icon { width: 1rem; height: 1rem; }
.slideshow-button:hover { color: var(--peach); }
.slideshow-button:hover::before, .slideshow-button:focus-visible::before { border-color: var(--peach); background: color-mix(in srgb, var(--ink) 82%, transparent); }
.slideshow-button:focus-visible { outline-color: var(--peach); outline-offset: 3px; }
.slideshow-previous, .slideshow-next { top: calc(50% - 22px); }
.slideshow-previous { left: .75rem; }
.slideshow-next { right: .75rem; }
.slideshow-status { position: absolute; inset: auto var(--space-3) var(--space-3); z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--ink); color: var(--paper); font-size: .875rem; }
.slideshow-status[hidden] { display: none; }
.slideshow-status button { flex: 0 0 auto; min-height: 44px; padding: var(--space-2); border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
.slideshow-status button[hidden] { display: none; }
.slideshow-status button:is(:hover, :focus-visible) { color: var(--peach); outline-color: var(--peach); }
.slideshow-progress { position: absolute; z-index: 1; inset: auto 0 0; display: block; height: 3px; background: color-mix(in srgb, var(--paper) 24%, var(--ink)); pointer-events: none; }
.slideshow-progress[hidden] { display: none; }
.slideshow-progress > span { display: block; height: 100%; background: var(--peach); transform: scaleX(0); transform-origin: left; }
@media (hover: none), (pointer: coarse) {
  .slideshow-controls { opacity: 1; }
}

.section-wave { --wave-fill: var(--paper); --wave-offset: 0rem; --wave-shift: 0px; --wave-width: 6rem; --wave-height: 4rem; position: relative; z-index: 1; height: var(--wave-height); margin-block: -1px; overflow: hidden; pointer-events: none; }
/* Move an overscanned repeating layer rather than repainting the background on
   every touch-scroll frame. One tile of overscan covers either direction. */
.section-wave::before { content: ""; position: absolute; inset: 0 calc(-1 * var(--wave-width)); background: var(--wave-image) repeat-x calc(50% + var(--wave-offset)) bottom / var(--wave-width) var(--wave-height); transform: translate3d(var(--wave-shift), 0, 0); }
/* The negative section margins overlap both joins; seal the lower pixel row. */
.section-wave::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--wave-fill); }
.section-wave--games { --wave-image: url("../images/wave-games.svg"); background-color: var(--hero-background); }
.section-wave--about { --wave-fill: var(--about); --wave-image: url("../images/wave-about.svg"); background-color: var(--paper); }
.section-wave--footer { --wave-fill: var(--ink); --wave-offset: 2rem; --wave-image: url("../images/wave-footer.svg"); background-color: var(--about); }
.section-wave--catalogue-footer { background-color: var(--paper); }
.about { --pencil: var(--about-pencil); padding-block: var(--space-10) var(--space-12); background: var(--about); }
.about-inner { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: var(--space-16); }
.about-heading { display: flex; align-items: center; gap: var(--space-6); }
.about-mark { width: 6.5rem; height: auto; flex: 0 0 auto; transform: rotate(-8deg); }
.about h2 { font-size: clamp(2rem, 3.2vw, 3rem); }
.about-lead { margin-bottom: var(--space-3); font-size: 1.375rem; font-weight: 650; line-height: 1.4; }
.about-copy > p:not(.about-lead) { max-width: 55ch; }
.studio-name-note { margin-top: var(--space-4); color: var(--pencil); font-size: .875rem; }

.site-footer { background: var(--ink); color: var(--paper); }
.footer-inner { padding-top: var(--space-18); }
.footer-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: end; gap: var(--space-12); padding-bottom: var(--space-16); }
.footer-main h2 { margin-bottom: var(--space-4); font-size: clamp(3.5rem, 7.5vw, 6rem); font-weight: 800; }
.footer-main .accent-period { color: var(--peach); }
.footer-main > div > p { color: var(--rule); }
.site-footer a:hover { color: var(--peach); }
.site-footer :focus-visible { outline-color: var(--peach); }
.contact-link { display: inline-flex; align-items: center; max-width: 100%; min-height: 48px; margin-top: var(--space-4); font-size: clamp(1rem, 1.8vw, 1.375rem); font-weight: 600; overflow-wrap: anywhere; }
.socials { justify-self: start; min-width: 14rem; padding-bottom: var(--space-1); }
.socials h3 { font-family: var(--font); font-size: 1rem; font-weight: 600; letter-spacing: 0; }
.social-list { display: flex; flex-direction: column; gap: var(--space-1); list-style: none; padding: 0; margin: var(--space-3) 0 0; }
.social-list a { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-height: 44px; font-size: .9375rem; text-decoration: none; }
.social-list a:hover { text-decoration: underline; }
.social-list span { color: var(--rule); }
.social-list a:is(:hover, :focus-visible) { color: var(--peach); text-decoration: underline; }
.social-list a:is(:hover, :focus-visible) span { color: inherit; }
.social-list .icon { width: .9rem; height: .9rem; }
.social-logo { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; fill: currentColor; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-8); padding-block: var(--space-5); border-top: 1px solid var(--pencil); color: var(--rule); font-size: .8125rem; }
.footer-brand { display: flex; align-items: center; gap: var(--space-3); }
.studio-mark { display: block; flex: 0 0 auto; width: 4rem; height: auto; }
.footer-bottom a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; text-decoration: none; }
.footer-bottom .icon { width: 1rem; height: 1rem; }

@media (max-width: 1000px) {
  .wrap { width: calc(100% - var(--space-20)); }
  .header-inner { gap: var(--space-4); }
  .main-nav { gap: var(--space-6); }
  .game-grid { column-gap: var(--space-8); }
  .about-inner { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .about-heading { display: block; }
  .about-mark { width: 4.5rem; margin-bottom: var(--space-4); }
  .footer-main { gap: var(--space-8); }
  .socials { min-width: 0; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - var(--space-10)); }
  :root { scroll-padding-top: calc(6rem + var(--space-6)); }
  .header-inner { flex-wrap: wrap; justify-content: center; gap: 0 var(--space-4); }
  .studio-brand { gap: var(--space-2); font-size: 1.0625rem; }
  .studio-brand span { max-width: none; }
  .studio-logo { width: 2.25rem; }
  .main-nav { width: 100%; justify-content: space-between; gap: var(--space-3); }
  .main-nav a { font-size: .875rem; }
  .main-nav .icon { display: none; }
  /* Let the wide title's aspect ratio set the phone composition. A viewport
     height minimum otherwise surrounds a shrinking logo with excessive space. */
  .hero { min-height: 0; padding-block: var(--space-12); }
  .hero--games { min-height: 14rem; }
  .hero::before { background-size: 30rem auto; }
  .hero-pattern { font-size: .75rem; }
  .section-heading { flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-6); }
  .game-grid { grid-template-columns: 1fr; gap: var(--space-11); }
  .art-lettering { font-size: clamp(2.25rem, 10vw, 3.75rem); }
  .game-title-row { margin-top: var(--space-5); }
  .game h2, .game h3 { font-size: 1.625rem; }
  .game-play { margin-top: var(--space-3); }
  .games { padding-block: var(--space-8) var(--space-10); }
  .section-wave { --wave-width: 5.25rem; --wave-height: 3.5rem; }
  .section-wave--footer { --wave-offset: 1.75rem; }
  .about { padding-block: var(--space-8) var(--space-10); }
  .about-inner { grid-template-columns: 1fr; gap: var(--space-6); }
  .about-heading { display: flex; gap: var(--space-4); }
  .about-mark { width: 4.5rem; margin: 0; }
  .about h2 { font-size: 2rem; }
  .about-lead { font-size: 1.25rem; }
  .footer-inner { padding-top: var(--space-12); }
  .footer-main { grid-template-columns: 1fr; gap: var(--space-8); padding-bottom: var(--space-10); }
  .footer-main h2 { font-size: clamp(3.5rem, 14vw, 5rem); }
  .contact-link { font-size: 1.0625rem; }
  .socials { justify-self: start; }
  .footer-bottom { gap: var(--space-2) var(--space-4); padding-block: var(--space-4); }
  .studio-mark { width: 3rem; }
  .footer-bottom > p { flex-basis: 100%; order: 3; }
}
@media (max-width: 360px) {
  .header-inner { width: calc(100% - var(--space-8)); gap: var(--space-2); }
  .studio-brand { gap: var(--space-1); font-size: .9375rem; }
  .studio-brand span { width: auto; }
  .studio-logo { width: 1.75rem; }
  .main-nav { gap: var(--space-2); }
  .footer-bottom { font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-pattern-shift { transform: none; }
  .section-wave { --wave-shift: 0px !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .hero::before, .hero::after, .hero-pattern { display: none; }
  .section-wave { display: none; }
  .hero--games h1 { transform: translateY(.08em); }
  .art-border, .game-play, .footer-bottom { border-color: CanvasText; }
  .site-footer { background: Canvas; color: CanvasText; }
  .site-footer p, .social-list span { color: CanvasText; }
}
