/* Arca Magica: one night sky, one star, one trail of light.
   The intro video is the only loud moment; everything else stays quiet. */

@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/static/fonts/jost-latin.woff2') format('woff2');
  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;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/static/fonts/jost-latin-ext.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost';
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url('/static/fonts/jost-italic-latin.woff2') format('woff2');
  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;
}
@font-face {
  font-family: 'Jost';
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url('/static/fonts/jost-italic-latin-ext.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --night: #04091a;     /* the intro's sky, matched to the video */
  --deep: #0a1230;      /* raised surfaces */
  --rim: #1c2856;       /* hairlines */
  --rim-bright: #33447f;
  --trail: #9cc2ff;     /* the light trail */
  --star: #eef3ff;      /* text */
  --mist: #8e98bb;      /* secondary text */
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

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

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--star);
  font: 400 18px/1.6 'Jost', system-ui, sans-serif;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* A faint, fixed starfield, the same sky the intro is set in. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #c9d8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 71% 9%, #c9d8ff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 38% 64%, #dfe8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 47%, #b7c9f5 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 83%, #b7c9f5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 58% 31%, #c9d8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 88%, #c9d8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 52%, #b7c9f5 50%, transparent 51%);
  background-size: 620px 540px;
}

main { flex: 1; }

img, video { max-width: 100%; display: block; }

a { color: var(--trail); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--star); }

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

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

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--star);
  color: var(--night);
  border-radius: 8px;
}
.skip:focus { top: 12px; }

/* --- header & footer ------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  background: rgb(4 9 26 / 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--star);
  text-decoration: none;
  /* Echoes the logotype: light, wide-set capitals. Used for the name only. */
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.brand img { border-radius: 22.5%; }

.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 30px); font-size: 16px; }
.site-nav a { color: var(--mist); text-decoration: none; }
.site-nav a:hover { color: var(--star); }
.site-nav .lang {
  padding: 4px 12px;
  border: 1px solid var(--rim-bright);
  border-radius: 999px;
  color: var(--star);
  font-size: 14px;
}

@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; row-gap: 6px; }
  .brand span { font-size: 13px; }
  .site-nav { width: 100%; justify-content: flex-start; font-size: 15px; }
  .site-nav .lang { margin-left: auto; }
}

.site-footer { border-top: 1px solid var(--rim); margin-top: 48px; }
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 40px;
  color: var(--mist);
  font-size: 15px;
}
.footer-brand { margin: 0; color: var(--star); letter-spacing: 0.24em; text-transform: uppercase; font-size: 13px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-inner nav a { color: var(--mist); text-decoration: none; }
.footer-inner nav a:hover { color: var(--star); }
.footer-note { margin: 0 0 0 auto; }
@media (max-width: 640px) { .footer-note { margin-left: 0; } }

/* --- shared ---------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid var(--trail);
  border-radius: 999px;
  color: var(--star);
  font-size: 16px;
  text-decoration: none;
  transition: background-color 0.15s;
}
.button:hover { background: rgb(156 194 255 / 0.12); color: var(--star); }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1em; }

.app-icon {
  flex: none;
  border-radius: 22.5%;
  object-fit: cover;
  background: var(--deep);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06), 0 10px 40px -8px color-mix(in oklab, var(--accent, var(--trail)) 45%, transparent);
}
.app-icon-blank {
  display: grid;
  place-items: center;
  color: var(--accent, var(--trail));
  font-size: 40px;
  font-weight: 300;
  border: 1px solid color-mix(in oklab, var(--accent, var(--trail)) 40%, var(--rim));
}

.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--rim-bright);
  color: var(--mist);
}
.status-coming_soon { border-color: var(--trail); color: var(--trail); }
.status-released { border-color: var(--star); background: var(--star); color: var(--night); }

.game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--mist); font-size: 15px; }

/* --- home: intro ---------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(calc(100svh - 64px), 900px);
  padding: 0 var(--gutter) 24px;
}

.intro {
  position: relative;
  width: min(100%, 1180px);
  aspect-ratio: 16 / 9;
}

.intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Feather the frame so the video melts into the page's sky. */
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%);
}

