/* Lost in Lir: a heraldic storybook guild hall.
   Colours come from the crest (ray greens, shield brown, gold letters, light-blue rim);
   each game card and page is tinted from its art through --deep, --deep2, --accent, --accent-ink. */

@font-face { font-family: "Cinzel"; font-weight: 600; font-display: swap;
  src: url("../fonts/cinzel-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 700; font-display: swap;
  src: url("../fonts/cinzel-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-display: swap;
  src: url("../fonts/alegreya-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("../fonts/alegreya-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-display: swap;
  src: url("../fonts/alegreya-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --ray-dark: #027625;
  --ray-light: #468d27;
  --forest: #08361a;
  --forest-deep: #052611;
  --shield: #7a2a0e;
  --shield-deep: #4a1807;
  --gold: #f6cf4a;
  --gold-deep: #c8952b;
  --rim: #aee8f3;
  --parchment: #f8f1de;
  --parchment-edge: #e9dcb8;
  --ink: #2c1d12;
  --ink-soft: #5b4634;
  --serif: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 1.125rem/1.55 var(--sans);
  color: var(--ink);
  background: var(--parchment);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

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

/* ------------------------------------------------------------------ the hero */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--ray-dark);
  min-height: clamp(440px, 74vh, 700px);
  display: grid;
  place-items: center;
  padding: clamp(48px, 8vh, 96px) var(--gutter) clamp(72px, 11vh, 120px);
  text-align: center;
}
.rays {
  position: absolute;
  z-index: -2;
  left: 50%; top: 46%;
  width: max(220vmax, 1800px); aspect-ratio: 1;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, var(--ray-dark) 0deg 15deg, var(--ray-light) 15deg 30deg);
  animation: turn 240s linear infinite;
}
.hero::before { /* a soft light behind the crest and a darker edge, like a lantern-lit hall */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 50% 44%, rgb(255 236 150 / .32), transparent 34%),
    radial-gradient(ellipse at 50% 46%, transparent 42%, rgb(3 30 12 / .62) 100%);
}
.hero::after { /* gold ribbon edge into the parchment */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  background:
    linear-gradient(var(--shield-deep), var(--shield-deep)) bottom / 100% 4px no-repeat,
    linear-gradient(90deg, var(--gold-deep), var(--gold) 30%, #fff1b0 50%, var(--gold) 70%, var(--gold-deep));
}
@keyframes turn { to { rotate: 360deg; } }

.hero-inner { display: grid; justify-items: center; gap: clamp(14px, 2.4vh, 24px); }
.crest img {
  width: clamp(240px, 64vw, 440px);
  filter: drop-shadow(0 14px 22px rgb(0 0 0 / .45)) drop-shadow(0 0 2px rgb(0 0 0 / .4));
}
.tagline {
  font: 700 clamp(.95rem, 2.6vw, 1.35rem)/1.2 var(--serif);
  letter-spacing: .14em;
  color: var(--gold);
  text-shadow: 0 2px 0 var(--shield-deep), 0 0 18px rgb(0 0 0 / .55);
  padding: .5em 1.4em;
  background: linear-gradient(90deg, transparent, rgb(74 24 7 / .78) 14%, rgb(74 24 7 / .78) 86%, transparent);
  border-block: 2px solid rgb(246 207 74 / .65);
}
.indie { /* the studio's motto starts with what it is: an indie studio */
  display: block;
  font-size: 2.1em;
  line-height: 1;
  letter-spacing: .3em;
  margin: .02em 0 .14em .3em; /* the trailing letter-spacing would push it off centre */
  color: var(--rim);
  text-shadow: 0 2px 0 #0f4a63, 0 0 16px rgb(110 220 245 / .45), 0 0 2px rgb(0 0 0 / .6);
}

/* ------------------------------------------------------------------ section titles */

.games { padding-block: clamp(40px, 7vw, 80px) clamp(56px, 8vw, 96px); }
.section-title {
  display: flex; align-items: center; gap: 18px;
  justify-content: center;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--shield);
  letter-spacing: .06em;
  margin-bottom: clamp(24px, 4vw, 44px);
  text-align: center;
}
.section-title::before, .section-title::after {
  content: ""; flex: 1 1 0; max-width: 260px; height: 10px;
  background:
    radial-gradient(circle, var(--gold-deep) 0 3.5px, transparent 4px) center / 10px 10px no-repeat,
    linear-gradient(var(--gold-deep), var(--gold-deep)) center / 100% 2px no-repeat;
}
.section-title::before { background-position: right center, center; }
.section-title::after { background-position: left center, center; }

/* ------------------------------------------------------------------ game cards */

.cards {
  list-style: none;
  display: grid;
  gap: clamp(20px, 3vw, 36px);
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
.card {
  position: relative;
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--deep2) -20%, var(--deep) 55%);
  color: #fff;
  box-shadow: 0 0 0 2px rgb(200 149 43 / .85), 0 0 0 5px var(--parchment), 0 0 0 6px rgb(200 149 43 / .45),
              0 18px 30px -12px rgb(44 29 18 / .55);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); }
