/* NiaziStudio - styles for the studio pages (home, games, apps, company, stories, support, legal).
   Game and app pages (games/<name>/, apps/<name>/) do not use this file. */

/* ---------- Font ---------- */
@font-face { font-family: "Poppins"; src: url("/shared/fonts/poppins-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/shared/fonts/poppins-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/shared/fonts/poppins-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f3f3f6;
  --text: #17171a;
  --muted: #5d5d66;
  --glass: rgba(255, 255, 255, 0.52);
  --glass-solid: rgba(255, 255, 255, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --hairline: rgba(20, 20, 30, 0.11);
  --hover: rgba(20, 20, 30, 0.06);
  --shadow: 0 20px 48px -28px rgba(40, 44, 70, 0.28);
  --field-a: #cddaf1;
  --field-b: #f4dfcc;
  --field-c: #dcdde9;
  --placeholder: #dcdce1;

  --font: "Poppins", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --container: 1120px;
  --gutter: 24px;
  --r-s: 14px;
  --r-m: 22px;
  --r-l: 30px;
  --header-h: 80px;
}

/* Dark tokens: used when the visitor picks dark, or (without JavaScript) when the device is in dark mode. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0d;
  --text: #f4f4f6;
  --muted: #a4a4ae;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-solid: rgba(24, 24, 28, 0.9);
  --glass-edge: rgba(255, 255, 255, 0.11);
  --hairline: rgba(255, 255, 255, 0.12);
  --hover: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --field-a: #18233b;
  --field-b: #33251b;
  --field-c: #191922;
  --placeholder: #3a3a3e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0b0b0d;
    --text: #f4f4f6;
    --muted: #a4a4ae;
    --glass: rgba(255, 255, 255, 0.055);
    --glass-solid: rgba(24, 24, 28, 0.9);
    --glass-edge: rgba(255, 255, 255, 0.11);
    --hairline: rgba(255, 255, 255, 0.12);
    --hover: rgba(255, 255, 255, 0.08);
    --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
    --field-a: #18233b;
    --field-b: #33251b;
    --field-c: #191922;
    --placeholder: #3a3a3e;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 32px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Soft, still colour fields behind the page. They give the glass surfaces something to sit on. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(62vmax 48vmax at -6% -10%, var(--field-a), transparent 64%),
    radial-gradient(54vmax 44vmax at 106% 14%, var(--field-b), transparent 62%),
    radial-gradient(60vmax 46vmax at 46% 112%, var(--field-c), transparent 62%);
}
main { flex: 1; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--text); color: var(--bg); }

.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 100;
  padding: 10px 18px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass-solid);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    backdrop-filter: blur(24px) saturate(170%);
  }
}

/* ---------- Type ---------- */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.display { font-size: clamp(38px, 6.4vw, 80px); line-height: 1.05; letter-spacing: -0.04em; }
.h2 { font-size: clamp(26px, 3.4vw, 36px); }
.h3 { font-size: 20px; letter-spacing: -0.015em; }
.lead { font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.text-link { font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.text-link::after { content: "\2192"; transition: transform 0.25s ease; }
.text-link:hover::after { transform: translateX(4px); }
.inline-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.inline-link:hover { text-decoration-thickness: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-weight: 500; text-decoration: none; cursor: pointer;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-quiet { background: var(--hover); color: var(--text); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding: 12px var(--gutter) 0; }
.bar {
  position: relative; z-index: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--container); height: var(--header-h); margin-inline: auto;
  padding: 0 14px 0 26px;
  border-radius: var(--r-l);
}
/* The glass sits on a layer behind the bar's content, so the mobile menu can have its own glass. */
.bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--glass-solid); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .bar::before {
    background: var(--glass);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    backdrop-filter: blur(24px) saturate(170%);
  }
}
.brand { display: inline-flex; align-items: center; min-height: 56px; border-radius: 12px; text-decoration: none; }
/* The logo is a shape filled with the text colour, so it has no box and follows light and dark. */
.brand-mark {
  display: block; height: 46px; aspect-ratio: 868 / 457;
  background: var(--text);
  -webkit-mask: url("/shared/brand.svg") center / contain no-repeat;
  mask: url("/shared/brand.svg") center / contain no-repeat;
}
.header-actions { display: flex; align-items: center; gap: 4px; }
.nav ul { display: flex; align-items: center; gap: 2px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 20px;
  border-radius: 999px; font-size: 16px; font-weight: 500; text-decoration: none;
  transition: background-color 0.2s ease;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--hover); }

.icon-btn {
  display: none; align-items: center; justify-content: center;
  width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; transition: background-color 0.2s ease;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.js .theme-toggle { display: inline-flex; }
:root[data-theme="dark"] .icon-moon, :root[data-theme="light"] .icon-sun { display: none; }
.menu-toggle .icon-close, .menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 859px) {
  :root { --header-h: 68px; --gutter: 16px; }
  .bar { padding: 0 8px 0 18px; border-radius: 24px; }
  .brand-mark { height: 40px; }
  .js .menu-toggle { display: inline-flex; }
  .icon-btn { width: 48px; height: 48px; }
  /* With JavaScript: the links open as a panel under the bar. */
  .js .nav { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 8px); }
  .js .nav.is-open { display: block; }
  .js .nav ul {
    flex-direction: column; align-items: stretch; gap: 4px; padding: 10px; border-radius: 24px;
    background: var(--glass-solid); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
  }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .js .nav ul { -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); }
  }
  .js .nav a { min-height: 56px; padding: 0 20px; font-size: 18px; border-radius: 16px; }
  /* Without JavaScript: the links sit in a second row inside the bar. */
  html:not(.js) .bar { height: auto; flex-wrap: wrap; gap: 0; padding: 6px 8px 8px 10px; }
  html:not(.js) .brand { padding-left: 8px; }
  html:not(.js) .header-actions { width: 100%; }
  html:not(.js) .nav ul { flex-wrap: wrap; }
  html:not(.js) .nav a { min-height: 44px; padding: 0 14px; }
}

