/* Layout: a calm single-column reading width (68ch) for prose, widening to a 1120px grid for game and app cards.
   Palette: one dark theme on near-black, with the logo's sky blue as the single accent. Flat colors only, no gradients.
   Text colors are picked for strong contrast on the dark background (body text ~17:1, muted text ~8:1). */
:root {
  --paper: #0A0A0B;
  --surface: #141416;
  --surface-2: #1C1C1F;
  --ink: #F5F5F7;
  --ink-2: #D6D6DB;
  --muted: #A8A8B0;
  --line: #2A2A2F;
  --line-strong: #45454D;
  --accent: #3DA9FC;
  --accent-ink: #050505;
  --accent-soft: #0F2233;
  --sun: #FFC53D;
  --mint: #34D399;
  --coral: #FF7A66;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 20px;
  --max: 1120px;
  --prose: 68ch;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; text-wrap: balance; color: var(--ink); margin: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: calc(var(--prose) + 40px); }
.section { padding-block: clamp(48px, 8vw, 88px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 8px; margin-bottom: 28px; max-width: 60ch; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; flex: none; transition: transform 0.25s; }
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.08); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-dim { color: var(--muted); font-weight: 500; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 6px 12px; border-radius: 999px; }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 700 0.95rem var(--font-body); padding: 12px 20px; border-radius: 14px; text-decoration: none; border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface-2); cursor: pointer; transition: transform 0.12s, background-color 0.12s, border-color 0.12s; }
.btn:hover { transform: translateY(-2px); border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #6BBEFD; border-color: #6BBEFD; }
.btn[aria-disabled="true"] { opacity: 0.6; cursor: default; transform: none; }

/* Store badges */
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.store-badge { display: inline-flex; align-items: center; gap: 10px; min-width: 176px; padding: 9px 18px 9px 14px; border-radius: 14px; background: #000000; color: #FFFFFF; text-decoration: none; border: 1px solid var(--line-strong); transition: transform 0.12s, border-color 0.12s; }
.store-badge:hover { transform: translateY(-2px); border-color: var(--ink-2); }
.store-badge:active { transform: translateY(1px); }
.store-badge[aria-disabled="true"] { opacity: 0.55; transform: none; }
.store-badge .store-logo { width: 26px; height: 26px; flex: none; }
.store-badge span { display: grid; line-height: 1.1; }
.store-badge small { font-size: 0.68rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-2); }
.store-badge b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }

/* Hero */
.hero { padding-block: clamp(48px, 9vw, 104px) clamp(40px, 7vw, 72px); position: relative; }
.hero-grid { display: grid; gap: 40px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; }
.hero h1 { max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-lede { font-size: 1.15rem; color: var(--ink-2); max-width: 52ch; margin-top: 20px; }
.hero .actions { margin-top: 28px; }

/* Floating icon cluster */
.icon-cluster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 380px; margin-inline: auto; }
.cluster-tile { display: block; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); padding: 10px; transition: transform 0.25s; animation: bob 5s ease-in-out infinite; }
.cluster-tile .app-icon { width: 100%; height: auto; aspect-ratio: 1; border-radius: 20px; display: block; }
.cluster-tile:hover { transform: scale(1.08) rotate(0deg) !important; }
.t1 { transform: rotate(-8deg); animation-delay: 0s; }
.t2 { transform: rotate(5deg) translateY(18px); animation-delay: -1.2s; }
.t3 { transform: rotate(-3deg); animation-delay: -2.4s; }
.t4 { transform: rotate(6deg); animation-delay: -0.6s; }
.t5 { transform: rotate(-6deg) translateY(18px); animation-delay: -1.8s; }
.t6 { transform: rotate(4deg); animation-delay: -3s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: clamp(36px, 6vw, 56px) 0 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; display: grid; gap: 2px; }
.facts dt { color: var(--muted); font-size: 0.8rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.facts dd { margin: 0; font-weight: 700; font-family: var(--font-display); font-size: 1.15rem; }

/* App and game cards */
.app-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.app-card { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform 0.2s, border-color 0.2s; overflow: hidden; }
.app-card[hidden] { display: none; }
.app-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.app-card-link { display: grid; height: 100%; grid-template-rows: auto 1fr auto; color: inherit; text-decoration: none; }
.app-card-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 20px 0; }
.app-card-top .app-icon { transition: transform 0.25s; }
.app-card:hover .app-card-top .app-icon { transform: rotate(-6deg) scale(1.06); }
.kind { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px solid currentColor; }
.is-game .kind { background: #2A2208; color: var(--sun); }
.app-card-body { padding: 14px 20px 0; display: grid; gap: 6px; align-content: start; }
.app-card-body p { color: var(--ink-2); }
.app-card h3 { font-size: 1.25rem; }
.app-card-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 16px 20px 20px; }
.app-card-foot .meta-line { margin-left: auto; }
.app-icon { width: 56px; height: 56px; border-radius: 16px; flex: none; object-fit: cover; box-shadow: 0 0 0 1px var(--line-strong); }
.tag { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-strong); }
.tag-ios { color: var(--ink); }
.meta-line { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.next-note { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; color: var(--ink-2); display: grid; align-content: center; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.filters[hidden] { display: none; }
.filter { font: 700 0.95rem var(--font-body); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: transform 0.12s; }
.filter:hover { transform: translateY(-1px); border-color: var(--ink-2); color: var(--ink); }
.filter span { font-family: var(--font-mono); font-size: 0.78rem; opacity: 0.8; margin-left: 2px; }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Principles */
.principles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.principle { display: grid; gap: 8px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.principle p { color: var(--ink-2); }
.principle .num { font-family: var(--font-display); font-weight: 700; font-size: 1rem; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }

/* Contact band */
.contact-band { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); border-radius: 28px; padding: clamp(28px, 5vw, 52px); display: grid; gap: 16px; }
.contact-band h2 { color: var(--ink); }
.contact-band p { color: var(--ink-2); max-width: 52ch; }

/* App page */
.app-hero-wrap { border-bottom: 1px solid var(--line); }
.app-title { display: flex; align-items: center; gap: 18px; margin: 22px 0 18px; }
.app-title .app-icon { width: 96px; height: 96px; border-radius: 24px; border: 1px solid var(--line); }
.app-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; margin-top: 2px; }
.media-wrap { margin-top: clamp(32px, 5vw, 48px); }
.media { margin: 0; border-radius: 24px; overflow: hidden; background: #000000; border: 1px solid var(--line-strong); aspect-ratio: 16 / 9; }
.media > img, .media iframe, .yt { width: 100%; height: 100%; display: block; border: 0; }
.media > img, .yt img { object-fit: cover; width: 100%; height: 100%; }
.yt { position: relative; cursor: pointer; }
.yt-btn { position: absolute; inset: 0; margin: auto; width: 76px; height: 54px; border-radius: 16px; background: #FF0033; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); transition: transform 0.15s; }
.yt-btn::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-style: solid; border-width: 11px 0 11px 19px; border-color: transparent transparent transparent #FFFFFF; transform: translateX(2px); }
.yt:hover .yt-btn { transform: scale(1.1); }
.feature-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 6px; align-content: start; transition: transform 0.2s, border-color 0.2s; }
.feature p { color: var(--ink-2); }
.feature:hover { transform: translateY(-3px); border-color: var(--accent); }
.feature h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); margin-right: 10px; transform: rotate(45deg) translateY(-2px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); padding: 6px 12px; border-radius: 999px; font-size: 0.92rem; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.faq details[open] { border-color: var(--line-strong); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }
.faq details p { margin-top: 10px; color: var(--ink-2); }
.note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 0.95rem; color: var(--ink-2); }

