/* Jamin Games home page. Colours and shapes come from the studio logo:
   a dark jar with a thick white outline, berry jam, a yellow cap and masking tape. */

@font-face { font-family: "Permanent Marker"; src: url("../assets/fonts/PermanentMarker-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Anton"; src: url("../assets/fonts/Anton-Regular.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 400; src: url("../assets/fonts/Inter-Regular.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 600; src: url("../assets/fonts/Inter-SemiBold.woff") format("woff"); font-display: swap; }

:root {
  --ink: #15121A;      /* logo background */
  --glass: #2A2533;    /* jar glass */
  --berry: #C8184A;    /* the jam */
  --cap: #FFD23F;      /* the lid */
  --tape: #EFE6CC;     /* masking tape */
  --line: #FFFFFF;     /* jar outline */
  --coral: #FF5A36;    /* SpikeSzn */
  --head: "Anton", Impact, "Arial Narrow", sans-serif;
  --marker: "Permanent Marker", "Comic Sans MS", cursive;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --dots: radial-gradient(rgba(255, 255, 255, .055) 2.4px, transparent 2.7px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--ink); color: #fff;
  font-family: var(--body); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--cap); outline-offset: 4px; border-radius: 4px; }
.block--label :focus-visible { outline-color: var(--ink); }

.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 60; background: var(--cap); color: var(--ink); padding: 8px 14px; font-weight: 600; }
.skip:focus { left: 8px; }

h2 { font-family: var(--head); font-weight: 400; text-transform: uppercase; font-size: clamp(44px, 6.4vw, 80px); line-height: 1; letter-spacing: .01em; margin-bottom: 28px; }
h3 { font-family: var(--head); font-weight: 400; text-transform: uppercase; font-size: clamp(36px, 4.4vw, 56px); line-height: 1; }
.lead { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.5; max-width: 52ch; }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 40; background: rgba(21, 18, 26, .92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--glass); --jar-line: #fff; }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--head); text-transform: uppercase; font-size: 22px; letter-spacing: .04em; }
.brand svg { width: 38px; height: 40px; }
.top nav { display: flex; gap: 6px; }
.top nav a { padding: 8px 12px; text-decoration: none; font-weight: 600; font-size: 15px; border-radius: 8px; }
.top nav a:hover { background: var(--glass); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.jbtn {
  display: inline-block; text-decoration: none; background: var(--cap); color: var(--ink);
  font-family: var(--head); text-transform: uppercase; font-size: 19px; letter-spacing: .04em; line-height: 1;
  padding: 15px 22px 14px; border: 4px solid var(--line); border-radius: 14px;
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1);
}
.jbtn:hover { transform: translateY(-3px) rotate(-1.5deg); }
.jbtn:active { transform: scale(.96); }
.jbtn--ghost { background: transparent; color: #fff; }

/* ---------- Tape ---------- */
.tape {
  display: inline-block; background: var(--tape); color: var(--ink);
  font-family: var(--marker); font-size: 22px; line-height: 1; padding: 9px 26px 7px; white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 17%, 100% 33%, calc(100% - 6px) 50%, 100% 67%, calc(100% - 6px) 83%, 100% 100%, 0 100%, 6px 83%, 0 67%, 6px 50%, 0 33%, 6px 17%);
}

/* ---------- The stage (hero = splash screen) ---------- */
.stage { background-color: var(--ink); background-image: var(--dots); background-size: 26px 26px; padding-bottom: clamp(48px, 7vw, 88px); overflow: hidden; }
.scene-btn { display: block; width: 100%; padding: 0; border: 0; background: none; }
.scene-btn:disabled { cursor: default; }
.scene { width: 100%; height: clamp(340px, 66vh, 640px); overflow: visible; }
.stage-copy { text-align: center; margin-top: -4px; }
.stage-line { font-size: clamp(19px, 2.1vw, 26px); max-width: 30ch; margin: 0 auto 26px; line-height: 1.35; }
.stage-copy .actions { justify-content: center; }

/* ---------- Blocks ---------- */
.block { padding: clamp(72px, 9vw, 120px) 0; }