/* ---------- Sections ---------- */
.hero { padding: clamp(64px, 10vw, 128px) 0 clamp(40px, 6vw, 72px); }
.hero h1 { max-width: 13ch; }
.hero .lead { margin-top: 24px; max-width: 34ch; }

.section { padding: clamp(32px, 5vw, 56px) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }

.page-head { padding: clamp(56px, 8vw, 104px) 0 clamp(32px, 5vw, 56px); }
.page-head .lead { margin-top: 20px; max-width: 44ch; }
.page-body { padding-bottom: clamp(56px, 8vw, 104px); display: grid; gap: 24px; }

.panel { padding: clamp(24px, 4vw, 44px); }
.panel > * + * { margin-top: 16px; }
.panel p { max-width: 62ch; }
.split { display: grid; gap: 16px 48px; }
@media (min-width: 860px) { .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } .split > * + * { margin-top: 0; } }

/* ---------- Rail (the icon carousels on the home page) ---------- */
/* Plain centred row first: this is what shows without JavaScript, and for a single item. */
.rail-view { overflow-x: auto; }
.rail-track { display: flex; width: max-content; margin-inline: auto; }
.rail-item { flex: none; width: 164px; }
.rail-item a {
  display: grid; justify-items: center; gap: 12px; padding: 14px 10px;
  border-radius: var(--r-m); text-align: center; text-decoration: none;
}
.rail-item a:hover .app-icon { transform: translateY(-4px); }
.rail-name { font-size: 15px; font-weight: 500; line-height: 1.35; }

.app-icon {
  width: 112px; height: auto; aspect-ratio: 1; border-radius: 22.37%;
  background: var(--placeholder);
  transition: transform 0.3s ease;
}

/* Ring: set up by shared/site.js for two or more items. Each item is placed by the script;
   there is no panel around them. The sizes (--ring-*) are worked out in the script. */
