/* Chess of Timur — site styles. Colors are the game's own (Theme.cs): night blue, board sand, gold for actions. */
:root {
  --night: #1C2230;
  --sand: #EEDDB8;
  --text: #F3E9D2;
  --text-dim: rgba(243, 233, 210, .66);
  --gold: #E9B949;
  --gold-deep: #C8902C;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: min(1040px, 100% - 32px);
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #F6CF6B; }
:focus-visible { outline: 3px solid #2EC4B6; outline-offset: 3px; border-radius: 6px; }

.wrap { width: var(--page); margin-inline: auto; }

/* ---------- Living background: Timurid star tiles drifting slowly, the two sides' lights moving,
   and small gold stars floating and twinkling around the title. ---------- */
.backdrop { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.backdrop .pattern {
  position: absolute;
  inset: -120px;
  background: url("/assets/img/girih.svg") 0 0 / 120px 120px;
  animation: drift 60s linear infinite;
  will-change: transform;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, #000 30%, transparent 85%);
}
.backdrop .glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 35% at 20% 20%, rgba(46, 196, 182, .20), transparent 70%),
    radial-gradient(40% 35% at 80% 60%, rgba(240, 120, 90, .15), transparent 70%);
  animation: sway-light 18s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes drift { to { transform: translate(120px, 120px); } }
@keyframes sway-light { from { transform: translate(-4%, -2%) rotate(0deg); } to { transform: translate(4%, 3%) rotate(6deg); } }

.sky { position: absolute; left: 0; right: 0; top: 0; height: 900px; z-index: -1; overflow: hidden; pointer-events: none; }
.sky i {
  position: absolute;
  width: var(--s);
  height: var(--s);
  background: url("/assets/img/yildiz.svg") center / contain no-repeat;
  opacity: 0;
  animation: twinkle var(--t) ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: translateY(12px) rotate(0deg) scale(.6); }
  50% { opacity: .7; transform: translateY(-12px) rotate(90deg) scale(1); }
}
.spin { animation: turn 24s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }

h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.05; margin: 0; font-variant-numeric: lining-nums; }

/* ---------- Header ---------- */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
}
.brand:hover { color: var(--text); }

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 34px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: #2A1B08;
  background: linear-gradient(180deg, #F2C95E, var(--gold-deep));
  box-shadow: 0 10px 28px rgba(233, 185, 73, .25);
  transition: transform .15s ease;
}
.btn:hover { color: #2A1B08; transform: translateY(-2px); }
.btn svg { width: 20px; height: 20px; }
.btn.small { padding: 9px 22px; font-size: 15px; box-shadow: none; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 0; text-align: center; }
h1 { font-size: clamp(46px, 7vw, 86px); }
h1 em { font-style: normal; color: var(--gold); }
.lead { margin: 18px auto 32px; max-width: 36em; color: var(--text-dim); font-size: 19px; }
.soon { margin: 18px 0 0; font-size: 14px; color: rgba(243, 233, 210, .45); }

/* The call to action: a slow glow, a light sweeping across, crossed swords that clash on hover. */
.cta { position: relative; overflow: hidden; padding: 19px 44px; font-size: 20px; letter-spacing: .02em; animation: glow 2.6s ease-in-out infinite; }
.cta::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  animation: sweep 3.2s ease-in-out infinite;
}
.cta .swords { width: 24px; height: 24px; transition: transform .3s ease; }
.cta:hover { transform: translateY(-3px) scale(1.04); }
.cta:hover .swords { animation: clash .5s ease-in-out 2; }
@keyframes glow {
  0%, 100% { box-shadow: 0 10px 28px rgba(233, 185, 73, .25), 0 0 0 0 rgba(233, 185, 73, .35); }
  50% { box-shadow: 0 14px 40px rgba(233, 185, 73, .45), 0 0 0 10px rgba(233, 185, 73, 0); }
}
@keyframes sweep { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes clash { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg) scale(1.1); } 60% { transform: rotate(10deg); } }

