/* ==========================================================
   Nazar Games — site styles
   Palette: nazar boncuğu (cobalt / pearl / sky / pupil) on night
   ========================================================== */

@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-latin.woff2") format("woff2-variations"),
       url("fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
  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: "Bricolage";
  src: url("fonts/bricolage-latin-ext.woff2") format("woff2-variations"),
       url("fonts/bricolage-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Base */
  --night: #070c22;      /* page background — deep navy, not black */
  --night-2: #0c1636;    /* raised surfaces */
  --footer: #03061a;     /* footer band — a step darker than the page */
  --line: rgba(158, 184, 255, 0.14);

  /* Nazar bead */
  --cobalt: #2d5be8;     /* outer glass */
  --cobalt-deep: #173a9e;
  --pearl: #eef3ff;      /* white ring */
  --sky: #74cbf4;        /* light-blue ring */
  --pupil: #02040c;      /* centre */

  /* Text */
  --text: #e9eeff;
  --muted: #9ba9d2;
  --faint: #7f8db8;

  --font: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.6;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--sky); color: var(--night); }

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* ---------- Hero (no header bar: fills the first screen) ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;            /* older browsers */
  flex: 1 0 auto;
  display: flex;
  align-items: center;
}
@supports (overflow: clip) {
  .hero { overflow: visible; overflow-x: clip; }
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  padding-top: clamp(56px, 11vh, 128px);
  padding-bottom: clamp(56px, 11vh, 128px);
}

.hero__copy { max-width: 34rem; }

.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(2.75rem, 6.4vw, 5.25rem);
  line-height: 0.98;
  font-weight: 700;
  font-stretch: 92%;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}

.lede {
  margin: 0 0 36px;
  max-width: 28rem;
  color: var(--muted);
  font-size: clamp(1.125rem, 1.5vw, 1.3125rem);
  line-height: 1.55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn--primary {
  background: var(--cobalt);
  color: #fff;
}
.btn--primary:hover { background: #3a68f2; }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: rgba(158, 184, 255, 0.4); }

/* ==========================================================
   The bead
   site.js sets these on .bead-stage while the eye reacts:
     --m          0 → 1   morph from nazar to angry evil eye
     --tint       0 → .75 red build-up from quick pokes
     --red-halo / --blue-halo / --glint   matching glow levels
   ========================================================== */

.bead-stage {
  position: relative;
  display: grid;
  place-items: center;
}

/* faint blue ripples around the bead */
.bead-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 190%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(45, 91, 232, 0.28) 0%, rgba(45, 91, 232, 0.08) 32%, transparent 60%),
    repeating-radial-gradient(circle, transparent 0 47px, rgba(158, 184, 255, 0.07) 48px 49px);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 68%);
          mask: radial-gradient(circle, #000 30%, transparent 68%);
  opacity: var(--blue-halo, 1);
  pointer-events: none;
}

/* red glow, rises with anger */
.bead-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 190%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 32, 18, 0.34) 0%, rgba(225, 32, 18, 0.09) 32%, transparent 60%);
  opacity: var(--red-halo, 0);
  pointer-events: none;
}

.bead {
  position: relative;
  width: clamp(220px, 34vw, 420px);
  height: clamp(220px, 34vw, 420px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--cobalt) 0 58%, #2550d6 74%, var(--cobalt-deep) 100%);
  box-shadow:
    inset 14px 18px 36px rgba(255, 255, 255, 0.10),
    inset -18px -24px 48px rgba(2, 4, 12, 0.45);
  animation: bead-in 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* no double-tap zoom when poking the eye */
}
.bead.is-poking { cursor: pointer; }

/* blue under-glow (separate layer so it can fade out as the eye turns red) */
.bead::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  box-shadow: 0 40px 90px -30px rgba(45, 91, 232, 0.65);
  opacity: var(--blue-glow, 1);
  pointer-events: none;
}

/* Layers are absolutely centred (no aspect-ratio needed → works on older Safari) */
.bead__white,
.bead__iris,
.bead__pupil,
.bead__shape,
.bead__anger {
  position: absolute;
  border-radius: 50%;
}

