/* ============================================================
   Esvio Games — single page studio site
   ============================================================ */

/* ---------- Fonts (self-hosted, SIL Open Font License 1.1) ---------- */
@font-face {
  font-family: "Figtree Variable";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("assets/fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #fffaf5;
  --surface: #fff1e5;
  --ink: #24211f;
  --ink-soft: #4a4340;
  --muted: #6b625c;

  /* Accent stops sampled from the approved logo (s1 / s3) */
  --brand-red: #ff1f00;
  --brand-orange: #ff7a00;
  --brand-gold: #ffb50d;
  --grad-brand: linear-gradient(100deg, var(--brand-red) 0%, var(--brand-orange) 52%, var(--brand-gold) 100%);

  /* Deepened range so white button labels stay legible (>= 3.6:1) */
  --cta-a: #d81e00;
  --cta-b: #e54a06;
  --grad-cta: linear-gradient(100deg, var(--cta-a) 0%, var(--cta-b) 100%);
  --accent: #c21500;

  --focus: #e85400;
  --rule: rgba(36, 33, 31, 0.1);

  --container: 1140px;
  --header-h: 68px;
  --radius: 14px;
  --radius-lg: 24px;
  --gap: clamp(1.25rem, 0.6rem + 3vw, 2.5rem);
  --section-y: clamp(4rem, 2.6rem + 7vw, 7.5rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 220ms;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Figtree Variable", "Figtree", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.0625rem, 1.02rem + 0.2vw, 1.125rem);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
p,
ul,
figure {
  margin: 0;
}

h1,
h2 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.75rem);
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

::selection {
  background: #ffd9b8;
  color: var(--ink);
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
}

.section {
  padding-block: var(--section-y);
  scroll-margin-top: var(--header-h);
}

main {
  scroll-margin-top: var(--header-h);
}

.band {
  background: var(--surface);
}

.section-body {
  max-width: 58ch;
  color: var(--ink-soft);
  margin-top: 1.25rem;
}

/* In the two-column layout the grid gap already separates the blocks. */
.split > .section-body,
.contact-list {
  margin-top: 0;
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: 4px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  transition: box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 6px 20px -12px rgba(36, 33, 31, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  margin-inline-start: -0.25rem;
  padding-inline: 0.25rem;
  text-decoration: none;
  border-radius: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-nav-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1rem);
}

/* Without JavaScript the menu is never collapsible, so it must stay reachable. */
html:not(.js) .site-nav[hidden] {
  display: flex;
}

html:not(.js) .site-nav {
  flex-wrap: wrap;
  row-gap: 0.25rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.875rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.site-nav a:hover {
  background: var(--surface);
  color: var(--accent);
}

/* Mobile navigation toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.875rem 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(36, 33, 31, 0.18);
  border-radius: 10px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.nav-toggle:hover {
  background: var(--surface);
  border-color: rgba(36, 33, 31, 0.3);
}

.nav-toggle-icon {
  position: relative;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: background-color var(--dur) var(--ease);
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), top var(--dur) var(--ease);
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ---------- Buttons & links ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  background-image: var(--grad-cta);
  background-size: 130% 100%;
  background-position: 0% 50%;
  color: #fff;
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 10px 22px -14px rgba(216, 30, 0, 0.85);
  transition: background-position 320ms var(--ease), box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn-primary:hover {
  background-position: 100% 50%;
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -14px rgba(216, 30, 0, 0.9);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px -14px rgba(216, 30, 0, 0.9);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--brand-orange), var(--brand-orange));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 2px;
  transition: color var(--dur) var(--ease), background-size var(--dur) var(--ease);
}

.text-link:hover {
  color: var(--accent);
  background-size: 100% 3px;
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(2rem, 0.8rem + 6vw, 4.5rem) clamp(1rem, 0.4rem + 3vw, 3rem);
}

/* Grid children must be allowed to shrink below their content's intrinsic
   width, otherwise the 420px logo forces the page wider than the viewport. */
.hero-grid > *,
.split > * {
  min-width: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(2.5rem, 2rem + 5vw, 5rem);
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin-top: 1rem;
  font-size: clamp(2.25rem, 1.4rem + 3.9vw, 3.75rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.title-line {
  display: block;
}

.hero .lead {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.75rem, 0.4rem + 1.5vw, 1.75rem);
  margin-top: clamp(2rem, 1.5rem + 2vw, 2.75rem);
}

.hero-art {
  display: flex;
  justify-content: center;
}

.hero-logo {
  width: min(100%, 26rem);
  aspect-ratio: 1;
}

/* ---------- Studio ---------- */
/* ---------- First game ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: clamp(2rem, 1.5rem + 3vw, 3.5rem);
}

#first-game .split {
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.4375rem 0.9375rem;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px rgba(36, 33, 31, 0.1);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-image: var(--grad-brand);
  flex: none;
}

.game-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1.375rem);
  height: clamp(11rem, 22vw, 15rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px rgba(36, 33, 31, 0.06);
  overflow: hidden;
}

.game-art::after {
  content: "";
  position: absolute;
  left: -2rem;
  top: -4rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 60%, rgba(255, 122, 0, 0.14), rgba(255, 122, 0, 0) 70%);
}

.game-art-disc {
  position: absolute;
  right: -3.5rem;
  bottom: -5.5rem;
  width: clamp(12rem, 18vw, 16rem);
  height: clamp(12rem, 18vw, 16rem);
  border-radius: 50%;
  background: #ffe9d6;
}

.stripe {
  position: relative;
  display: block;
  width: clamp(0.5rem, 1.6vw, 0.875rem);
  border-radius: 999px;
  background-image: var(--grad-brand);
  transform: skewX(-12deg);
}

.stripe-1 {
  height: 34%;
}

.stripe-2 {
  height: 58%;
}

.stripe-3 {
  height: 82%;
}

/* ---------- Contact ---------- */
/* Tall enough that the anchor always lands with this section at the top of
   the viewport instead of showing the previous section's tail. */
#contact {
  /* The footer's rule carries the separation, so the last section ends tighter. */
  padding-block-end: clamp(2.5rem, 1.8rem + 3vw, 4rem);
}

.contact-list {
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 2.25rem);
}

.contact-list li {
  display: grid;
  gap: 0.5rem;
  justify-items: start;
}

.contact-label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-list .btn-primary {
  justify-self: start;
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3125rem);
  overflow-wrap: anywhere;
  max-width: 100%;
}

.contact-list .text-link {
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  padding-left: 0.25rem;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem) clamp(1.5rem, 1rem + 1.5vw, 2rem);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.footer-top nav {
  display: flex;
  min-width: 0;
}

.copyright {
  margin-block-start: clamp(1rem, 0.6rem + 1.5vw, 1.5rem);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 47.9375rem) {
  /* Without JavaScript the menu stacks into three 44px rows inside the sticky bar. */
  html:not(.js) {
    --header-h: 8.75rem;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .js .site-header .site-nav {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
    left: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
    z-index: 40;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: 0 18px 40px -18px rgba(36, 33, 31, 0.4), inset 0 0 0 1px rgba(36, 33, 31, 0.08);
  }

  .js .site-header .site-nav[hidden] {
    display: none;
  }

  .js .site-header .site-nav a {
    justify-content: flex-start;
    min-height: 48px;
    font-size: 1.0625rem;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Keeps the first link's text flush with the logo above it. */
  .site-footer .site-nav {
    margin-inline-start: -0.875rem;
  }
}

@media (min-width: 48rem) {
  :root {
    --header-h: 76px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 1.125rem;
  }

  .site-nav {
    display: flex !important;
    margin-inline-end: -0.875rem;
  }

  .site-nav a {
    font-size: 1rem;
  }

  .nav-toggle {
    display: none;
  }
}

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .hero-art {
    justify-content: flex-end;
  }

  .split {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    column-gap: clamp(2.5rem, 5vw, 5rem);
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .nav-toggle {
    display: none;
  }

  body {
    background: #fff;
  }
}

/* ---------- Reduced motion ---------- */
@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;
  }

  .btn-primary:hover {
    transform: none;
  }
}
