/* getany.org — Any-co studio site.
   Light-theme polish so the site reads like the any-co desktop app (facts from Ty's EA):
   - LIGHT theme by default, no prefers-color-scheme dark switch for the page shell.
   - Full-bleed soft pastel gradient wash: pale blue top-left, lavender/pink right,
     peach bottom — layered radial-gradients over a near-white base.
   - Frosted translucent white surfaces (rgba(255,255,255,.6–.75) + backdrop blur),
     12–16px radii, thin light borders, soft shadows.
   - Geist + Geist Mono self-hosted; near-black text, small muted-grey secondary text;
     small grey section labels.
   - Monochrome accent: black rounded logo tile, black primary Play button. Pixel game
     logos and the game iframes stay on a dark/black backing (the games are dark).
   - The in-page game embed breaks out of the text column: a full-width section,
     16:9 dark wrapper, iframe at 100%. Games with a FIXED canvas (Caravan, 1152x648)
     are rendered at native size and scaled down to the wrapper via CSS transform.
   - Top nav (v3): hauntjob-style sticky frosted bar on every page — brand tile with an
     inline controller glyph, center links, black CTA, hamburger under 768px. */

@font-face {
  font-family: "Geist Variable";
  src: url(/fonts/geist-latin-wght-normal.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono Variable";
  src: url(/fonts/geist-mono-latin-wght-normal.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens: the app's light set only --- */

:root {
  --app-font-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
  --app-font-mono: "Geist Mono Variable", ui-monospace, monospace;

  --foreground: oklch(0.145 0 0);        /* near-black */
  --secondary-text: #52525b;             /* muted grey */
  --label-text: #71717a;                 /* small section labels */
  --hairline: rgba(24, 24, 27, 0.08);    /* thin light borders */
  --hairline-strong: rgba(24, 24, 27, 0.12);

  --ink: #0a0a0a;                        /* the black accent */

  --surface: rgba(255, 255, 255, 0.68);  /* frosted white */
  --surface-strong: rgba(255, 255, 255, 0.78);

  --radius: 0.75rem;                     /* 12px */
  --radius-lg: 1rem;                     /* 16px */
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-pill: 999px;

  --shadow-soft: 0 1px 2px rgba(24, 24, 27, 0.04), 0 8px 24px rgba(24, 24, 27, 0.06);
  --shadow-tile: 0 4px 14px rgba(24, 24, 27, 0.18);

  --accent: #6d5dfc;                      /* link hover accent */
  --nav-muted: #6b7280;                   /* nav link grey */

  color-scheme: light;
}

/* --- Base --- */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-family: var(--app-font-sans);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--foreground);
  font-family: var(--app-font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Pastel gradient wash: near-white base with low-contrast radial layers.
     Pale blue top-left, lavender/pink to the right, peach at the bottom. */
  background-color: #fdfcff;
  background-image:
    radial-gradient(1100px 720px at 8% -12%, rgba(193, 219, 253, 0.55) 0%, rgba(193, 219, 253, 0) 62%),
    radial-gradient(950px 680px at 92% 4%, rgba(233, 213, 247, 0.55) 0%, rgba(233, 213, 247, 0) 60%),
    radial-gradient(900px 560px at 78% 30%, rgba(252, 210, 224, 0.30) 0%, rgba(252, 210, 224, 0) 58%),
    radial-gradient(1200px 760px at 50% 112%, rgba(255, 218, 191, 0.55) 0%, rgba(255, 218, 191, 0) 62%),
    radial-gradient(800px 520px at 12% 108%, rgba(255, 231, 207, 0.40) 0%, rgba(255, 231, 207, 0) 58%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

a {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(24, 24, 27, 0.22);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--foreground); }

:focus-visible {
  outline: 2px solid rgba(24, 24, 27, 0.55);
  outline-offset: 2px;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

main.wrap { padding-top: 3rem; padding-bottom: 4rem; }

/* --- Top nav (v3): hauntjob-style sticky frosted bar, on every page --- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  /* Fade-down on load: opacity 0 -> 1, translateY(-12px) -> 0, 300ms. */
  animation: topnav-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes topnav-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .topnav { animation: none; }
}

.topnav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

@media (min-width: 1024px) {
  .topnav-inner { padding-left: 60px; padding-right: 60px; }
}

/* Brand: 28px black rounded tile with an inline controller glyph + wordmark. */
.topnav .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.topnav .brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-tile);
}

.brand-mark svg { display: block; }

.brand-word {
  font-family: var(--app-font-sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}

/* Center links: grey, accent + underline on hover. */
.topnav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.topnav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--nav-muted);
  text-decoration: none;
  transition: color 200ms ease;
}

