/* ============================================
   allen's corner — shared design system
   ============================================ */

:root {
  --bg: #faf9f4;
  --ink: #17160f;
  --ink-soft: #6d6b5c;
  --ink-rgb: 23, 22, 15;
  --surface: #f3f1e9;
  --light: #f3f1e9;
  --paused-bg: #f3f1e9;
  --shadow-ink: 23, 22, 15;
  --accent: #34c759;
  --seed: #1257a6;
  --seed-soft: rgba(18, 87, 166, 0.35);
  --red: #ff453a;
  --hairline: rgba(23, 22, 15, 0.12);
  --bg-rgb: 250, 249, 244;
  /* legacy accent names, remapped to muted apple-ish tints (used as chip tints only) */
  --coral: #ff6b5e;
  --sky: #0a84ff;
  --lemon: #ffd60a;
  --mint: #34c759;
  --lilac: #bf5af2;
  --peach: #ff9f0a;
  --rose: #ff375f;
  --sea: #64d2ff;
  --card-radius: 28px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --serif-lean: normal;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 20px 50px -30px rgba(var(--shadow-ink), 0.4);
  --shadow-hover: 0 24px 40px -24px rgba(var(--shadow-ink), 0.3);
}

:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --ink: #f1efe4;
  --ink-soft: #9a988c;
  --ink-rgb: 241, 239, 228;
  --surface: #131316;
  --light: #131316;
  --paused-bg: #131316;
  --hairline: rgba(241, 239, 228, 0.14);
  --bg-rgb: 11, 11, 13;
  --seed: #e2a94f;
  --seed-soft: rgba(226, 169, 79, 0.35);
  --shadow-ink: 0, 0, 0;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", serif;
  --serif-lean: italic;
  --shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.9);
  --shadow-hover: 0 24px 40px -24px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

h1, h2, h3, .display {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

a { color: var(--ink); }

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- top nav on subpages: frosted sticky bar ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  height: 52px;
  margin: 0 -20px;
  padding: 0 20px;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(var(--bg-rgb), 0.8);
  border-bottom: 1px solid var(--hairline);
}

.topnav .home-link {
  display: inline-block;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  transition: color 0.2s ease;
}

.topnav .home-link:hover { color: var(--ink); }

/* ---------- page hero on subpages ---------- */
.page-hero {
  text-align: center;
  padding: 64px 20px 20px;
}

.page-hero .emoji { font-size: 3rem; display: block; margin-bottom: 14px; }
.page-hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); margin: 0 0 14px; letter-spacing: -0.04em; }
.page-hero p.sub { color: var(--ink-soft); max-width: 560px; margin: 0 auto; font-size: 1.15rem; line-height: 1.5; }

/* ---------- card grid (homepage) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  padding: 30px 0 60px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 24px;
  background: var(--surface);
  border: none;
  border-radius: var(--card-radius);
  text-decoration: none;
  color: var(--ink);
  box-shadow: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

/* emoji icon */
.card .card-emoji {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 2.1rem;
  line-height: 1;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  margin-bottom: 16px;
  transition: transform 0.3s var(--ease);
}

.card:hover .card-emoji { transform: scale(1.08); }

.card h3 { position: relative; z-index: 1; margin: 3px 0 5px; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.card p { position: relative; z-index: 1; margin: 0; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.45; flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* arrow that slides in on hover */
.card .card-arrow {
  position: absolute;
  right: 20px;
  bottom: 16px;
  z-index: 1;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.card:hover .card-arrow { opacity: 1; transform: translateX(0); }

.card.ghost {
  background: transparent;
  border: 1px dashed var(--hairline);
  opacity: 0.7;
  justify-content: flex-end;
}

.card.ghost .card-emoji { transform: none; }
.card.ghost:hover { transform: translateY(-3px); box-shadow: none; opacity: 0.95; }

/* paused: a real, finished toy that isn't public yet */
.card.paused {
  background: var(--paused-bg);
  cursor: default;
  justify-content: flex-end;
  opacity: 0.75;
}
.card.paused .card-emoji { filter: grayscale(1); opacity: 0.6; }
.card.paused p, .card.paused h3 { color: var(--ink-soft); }
.card.paused:hover { transform: none; box-shadow: none; }
.card.paused:hover .card-emoji { transform: none; }

.bg-coral { --tint: var(--coral); }
.bg-sky   { --tint: var(--sky); }
.bg-lemon { --tint: var(--lemon); }
.bg-mint  { --tint: var(--mint); }
.bg-lilac { --tint: var(--lilac); }
.bg-peach { --tint: var(--peach); }
.bg-rose  { --tint: var(--rose); }
.bg-sea   { --tint: var(--sea); }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- generic content blocks ---------- */
.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}

.block {
  background: var(--surface);
  border: none;
  border-radius: var(--card-radius);
  padding: 30px 32px;
  margin: 26px 0;
  box-shadow: none;
}

.block h2 { margin-top: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.block .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 0;
  margin-bottom: 12px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}

.btn:hover { transform: scale(1.04); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.small { font-size: 0.85rem; padding: 8px 18px; }

/* ---------- footer ---------- */
footer.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 20px 20px 24px;
}

footer.site-footer a { color: var(--ink-soft); }

@keyframes fairy-dust {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.8); }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-5px, -11px) scale(1); }
}
.site-footer .claude-credit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--ink);
  vertical-align: -3px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.site-footer .claude-credit:hover {
  filter: brightness(1.2);
}
.site-footer .claude-credit svg { width: 15px; height: 15px; }
.site-footer .claude-credit::before {
  content: "✨";
  position: absolute;
  font-size: 0.65rem;
  pointer-events: none;
}
.site-footer .claude-credit:hover::before {
  animation: fairy-dust 0.85s ease-out forwards;
  left: -8px;
  top: -8px;
}

@media (max-width: 520px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card { min-height: 150px; padding: 16px; }
  .card .card-emoji { font-size: 1.8rem; width: 44px; height: 44px; }
  .card h3 { font-size: 1.05rem; }
  .card p { font-size: 0.78rem; }
  .page-hero { padding-top: 44px; }
}
