/* Fortuneville — catalog + game detail
   Palette sampled from the design PNGs. */

:root {
  --bg: #213456;        /* page + detail background (under the cards) */
  --band: #1b263b;      /* header band */
  --line: #365196;      /* header divider */
  --box: #0c1018;       /* contact box */
  --surface: #182640;   /* media placeholder */
  --text: #a6b6dc;
  --text-dim: #a6b6dc;
  --accent: #ffa800;
  --radius: 8px;
  --content: 970px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-italic.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

/* Slim dark scrollbars instead of the default chrome ones.
   Modern browsers use the standard properties; the -webkit rules
   cover Safari and older Chromium. */

html,
.detail {
  scrollbar-width: thin;
  scrollbar-color: #3b4f7c transparent;
}

body::-webkit-scrollbar,
.detail::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-track,
.detail::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb,
.detail::-webkit-scrollbar-thumb {
  background: #3b4f7c;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

body::-webkit-scrollbar-thumb:hover,
.detail::-webkit-scrollbar-thumb:hover {
  background: #4c6396;
  background-clip: padding-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ---- Header ------------------------------------------------------------ */

.top {
  background: var(--band);
  border-bottom: 3px solid var(--line);
}

.top-inner {
  position: relative;
  height: 202px;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 24px;
}

/* Logo centred above the first card column, contact box above the last one,
   tagline in the middle of the page. */
.logo {
  position: absolute;
  top: 43px;
  left: 40px;
  margin: 0;
  line-height: 0;
}

.logo img {
  width: 184px;
  height: auto;
  display: block;
}

.tagline {
  position: absolute;
  top: 112px;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16.5px;
  line-height: 19px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.contact {
  position: absolute;
  top: 78px;
  right: 46px;
  width: 172px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--box);
  text-align: center;
}

.contact-title {
  margin: 0;
  color: var(--accent);
  font-size: 16px;
  line-height: 19px;
  text-transform: uppercase;
}

.contact-mail {
  display: block;
  margin-top: 1px;
  color: #fff;
  font-size: 15.5px;
  line-height: 19px;
  text-decoration: none;
}

.contact-mail:hover {
  color: #ffe3b0;
}

.contact-mail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .top-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    height: auto;
    padding: 28px 24px;
  }

  .logo,
  .tagline,
  .contact {
    position: static;
    transform: none;
  }

  .tagline {
    white-space: normal;
  }
}

/* ---- Catalog grid ------------------------------------------------------ */

.catalog {
  max-width: var(--content);
  margin: 36px auto 0;
  padding: 0 24px 64px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 20px;
}

.card {
  display: block;
  aspect-ratio: 216 / 377;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transform: translateZ(0);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
}

.card:focus-visible,
.home:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 620px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* Catalog is pushed back while a detail page is open (App Store style).
   The transform is animated from JS (WAAPI) so open/close stay perfectly
   in sync with the clip-path reveal; the class only holds the end state. */

body.pushed-back #page {
  transform: scale(0.96);
  opacity: 0.6;
}

body.no-scroll {
  overflow: hidden;
}

/* ---- Game detail overlay ----------------------------------------------- */

.detail {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail[hidden] {
  display: none;
}

.detail-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 63px 24px 64px;
}

/* Zero-height strip aligned with the content column; the home button sits
   in it at the reference position and scrolls away with the content. */
.detail-bar {
  position: relative;
  z-index: 60;
  height: 0;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 24px;
}

.home {
  position: absolute;
  top: 22px;
  right: 93px;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  color: var(--text);
  transition: color 0.2s ease, transform 0.2s ease;
}

.home:hover {
  color: #d3dcef;
  transform: scale(1.06);
}

.home svg {
  width: 78px;
  height: 78px;
}

.detail h2 {
  margin: 0 0 11px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text);
}

.detail h2.section-gap {
  margin: 13px 0 9px;
}

.row {
  display: grid;
  align-items: start;
}

.row.start {
  grid-template-columns: 686fr 218fr;
  gap: 20px;
}

.row.previews {
  grid-template-columns: 215fr 683fr;
  gap: 25px;
}

.shot {
  width: 100%;
  display: block;
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.shot > img,
.shot > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.row.start .landscape {
  aspect-ratio: 686 / 385;
}

.row.start .portrait {
  aspect-ratio: 218 / 386;
}

.row.previews .portrait {
  aspect-ratio: 215 / 382;
}

.row.previews .landscape {
  aspect-ratio: 680 / 383;
}

.note {
  margin: 14px 0 0;
  font-size: 22px;
  font-style: italic;
  line-height: 27px;
  color: var(--text);
}

@media (max-width: 640px) {
  .detail-inner {
    padding-top: 88px;
  }

  .row.start,
  .row.previews {
    grid-template-columns: 1fr;
  }

  .row .portrait {
    max-width: 300px;
  }

  .row.previews .portrait {
    order: 2;
  }
}

/* ---- Media slots: fullscreen hint + viewport viewer -------------------- */

.shot.zoomable {
  position: relative;
  cursor: pointer;
}

.fs-hint {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fs-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease, transform 0.35s var(--ease);
}

.fs-btn svg {
  width: 18px;
  height: 18px;
}

.shot.zoomable:hover .fs-btn,
.shot.zoomable:focus-visible .fs-btn {
  opacity: 1;
  transform: scale(1);
}

.shot.zoomable:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (hover: none) {
  .fs-btn {
    opacity: 0.9;
    transform: none;
  }
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 16, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: zoom-out;
}

.viewer[hidden] {
  display: none;
}

.viewer video,
.viewer img {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: cover;
  display: block;
}

.viewer-close {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 101;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, transform 0.2s ease;
}

.viewer-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}

.viewer-close:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.viewer-close svg {
  width: 22px;
  height: 22px;
}

/* ---- Motion preferences ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .card,
  .home {
    transition: none;
  }
}