.hero-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2%;
  margin: 0 auto;
  max-width: 34ch;
  padding: 0 16px;
  text-align: center;
  color: var(--mist);
  font-weight: 300;
  font-size: clamp(17px, 1.9vw, 23px);
  line-height: 1.45;
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.intro-replay {
  position: absolute;
  right: var(--gutter);
  bottom: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rim-bright);
  border-radius: 50%;
  background: transparent;
  color: var(--mist);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.intro-replay:hover { color: var(--star); border-color: var(--trail); }
.intro-replay[data-playing] { color: var(--trail); border-color: var(--trail); }

/* While the intro plays, the line under the logo waits for it. */
.js .hero[data-state='playing'] .hero-line { opacity: 0; transform: translateY(8px); }

@media (max-aspect-ratio: 4/5) {
  .intro { width: auto; height: min(76svh, 860px); max-width: 100%; aspect-ratio: 9 / 16; }
  .hero-line { bottom: 6%; }
}

/* --- home: sections -------------------------------------------------------- */

.band {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 104px) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 3fr;
  gap: 16px 48px;
  align-items: start;
}
.band > h2 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.band > :not(h2) { grid-column: 2; }
@media (max-width: 760px) {
  .band { grid-template-columns: 1fr; }
  .band > :not(h2) { grid-column: 1; }
}

.contact-address { margin: 8px 0 0; font-size: clamp(22px, 2.6vw, 28px); font-weight: 300; }
.contact-address a { text-decoration: none; border-bottom: 1px solid var(--rim-bright); }
.contact-address a:hover { border-color: var(--trail); }

.empty-slot { display: flex; align-items: center; gap: 24px; color: var(--mist); max-width: 52ch; }
.empty-slot p { margin: 0; }
.slot {
  flex: none;
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 22.5%;
  border: 1.5px dashed var(--rim-bright);
}
/* The brand's four-point star, waiting in an empty app slot. */
.slot::before {
  content: '';
  position: absolute;
  inset: 26px;
  background: var(--trail);
  opacity: 0.6;
  clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%);
}

.game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}
.game-card a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 9%, var(--deep)), var(--deep));
  border: 1px solid color-mix(in oklab, var(--accent) 24%, var(--rim));
  transition: border-color 0.2s;
}
.game-card a:hover { border-color: color-mix(in oklab, var(--accent) 70%, var(--rim)); }
.game-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.game-card-body { display: flex; gap: 20px; padding: 22px; align-items: flex-start; }
.game-cover + .game-card-body { margin-top: -56px; }
.game-card h3 { margin: 4px 0 8px; font-weight: 400; font-size: 24px; line-height: 1.2; }
.game-cover + .game-card-body h3 { margin-top: 60px; }
.game-tagline { margin: 10px 0 0; color: var(--mist); }

/* --- game page --------------------------------------------------------------- */

.game-page { max-width: 1120px; margin: 0 auto; padding: 24px var(--gutter) 0; }
.game-banner { margin: 0 calc(var(--gutter) * -1); }
.game-banner img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(#000 45%, transparent 92%);
  mask-image: linear-gradient(#000 45%, transparent 92%);
}
@media (min-width: 1180px) { .game-banner { margin: 0; } .game-banner img { border-radius: 24px 24px 0 0; } }
.game-head { display: flex; gap: clamp(20px, 3vw, 36px); align-items: flex-end; margin-top: 32px; }
.game-head.has-banner { margin-top: clamp(-72px, -5vw, -32px); position: relative; }
.game-head h1, .game-head .game-tagline { text-shadow: 0 1px 18px rgb(4 9 26 / 0.9); }
.game-head h1 { margin: 0 0 6px; font-weight: 400; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; }
.game-head .game-tagline { margin: 0 0 14px; font-size: 20px; }
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
@media (max-width: 600px) {
  .game-head { flex-direction: column; align-items: flex-start; }
  .game-head .app-icon { width: 96px; height: 96px; }
}
.game-description { margin-top: 48px; font-size: 19px; }
.shots { margin: 48px calc(var(--gutter) * -1) 0; }
.shots ul {
  list-style: none;
  margin: 0;
  padding: 0 var(--gutter) 12px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--rim-bright) transparent;
}
.shots li { flex: none; scroll-snap-align: start; }
.shots img { height: clamp(280px, 52vh, 540px); width: auto; border-radius: 18px; border: 1px solid var(--rim); }
.game-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rim); font-size: 16px; }

