/* Tiramisu Studios — tiramisu.game */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #111214;
  --ink-2: #45484E;
  --ink-hover: #5A5D63;
  --paper: #F5F5F2;
  --rule: #CFCFC9;
  --dark: #111214;
  --dark-rule: #3A3D44;
  --dark-muted: #C9CBD0;
  --red: #E60000;
  --accent: #E5391A;
  --pad: clamp(20px, 4vw, 32px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--dark); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--ink-hover); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.dark a:focus-visible, .dark button:focus-visible { outline-color: #FFFFFF; }
.svg-icon { flex: none; fill: currentColor; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1280px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* Type */
.display {
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  line-height: 1;
}
.h-section { font-size: clamp(30px, 4vw, 52px); }
.lede { font-size: 19px; line-height: 1.45; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.label { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }

/* Links and buttons */
a.more {
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 4px;
  transition: border-color .2s ease, color .2s ease;
}
a.more:hover { border-bottom-color: var(--ink-hover); }
a.more.with-icon { display: inline-flex; align-items: center; gap: 8px; }

.btn-store {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  font-weight: 700; font-size: 16px;
  color: #FFFFFF; background: var(--ink);
  transition: background-color .2s ease, transform .2s ease;
}
.btn-store:hover { color: #FFFFFF; background: #33363C; transform: translateY(-2px); }
.dark .btn-store { color: var(--ink); background: #FFFFFF; }
.dark .btn-store:hover { color: var(--ink); background: #DCDDE0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 20px; padding-bottom: 20px;
}
.site-header .logo img { height: 56px; width: auto; }
.back { font-size: 16px; }

/* Motion */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: scale(1.07) translateX(-1.2%); } to { transform: scale(1.07) translateX(1.2%); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.rise { animation: rise .8s var(--ease) both; }
.rise.d1 { animation-delay: .12s; }
.rise.d2 { animation-delay: .24s; }
@supports (animation-timeline: view()) {
  .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
}
.art { position: relative; overflow: hidden; background: #1B1D22; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.art:hover img { transform: scale(1.04); }
.feature img { animation: drift 16s ease-in-out infinite alternate; }

/* Home: hero */
.hero {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px;
  padding-top: clamp(36px, 6vw, 72px); padding-bottom: clamp(40px, 5vw, 64px);
}
.hero h1 {
  flex: 1 1 560px;
  font-size: clamp(36px, 8vw, 120px); line-height: .92; letter-spacing: -.02em; text-wrap: balance;
}
.hero p { flex: 0 1 340px; }

/* Home: games */
.games { display: flex; flex-direction: column; gap: clamp(48px, 6vw, 72px); }
.soon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); gap: 56px 40px; }
.game { display: flex; flex-direction: column; gap: 20px; }
.game .art { aspect-ratio: 16 / 10; }
.game-text { display: flex; flex-direction: column; gap: 8px; }
.game-title { font-size: clamp(28px, 3.2vw, 34px); line-height: 1.05; }
.badge {
  position: absolute; left: 16px; top: 16px; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: #FFFFFF; color: var(--ink);
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }

.flagship { gap: 24px; }
.flagship .art { display: block; width: 100%; min-width: 0; aspect-ratio: 21 / 9; }
.flagship-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.flagship-row > div:first-child { flex: 1 1 520px; display: flex; flex-direction: column; gap: 10px; }
.flagship h2 { font-size: clamp(34px, 5vw, 64px); letter-spacing: -.01em; }
.flagship p { max-width: 60ch; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }

.all-games {
  border-top: 3px solid var(--ink); padding-top: clamp(28px, 3vw, 40px);
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 64px;
}
.all-games > div:first-child { flex: 1 1 480px; display: flex; flex-direction: column; gap: 12px; }
.all-games p { max-width: 52ch; }

.studio {
  display: flex; flex-wrap: wrap; gap: 32px 64px;
  padding-top: clamp(64px, 10vw, 128px); padding-bottom: clamp(64px, 10vw, 128px);
}
.studio h2 { flex: 1 1 420px; text-wrap: balance; }
.studio p { flex: 1 1 420px; max-width: 58ch; }

/* Contact and footer (every page) */
.dark { color: #FFFFFF; }
.dark a { color: #FFFFFF; }
.dark a:hover { color: var(--dark-muted); }
.contact { background: var(--red); scroll-margin-top: 0; }
.contact .wrap {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 48px 64px;
  padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px);
}
.contact h2 { flex: 1 1 380px; }
.contact-body { flex: 2 1 560px; display: flex; flex-wrap: wrap; gap: 40px 64px; }
.contact-item { display: flex; flex-direction: column; gap: 6px; }
.contact-item.social { gap: 14px; }
.contact .label { color: #FFFFFF; }
.contact .email { font-weight: 600; font-size: 19px; }
.contact a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 4px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border: 1px solid rgba(255, 255, 255, .6);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.contact .socials a:hover { background: #FFFFFF; color: var(--red); border-color: #FFFFFF; text-decoration: none; }

.site-footer { background: var(--dark); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  padding-top: 28px; padding-bottom: 40px; font-size: 15px;
}
.site-footer .copy { color: var(--dark-muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 28px; }

/* Game page */
.game-intro {
  display: flex; flex-direction: column; gap: clamp(24px, 3vw, 40px);
  padding-top: clamp(16px, 3vw, 32px);
}
.game-intro-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px 64px; }
.game-intro-row h1 img { width: clamp(220px, 30vw, 400px); height: auto; }
.game-intro-row > div { flex: 1 1 420px; max-width: 620px; display: flex; flex-direction: column; gap: 24px; }

.video { display: block; aspect-ratio: 16 / 9; width: 100%; padding: 0; border: 0; cursor: pointer; }
.video .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  width: clamp(64px, 8vw, 104px); height: clamp(64px, 8vw, 104px); border-radius: 50%; background: #FFFFFF;
  transition: transform .25s ease;
}
.video .play svg { width: 38%; height: 38%; margin-left: 6%; }
.video:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.video-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000000; }

.section { padding-top: clamp(64px, 9vw, 120px); display: flex; flex-direction: column; }
.section.gap-l { gap: clamp(32px, 4vw, 56px); }
.section.gap-m { gap: clamp(24px, 3vw, 40px); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 32px 40px; }
.stat { display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--ink); padding-top: 16px; }
.stat strong { font-weight: 900; font-stretch: 125%; font-size: clamp(34px, 4vw, 58px); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat span { color: var(--ink-2); }

.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 0 64px; }
.specs div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding: 14px 0; border-top: 1px solid var(--rule); }
.specs dt { color: var(--ink-2); }
.specs dd { font-weight: 600; }

.gallery-stage { position: relative; aspect-ratio: 16 / 9; background: #1B1D22; overflow: hidden; }
.gallery-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .45s ease; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 16px; }
.thumbs a { display: block; aspect-ratio: 16 / 9; outline: 3px solid transparent; outline-offset: 3px; }
.thumbs a[aria-current="true"] { outline-color: var(--ink); }
.thumbs a:focus-visible { outline-color: var(--ink); box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }

.play-band { background: var(--dark); margin-top: clamp(64px, 9vw, 120px); }
.play-band .wrap {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px 64px;
  padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px);
}
.play-band .wrap > div:first-child { flex: 1 1 420px; display: flex; flex-direction: column; gap: 12px; }
.play-band p { color: var(--dark-muted); font-size: 19px; }
.qr { display: flex; align-items: center; gap: 16px; }
.qr img { width: 112px; height: 112px; background: #FFFFFF; }
.qr span { max-width: 13ch; color: var(--dark-muted); font-size: 15px; line-height: 1.35; }
@media (max-width: 720px) { .qr { display: none; } }

.link-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 40px 64px;
  padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(56px, 8vw, 104px);
}
.link-strip > div { display: flex; flex-direction: column; gap: 16px; border-top: 3px solid var(--ink); padding-top: 16px; }
.link-strip h2 { font-weight: 700; font-size: 17px; }
.link-strip .links { display: flex; flex-wrap: wrap; gap: 16px 32px; }

/* Legal pages */
.legal-page {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px 64px;
  padding-top: clamp(32px, 5vw, 64px); padding-bottom: clamp(64px, 9vw, 120px);
}
.legal-head { flex: 1 1 320px; display: flex; flex-direction: column; gap: 16px; }
.legal-head .label { font-weight: 600; color: var(--ink-2); }
.legal-head h1 { font-size: clamp(40px, 5vw, 64px); line-height: .95; letter-spacing: -.01em; }
.legal-head p { max-width: 32ch; font-size: 19px; line-height: 1.4; color: var(--ink-2); }
.legal { flex: 2 1 560px; max-width: 720px; font-size: 17px; line-height: 1.65; color: #2A2C31; }
.legal h2 { margin: 48px 0 12px; font-weight: 900; font-stretch: 125%; font-size: 18px; line-height: 1.2; letter-spacing: .01em; text-transform: uppercase; color: var(--ink); }
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0 0 16px; }
.legal a { border-bottom: 2px solid var(--ink); }

/* Not found */
.not-found { padding-top: clamp(48px, 8vw, 120px); padding-bottom: clamp(64px, 10vw, 160px); display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.not-found h1 { font-size: clamp(40px, 8vw, 120px); line-height: .92; letter-spacing: -.02em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .reveal, .feature img, .badge .dot { animation: none; }
  .art img, a.more, .btn-store, .video .play, .gallery-stage img, .socials a { transition: none; }
  .art:hover img { transform: none; }
  .btn-store:hover { transform: none; }
  .video:hover .play { transform: translate(-50%, -50%); }
}

/* Long legal titles (cookie notices) */
.legal-head.long h1 { font-size: clamp(30px, 3vw, 40px); line-height: 1; overflow-wrap: anywhere; hyphens: manual; }
.legal strong { font-weight: 700; color: var(--ink); }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--dark); border-top: 1px solid var(--dark-rule);
  font-size: 14px; line-height: 1.5;
}
.cookie-banner .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 16px; padding-bottom: 16px; }
.cookie-banner p { flex: 1 1 560px; max-width: 980px; color: var(--dark-muted); }
.cookie-banner a { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
.cookie-banner .btn-store { min-height: 44px; padding: 0 28px; border: 0; cursor: pointer; font-family: inherit; }
.cookie-ok .cookie-banner { display: none; }
.legal code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: #E8E8E3; padding: 1px 5px; }

/* Comfortable tap target for footer links */
.site-footer nav a { display: inline-block; padding: 12px 0; }
.site-footer .wrap { padding-top: 16px; padding-bottom: 28px; }

/* Compact cookie banner on small and short screens */
@media (max-width: 600px) {
  .cookie-banner { font-size: 12.5px; line-height: 1.45; }
  .cookie-banner .wrap { gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .cookie-banner .btn-store { width: 100%; min-height: 44px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .cookie-banner { font-size: 12px; line-height: 1.4; }
  .cookie-banner .wrap { flex-wrap: nowrap; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
  .cookie-banner p { flex: 1 1 auto; }
  .cookie-banner .btn-store { width: auto; flex: none; }
}

/* Gallery thumbnails: one row of six, or two rows of three on narrow screens */
.thumbs { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 720px) { .thumbs { grid-template-columns: repeat(3, 1fr); gap: 10px; } }

/* Stats: 4 / 2 / 1 columns, never 3 + 1 */
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .stats { grid-template-columns: 1fr; } }

/* Link strip: three columns from tablet landscape up */
.link-strip { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 40px 48px; }

/* Flagship panel on phones: a little taller than 21:9 so the car stays large; never wider than the screen */
@media (max-width: 720px) {
  .flagship .art { aspect-ratio: 16 / 9; }
  .flagship .art img { object-position: 48% 50%; }
}

/* Safari: aspect-ratio boxes must never take a minimum width from their content */
.art, .video, .gallery-stage, .thumbs a { min-width: 0; max-width: 100%; }
.game, .flagship-row > div, .game-intro-row > div, .hero h1, .hero p { min-width: 0; }

/* Safari (iOS) fixes: never allow sideways scrolling, and make image boxes clip their animated images */
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
.art { isolation: isolate; -webkit-mask-image: -webkit-radial-gradient(white, black); transform: translateZ(0); }

/* Motion only where it makes sense: hover zoom and the slow drift on devices with a mouse */
.feature img { animation: none; }
.art:hover img { transform: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) and (prefers-reduced-motion: no-preference) {
  .feature img { animation: drift 16s ease-in-out infinite alternate; }
  .art:hover img { transform: scale(1.04); }
  .feature:hover img { transform: none; }
}

/* Coming soon cards: link sits under the pitch */
.soon-grid .game > a.more { align-self: flex-start; margin-top: auto; }
.game .art { display: block; }