.topnav-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 8px;
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Black CTA chip: scales up slightly on hover. */
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #ffffff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), background 150ms ease;
}
.nav-cta:hover { text-decoration: none; color: #ffffff; background: #1c1c1e; transform: scale(1.04); }
.nav-cta:active { transform: scale(0.98); }

@media (prefers-reduced-motion: reduce) {
  .nav-cta:hover, .nav-cta:active { transform: none; }
}

/* Hamburger: hidden on desktop, shown under 768px. */
.nav-burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
}
.nav-burger:hover { background: rgba(0, 0, 0, 0.04); }

/* Stacked mobile menu under the bar (toggled by JS on every page). */
.topnav-menu {
  display: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 8px 24px 16px;
  flex-direction: column;
  gap: 4px;
}
.topnav-menu.open { display: flex; }
.topnav-menu a {
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--nav-muted);
  text-decoration: none;
}
.topnav-menu a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 6px; }

@media (max-width: 767px) {
  .topnav-links { display: none; }
  .nav-burger { display: inline-flex; }
}

/* --- Type --- */

h1, h2 { line-height: 1.2; letter-spacing: -0.02em; }

h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 650;
  margin: 0 0 0.75rem;
}

/* Section labels: small and grey, like the app's "Projects" / "Today". */
h2 {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--label-text);
  margin: 2.75rem 0 0.85rem;
}

.tagline {
  font-size: 1.05rem;
  color: var(--secondary-text);
  margin: 0 0 2.25rem;
  max-width: 62ch;
}

/* --- Pixel-art game logos: kept crisp, on a dark backing so dark logos stay legible --- */

.logo {
  display: block;
  image-rendering: pixelated;
  max-width: 100%;
  height: auto;
}

.logo-backing {
  display: inline-block;
  background: var(--ink);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
}

/* Logo standing in for an h1 on the game pages. */
h1 .logo { max-height: 2.4rem; width: auto; }

/* --- Cards: frosted translucent white panels --- */

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  backdrop-filter: blur(14px) saturate(1.05);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.game-card img.cover {
  image-rendering: pixelated;
  width: 100%;
  max-width: 630px;
  height: auto;
  border-radius: var(--radius);
}

.game-card .logo-backing { align-self: flex-start; }
.game-card .logo { max-width: 420px; }
.game-card .tagline { margin: 0; font-size: 1rem; max-width: none; }

/* --- Buttons: pills --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  align-self: flex-start;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--app-font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-tile);
  transition: background 150ms ease, transform 150ms ease;
}

.btn:hover { text-decoration: none; background: #1c1c1e; }
.btn:active { transform: translateY(1px); }

/* Ghost/secondary: white pill chip with a thin border. */
.btn.ghost {
  background: var(--surface-strong);
  color: var(--foreground);
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn.ghost:hover {
  background: #ffffff;
  border-color: rgba(24, 24, 27, 0.2);
}

/* --- Play embed: full-width, breaks out of the text column ---
   The games are dark, so the frame sits on a black backing. The section spans
   min(1152px, viewport minus 32px gutters) and is centred on the viewport
   (negative margin centreing, no transform so nothing inside is affected). */

section.play-section {
  width: min(1152px, calc(100vw - 32px));
  margin-left: calc(50% - min(1152px, calc(100vw - 32px)) / 2);
}

/* 16:9 dark wrapper: clips whatever the iframe renders to a widescreen frame. */
.play-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000000;
  border: 1px solid rgba(10, 10, 10, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin: 0;
}

iframe.play {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000000;
}

/* Fixed-size canvas (Caravan renders a fixed 1152x648 canvas and never
   resizes): render the iframe at its native size and scale it down to fit
   the wrapper. --game-scale is set to (wrapper inner width / 1152) by one
   tiny inline script on that page; 1 is the no-JS fallback (full size). */
iframe.play.fixed-canvas {
  --game-scale: 1;
  width: 1152px;
  height: 648px;
  transform: scale(var(--game-scale));
  transform-origin: top left;
}

/* Row of actions under the embed (fullscreen + itch links). */
.play-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.5rem;
}

p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }
strong { font-weight: 600; }

/* --- Disclosure: a quieter frosted panel --- */

section.disclosure {
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin-top: 2.75rem;
  padding: 1.5rem;
  font-size: 0.95rem;
  color: var(--secondary-text);
}

section.disclosure h2 {
  color: var(--label-text);
  margin: 0 0 0.75rem;
}

/* --- Footer --- */

footer.site {
  border-top: 1px solid var(--hairline);
  margin-top: 4rem;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 0.875rem;
  color: var(--label-text);
}

footer.site .wrap { padding-top: 1.25rem; padding-bottom: 1.75rem; }
footer.site a { color: var(--secondary-text); text-decoration-color: rgba(24, 24, 27, 0.18); }
footer.site a:hover { color: var(--foreground); }

@media (max-width: 640px) {
  .wrap { padding-left: 1rem; padding-right: 1rem; }
  main.wrap { padding-top: 2rem; }
  .game-card { padding: 1.1rem; }
}