/* Now cooking */
#games { background: var(--glass); }
.feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 4.5vw, 64px); align-items: center; }
.feature-art { position: relative; display: block; border: 6px solid var(--line); border-radius: 28px; background: var(--coral); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.feature-art img { width: 100%; border-radius: 22px; }
.feature-art:hover { transform: rotate(-1deg) scale(1.015); }
.tape--corner { position: absolute; left: -24px; bottom: 26px; transform: rotate(-6deg); font-size: 24px; }
.feature-copy h3 { color: var(--cap); }
.feature-tag { font-family: var(--marker); font-size: clamp(20px, 2.2vw, 26px); margin: 10px 0 16px; }
.feature-copy p { max-width: 38ch; }
.feature-copy .actions { margin: 26px 0 18px; }
.feature-meta { font-size: 14px; opacity: .75; }
.feature-meta a { color: var(--cap); font-weight: 600; opacity: 1; }
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: clamp(28px, 4vw, 48px); }
.strip a { display: block; border: 4px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.strip a:hover { transform: translateY(-4px); }
.strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* On the shelf */
.block--shelf { background-color: var(--ink); background-image: var(--dots); background-size: 26px 26px; }
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(16px, 4vw, 56px); margin: 44px 30px 0; align-items: start; max-width: 800px; }
.shelf li, .jar-link { display: grid; justify-items: center; align-content: start; text-align: center; text-decoration: none; }
.jar { position: relative; display: grid; justify-items: center; width: 100%; margin-bottom: 36px; }
.jar svg { width: min(100%, 210px); height: auto; overflow: visible; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 50% 100%; position: relative; z-index: 1; }
/* the board the jars stand on */
.jar::after { content: ""; position: absolute; left: -30px; right: -30px; bottom: -12px; height: 12px; background: var(--tape); }
.shelf li:first-child .jar::after { border-radius: 6px 0 0 6px; }
.shelf li:last-child .jar::after { border-radius: 0 6px 6px 0; }
.jar-link:hover svg { transform: rotate(-4deg) scale(1.04); }
/* The SpikeSzn jar fills when the shelf scrolls into view, and refills when you point at it */
.anim .jar-link .jam-rise { transform: translateY(250px); }
.anim .jar-link.is-in .jam-rise { animation: jam-fill 1.7s cubic-bezier(.5, 0, .3, 1.2) .25s both; }
.anim .jar-link.is-in .jam { animation: jam-slosh 1.6s ease-in-out .25s 2; }
.anim .jar-link.is-in:hover .jam-rise { animation: jam-fill-again 1.5s cubic-bezier(.5, 0, .3, 1.2) both; }
.anim .jar-link.is-in:hover .jam { animation: jam-slosh-again 1.5s ease-in-out 2; }
@keyframes jam-fill { from { transform: translateY(250px); } to { transform: none; } }
@keyframes jam-fill-again { from { transform: translateY(250px); } to { transform: none; } }
@keyframes jam-slosh { from { transform: none; } to { transform: translateX(-160px); } }
@keyframes jam-slosh-again { from { transform: none; } to { transform: translateX(-160px); } }
.shelf b { font-family: var(--head); font-weight: 400; text-transform: uppercase; font-size: clamp(20px, 2.4vw, 28px); letter-spacing: .03em; line-height: 1.1; }
.shelf b + span { font-size: 14px; opacity: .7; margin-top: 4px; }
.shelf .is-empty svg { opacity: .5; }
.jar-link b { color: var(--cap); }

/* The studio and contact: printed on the tape */
.block--label { background: var(--tape); color: var(--ink); }
.label-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(36px, 6vw, 88px); }
.block--label h2 { font-family: var(--marker); text-transform: none; font-size: clamp(40px, 5.2vw, 64px); margin-bottom: 22px; transform: rotate(-1.5deg); transform-origin: left; }
.block--label p + p { margin-top: 14px; max-width: 52ch; }
.facts { margin-top: 30px; max-width: 460px; }
.facts > div { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 2px solid rgba(21, 18, 26, .16); }
.facts dt { font-weight: 600; font-size: 14px; opacity: .65; padding-top: 2px; }
.contacts dt { font-size: 14px; font-weight: 600; opacity: .65; margin-top: 14px; }
.contacts dt:first-child { margin-top: 0; }
.contacts a, .facts a { font-weight: 600; color: var(--berry); overflow-wrap: anywhere; }
.contacts a { font-size: 18px; }
.contacts a:hover, .facts a:hover, .links a:hover { color: var(--ink); }
.links { margin-top: 26px; display: grid; gap: 8px; }
.links a { font-weight: 600; color: var(--berry); }

.foot { background: var(--ink); color: rgba(255, 255, 255, .65); font-size: 14px; padding: 26px 0 34px; }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }

/* ---------- Smaller screens ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .wrap { width: min(1120px, 100% - 36px); }
  .feature, .label-grid { grid-template-columns: minmax(0, 1fr); }
  .tape--corner { left: -12px; bottom: 16px; font-size: 19px; }
  .feature-art { border-width: 5px; border-radius: 22px; }
  .feature-art img { border-radius: 17px; }
  .strip { gap: 10px; }
  .strip a { border-width: 3px; border-radius: 12px; }
}
@media (max-width: 700px) {
  .scene { height: auto; aspect-ratio: 620 / 680; max-height: 70vh; }
}
@media (max-width: 520px) {
  .brand span { font-size: 19px; }
  .top nav a { padding: 8px 8px; font-size: 14px; }
  .top nav { gap: 0; }
  .shelf { gap: 0 10px; }
  .jar::after { left: -6px; right: -6px; }
  .shelf b + span { font-size: 12.5px; }
  .jbtn { font-size: 17px; padding: 13px 18px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
