/* KaputLabs — site styles
   Fonts are self-hosted (no Google servers) to keep the site GDPR-friendly. */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 400; font-display: swap; src: url("fonts/bricolage-400.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("fonts/bricolage-800.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 400; font-display: swap; src: url("fonts/space-mono-400.woff2") format("woff2"); }

:root {
  --ink: #17161C;
  --ink-2: #222029;
  --line: #34313B;
  --paper: #FBFAF7;
  --paper-2: #EDEAE3;
  --muted: #5A5750;
  --muted-on-ink: #B9B5AC;
  --crack: #F2551F;
  --crack-text: #C93F10;
  --lab: #22A39A;
  --display: "Bricolage Grotesque", "Arial Rounded MT Bold", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "Courier New", monospace;
  --wrap: 1120px;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--crack); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 40px);
  margin: 0 auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
h1, h2, h3 { line-height: 1; letter-spacing: -0.035em; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(36px, 6vw, 60px); font-weight: 800; }
h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 24px; letter-spacing: -0.04em; }
.brand img { width: 26px; height: auto; }
.brand .word > span { font-weight: 400; color: var(--muted-on-ink); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  font-family: var(--mono);
  font-size: 14px;
  text-decoration: none;
  color: var(--muted-on-ink);
  padding: 10px 12px;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { color: var(--paper); background: var(--ink-2); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--ink); }

/* ---------- hero ---------- */
.hero { background: var(--ink); color: var(--paper); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 40px; align-items: center; padding-block: 72px 96px; }
.hero h1 { white-space: nowrap; font-size: clamp(52px, 9.5vw, 118px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.88; }
.hero h1 .labs { font-weight: 400; color: var(--muted-on-ink); }
.hero h1 .t { display: inline-block; transform: rotate(-6deg); transform-origin: 50% 85%; }
.hero .lede { font-family: var(--mono); font-size: clamp(15px, 2vw, 18px); color: var(--muted-on-ink); margin-top: 28px; max-width: 34ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font-family: var(--mono); font-size: 15px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--crack); color: var(--ink); }
.btn-primary:hover { background: #FF6A36; }
.btn-ghost { border-color: var(--line); color: var(--paper); }
.btn-ghost:hover { border-color: var(--paper); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--ink-2); }

