/* Puzzion — ShuTong Studio */

:root {
  --bg: #f6f4ef;
  --surface: #fffdf8;
  --fg: #1b1b1f;
  --muted: #64636a;
  --line: #e3dfd6;
  --a: #ff6b4a;
  --b: #3d7bff;
  --c: #ffc93c;
  --d: #2fbf8f;
  --shadow: 0 1px 2px rgba(27, 27, 31, .04), 0 12px 32px -12px rgba(27, 27, 31, .14);
  --radius: 22px;
  --max: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --surface: #1a1a1d;
    --fg: #f2f1ee;
    --muted: #9a99a1;
    --line: #2a2a2f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
main { flex: 1; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Brand mark ---------- */
.mark {
  display: grid;
  grid-template-columns: repeat(2, var(--s, 12px));
  gap: calc(var(--s, 12px) / 4.5);
  flex: none;
}
.mark span { width: var(--s, 12px); height: var(--s, 12px); border-radius: calc(var(--s, 12px) / 3.6); }
.mark span:nth-child(1) { background: var(--a); }
.mark span:nth-child(2) { background: var(--b); }
.mark span:nth-child(3) { background: var(--c); }
.mark span:nth-child(4) { background: var(--d); border-radius: calc(var(--s, 12px) / 3.6) calc(var(--s, 12px) / 3.6) calc(var(--s, 12px) / 2) calc(var(--s, 12px) / 3.6); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.brand-sub { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  transition: color .15s, background-color .15s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); background: var(--surface); }
@media (max-width: 560px) {
  .brand-sub { display: none; }
  .site-nav a { padding: 8px 9px; font-size: 14px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s, background-color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--muted); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:focus-visible, .site-nav a:focus-visible, .text-link:focus-visible { outline: 3px solid var(--b); outline-offset: 3px; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 96px; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 56px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--d); }
.hero h1 {
  margin-top: 22px;
  font-size: clamp(44px, 7vw, 76px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}
.hero h1 .hl { color: var(--a); }
.hero-lead { margin-top: 22px; font-size: clamp(18px, 2.2vw, 20px); color: var(--muted); max-width: 36ch; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.board {
  --cell: clamp(40px, 6.2vw, 62px);
  display: grid;
  grid-template-columns: repeat(6, var(--cell));
  gap: calc(var(--cell) / 7);
  width: max-content;
  margin-left: auto;
  padding: calc(var(--cell) / 3.2);
  border-radius: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.board span {
  width: var(--cell);
  height: var(--cell);
  border-radius: 28%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.board span[class] { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12); animation: settle 700ms cubic-bezier(.2, .8, .2, 1) both; }
.board .c-a { background: var(--a); }
.board .c-b { background: var(--b); }
.board .c-c { background: var(--c); }
.board .c-d { background: var(--d); }
.board span:nth-child(6n+1) { animation-delay: 0ms; }
.board span:nth-child(6n+2) { animation-delay: 60ms; }
.board span:nth-child(6n+3) { animation-delay: 120ms; }
.board span:nth-child(6n+4) { animation-delay: 180ms; }
.board span:nth-child(6n+5) { animation-delay: 240ms; }
.board span:nth-child(6n) { animation-delay: 300ms; }
@keyframes settle {
  from { opacity: 0; transform: translateY(-16px) scale(.92); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 860px) {
  .hero { padding: 40px 0 72px; }
  .hero .container { grid-template-columns: 1fr; gap: 44px; }
  .board { margin: 0 auto; --cell: min(44px, calc((100vw - 40px - 48px) / 7.4)); }
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(32px, 4.6vw, 46px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 18px; }
@media (max-width: 560px) { .section { padding: 64px 0; } }

/* ---------- Genres ---------- */
.genres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.genre {
  --accent: var(--b);
  position: relative;
  padding: 24px 24px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s;
}
.genre::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.genre:hover { transform: translateY(-3px); }
.genre-art { color: var(--fg); margin-bottom: 20px; }
.genre-art svg { display: block; width: 100%; max-width: 168px; height: auto; margin: 0 auto; }
.art-grid rect { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.genre h3 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.genre p { margin-top: 8px; color: var(--muted); font-size: 16px; }
.art-pop { transform-box: fill-box; transform-origin: center; animation: pop 2.8s ease-in-out infinite; }
.art-slide { animation: slide 2.8s ease-in-out infinite; }
@keyframes pop { 0%, 60%, 100% { transform: scale(1); } 75% { transform: scale(1.18); } }
@keyframes slide { 0%, 55% { transform: none; opacity: 1; } 80% { transform: translateY(-26px); opacity: 0; } 81% { transform: none; opacity: 0; } 100% { opacity: 1; } }
.games-cta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 22px 28px;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}
.games-cta p { font-size: 18px; font-weight: 600; }
@media (max-width: 980px) { .genres { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .genres { grid-template-columns: 1fr; }
  .genre-art svg { max-width: 140px; }
  .games-cta { padding: 20px; }
  .games-cta .btn { width: 100%; justify-content: center; }
}

/* ---------- Studio ---------- */
.studio { border-top: 1px solid var(--line); }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.value { padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.value .dot { width: 14px; height: 14px; border-radius: 4px; margin-bottom: 18px; }
.value h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.value p { margin-top: 8px; color: var(--muted); font-size: 16px; }
@media (max-width: 860px) { .values { grid-template-columns: 1fr; } }

/* ---------- Contact band ---------- */
.contact-band { padding: 0 0 96px; }
.contact-card {
  padding: 56px 48px;
  border-radius: 30px;
  background: var(--fg);
  color: var(--bg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.contact-card h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; }
.contact-card p { margin-top: 10px; opacity: .72; max-width: 46ch; }
.contact-card .btn-primary { background: var(--bg); color: var(--fg); }
@media (max-width: 560px) {
  .contact-band { padding-bottom: 64px; }
  .contact-card { padding: 36px 24px; border-radius: 24px; }
  .contact-card .btn { width: 100%; justify-content: center; }
}

/* ---------- Legal & contact pages ---------- */
.page { padding: 56px 0 96px; }
.page .container { max-width: 800px; }
.page-head { padding-bottom: 28px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(36px, 6vw, 52px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.08; }
.page-meta { margin-top: 14px; color: var(--muted); font-size: 15px; }
.prose h2 { margin: 44px 0 12px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.prose h3 { margin: 24px 0 8px; font-size: 18px; font-weight: 700; }
.prose p, .prose ul, .prose table { margin-bottom: 14px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a, .text-link { color: var(--b); text-decoration: underline; text-underline-offset: 3px; }
.prose .callout { padding: 20px 22px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0; }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { font-weight: 700; white-space: nowrap; }
.prose td:nth-child(2) { word-break: break-all; font-size: 14px; }
@media (max-width: 560px) { .prose th, .prose td { padding: 10px; } .prose th { white-space: normal; } }

.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.contact-item { padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.contact-item h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.contact-item p { margin-top: 8px; color: var(--muted); font-size: 16px; }
.contact-item .btn { margin-top: 18px; }
.contact-email { font-size: clamp(22px, 3.4vw, 28px); font-weight: 800; letter-spacing: -0.02em; text-decoration: none; word-break: break-all; }
.contact-email:hover { color: var(--a); }
.contact-item.wide { grid-column: 1 / -1; }
@media (max-width: 680px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 15px; color: var(--muted); }
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--fg); }
