/* Sunny Source — shared site styles.
   Colors come from the games' own world: dusk indigo, rose, sunstone gold. */

:root {
  --night: #1d1440;
  --night-2: #261a55;
  --violet: #3b2b85;
  --rose: #c2557a;
  --gold: #ffcf1f;
  --gold-deep: #b37a00;
  --ink: #efe9ff;
  --ink-dim: #b9acdf;
  --line: rgba(239, 233, 255, 0.14);

  --display: 'Fredoka', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.333rem;
  --step-2: 1.777rem;
  --step-3: 2.369rem;
  --step-4: 3.157rem;
}

* { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--body);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 207, 31, 0.16), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 55%, #3a1f52 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #ffe58a; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(var(--step-3), 6vw, var(--step-4)); font-weight: 700; }
h2 { font-size: var(--step-2); margin-top: 2.2em; }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1em; max-width: 62ch; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 var(--step-1)/1 var(--display);
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 34px; height: 34px; }
.site-head nav a {
  color: var(--ink-dim);
  text-decoration: none;
  margin-left: 18px;
  white-space: nowrap;
}
.site-head nav a:hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-block;
  font: 600 var(--step-1)/1 var(--display);
  padding: 18px 28px 20px;
  border-radius: 18px;
  text-decoration: none;
  color: #4a2a00;
  background: var(--gold);
  box-shadow: 0 6px 0 var(--gold-deep);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { color: #4a2a00; background: #ffd94a; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-deep); }
.btn.secondary {
  color: var(--ink);
  background: var(--violet);
  box-shadow: 0 6px 0 #1d1450;
}
.btn.secondary:hover { background: #4836a0; color: var(--ink); }

/* Product page layout: sticky phone with the live game + scrolling details */
.product {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
  padding: 24px 0 80px;
}
.product > * { min-width: 0; }
.stage { position: sticky; top: 24px; }
.phone {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 38px;
  padding: 12px;
  background: #0e0a24;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.08),
    0 30px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 120px -30px rgba(255, 207, 31, 0.35);
}
.phone iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 28px;
  display: block;
  background: #241a5c;
}
.stage-note {
  margin: 14px 4px 0;
  font-size: var(--step--1);
  color: var(--ink-dim);
  text-align: center;
  max-width: none;
}

.lede { font-size: var(--step-1); color: var(--ink); line-height: 1.5; }

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 28px;
  list-style: none;
}
.platforms li {
  font-size: var(--step--1);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
}

/* Offer box */
.offer {
  margin: 8px 0 12px;
  padding: 28px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 207, 31, 0.14), rgba(194, 85, 122, 0.14));
  border: 1px solid rgba(255, 207, 31, 0.35);
}
.offer h2 { margin-top: 0; }
.offer .actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 18px; }
.offer .addr { font-family: var(--mono); font-size: var(--step--1); color: var(--ink-dim); user-select: all; }

/* File tree */
.tree {
  font: 400 0.95rem/1.75 var(--mono);
  background: rgba(14, 10, 36, 0.6);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  overflow-x: auto;
  white-space: pre;
  color: var(--ink);
}
.tree .c { color: var(--ink-dim); }

/* Steps (a real sequence) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 56px;
  max-width: 62ch;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 var(--step-0)/1 var(--display);
  color: #4a2a00;
  background: var(--gold);
}
.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 40px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}

.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 8px 0 0;
}
.shots img {
  width: 100%;
  border-radius: 16px;
  display: block;
  border: 1px solid var(--line);
}

details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
  max-width: 66ch;
}
details:last-of-type { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer;
  font: 600 var(--step-0)/1.4 var(--display);
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; float: right; color: var(--gold); font-size: 1.3em; line-height: 1; }
details[open] summary::after { content: '–'; }
details p { margin: 10px 0 0; color: var(--ink-dim); }

/* Catalog */
.hero { padding: 40px 0 24px; }
.hero h1 { max-width: 16ch; }
.hero p { font-size: var(--step-1); color: var(--ink-dim); max-width: 46ch; }

.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; padding: 24px 0 80px; }
.item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  padding: 18px;
  border-radius: 30px;
  background: rgba(59, 43, 133, 0.35);
  border: 1px solid var(--line);
}
.item:hover { background: rgba(59, 43, 133, 0.55); color: var(--ink); }
.item img { width: 150px; border-radius: 20px; display: block; }
.item h2 { margin: 0 0 6px; font-size: var(--step-2); }
.item p { margin: 0 0 10px; color: var(--ink-dim); }
.item .go { font: 600 var(--step-0)/1 var(--display); color: var(--gold); }

.how { padding: 8px 0 80px; max-width: 760px; }

.site-foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--ink-dim);
  font-size: var(--step--1);
}
.site-foot p { max-width: none; }

@media (max-width: 860px) {
  .product { grid-template-columns: 1fr; }
  .stage { position: static; max-width: 360px; margin-inline: auto; width: 100%; }
  .shots { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .item { grid-template-columns: 1fr; }
  .item img { width: 100%; }
  .site-head nav a:not(:last-child) { display: none; }
  .offer { padding: 22px; }
}

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