/* ==========================================================================
   Harez Labs game site — shared skeleton (every <id>.harezlabs.com page).
   Type system and layout are shared with harezlabs.com; colours and textures come from
   games-sites/_data/<id>/theme.css, which must define every --token used below.
   ========================================================================== */

:root {
  --font-head: "Philosopher", Georgia, serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: "Lexend", system-ui, sans-serif;

  --harez-navy: #092F4E;
  --harez-cream: #FDF6EC;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(64px, 9vw, 120px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); font-weight: 700; line-height: 1.08; }
a { color: var(--link); text-underline-offset: 3px; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--page);
  font-family: var(--font-label);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section-title {
  font-size: clamp(34px, 4.6vw, 54px);
  letter-spacing: -0.01em;
  max-width: 18ch;
}
.section-intro {
  margin-top: 18px;
  max-width: 60ch;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-soft);
}

/* ---------- Top bar ---------- */
.bar {
  position: relative;
  z-index: 2;
  background-color: var(--band);
  color: var(--band-ink);
}
.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.bar__home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.bar__icon { width: 40px; height: 40px; border-radius: 10px; }
.bar__name { font-family: var(--font-head); font-weight: 700; font-size: 22px; }

.lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--band-ink);
  color: var(--ink);
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.lang__icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang:hover { background: var(--page); }
.bar :focus-visible { outline-color: var(--band-ink); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(36px, 6vw, 80px) clamp(24px, 4vw, 48px); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
}
.hero__icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  margin-bottom: 28px;
}
.hero__title { display: flex; flex-direction: column; gap: 14px; }
.hero__name {
  font-size: clamp(60px, 9.4vw, 124px);
  line-height: 0.92;
  letter-spacing: -0.025em;
}
.hero__rest {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: clamp(18px, 1.9vw, 22px);
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.hero__tagline {
  margin-top: 28px;
  font-family: var(--font-head);
  font-style: italic;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.2;
  max-width: 22ch;
}
.hero__text {
  margin-top: 18px;
  max-width: 54ch;
  color: var(--ink-soft);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 32px;
}
.hero__note {
  font-family: var(--font-label);
  font-size: 15px;
  color: var(--ink-soft);
}

.store { display: inline-block; border-radius: 10px; }
.store__badge { width: 200px; height: auto; }

/* ---------- Modes ---------- */
.modes { padding-block: clamp(40px, 6vw, 80px) var(--section-y); }
.patches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(36px, 5vw, 56px);
}
.patch { position: relative; padding: 0 clamp(20px, 2.6vw, 36px) clamp(28px, 3vw, 40px); }
.patch__fabric { display: block; height: 64px; margin-inline: calc(-1 * clamp(20px, 2.6vw, 36px)); margin-bottom: 28px; }
.patch__title { font-size: clamp(28px, 2.8vw, 34px); }
.patch__text { margin-top: 12px; color: var(--ink-soft); }

/* ---------- Features ---------- */
.features { padding-block: 0 var(--section-y); }
.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 56px);
  margin-top: clamp(28px, 4vw, 44px);
}
.note { padding-block: 24px 28px; }
.note__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.3;
}
.note__text { margin-top: 8px; color: var(--ink-soft); font-size: 17px; }

/* ---------- Gallery ---------- */
.gallery { padding-block: var(--section-y); }
.shots {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2.2fr);
  align-items: end;
  gap: clamp(20px, 2.6vw, 32px);
  margin-top: clamp(32px, 4vw, 48px);
}
.shot figcaption {
  margin-top: 12px;
  font-family: var(--font-label);
  font-size: 15px;
  color: var(--ink-soft);
}
.shots:focus-visible { outline-offset: 8px; }

/* ---------- Tech ---------- */
.tech {
  --focus: var(--dark-ink);
  padding-block: var(--section-y);
  background-color: var(--dark);
  color: var(--dark-ink);
}
.tech .section-intro { color: var(--dark-soft); }
.specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 56px);
  margin-top: clamp(32px, 4vw, 48px);
}
.spec { padding-block: 24px 28px; }
.spec__title { font-size: 23px; line-height: 1.2; }
.spec__text { margin-top: 10px; color: var(--dark-soft); font-size: 17px; }

/* ---------- Closing call to action ---------- */
.cta {
  --focus: var(--band-ink);
  padding-block: clamp(48px, 6vw, 72px);
  background-color: var(--band);
  color: var(--band-ink);
}
.cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 48px;
}
.cta__title { font-size: clamp(32px, 4vw, 48px); }
.cta__text { margin-top: 10px; max-width: 48ch; }

/* ---------- Footer (Harez Labs) ---------- */
.foot {
  --focus: var(--harez-cream);
  padding-block: 40px;
  background: var(--harez-navy);
  color: var(--harez-cream);
  font-size: 15px;
}
.foot a { color: var(--harez-cream); }
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
}
.foot__studio { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.foot__mark { flex: none; width: 46px; height: 34px; color: var(--harez-cream); }
.foot__by { display: block; font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 1.2; }
.foot__link { display: block; text-decoration: underline; text-underline-offset: 3px; opacity: 0.85; }
.foot__studio:hover .foot__link { opacity: 1; }
.foot__links a { font-family: var(--font-label); }
.foot__rights { width: 100%; opacity: 0.7; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { max-width: 460px; width: 100%; margin-inline: auto; }
  .notes, .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Gallery becomes a sideways strip; the page itself never scrolls sideways. */
  .wrap--bleed { padding-inline: 0; }
  .shots {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    padding: 4px var(--gutter) 16px;
    overscroll-behavior-x: contain;
  }
  .shot { flex: none; scroll-snap-align: start; }
  .shot--portrait { width: min(62vw, 280px); }
  .shot--wide { width: min(86vw, 560px); }
}

@media (max-width: 720px) {
  .patches { grid-template-columns: 1fr; }
  .notes, .specs { grid-template-columns: 1fr; }
  /* The bar already shows the icon on small screens; this brings the board closer to the first screen. */
  .hero__icon { display: none; }
  .hero__text { font-size: 17px; }
  .bar__name { font-size: 20px; }
  .lang { padding: 0 14px; }
  .cta__inner { flex-direction: column; align-items: flex-start; }
}

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