/* Entrance: the title, text and button rise in one after another. */
.rise { opacity: 0; animation: rise .8s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* The game view: big, lit from both sides, it tilts back into place and then floats. */
.stage {
  position: relative;
  width: min(720px, 100% - 32px);
  margin: 56px auto 0;
  perspective: 1600px;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 8% -4% -6%;
  z-index: -1;
  background:
    radial-gradient(closest-side at 25% 50%, rgba(46, 196, 182, .30), transparent),
    radial-gradient(closest-side at 75% 55%, rgba(240, 120, 90, .26), transparent);
  filter: blur(40px);
  animation: breathe 7s ease-in-out infinite;
}
.screen {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(238, 221, 184, .12);
  box-shadow: 0 50px 110px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: rotateX(16deg) translateY(60px) scale(.94);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1);
}
.stage.shown .screen { opacity: 1; transform: none; animation: float 7s ease-in-out 1.3s infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes breathe { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }

/* Lower parts rise in when reached; the pieces follow one by one, then sway gently. */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.shown { opacity: 1; transform: none; }

/* ---------- Three short points ---------- */
.points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 36px;
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-dim);
}
.points li::before { content: "◆"; margin-right: 10px; color: var(--gold); font-size: 12px; vertical-align: 2px; }

/* ---------- The new pieces ---------- */
.pieces {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 44px;
  margin: 56px 0 80px;
}
.pieces.reveal { transform: none; }
.pieces figure { margin: 0; text-align: center; opacity: 0; transform: translateY(30px) scale(.9); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .3, 1.3); }
.pieces.shown figure { opacity: 1; transform: none; }
.pieces.shown figure:nth-child(2) { transition-delay: .1s; }
.pieces.shown figure:nth-child(3) { transition-delay: .2s; }
.pieces.shown figure:nth-child(4) { transition-delay: .3s; }
.pieces.shown img { animation: sway 4s ease-in-out infinite; }
.pieces.shown figure:nth-child(2) img { animation-delay: -1s; }
.pieces.shown figure:nth-child(3) img { animation-delay: -2s; }
.pieces.shown figure:nth-child(4) img { animation-delay: -3s; }
.pieces figure:hover img { animation: hop .5s ease; }
@keyframes sway { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-3deg); } }
@keyframes hop { 0%, 100% { transform: none; } 40% { transform: translateY(-14px) rotate(6deg) scale(1.08); } }
.pieces img {
  display: block;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
  width: 84px;
  height: 84px;
  padding: 12px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--sand);
}
.pieces figcaption { font-family: var(--serif); font-weight: 700; font-size: 22px; }

/* ---------- Footer ---------- */
.site-footer { padding: 28px 0 40px; border-top: 1px solid rgba(238, 221, 184, .07); color: rgba(243, 233, 210, .45); font-size: 13px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; }
.site-footer a { color: var(--text-dim); }
.credits { max-width: 600px; }

/* ---------- Text pages (privacy, 404) ---------- */
.doc { max-width: 760px; padding: 40px 0 72px; }
.doc h1 { font-size: clamp(42px, 6vw, 60px); margin-bottom: 8px; }
.doc .updated { color: var(--text-dim); margin: 0 0 32px; }
.doc h2 { font-size: 30px; margin: 36px 0 10px; }
.doc p, .doc li { color: rgba(243, 233, 210, .86); }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid rgba(238, 221, 184, .1); }
.doc th { color: var(--text); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise, .reveal, .screen, .pieces figure { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand { font-size: 21px; }
  .hero { padding-top: 32px; }
  .lead { font-size: 17px; }
  .hero .cta { width: 100%; }
  .stage { width: calc(100% - 20px); margin-top: 40px; }
  .screen { border-radius: 12px; }
  .points { flex-direction: column; align-items: center; }
  .pieces { gap: 12px 14px; flex-wrap: nowrap; }
  .pieces img { width: 60px; height: 60px; padding: 9px; }
  .pieces figcaption { font-size: 17px; }
}