.card:hover .arrow { translate: 4px 0; }
.card-art {
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 1024 / 500;
  background: var(--deep);
}
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: scale .5s ease; }
.card:hover .card-art img { scale: 1.035; }
.card-body {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  column-gap: 16px;
  padding: 0 clamp(18px, 3vw, 28px) clamp(20px, 3vw, 28px);
}
.card-icon {
  grid-row: 1; grid-column: 1;
  width: clamp(76px, 18vw, 104px);
  margin-top: calc(clamp(76px, 18vw, 104px) * -.22);
  border-radius: 23%;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px var(--deep), 0 10px 18px rgb(0 0 0 / .4);
  background: var(--deep);
}
.card-title {
  grid-row: 1; grid-column: 2;
  align-self: end;
  padding-top: 12px;
  font-size: clamp(1.3rem, 3.2vw, 1.65rem);
  letter-spacing: .02em;
  text-shadow: 0 2px 6px rgb(0 0 0 / .35);
}
.card-link { text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: calc(-1 * 100vmax); }
.card { overflow: clip; overflow-clip-margin: 8px; }
.card-text { grid-column: 1 / -1; margin-top: 14px; color: rgb(255 255 255 / .9); }
.card-actions {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 18px;
  margin-top: 20px;
}
.more { font-weight: 700; color: var(--accent); white-space: nowrap; }
.arrow { display: inline-block; transition: translate .2s ease; }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 3px solid var(--gold); outline-offset: 8px; }

/* ------------------------------------------------------------------ buttons */

.btn {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: .55em;
  min-height: 48px;
  padding: .6em 1.15em .6em 1em;
  border-radius: 999px;
  font: 700 1.02rem/1.1 var(--sans);
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-play {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18), 0 4px 12px rgb(0 0 0 / .28);
}
.btn-icon { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }
.btn-big { font-size: 1.12rem; min-height: 54px; padding-inline: 1.3em 1.5em; }

/* ------------------------------------------------------------------ game page: top bar */

.topbar {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--ray-dark);
  border-bottom: 3px solid var(--gold-deep);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { position: relative; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--gold); }
.brand::before { /* small rays behind the crest, fading into the bar's green */
  content: ""; position: absolute; z-index: -1; left: 26px; top: 50%;
  width: 900px; aspect-ratio: 1; translate: -50% -50%;
  background: repeating-conic-gradient(var(--ray-dark) 0deg 15deg, var(--ray-light) 15deg 30deg);
  -webkit-mask-image: radial-gradient(circle, #000 40px, transparent 300px);
  mask-image: radial-gradient(circle, #000 40px, transparent 300px);
}
.brand img { width: 52px; filter: drop-shadow(0 3px 4px rgb(0 0 0 / .45)); }
.brand span {
  font: 700 1.2rem/1 var(--serif); letter-spacing: .08em;
  text-shadow: 0 2px 0 var(--shield-deep), 0 0 10px rgb(0 0 0 / .5);
}
.topbar-link {
  font-weight: 700; color: #fff; text-decoration: none;
  padding: 10px 16px; border-radius: 999px;
  background: rgb(5 38 17 / .55); border: 1px solid rgb(246 207 74 / .55);
}
.topbar-link:hover { background: rgb(5 38 17 / .8); }

/* ------------------------------------------------------------------ game page: hero */

.game { background: var(--parchment); }
.game-hero {
  color: #fff;
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--deep2) 70%, transparent), transparent 70%),
    var(--deep);
  padding-top: clamp(16px, 3vw, 36px);
}
.banner {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent), 0 24px 40px -18px rgb(0 0 0 / .7);
  aspect-ratio: 1024 / 500;
  background: var(--deep2);
}
.banner img { width: 100%; height: 100%; object-fit: cover; }
.game-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 8px 22px;
  padding: 0 clamp(4px, 2vw, 28px) clamp(26px, 4vw, 40px);
}
.game-icon {
  width: clamp(96px, 22vw, 150px);
  margin-top: calc(-1 * min(clamp(96px, 22vw, 150px) * .4, 4vw)); /* clear the art's tagline */
  border-radius: 23%;
  box-shadow: 0 0 0 4px var(--accent), 0 0 0 7px var(--deep), 0 14px 26px rgb(0 0 0 / .5);
  background: var(--deep);
  position: relative;
}
.game-head h1 { font-size: clamp(1.75rem, 5.5vw, 3rem); letter-spacing: .02em; text-shadow: 0 3px 10px rgb(0 0 0 / .4); }
.game-short { margin-top: 6px; font-size: clamp(1.05rem, 2.4vw, 1.25rem); color: rgb(255 255 255 / .9); max-width: 44ch; }
.game-head .btn-big { grid-column: 1 / -1; justify-self: start; margin-top: 14px; }
@media (min-width: 860px) {
  .game-head { grid-template-columns: auto 1fr auto; }
  .game-head .btn-big { grid-column: 3; align-self: center; margin-top: 0; }
}
@media (max-width: 520px) {
  .game-head { grid-template-columns: 1fr; justify-items: start; }
  .game-head .btn-big { justify-self: stretch; justify-content: center; }
}