.rail.is-ring .rail-view {
  position: relative; height: var(--ring-h); overflow: hidden;
  perspective: var(--ring-p);
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.rail.is-ring.is-dragging .rail-view { cursor: grabbing; }
.rail.is-ring.is-dragging .rail-item a { pointer-events: none; }
.rail.is-ring .rail-track {
  position: absolute; left: 50%; top: var(--ring-top); display: block; width: 0; height: 0; margin: 0;
}
.rail.is-ring .rail-item {
  position: absolute; left: calc(var(--ring-w) / -2); top: calc(var(--ring-ih) / -2);
  width: var(--ring-w); height: var(--ring-ih);
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
.rail.is-ring .rail-item a { -webkit-tap-highlight-color: transparent; }
.rail.is-ring .rail-item img { -webkit-user-drag: none; }
@media (max-width: 600px) {
  .rail-item { width: 132px; }
  .rail .app-icon { width: 92px; }
  .rail-name { font-size: 14px; }
}

/* ---------- Tiles (games and apps pages) ---------- */
.tiles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 24px; padding: 28px;
  transition: transform 0.3s ease;
}
.tile:hover { transform: translateY(-4px); }
.tile .app-icon { width: 144px; }
.tile h2 { font-size: 22px; }
.tile h2 a { text-decoration: none; }
.tile h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tile p { margin-top: 8px; color: var(--muted); }
.tile .text-link { margin-top: auto; }
.tile-ghost {
  display: flex; align-items: flex-end; min-height: 200px; padding: 28px;
  border: 1.5px dashed var(--hairline); border-radius: var(--r-l); color: var(--muted);
}

/* ---------- Lists inside panels ---------- */
.rows { border-top: 1px solid var(--hairline); }
.rows > li, .rows > div { padding: 16px 0; border-bottom: 1px solid var(--hairline); }
.rows h3 { font-size: 17px; letter-spacing: -0.01em; }
.rows p { margin-top: 2px; color: var(--muted); }
.facts > div { display: grid; gap: 2px 24px; }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 560px) { .facts > div { grid-template-columns: 220px 1fr; } }

.link-rows { border-top: 1px solid var(--hairline); }
.link-rows a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding: 12px 0; border-bottom: 1px solid var(--hairline);
  font-weight: 500; text-decoration: none;
}
.link-rows a::after { content: "\2192"; color: var(--muted); transition: transform 0.25s ease; }
.link-rows a:hover::after { transform: translateX(4px); }

.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding: 12px 0; font-weight: 500; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > p { padding-bottom: 20px; color: var(--muted); max-width: 60ch; }

.contact-mail { font-size: clamp(20px, 3.2vw, 32px); font-weight: 600; letter-spacing: -0.025em; text-decoration: none; overflow-wrap: anywhere; }
.contact-mail:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* ---------- Stories ---------- */
.stories { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.story { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 28px; transition: transform 0.3s ease; }
.story:hover { transform: translateY(-4px); }
.story h2 { font-size: 21px; }
.story h2 a { text-decoration: none; }
.story h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.story p { color: var(--muted); }
.article { max-width: 720px; }
.article > * + * { margin-top: 20px; }
.article h2 { margin-top: 44px; font-size: 26px; }
.article h3 { margin-top: 32px; font-size: 20px; }
.article ul { list-style: disc; padding-left: 22px; }
.article ol { list-style: decimal; padding-left: 22px; }
.article a { text-decoration: underline; text-underline-offset: 3px; }
.article img { border-radius: var(--r-m); }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--hairline); background: var(--glass-solid); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-footer { background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); }
}
.footer-top { display: grid; gap: 40px; padding: 56px 0 48px; }
.footer-brand .brand-mark { height: 52px; }
.footer-brand p { margin-top: 16px; max-width: 30ch; color: var(--muted); }
.footer-cols { display: grid; gap: 32px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-cols h2 { margin-bottom: 8px; font-size: 13px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); line-height: 1.65; }
.footer-cols a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; overflow-wrap: anywhere; }
.footer-cols a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px;
  padding: 24px 0 32px; border-top: 1px solid var(--hairline);
  font-size: 14px; color: var(--muted);
}
@media (min-width: 720px) { .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .footer-top { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; } }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