.hero-flask { width: 100%; max-width: 300px; justify-self: center; overflow: visible; }
.hero-flask * { transform-box: fill-box; }
.hero-flask .liquid { animation: slosh 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.hero-flask .bubble { animation: rise 2.4s ease-in infinite; }
.hero-flask .b2 { animation-delay: .8s; }
.hero-flask .b3 { animation-delay: 1.6s; }
.hero-flask .shard { animation: float 4s ease-in-out infinite; }
.hero-flask .s2 { animation-delay: -1.3s; }
.hero-flask .s3 { animation-delay: -2.6s; }
.hero-flask:hover .crack { animation: zap .5s steps(4, end); }
@keyframes slosh { 0%,100% { transform: skewY(0deg); } 25% { transform: skewY(-2.5deg); } 75% { transform: skewY(2.5deg); } }
@keyframes rise { 0% { transform: translateY(8px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }
@keyframes float { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(4px,-6px) rotate(12deg); } }
@keyframes zap { 0% { stroke-dashoffset: 80; } 100% { stroke-dashoffset: 0; } }
.hero-flask .crack { stroke-dasharray: 80; }

/* ---------- sections ---------- */
section { padding-block: 96px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.section-head p { color: var(--muted); max-width: 46ch; }

/* games */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.game-card { background: var(--paper-2); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; }
.game-art {
  aspect-ratio: 4 / 3; background: var(--ink); color: var(--muted-on-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 14px; text-align: center; padding: 16px;
  background-image: repeating-linear-gradient(135deg, transparent 0 18px, rgba(255,255,255,.03) 18px 36px);
}
.game-art img { width: 100%; height: 100%; object-fit: cover; }
.game-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.status {
  align-self: flex-start; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; background: var(--paper); color: var(--crack-text); border: 1px solid #E6B3A0;
}
.game-body p { color: var(--muted); font-size: 16px; }
.stores { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.store {
  font-family: var(--mono); font-size: 13px; text-decoration: none;
  padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center;
  border-radius: 12px; background: var(--ink); color: var(--paper);
}
.store[aria-disabled="true"] { background: transparent; color: var(--muted); border: 1px dashed #BDB8AE; pointer-events: none; }
.game-card.empty { background: transparent; border: 2px dashed #CFCAC0; justify-content: center; align-items: center; padding: 40px; text-align: center; min-height: 280px; }
.game-card.empty p { color: var(--muted); font-family: var(--mono); font-size: 14px; }

/* about */
.about { background: var(--paper-2); }
.about .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.about-copy { display: flex; flex-direction: column; gap: 20px; font-size: 20px; max-width: 60ch; }
.principles { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.principles li { background: var(--paper); border-radius: 18px; padding: 20px 22px; display: grid; gap: 6px; }
.principles strong { font-size: 20px; letter-spacing: -0.02em; }
.principles span { color: var(--muted); font-size: 16px; }

/* press */
.press-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.press-video { border-radius: 24px; overflow: hidden; background: var(--ink); aspect-ratio: 16 / 9; }
.press-video video { width: 100%; height: 100%; object-fit: contain; background: var(--ink); }
.downloads { list-style: none; padding: 0; margin: 0; border-top: 1px solid #D9D4CA; }
.downloads li { border-bottom: 1px solid #D9D4CA; }
.downloads a { display: flex; justify-content: space-between; gap: 16px; padding: 16px 4px; text-decoration: none; min-height: 44px; align-items: center; }
.downloads a:hover { color: var(--crack-text); }
.downloads small { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin-top: 32px; font-size: 16px; }
.facts dt { font-family: var(--mono); font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-top: 3px; }
.facts dd { margin: 0; }

/* contact */
.contact { background: var(--crack); color: var(--ink); }
.contact .wrap { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.contact h2 { max-width: 14ch; }
.mail { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mail code { font-family: var(--mono); font-size: clamp(18px, 3vw, 26px); background: var(--paper); padding: 12px 18px; border-radius: 14px; }

/* footer */
.site-footer { background: var(--ink); color: var(--muted-on-ink); padding-block: 48px calc(48px + env(safe-area-inset-bottom, 0px)); font-family: var(--mono); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.site-footer nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; }
.site-footer a:hover { color: var(--paper); background: var(--ink-2); }

/* legal pages */
.legal { padding-block: 72px 96px; }
.legal .wrap { max-width: calc(760px + 40px); }
.legal h1 { font-size: clamp(44px, 8vw, 72px); font-weight: 800; margin-bottom: 12px; }
.legal h2 { font-size: 28px; margin: 48px 0 12px; letter-spacing: -0.02em; }
.legal h3 { font-size: 20px; margin: 28px 0 8px; }
.legal p, .legal li { color: #2E2C33; font-size: 17px; }
.legal p + p { margin-top: 12px; }
.legal address { font-style: normal; line-height: 1.7; }
.todo {
  background: #FFF1EB; border: 1px solid #F2B79F; border-radius: 16px; padding: 18px 20px; margin: 24px 0;
  font-family: var(--mono); font-size: 14px; color: #7A2A0C;
}
.ph { background: #FFE3D6; color: #7A2A0C; padding: 1px 6px; border-radius: 6px; font-family: var(--mono); font-size: .9em; }

/* 404 */
.notfound { min-height: 70vh; display: flex; align-items: center; }
.notfound .wrap { display: grid; gap: 24px; justify-items: start; }
.notfound h1 { font-size: clamp(72px, 16vw, 180px); font-weight: 800; letter-spacing: -0.05em; line-height: .85; }

/* responsive */
@media (max-width: 860px) {
  .hero .wrap, .about .wrap, .press-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-flask { max-width: 200px; justify-self: start; order: -1; }
  section { padding-block: 72px; }
  .nav a:not(.keep) { display: none; }
}

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