/* ------------------------------------------------------------------ screenshots */

.shots {
  color: #fff;
  background: linear-gradient(var(--deep), color-mix(in srgb, var(--deep) 82%, #000));
  padding: 8px 0 clamp(32px, 5vw, 56px);
  border-bottom: 4px solid var(--gold-deep);
}
.shots-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.shots h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); letter-spacing: .06em; color: var(--accent); }
.shots-nav { display: flex; gap: 10px; }
.shots-nav[hidden] { display: none; }
.shots-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  background: rgb(0 0 0 / .25); color: #fff; font-size: 1.2rem; cursor: pointer;
}
.shots-btn:hover { background: rgb(0 0 0 / .45); }
.strip {
  list-style: none;
  display: flex;
  gap: clamp(12px, 2vw, 20px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  padding: 6px max(var(--gutter), (100vw - 1180px) / 2 + var(--gutter)) 18px;
  scroll-padding-inline: max(var(--gutter), (100vw - 1180px) / 2 + var(--gutter));
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 70%, transparent) transparent;
}
.strip li { flex: none; scroll-snap-align: start; }
.strip img {
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .18), 0 12px 24px -8px rgb(0 0 0 / .6);
  background: rgb(0 0 0 / .3);
}
.strip.portrait img { width: clamp(200px, 62vw, 270px); }
.strip.landscape img { width: clamp(280px, 86vw, 620px); }

/* ------------------------------------------------------------------ description */

.about { padding-block: clamp(32px, 6vw, 72px); }
.parchment {
  max-width: 780px;
  margin-inline: auto;
  background: #fffaf0;
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 56px);
  box-shadow: 0 0 0 1px var(--parchment-edge), 0 0 0 6px #fffaf0, 0 0 0 7px var(--parchment-edge),
              0 20px 40px -24px rgb(44 29 18 / .45);
}
.parchment h2 {
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  color: var(--deep);
  letter-spacing: .03em;
  margin-bottom: 18px;
}
.parchment h3 {
  font-size: clamp(1.02rem, 2.4vw, 1.15rem);
  letter-spacing: .05em;
  color: color-mix(in srgb, var(--deep2) 65%, #000);
  margin: 30px 0 10px;
  display: flex; gap: .5em; align-items: baseline;
}
.parchment h3 .mark { font-family: var(--sans); color: var(--gold-deep); }
.parchment p { margin-top: 10px; max-width: 66ch; }
.parchment .lead { font-size: 1.22rem; color: var(--ink); }
.parchment ul:not(.links) { margin-top: 8px; padding-left: 0; list-style: none; }
.parchment ul:not(.links) li { position: relative; padding-left: 1.4em; margin-top: 6px; color: var(--ink); }
.parchment ul:not(.links) li::before {
  content: ""; position: absolute; left: .2em; top: .62em;
  width: .5em; height: .5em; rotate: 45deg;
  background: var(--gold-deep);
}
.about-actions { margin-top: 32px; }
.links {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--parchment-edge);
}
.links a { color: var(--shield); font-weight: 700; text-underline-offset: 3px; }
.links a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ other games on a game page */

.others { padding-bottom: clamp(56px, 8vw, 96px); }
@media (min-width: 760px) {
  .cards-small { grid-template-columns: repeat(3, 1fr); }
  .cards-small .card-actions .more { display: none; }
}
.cards-small .card-text { font-size: 1rem; }
.cards-small .card-title { font-size: clamp(1.15rem, 2.4vw, 1.35rem); }
.cards-small .card-icon { width: 76px; margin-top: -17px; }

/* ------------------------------------------------------------------ footer */

.site-footer {
  background: linear-gradient(var(--shield), var(--shield-deep));
  color: #f7e6c4;
  border-top: 4px solid var(--gold-deep);
  padding-block: 36px 40px;
}
.footer-inner { display: grid; gap: 10px; justify-items: center; text-align: center; }
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  font: 700 1.15rem/1 var(--serif); letter-spacing: .08em;
  color: var(--gold); text-decoration: none;
}
.site-footer a:not(.footer-brand) { color: var(--gold); font-weight: 700; text-underline-offset: 3px; white-space: nowrap; }
.copy { font-size: .95rem; opacity: .8; }

/* ------------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rays { animation: none; }
  .card, .card-art img, .btn, .arrow { transition: none; }
  .card:hover { transform: none; }
  .card:hover .card-art img { scale: 1; }
}
