/* ─────────────────────────────────────────────
   frgmt.xyz — a tiny park for restless hands
   design system from claude.ai/design handoff
   ───────────────────────────────────────────── */

:root {
  --paper:  #F2EBDC;
  --ink:    #0E0E0E;
  --ink-2:  #1F1B16;
  --rule:   #0E0E0E;

  --cherry: oklch(0.62 0.22 25);
  --sun:    oklch(0.84 0.17 85);
  --sky:    oklch(0.6 0.19 240);
  --grass:  oklch(0.66 0.15 145);
  --gum:    oklch(0.74 0.17 355);
  --plum:   oklch(0.45 0.16 320);
  --mint:   oklch(0.85 0.12 165);

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;
  --serif:   "Instrument Serif", ui-serif, Georgia, serif;

  --grain-opacity: 0.45;

  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-feature-settings: "ss01","ss02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  cursor: none;
  touch-action: none;
}
button { font: inherit; color: inherit; cursor: none; background: none; border: 0; padding: 0; }
input  { font: inherit; color: inherit; }
::selection { background: var(--cherry); color: var(--paper); }

/* paper grain — fixed, slow shift */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 9000;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  animation: grainShift 1.4s steps(2) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-6px, 4px); }
  50%  { transform: translate(4px, -3px); }
  75%  { transform: translate(-3px, -5px); }
  100% { transform: translate(0, 0); }
}

/* custom cursor */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  pointer-events: none; z-index: 9500;
  mix-blend-mode: difference;
  transition: width .14s ease, height .14s ease, margin .14s ease;
  opacity: 0;
}
.cursor.is-on { opacity: 1; }
.cursor::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--paper);
}
.cursor[data-state="hot"]   { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
.cursor[data-state="grab"]  { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
.cursor[data-state="grab"]::before { background: transparent; border: 2px solid var(--paper); }
.cursor[data-state="pan"]   { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.cursor[data-state="pan"]::before { background: transparent; border: 2px dashed var(--paper); }
.cursor[data-state="sit"]   { width: 56px; height: 24px; margin: -12px 0 0 -28px; border-radius: 4px; }
.cursor[data-state="sit"]::before { background: var(--paper); border-radius: 4px; }
.cursor[data-state="text"]  { width: 4px; height: 22px; margin: -11px 0 0 -2px; }

@media (hover: none) {
  .cursor { display: none; }
  body { cursor: auto; }
}

/* viewport */
#root { position: fixed; inset: 0; overflow: hidden; }

/* utility classes */
.mono   { font-family: var(--mono); font-feature-settings: "ss02"; }
.serif  { font-family: var(--serif); }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; letter-spacing: .04em; }
.nowrap { white-space: nowrap; }

/* ticker */
@keyframes tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* welcome flash */
@keyframes welcomeFade {
  0%, 30% { background: var(--ink); }
  100%    { background: rgba(0,0,0,0); }
}
@keyframes welcomeMark {
  0%   { transform: scale(.5) rotate(-12deg); opacity: 0; }
  30%  { transform: scale(1.05) rotate(0); opacity: 1; }
  80%  { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(.6) rotate(8deg); opacity: 0; }
}

@keyframes flashin {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.flashin { animation: flashin .9s var(--ease-out) both; }

/* shatter overlay */
@keyframes tileIn {
  from { transform: translateY(-110%) rotate(-6deg); opacity: 0; }
  to   { transform: translateY(0) rotate(0);          opacity: 1; }
}
@keyframes tileOut {
  from { transform: translateY(0) rotate(0);          opacity: 1; }
  to   { transform: translateY(120%) rotate(6deg);    opacity: 0; }
}

/* keyboard pill */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  border: 1px solid var(--ink); border-radius: 4px;
  font-family: var(--mono); font-size: 10px;
  background: var(--paper);
}

:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }

/* world wrap */
.world {
  position: absolute;
  will-change: transform;
}

/* zone card frame (used on attractions) */
.card {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 5px 5px 0 var(--ink);
}

/* small flash overlay */
.full-flash {
  position: fixed; inset: 0;
  background: var(--paper);
  opacity: 0; pointer-events: none;
  z-index: 9100;
  mix-blend-mode: screen;
  transition: opacity .18s var(--ease-out);
}
.full-flash.on { opacity: .85; transition: opacity .04s; }

/* edge pan hint glow when near edges */
.edge {
  position: fixed; pointer-events: none;
  z-index: 40;
  background: linear-gradient(to right, rgba(14,14,14,.06), transparent);
  transition: opacity .25s;
  opacity: 0;
}
.edge.on { opacity: 1; }
.edge.left   { top: 0; left: 0;  bottom: 0; width: 80px; }
.edge.right  { top: 0; right: 0; bottom: 0; width: 80px; transform: scaleX(-1); }
.edge.top    { left: 0; right: 0; top: 0; height: 60px;
  background: linear-gradient(to bottom, rgba(14,14,14,.06), transparent); }
.edge.bottom { left: 0; right: 0; bottom: 0; height: 60px;
  background: linear-gradient(to top, rgba(14,14,14,.06), transparent); }

/* mini map */
.minimap {
  position: fixed; right: 18px; bottom: 60px; z-index: 60;
  width: 140px; height: 80px;
  border: 1.5px solid var(--ink); border-radius: 10px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}
.minimap__viewport {
  position: absolute;
  border: 1.5px solid var(--cherry);
  background: rgba(232,85,58,.18);
}
.minimap__poi {
  position: absolute; width: 6px; height: 6px;
  border-radius: 50%; border: 1px solid var(--ink);
}

/* responsive: just keep the world on small screens, but warn no touch optimizations */
@media (max-width: 720px) {
  :root { --grain-opacity: 0.32; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
