/* NiaziStudio - shared styles.
   Changes here affect every page on the site. Edit only when asked. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --bg: #fbfbfd;
  --surface: #f5f5f7;
  --surface-hover: #efeff2;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #0066cc;
  --accent-hover: #0058b0;
  --on-accent: #ffffff;
  --bezel: #1d1d1f;
  --placeholder: #dcdce1;
  --header-bg: rgba(251, 251, 253, 0.72);

  --font: -apple-system, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing scale: 8px steps */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;
  --section: clamp(var(--space-10), 12vw, 144px);

  --radius-s: 12px;
  --radius-m: 20px;
  --radius-l: 28px;
  --container: 1040px;
  --gutter: var(--space-3);
  --header-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #1a1a1c;
    --surface-hover: #222225;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: rgba(255, 255, 255, 0.14);
    --accent: #2997ff;
    --accent-hover: #52a8ff;
    --on-accent: #001a33;
    --bezel: #2c2c2e;
    --placeholder: #3a3a3e;
    --header-bg: rgba(11, 11, 12, 0.72);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-2));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

.skip-link {
  position: absolute; left: var(--space-2); top: -64px; z-index: 100;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-s);
  background: var(--text); color: var(--bg);
}
.skip-link:focus { top: var(--space-1); }

.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;
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-weight: 600; }

.display {
  font-size: clamp(48px, 9vw, 96px);
  line-height: 1.03;
  letter-spacing: -0.04em;
}
.h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.h3 {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.lead {
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--muted);
}
.statement {
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.22;
  letter-spacing: -0.025em;
  font-weight: 600;
}
.small { font-size: 14px; line-height: 1.4; color: var(--muted); }
.muted { color: var(--muted); }

/* Marks an unfilled placeholder. Remove the span when real content is added. */
.todo {
  color: var(--muted);
  background: var(--surface);
  padding: 0.05em 0.4em;
  border-radius: 6px;
  font-size: 0.92em;
  font-weight: 400;
  letter-spacing: 0;
}

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

.section { padding-block: var(--section); }

/* A hairline above a section, aligned to the content edges. */
.ruled { padding-bottom: var(--section); }
.ruled > .container::before {
  content: "";
  display: block;
  border-top: 1px solid var(--line);
  margin-bottom: var(--section);
}

.split { display: grid; gap: var(--space-4); }
@media (min-width: 768px) {
  .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-6); }
}

main { display: block; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header { background: var(--bg); }
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.wordmark { display: inline-flex; align-items: center; min-height: 44px; }
.wordmark img { height: 20px; width: auto; }
.site-nav ul { display: flex; gap: var(--space-3); }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 14px; color: var(--text);
  opacity: 0.8; transition: opacity 0.2s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { opacity: 1; text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--space-6); }
.site-footer .container {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  font-size: 14px; color: var(--muted);
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); text-decoration: none; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--space-3);
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; transition: background-color 0.2s ease;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn[hidden] { display: none; }
.btn:disabled { opacity: 0.6; cursor: default; }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

.link-more::after { content: "\203A"; margin-left: 0.35em; display: inline-block; transition: transform 0.2s ease; }
.link-more:hover::after { transform: translateX(3px); }

.crumb { font-size: 14px; display: inline-block; margin-bottom: var(--space-4); }

