/* Nine Rose Games — shared styles */

/* Fraunces (SIL Open Font License, see /fonts/OFL.txt), self-hosted Latin subset */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/fraunces-latin-italic.woff2") format("woff2");
}

:root {
  --paper: #f6f1e8;
  --paper-2: #efe7da;
  --card: #fffdf9;
  --ink: #1d2636;
  --ink-soft: #4a5466;
  --muted: #6d7484;
  --line: #e2d8c8;
  --rose: #b03a5b;
  --rose-ink: #8f2747;
  --shadow: 0 1px 2px rgba(29, 38, 54, .06), 0 12px 32px -12px rgba(29, 38, 54, .28);

  /* per-game accents */
  --jigsaw: #2f6b4f;
  --sudoku: #c98a12;
  --mine-bg: #15110d;
  --mine-bg-2: #231b14;
  --mine-gold: #f0b93a;
  --mine-ice: #8fdcf5;

  --radius: 14px;
  --wrap: 1120px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161b;
    --paper-2: #1b1e25;
    --card: #1f232b;
    --ink: #ece7de;
    --ink-soft: #c3c0b8;
    --muted: #9a9ca4;
    --line: #2f343e;
    --rose: #e0708f;
    --rose-ink: #f08ea8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .7);
    --jigsaw: #6cc39a;
    --sudoku: #f0b43c;
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose-ink); text-underline-offset: 3px; }
a:hover { color: var(--rose); }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 16px; }

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

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

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand img { width: 34px; height: 34px; flex: none; }
.brand-name { font: 600 1.15rem/1 var(--serif); letter-spacing: -.01em; }
.brand-name span { color: var(--muted); font-weight: 400; }

.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---------- Hero ---------- */

.hero { padding: 72px 0 40px; }
.hero h1 {
  font: 600 clamp(2.3rem, 6vw, 4.1rem)/1.04 var(--serif);
  letter-spacing: -.025em; margin: 0 0 20px; max-width: 15ch;
}
.hero h1 em { font-style: italic; color: var(--rose); font-weight: 500; }
.hero .lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 56ch; margin: 0 0 32px; }

.hero-games { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 0; }
.hero-games a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 18px 8px 8px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease;
}
.hero-games a:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.hero-games img { width: 40px; height: 40px; border-radius: 10px; background: var(--paper-2); padding: 4px; }
.hero-games small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; line-height: 1.2; }

.promises {
  display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 40px 0 0; padding: 20px 0 0;
  border-top: 1px solid var(--line); list-style: none; color: var(--muted); font-size: .95rem;
}
.promises li::before { content: "✦"; color: var(--rose); margin-right: 8px; font-size: .8em; }

/* ---------- Game sections ---------- */