.bead__white {
  top: 20%; left: 20%; width: 60%; height: 60%;
  background: radial-gradient(circle at 42% 38%, #ffffff 0%, var(--pearl) 55%, #d9e3fb 100%);
  box-shadow: inset -6px -8px 18px rgba(23, 58, 158, 0.18);
  will-change: transform;
}

.bead__iris {
  top: 16%; left: 16%; width: 68%; height: 68%;
  background: radial-gradient(circle at 45% 40%, #9bdcfa 0%, var(--sky) 55%, #4fb0e2 100%);
  will-change: transform;
}

.bead__pupil {
  z-index: 1;
  top: 23%; left: 23%; width: 54%; height: 54%;
  will-change: transform;
}

/* the pupil's visible shape: a circle that can morph into a slit */
.bead__shape {
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at 33% 47%, #0d1430 0%, var(--pupil) 60%);
  transform: rotate(45deg);
}

/* glass highlight */
.bead__glint {
  position: absolute;
  top: 11%;
  left: 19%;
  width: 26%;
  height: 13%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%);
  transform: rotate(-32deg);
  filter: blur(1px);
  opacity: var(--glint, 1);
  pointer-events: none;
}

/* red tint that floods the nazar as it gets annoyed */
.bead__anger {
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle, #ff3218 0%, #d8140a 70%, #9a0b06 100%);
  mix-blend-mode: color;
  opacity: var(--tint, 0);
  pointer-events: none;
}

@keyframes bead-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- Easter egg: the angry evil eye ----------
   Red layers sit on top of the blue ones and fade in with --m,
   so the change is a smooth cross-fade in both directions.
   They only exist while the eye is (becoming) angry (.is-hot). */

.is-hot .bead::before,
.is-hot .bead__white::before,
.is-hot .bead__iris::before,
.is-hot .bead__iris::after,
.is-hot .bead__shape::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  opacity: var(--m, 0);
  pointer-events: none;
}

