:root {
  --bg: #f6f4ef;
  --bg-alt: #eeebe3;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-soft: #55534e;
  --line: #dcd7cc;
  --accent: #e8502e;
  --accent-soft: #ff6b4a;
  --sun: #ffd166;
  --radius: 18px;
  --radius-sm: 10px;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
  --max: 1120px;
  --narrow: 680px;
  --shadow: 0 1px 2px rgba(29,29,31,.04), 0 12px 32px -12px rgba(29,29,31,.14);
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 .5em; font-weight: 800; }
p { margin: 0 0 1em; }

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

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: var(--radius-sm); text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { width: 100%; max-width: var(--narrow); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,244,239,.85);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-mark { width: 32px; height: 32px; transition: transform .4s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 6px;
  width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer; border-radius: var(--radius-sm);
}
.nav-toggle .bar { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease); }
.nav-toggle[aria-expanded="true"] .bar:first-of-type { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:last-of-type { transform: translateY(-4px) rotate(-45deg); }

.site-nav {
  position: absolute; top: 68px; left: 0; right: 0;
  background: var(--bg); border-bottom: 1px solid var(--line);
  display: none;
}
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: .5rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .25rem; }
.site-nav a { display: block; padding: .7rem 0; text-decoration: none; font-weight: 600; color: var(--ink-soft); transition: color .2s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.nav-cta { color: var(--ink) !important; }

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .site-nav { position: static; display: block; background: none; border: 0; }
  .site-nav ul { flex-direction: row; align-items: center; padding: 0; gap: 2rem; }
  .site-nav a { padding: .4rem 0; font-size: .95rem; }
  .nav-cta { padding: .55rem 1.1rem !important; border: 1.5px solid var(--ink); border-radius: 999px; transition: background .2s, color .2s !important; }
  .nav-cta:hover { background: var(--ink); color: var(--bg) !important; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.5rem; border-radius: 999px; font: inherit; font-weight: 700; font-size: .95rem;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: transform .25s var(--ease), background .2s, color .2s, box-shadow .25s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(29,29,31,.5); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* Hero */
.hero { padding: 4rem 0 3rem; overflow: hidden; position: relative; }
.hero-inner { position: relative; z-index: 1; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.4rem, 9vw, 4.8rem); max-width: 14ch; }
.accent-text { color: var(--accent); font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.lede { font-size: clamp(1.05rem, 2.4vw, 1.25rem); color: var(--ink-soft); max-width: 36rem; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-phone { width: 180px; margin: 3rem auto 0; filter: drop-shadow(0 30px 40px rgba(29,29,31,.22)); transform: rotate(6deg); }
.floaty { transform-origin: 120px 200px; animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 900px) {
  .hero { padding: 6rem 0 5rem; }
  .hero-phone { position: absolute; right: max(2rem, calc((100vw - var(--max)) / 2 + 2rem)); top: 50%; width: 240px; margin: 0; transform: translateY(-50%) rotate(6deg); }
  .hero-phone.is-visible { transform: translateY(-50%) rotate(6deg); }
}

/* Sections */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 40rem; margin-bottom: 2.5rem; }
.section-head h2, .section h2 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }

/* Games */
.games-grid { display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .games-grid { grid-template-columns: repeat(3, 1fr); } }
.game-card {
  background: var(--surface); border-radius: var(--radius); padding: 1.75rem;
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 1.25rem;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.app-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 18px -8px rgba(29,29,31,.35); transition: transform .4s var(--ease); }
.game-card:hover .app-icon { transform: rotate(-6deg) scale(1.06); }
.game-card h3 { font-size: 1.35rem; margin-bottom: .2rem; }
.meta { font-size: .85rem; color: var(--ink-soft); font-weight: 600; margin-bottom: .8rem; }
.game-card p:not(.meta):not(.price) { color: var(--ink-soft); }
.price { font-weight: 700; font-size: .9rem; margin: 0; padding-top: .9rem; border-top: 1px dashed var(--line); }

/* Notes / articles list */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter {
  font: inherit; font-weight: 600; font-size: .9rem; padding: .45rem 1rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: all .2s;
}
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.article-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.article-item { border-bottom: 1px solid var(--line); }
.article-item[hidden] { display: none; }
.article-item a {
  display: grid; grid-template-columns: 2.5rem 1fr; gap: .25rem 1rem; padding: 1.6rem 0;
  text-decoration: none; position: relative;
}
.article-num { font-weight: 700; color: var(--accent); font-size: .9rem; padding-top: .3rem; font-variant-numeric: tabular-nums; }
.article-body { display: flex; flex-direction: column; gap: .35rem; }
.article-title { font-size: clamp(1.2rem, 3vw, 1.55rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; transition: color .2s; }
.article-excerpt { color: var(--ink-soft); max-width: 44rem; }
.article-meta { grid-column: 2; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.article-item a:hover .article-title { color: var(--accent); }
.article-item a::after {
  content: "→"; position: absolute; right: 0; top: 1.6rem; font-size: 1.3rem; opacity: 0; transform: translateX(-8px);
  transition: opacity .25s, transform .25s var(--ease); color: var(--accent);
}
.article-item a:hover::after { opacity: 1; transform: translateX(0); }
@media (min-width: 760px) {
  .article-item a { grid-template-columns: 4rem 1fr 9rem; padding: 2rem 2.5rem 2rem 0; align-items: start; }
  .article-meta { grid-column: 3; text-align: right; padding-top: .35rem; }
  .article-item a::after { top: 2rem; }
}

/* Studio */
.studio-grid { display: grid; gap: 2.5rem; }
.lede-sm { font-size: 1.15rem; }
.studio-grid p:not(.lede-sm) { color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.stats dt { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.stats dd { margin: .25rem 0 0; font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; }
@media (min-width: 860px) { .studio-grid { grid-template-columns: 1.2fr 1fr; align-items: center; gap: 4rem; } }

/* Contact */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1.1fr; gap: 4rem; } }
.contact-grid > div > p { color: var(--ink-soft); font-size: 1.1rem; }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
.contact-list li { display: flex; flex-direction: column; }
.contact-list span { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.contact-list a { font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: 1.1rem; }
@media (min-width: 560px) { .contact-form { padding: 2rem; } }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 700; font-size: .9rem; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--bg); width: 100%;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .9rem;
  transition: border-color .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #bfb8a9; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px rgba(232,80,46,.25); }
.field [aria-invalid="true"] { border-color: #c0392b; }
.error { color: #b02a1c; font-size: .85rem; font-weight: 600; margin: 0; min-height: 0; }
.error:empty { display: none; }
.contact-form .btn { justify-self: start; }
.form-success { margin: 0; padding: .9rem 1rem; border-radius: var(--radius-sm); background: #e3f1e6; color: #1f5e34; font-weight: 600; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; font-size: .9rem; color: var(--ink-soft); }
.footer-inner { display: flex; flex-direction: column; gap: 1rem; }
.footer-inner p { margin: 0; }
.footer-inner ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
.footer-inner a { text-decoration: none; font-weight: 600; }
.footer-inner a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 640px) { .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; } }

/* Article page */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.article { padding: 3rem 0 4rem; }
.article-header { margin-bottom: 2.5rem; }
.back-link { display: inline-block; font-size: .9rem; font-weight: 600; color: var(--ink-soft); text-decoration: none; margin-bottom: 2rem; transition: color .2s, transform .2s; }
.back-link:hover { color: var(--ink); transform: translateX(-3px); }
.article-header h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); }
.article-byline { color: var(--ink-soft); font-size: .95rem; margin: 0; }

.article-content { font-family: var(--font-serif); font-size: 1.2rem; line-height: 1.7; }
.article-content p, .article-content li { color: #2a2927; }
.article-content h2 { font-family: var(--font-sans); font-size: 1.45rem; margin: 2.4rem 0 .8rem; }
.article-content ul, .article-content ol { padding-left: 1.3rem; margin: 0 0 1.4rem; }
.article-content li { margin-bottom: .6rem; }
.article-content li::marker { color: var(--accent); font-family: var(--font-sans); font-weight: 700; }
.article-content strong { font-weight: 500; color: var(--ink); }
.dropcap::first-letter {
  float: left; font-size: 3.6em; line-height: .85; padding: .08em .1em 0 0; color: var(--accent); font-weight: 500;
}
.article-content blockquote {
  margin: 2rem 0; padding: .5rem 0 .5rem 1.4rem; border-left: 3px solid var(--accent);
  font-style: italic; font-size: 1.35rem; line-height: 1.5;
}
.article-content blockquote p { color: var(--ink); margin: 0; }
.figure { margin: 2rem 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.figure figcaption { font-family: var(--font-sans); font-size: .85rem; color: var(--ink-soft); margin-top: .75rem; text-align: center; }

.table-wrap { overflow-x: auto; margin: 1.5rem 0 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: .95rem; }
caption { text-align: left; padding: 1rem 1.1rem .5rem; font-weight: 700; font-size: .85rem; color: var(--ink-soft); }
th, td { padding: .75rem 1.1rem; text-align: left; border-top: 1px solid var(--line); }
thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
tbody th { font-weight: 600; }
td { font-variant-numeric: tabular-nums; }

.article-nav { display: grid; gap: 1rem; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.article-nav a { display: block; text-decoration: none; font-weight: 700; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .2s, transform .25s var(--ease); }
.article-nav a:hover { border-color: var(--ink); transform: translateY(-2px); }
.article-nav small { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .2rem; }
.article-nav .next { text-align: right; }
@media (min-width: 640px) { .article-nav { grid-template-columns: 1fr 1fr; } }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .hero-phone.reveal { transform: translateY(18px) rotate(6deg); }
.js .hero-phone.reveal.is-visible { transform: rotate(6deg); }
@media (min-width: 900px) {
  .js .hero-phone.reveal { transform: translateY(calc(-50% + 18px)) rotate(6deg); }
  .js .hero-phone.reveal.is-visible { transform: translateY(-50%) rotate(6deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