.game { padding: 72px 0; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
.game .wrap {
  display: grid; gap: 48px; align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.game.flip .wrap { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.game.flip .game-text { order: 2; }

.game-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.game-icon {
  width: 72px; height: 72px; flex: none; border-radius: 18px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.eyebrow {
  margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent, var(--rose));
}
.game h2 { font: 600 clamp(1.9rem, 4vw, 2.6rem)/1.05 var(--serif); letter-spacing: -.02em; margin: 2px 0 0; }
.tag-new {
  display: inline-block; vertical-align: middle; margin-left: 8px;
  font: 700 .7rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 6px; background: var(--mine-gold); color: #2a1d05;
}
.game .tagline { font: italic 400 1.25rem/1.4 var(--serif); color: var(--ink-soft); margin: 0 0 16px; }
.game p { margin: 0 0 16px; }

.features { list-style: none; padding: 0; margin: 20px 0 28px; display: grid; gap: 10px; }
.features li { position: relative; padding-left: 28px; }
.features li::before {
  content: ""; position: absolute; left: 4px; top: .55em;
  width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg);
  background: var(--accent, var(--rose));
}

.get { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.store-badge { display: inline-block; border-radius: 6px; transition: transform .15s ease; }
.store-badge:hover { transform: translateY(-2px); }
.store-badge img { height: 52px; width: auto; }
.get .price { color: var(--muted); font-size: .9rem; }
.credit { margin-top: 18px !important; font-size: .85rem; color: var(--muted); }

.game-jigsaw { --accent: var(--jigsaw); }
.game-sudoku { --accent: var(--sudoku); }

/* Diamond Mine: always a dark "cave" band */
.game-mine {
  --accent: var(--mine-gold);
  --ink: #f3ece0; --ink-soft: #d2c8b8; --muted: #a59a8a; --line: #3a2f24; --card: #2a2119;
  background:
    radial-gradient(ellipse 60% 70% at 78% 40%, rgba(240, 185, 58, .16), transparent 70%),
    linear-gradient(180deg, var(--mine-bg-2), var(--mine-bg));
  color: var(--ink); border-top: 0;
}
.game-mine h2 {
  background: linear-gradient(180deg, #ffe08a, var(--mine-gold) 55%, #c98a12);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.game-mine .game-icon { background: #1d1712; }
.game-mine a { color: var(--mine-ice); }

/* ---------- Gallery ---------- */

.gallery { display: grid; gap: 12px; }
.shot {
  display: block; padding: 0; border: 0; margin: 0; cursor: zoom-in; background: none;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  outline-offset: 4px; transition: transform .2s ease;
}
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.shot:hover { transform: translateY(-2px); }
.gallery .thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery .thumbs .shot { border-radius: 10px; }
.gallery .thumbs .shot img { aspect-ratio: 16 / 10; }

/* ---------- Lightbox ---------- */

.lightbox {
  border: 0; padding: 0; margin: auto; background: transparent;
  max-width: min(96vw, 1600px); max-height: 94vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(8, 9, 12, .86); }
.lightbox img { max-width: min(96vw, 1600px); max-height: 86vh; width: auto; border-radius: 10px; margin: 0 auto; }
.lightbox .lb-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 10px; color: #e9e4da; font-size: .95rem;
}
.lightbox button {
  font: inherit; color: #fff; background: rgba(255, 255, 255, .12); border: 0;
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, .22); }
.lightbox .lb-nav { display: flex; gap: 8px; }

/* ---------- About page ---------- */

.page-head { padding: 72px 0 24px; }
.page-head h1 { font: 600 clamp(2.3rem, 6vw, 3.6rem)/1.05 var(--serif); letter-spacing: -.025em; margin: 0 0 12px; }
.page-head .lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 56ch; margin: 0; }

.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; padding: 24px 0 72px; }
.prose { max-width: 62ch; }
.prose h2 { font: 600 1.6rem/1.2 var(--serif); margin: 40px 0 12px; letter-spacing: -.01em; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; }
.prose ul { padding-left: 20px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: start; }
.photos figure { margin: 0; }
.photos img { border-radius: 10px; aspect-ratio: 1; object-fit: cover; box-shadow: var(--shadow); }
.photos figure:first-child { grid-column: 1 / -1; }
.photos figure:first-child img { aspect-ratio: 3 / 2; }
.photos figcaption { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.photos .note { grid-column: 1 / -1; font-size: .9rem; color: var(--muted); margin: 4px 0 0; }

/* ---------- 404 ---------- */

.notfound { padding: 120px 0; text-align: center; }
.notfound h1 { font: 600 clamp(2.3rem, 6vw, 3.6rem)/1.05 var(--serif); margin: 0 0 12px; }
.notfound p { color: var(--ink-soft); margin: 0 0 28px; }
.button {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600;
}
.button:hover { color: var(--paper); background: var(--rose); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--rose); text-decoration: underline; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .game .wrap, .game.flip .wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .game.flip .game-text { order: 0; }
  .about { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero { padding-top: 48px; }
  .game { padding: 56px 0; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .brand-name span { display: none; }
  .nav a { padding: 8px 10px; }
  .hero-games a { flex: 1 1 100%; }
  .gallery .thumbs { gap: 8px; }
}