/* outer glass → dark crimson */
.is-hot .bead::before {
  background: radial-gradient(circle at 50% 50%, #200606 0 58%, #160404 74%, #070101 100%);
  box-shadow:
    inset 14px 18px 36px rgba(255, 90, 70, 0.05),
    inset -18px -24px 48px rgba(0, 0, 0, 0.6),
    0 40px 100px -30px rgba(230, 34, 20, 0.6);
}

/* white ring → outer red iris */
.is-hot .bead__white::before {
  background:
    repeating-conic-gradient(from 0deg, rgba(255, 170, 120, 0) 0deg, rgba(255, 170, 120, 0.1) 1.2deg, rgba(255, 170, 120, 0) 2.4deg, rgba(255, 170, 120, 0) 4deg),
    radial-gradient(circle closest-side, #f01c0e 0%, #c9130a 52%, #7a0905 78%, #1c0202 100%);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.65);
}

/* blue iris → glowing red-orange */
.is-hot .bead__iris::before {
  /* fully opaque, ending in the outer ring's red at this radius → no blue edge, no seam */
  background: radial-gradient(circle closest-side, #ffe39a 0%, #ffa12e 14%, #ff4a18 36%, #f0220f 66%, #c3150b 86%, #9c0e07 100%);
}

/* iris fibres: soft rays that fade out before the centre (no moiré) */
.is-hot .bead__iris::after {
  background:
    repeating-conic-gradient(from 0deg, rgba(255, 225, 170, 0) 0deg, rgba(255, 225, 170, 0.28) 1deg, rgba(255, 225, 170, 0) 2deg, rgba(255, 225, 170, 0) 3.6deg),
    repeating-conic-gradient(from 1.7deg, rgba(120, 0, 0, 0) 0deg, rgba(120, 0, 0, 0.22) 1.2deg, rgba(120, 0, 0, 0) 2.4deg, rgba(120, 0, 0, 0) 5deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 22%, #000 52%, #000 82%, transparent 100%);
          mask: radial-gradient(circle closest-side, transparent 22%, #000 52%, #000 82%, transparent 100%);
}

/* slit pupil fill + glow (the shape itself is morphed by site.js) */
.is-hot .bead__shape::after {
  border-radius: inherit;
  background: radial-gradient(ellipse at center, #050000 0%, #160000 60%, #3d0402 100%);
  box-shadow: 0 0 0 2px rgba(255, 110, 50, 0.35), 0 0 18px 4px rgba(255, 50, 20, 0.6);
}

/* ---------- Hero copy entrance ---------- */

.hero__copy > * {
  animation: copy-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero__copy > *:nth-child(2) { animation-delay: 0.08s; }
.hero__copy > *:nth-child(3) { animation-delay: 0.16s; }

@keyframes copy-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Footer (darker band, Grand Games–style stack) ---------- */

.site-footer {
  background: var(--footer);
  border-top: 1px solid rgba(158, 184, 255, 0.07);
}
.site-footer .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 36px;
  padding-bottom: 36px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: -4px -14px 10px;   /* margins instead of flex gap: works on older Safari */
  padding: 0;
  list-style: none;
}
.footer-links li { margin: 4px 14px; }
.footer-links a,
.footer-links button {
  display: inline-block;
  line-height: 1.6;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.2s ease;
}
.footer-links a:hover,
.footer-links button:hover,
.footer-links a[aria-current="page"] { color: var(--text); }

.copyright {
  margin: 0;
  color: var(--faint);
  font-size: 0.875rem;
}

/* ---------- Legal documents ---------- */

.doc {
  max-width: 46rem;
  padding-top: clamp(56px, 10vh, 112px);
  padding-bottom: 96px;
}

.doc h1 {
  margin: 0 0 12px;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.04;
  font-weight: 700;
  font-stretch: 90%;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 72;
}

.doc .effective {
  margin: 0 0 40px;
  color: var(--muted);
}

.doc .intro {
  font-size: 1.125rem;
  color: var(--text);
}

.doc h2 {
  margin: 56px 0 14px;
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 32;
  scroll-margin-top: 24px;
}

.doc h3 {
  margin: 32px 0 8px;
  font-size: 1.0625rem;
  font-weight: 650;
}

.doc p, .doc li { color: #d3dbf5; }
.doc p { margin: 0 0 16px; }
.doc ul { margin: 0 0 16px; padding-left: 1.25rem; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--sky); }
.doc strong { color: var(--text); font-weight: 650; }

.doc a {
  color: var(--sky);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.doc a:hover { text-decoration-thickness: 2px; }

.toc {
  margin: 0 0 8px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 22, 54, 0.6);
}
.toc p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.4rem;
  columns: 2 16rem;
  column-gap: 32px;
}
.toc li { margin: 0 0 6px; break-inside: avoid; font-size: 0.95rem; }
.toc li::marker { color: var(--faint); }
.doc .toc a { color: var(--text); text-decoration: none; }
.doc .toc a:hover { color: var(--sky); }

.table-wrap {
  margin: 8px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}
.doc th, .doc td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: #d3dbf5;
}
.doc th {
  color: var(--text);
  font-weight: 650;
  background: rgba(12, 22, 54, 0.8);
}
.doc tr:last-child td { border-bottom: 0; }

@media (max-width: 640px) {
  .doc table, .doc thead, .doc tbody, .doc tr, .doc td { display: block; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .doc tr:last-child { border-bottom: 0; }
  .doc td { padding: 4px 0; border: 0; }
  .doc td::before {
    content: attr(data-label);
    display: block;
    color: var(--faint);
    font-size: 0.85rem;
  }
}

/* ---------- Cookie consent ---------- */

.consent {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  max-width: 460px;
  margin-left: auto;
  padding: 20px 20px 18px;
  background: var(--night-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}
.consent[hidden] { display: none; }
.consent h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 650;
}
.consent p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.consent p a { color: var(--sky); text-underline-offset: 3px; }
.consent__actions {
  display: flex;
  flex-wrap: wrap;
  margin: -5px;
}
.consent__actions .btn { margin: 5px; }
.consent .btn { min-height: 42px; padding: 0 18px; font-size: 0.9375rem; }

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

/* Phones in portrait (and very narrow screens): eye on top, text below */
@media (max-width: 699px) and (orientation: portrait), (max-width: 559px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 48px;
  }
  .bead-stage { order: -1; justify-self: start; }
  .bead {
    width: clamp(180px, 52vw, 260px);
    height: clamp(180px, 52vw, 260px);
  }
  .bead-stage::before,
  .bead-stage::after { width: 220%; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: clamp(2.5rem, 12vw, 3.25rem); }
}

/* Phones in landscape (short screens): side by side, eye sized to the screen height */
@media (orientation: landscape) and (max-height: 520px) {
  .hero .wrap {
    gap: 32px;
    padding-top: 28px;
    padding-bottom: 28px;
  }
  .bead {
    width: clamp(150px, 62vh, 300px);
    height: clamp(150px, 62vh, 300px);
  }
  .hero h1 { font-size: clamp(2rem, 5.4vw, 3.25rem); margin-bottom: 16px; }
  .lede { font-size: 1rem; margin-bottom: 22px; }
}

/* Very old browsers without clamp() (e.g. iOS 12 iPads): fixed sizes */
@supports not (width: clamp(1px, 1vw, 2px)) {
  :root { --gutter: 24px; }
  .hero .wrap { gap: 48px; padding-top: 80px; padding-bottom: 80px; }
  .hero h1 { font-size: 4rem; }
  .lede { font-size: 1.25rem; }
  .bead { width: 320px; height: 320px; }
  .doc { padding-top: 80px; }
  .doc h1 { font-size: 3rem; }
  @media (max-width: 699px) {
    .bead { width: 220px; height: 220px; }
    .hero h1 { font-size: 3rem; }
  }
}

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