/* ruffle.space — design tokens */
:root {
  /* Core palette — pulled from logo */
  --ink: #1A1612;
  --ink-2: #2B231C;
  --paper: #FBF4E6;
  --paper-2: #F3E9D2;
  --paper-3: #E8DAB8;

  --orange: #E85A2A;
  --orange-2: #F06B1F;
  --mustard: #E8A83A;
  --teal: #5E8C8A;
  --mauve: #B58AA6;
  --cream: #F7E7C4;

  /* Semantic */
  --bg: var(--paper);
  --fg: var(--ink);
  --accent: var(--orange);
  --accent-2: var(--teal);
  --accent-3: var(--mustard);
  --accent-4: var(--mauve);

  --muted: #7A6C55;
  --line: rgba(26,22,18,0.14);
  --line-strong: rgba(26,22,18,0.85);

  /* Radii — squircle-feel (superellipse approximation).
     CSS border-radius with ~42% corner-smoothing approximation. */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 20px;
  --r-lg: 32px;
  --r-pill: 999px;
  /* squircle exponent — used via CSS corner-shape when available */

  /* Spacing scale (8pt base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* Shadows — "sticker" style with ink offset */
  --shadow-sticker-sm: 2px 2px 0 var(--ink);
  --shadow-sticker: 4px 4px 0 var(--ink);
  --shadow-sticker-lg: 6px 6px 0 var(--ink);
  --shadow-soft: 0 8px 24px -12px rgba(26,22,18,0.25);
  --shadow-card: 0 2px 0 rgba(26,22,18,0.06), 0 12px 32px -16px rgba(26,22,18,0.22);

  /* Type */
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'Inter Tight', 'Inter', system-ui, sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Paper texture — subtle speckle */
.paper-texture {
  background-image:
    radial-gradient(rgba(26,22,18,0.04) 1px, transparent 1px),
    radial-gradient(rgba(26,22,18,0.025) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}

.ink-mode {
  --bg: #14110E;
  --fg: #F5EAD2;
  --paper: #1E1913;
  --paper-2: #14110E;
  --paper-3: #2A2219;
  --cream: #2A2219;
  --ink: #F5EAD2;
  --muted: #A89572;
  --line: rgba(245,234,210,0.14);
  --line-strong: rgba(245,234,210,0.85);
  --shadow-sticker-sm: 2px 2px 0 rgba(245,234,210,0.9);
  --shadow-sticker: 4px 4px 0 rgba(245,234,210,0.9);
  --shadow-sticker-lg: 6px 6px 0 rgba(245,234,210,0.9);
}
.ink-mode .sticker:hover {
  box-shadow: 8px 10px 0 rgba(245,234,210,0.9);
}
.ink-mode .import-card:hover {
  box-shadow: 10px 12px 0 rgba(245,234,210,0.9);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.sans { font-family: var(--font-sans); }
.mono { font-family: var(--font-body); }

.ink-mode .import-brand-icon {
  filter: invert(1) brightness(1.2);
}

/* Sticker — an element with ink outline + offset shadow, squircle corners */
.sticker {
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sticker);
  background: var(--paper);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.sticker:hover {
  transform: translate(-2px, -4px);
  box-shadow: 8px 10px 0 var(--ink);
}

/* Import cards keep their base rotation but gently shift on hover */
.import-card {
  transform: rotate(var(--base-rot, 0deg)) !important;
}
.import-card:hover {
  transform: translate(-2px, -6px) rotate(var(--hover-rot, 2deg)) !important;
  box-shadow: 10px 12px 0 var(--ink);
}

/* Squircle utility — applies superellipse-style rounded corners.
   Modern browsers: uses corner-shape: squircle. Fallback: larger border-radius. */
@supports (corner-shape: squircle) {
  .sticker, .squircle, .btn, .chip, input, button.squircle-btn {
    corner-shape: squircle;
  }
}
/* Manual squircle class with explicit smoothing */
.squircle { border-radius: var(--r-md); }
.squircle-sm { border-radius: var(--r-sm); }
.squircle-lg { border-radius: var(--r-lg); }

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
@supports (corner-shape: squircle) { .chip { corner-shape: squircle; } }

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sticker-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
@supports (corner-shape: squircle) { .btn { corner-shape: squircle; } }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--orange); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--paper-2); box-shadow: none; transform: none; }

/* Focus */
:focus-visible { outline: 2px dashed var(--orange); outline-offset: 3px; }

/* Scroll */
html { scroll-behavior: smooth; }

/* Utility */
.hide-scroll::-webkit-scrollbar { display: none; }