/* ---------- App icon and device frames ---------- */
.app-icon {
  width: var(--icon-size, 96px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.37%;
  background: var(--placeholder);
}

.device {
  --shot-ratio: 1170 / 2532;
  padding: 4px;
  background: var(--bezel);
  border-radius: 30px;
}
.device img {
  width: 100%; height: auto;
  aspect-ratio: var(--shot-ratio);
  object-fit: cover;
  border-radius: 26px;
  background: var(--placeholder);
}

/* ---------- Home ---------- */
.hero { padding-top: clamp(var(--space-12), 16vw, 192px); padding-bottom: var(--section); }
.hero .lead { margin-top: var(--space-3); max-width: 22ch; }

.games-grid { display: grid; gap: var(--space-3); margin-top: var(--space-8); }
@media (min-width: 768px) {
  .games-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

.game-card {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: var(--space-8);
  min-height: 360px;
  padding: var(--space-5);
  background: var(--surface);
  border-radius: var(--radius-l);
  transition: background-color 0.25s ease;
}
.game-card:hover { background: var(--surface-hover); }
.game-card a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.game-card a:hover { text-decoration: none; }
.game-card h3 { color: var(--text); font-size: 32px; letter-spacing: -0.03em; line-height: 1.1; }
.game-card p { margin-top: var(--space-1); }
.game-card .link-more { display: inline-block; margin-top: var(--space-2); font-weight: 400; }

.tile-soon {
  display: flex; align-items: flex-end;
  min-height: 200px;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  color: var(--muted);
}
@media (min-width: 768px) { .tile-soon { min-height: 360px; } }

.contact-mail { font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -0.025em; font-weight: 600; word-break: break-word; }

/* ---------- Game page ---------- */
.game-hero { padding-top: clamp(var(--space-8), 10vw, var(--space-16)); padding-bottom: var(--section); }
.game-hero .app-icon { --icon-size: 128px; }
.game-hero h1 { margin-top: var(--space-4); }
.game-hero .lead { margin-top: var(--space-2); max-width: 28ch; }
.game-hero .actions { margin-top: var(--space-5); }

.feature-list { border-top: 1px solid var(--line); }
.feature-list li { padding-block: var(--space-3); border-bottom: 1px solid var(--line); }
.feature-list p { margin-top: 4px; color: var(--muted); max-width: 52ch; }

.shots {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: min(240px, 64vw);
  gap: var(--space-3);
  margin-top: var(--space-6);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: var(--space-2);
  scrollbar-width: thin;
}
.shots > * { scroll-snap-align: start; }
@media (min-width: 900px) {
  .shots { grid-auto-columns: calc((100% - 4 * var(--space-3)) / 5); overflow: visible; }
}

.link-rows { border-top: 1px solid var(--line); }
.link-rows a {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 64px; padding-block: var(--space-2);
  border-bottom: 1px solid var(--line);
  color: var(--text); font-size: 21px; letter-spacing: -0.015em; font-weight: 600;
}
.link-rows a::after { content: "\203A"; color: var(--muted); transition: transform 0.2s ease; }
.link-rows a:hover { text-decoration: none; }
.link-rows a:hover::after { transform: translateX(3px); }

/* ---------- Support ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; gap: var(--space-2); align-items: center;
  min-height: 64px; padding-block: var(--space-2);
  font-size: 19px; font-weight: 600; letter-spacing: -0.015em;
  cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 24px; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > :not(summary) { padding-bottom: var(--space-3); color: var(--muted); max-width: 56ch; }

.form { display: grid; gap: var(--space-3); max-width: 560px; }
.field { display: grid; gap: var(--space-1); }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea {
  width: 100%;
  padding: 14px var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.field textarea { min-height: 176px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.form .btn { justify-self: start; }
.form-status { min-height: 1.5em; font-size: 15px; color: var(--muted); }
.form-status[data-state="error"] { color: var(--text); }
.direct { margin-top: var(--space-6); }

/* ---------- Long-form text (privacy policy) ---------- */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--space-2); }
.prose h2 { margin-top: var(--space-6); font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; }
.prose h3 { margin-top: var(--space-4); font-size: 19px; letter-spacing: -0.01em; }
.prose ul { list-style: disc; padding-left: var(--space-3); }
.prose ol { list-style: decimal; padding-left: var(--space-3); }
.prose li + li { margin-top: var(--space-1); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose--legal h2 {
  margin-top: var(--space-6);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.page-head { padding-top: clamp(var(--space-8), 10vw, var(--space-16)); padding-bottom: var(--space-8); }
.page-head .lead { margin-top: var(--space-2); max-width: 32ch; }
.page-body { padding-bottom: var(--section); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(12px);
    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; scroll-behavior: auto !important; }
}