/* Prose */
.prose { max-width: var(--prose); color: var(--ink-2); }
.prose strong, .prose th { color: var(--ink); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); color: var(--ink); padding: 2px 5px; border-radius: 5px; }
.prose pre { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; font-size: 0.88rem; line-height: 1.55; }
.prose pre code { background: none; padding: 0; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 6px; }
.prose img { border-radius: 10px; }
.table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; }
.page-head { padding-block: clamp(48px, 8vw, 80px) 24px; display: grid; gap: 14px; }
.page-head p.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 60ch; }
.post-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.breadcrumbs { font-size: 0.85rem; color: var(--muted); }
.breadcrumbs a { color: var(--ink-2); }

/* Blog */
.post-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.post-card { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform 0.2s, border-color 0.2s; }
.post-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.post-card-link { display: grid; height: 100%; grid-template-rows: auto 1fr; color: inherit; text-decoration: none; }
.post-card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }
.post-card-body { padding: 20px; display: grid; gap: 8px; align-content: start; }
.post-card-body h3 { font-size: 1.25rem; }
.post-card-body p.muted { color: var(--ink-2); }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.draft-flag { color: var(--sun); font-weight: 700; text-transform: uppercase; }
.post-hero { margin: 0 0 32px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-strong); background: #000000; }
.post-hero img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.post-hero-media { margin-bottom: 32px; }
.post-app { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px; margin-bottom: 32px; }
.post-app-head { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }
.post-app-head > span { display: grid; gap: 2px; }
.post-app-head b { font-family: var(--font-display); font-size: 1.2rem; }
.post-app-head:hover b { color: var(--accent); }
.post-app .store-badges { margin-top: 18px; }
.post-foot { border-top: 1px solid var(--line); padding-block: 24px 64px; display: grid; gap: 4px; }

/* Contact */
.email-box { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.email-box code { font-family: var(--font-mono); font-size: 1.05rem; color: var(--ink); user-select: all; word-break: break-all; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); padding-block: 36px; }
.footer-brand { font-family: var(--font-display); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.footer-brand img { border-radius: 50%; }
.social { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.social a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); transition: transform 0.15s, color 0.15s, border-color 0.15s; }
.social a:hover { transform: translateY(-3px); color: var(--accent); border-color: var(--accent); }
.social-lg { margin: 0; gap: 12px; }
.social-lg a { width: 52px; height: 52px; }
.social-lg svg { width: 24px; height: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; align-content: start; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .icon-cluster { max-width: 320px; gap: 14px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .app-title .app-icon { width: 76px; height: 76px; border-radius: 20px; }
  body { font-size: 16px; }
}
@media (max-width: 560px) {
  .header-inner { padding-block: 10px; }
  .site-nav { width: 100%; justify-content: space-between; gap: 0; }
  .site-nav a { padding: 6px 9px; font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