/* --- long-form documents --------------------------------------------------- */

.doc {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px var(--gutter) 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}
.toc { position: sticky; top: 88px; font-size: 15px; line-height: 1.45; }
.toc p { margin: 0 0 12px; color: var(--mist); }
.toc ol, .toc ul { margin: 0; padding: 0 0 0 1.6em; display: grid; gap: 8px; color: var(--mist); }
.toc ul { list-style: none; padding: 0; }
.toc a { color: var(--star); text-decoration: none; }
.toc a:hover { color: var(--trail); }
@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; padding: 18px 20px; border: 1px solid var(--rim); border-radius: 16px; }
  .toc ol, .toc ul { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); column-gap: 24px; }
}

.doc-body { max-width: var(--measure); }
.doc-body h1 { margin: 0; font-weight: 300; font-size: clamp(38px, 5vw, 56px); line-height: 1.08; }
.updated { margin: 12px 0 0; color: var(--mist); font-size: 16px; }
.doc-intro { margin-top: 28px; font-size: 20px; line-height: 1.55; color: #d6def5; }
.doc-body section { margin-top: 52px; }
.doc-body h2 { margin: 0 0 14px; font-weight: 400; font-size: 26px; line-height: 1.25; }
.doc-body h3 { margin: 28px 0 6px; font-weight: 500; font-size: 18px; }
.doc-body h4 { margin: 20px 0 4px; font-weight: 500; font-size: 17px; color: var(--mist); }
.doc-body p, .doc-body li { color: #dbe2f7; }
.doc-body p { margin: 0 0 1em; }
.doc-body ul, .doc-body ol { margin: 0 0 1em; padding-left: 1.3em; }
.doc-body li { margin-bottom: 0.45em; padding-left: 0.2em; }
.doc-body li::marker { color: var(--mist); }
.doc-body strong { font-weight: 500; color: var(--star); }

.doc-body.numbered { counter-reset: section; }
.doc-body.numbered section > h2::before {
  counter-increment: section;
  content: counter(section) '.';
  display: inline-block;
  min-width: 1.7em;
  color: var(--mist);
  font-weight: 300;
}

.game-privacy { margin-top: 28px; padding-top: 4px; }
.game-privacy + .game-privacy { border-top: 1px solid var(--rim); padding-top: 24px; }
.game-privacy h3 { font-size: 21px; font-weight: 400; margin-top: 0; }
.game-privacy h3 a { color: var(--star); text-decoration: none; }
.meta { color: var(--mist); font-size: 16px; }

.table-wrap { overflow-x: auto; margin: 0 0 1em; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rim); }
thead th { color: var(--mist); font-weight: 400; font-size: 14px; white-space: nowrap; }
tbody th { font-weight: 500; min-width: 9em; }
td { color: #dbe2f7; }
td:last-child { white-space: nowrap; }

details { border-bottom: 1px solid var(--rim); }
details:first-of-type { border-top: 1px solid var(--rim); }
summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 40px 16px 0;
  position: relative;
  font-size: 19px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 1.5px solid var(--mist);
  border-bottom: 1.5px solid var(--mist);
  translate: 0 -75%;
  rotate: 45deg;
  transition: rotate 0.2s;
}
details[open] summary::after { rotate: 225deg; translate: 0 -25%; }
details > :not(summary) { margin-top: 0; padding-bottom: 8px; }

.contact-card {
  margin: 0 0 28px;
  padding: 24px 26px;
  border: 1px solid var(--rim-bright);
  border-radius: 20px;
  background: linear-gradient(160deg, rgb(156 194 255 / 0.07), transparent 60%);
}
.contact-card .contact-address { margin: 0 0 16px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }

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

.not-found { max-width: 640px; margin: 0 auto; padding: 18vh var(--gutter) 0; text-align: center; }
.not-found h1 { font-weight: 300; font-size: 44px; margin: 0 0 8px; }
.not-found p { color: var(--mist); }

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