/* Lazy Cat Team, coming soon. Built from the Claude Design export "Interactive cat design review". */

:root {
  --sun: #FBF8F4;          /* page 1 background */
  --ink: #15110D;          /* cat, text, page 2 background */
  --quiet: #5F574F;        /* quiet text, idle borders */
  --z: oklch(46% 0.015 70);
  --pink: oklch(82% 0.11 350);
  --ac: #31AAF1;           /* accent blue, from the pen */
  --ac-glow: #6CC3F6;      /* blue text on black */
  --ac-deep: #0B6FAE;      /* focus ring on light */
  --ac-soft2: #A9DAF8;
  --face-green: oklch(83% 0.14 155);
  --face-orange: oklch(78% 0.14 35);

  --serif: 'Lora', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;

  --grow: cubic-bezier(.34, 1.56, .64, 1);
  --flip: cubic-bezier(.3, 1.3, .5, 1);

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--sun);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 320ms ease-in-out;
  overflow-x: hidden;
}
html[data-page="dreams"] body,
html[data-page="games"] body { background: var(--ink); }
html[data-page="home"] { --theme: var(--sun); }

a, button { color: inherit; font: inherit; }
a:focus, button:focus { outline: none; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--ac-deep);
  outline-offset: 5px;
}
.page-dark a:focus-visible, .page-dark button:focus-visible { outline-color: var(--ac-glow); }

/* ---------- Pages ---------- */

main { min-height: 100vh; min-height: 100dvh; }

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    max(clamp(48px, 8vh, 80px), env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(48px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
}
.page[hidden] { display: none; }

.page.entering { animation: rise 320ms ease-out 80ms both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Page 1 ---------- */

.wordmark {
  position: relative;
  margin: 0 0.55em 0 0;
  font: 700 clamp(42px, 7.8vw, 112px)/1.1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark-cat {
  position: absolute;
  right: -0.84em;
  bottom: 0.02em;
  width: 0.8em;
  height: auto;
  transform: rotate(6deg);
}
.z {
  position: absolute;
  font: italic 700 1em/1 var(--serif);
  letter-spacing: 0;
  color: var(--z);
}
/* Offsets are in each z's own em, so they are the wordmark's em divided by the z's size. */
.z1 { font-size: 0.41em; right: -1.56em; top: -0.12em; }
.z2 { font-size: 0.30em; right: -3.0em;  top: -0.97em; }
.z3 { font-size: 0.22em; right: -4.95em; top: -2.05em; }

.soon {
  margin: 6px 0 0;
  font: italic 500 clamp(32px, 3.75vw, 54px)/1.2 var(--serif);
  color: var(--z);
}

.faces {
  display: flex;
  gap: clamp(14px, 3.9vw, 56px);
  margin-top: 40px;
}

.face {
  --size: clamp(98px, 10vw, 144px);
  all: unset;
  cursor: pointer;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  perspective: 700px;
  transition: transform 180ms var(--grow);
}
.face:focus-visible { outline: 3px solid var(--ac-deep); outline-offset: 5px; }
.face-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 480ms var(--flip);
}
.face[aria-pressed="true"] .face-inner { transform: rotateY(180deg); }
.face-front, .face-back {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  color: var(--ink);
  background: var(--bg);
}
.face-front svg { width: 100%; height: 100%; display: block; }
.face-back {
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(12px, 1.4vw, 20px);
  font: 500 clamp(12px, 1vw, 14px)/1.35 var(--sans);
}
.face-back .dots {
  font: 700 clamp(34px, 3.4vw, 48px)/1 var(--serif);
  letter-spacing: 0.06em;
  transform: translateY(-18%);
}
.face-blue   { --bg: var(--ac-soft2); }
.face-green  { --bg: var(--face-green); }
.face-orange { --bg: var(--face-orange); }

.dreams {
  --size: clamp(260px, 23.6vw, 340px);
  position: relative;
  display: block;
  width: var(--size);
  height: var(--size);
  margin-top: clamp(28px, 4vh, 40px);
  border-radius: 50%;
  text-decoration: none;
  transition: transform 220ms var(--grow);
}
.dreams-disc {
  position: absolute;
  inset: clamp(20px, 2.5vw, 36px);
  border-radius: 50%;
  background: var(--ink);
  color: var(--pink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.sleepy {
  width: clamp(83px, 7.3vw, 105px);
  aspect-ratio: 122 / 104;
  height: auto;
  transform: translateX(10%);
}
.dreams-label { font: 700 clamp(28px, 2.4vw, 34px)/1.1 var(--serif); letter-spacing: -0.01em; }

/* ---------- Page 2 and Games: lights out ---------- */

.page-dark { color: var(--pink); }

.rects { display: flex; gap: 32px; }

.rect {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 260px;
  height: 104px;
  border-radius: 28px;
  border: 2px solid var(--quiet);
  font: 600 30px var(--serif);
  color: var(--pink);
  text-decoration: none;
  transition: transform 180ms var(--grow), border-color 180ms, color 180ms, box-shadow 180ms;
}
.rect:focus-visible { outline: 3px solid var(--ac-glow); outline-offset: 5px; }
.rect.lit {
  transform: translateY(-4px) rotate(calc(var(--tilt, 0) * 1deg));
  border-color: var(--ac);
  color: var(--ac-glow);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ac) 16%, transparent), 0 0 40px color-mix(in srgb, var(--ac) 25%, transparent);
}

.more {
  margin: clamp(48px, 10vh, 96px) 0 0;
  font: italic 700 clamp(46px, min(8.3vw, 13vh), 120px)/1 var(--serif);
  color: var(--ac-glow);
  text-shadow: 0 0 48px color-mix(in srgb, var(--ac) 35%, transparent);
}
.more-small { margin-top: clamp(40px, 6vh, 56px); font-size: clamp(46px, min(6.7vw, 10.5vh), 96px); }
.more-wide { display: flex; flex-direction: column; align-items: center; gap: 0.12em; }
.more-line { display: flex; }
.more-line > span { display: inline-block; transform: translateY(calc(var(--y, 0) * 0.0083em)) rotate(var(--r, 0deg)); }
.more-line > .gap { width: 0.28em; }
.more-line.l1 { transform: translateX(-0.75em); }
.more-line.l2 { transform: translateX(0.33em); }
.more-narrow { display: none; }

.back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 128px;
  flex: none;
  margin-top: clamp(56px, 11vh, 112px);
  border-radius: 50%;
  border: 2px solid var(--ac);
  font: 600 24px var(--serif);
  color: var(--ac-glow);
  text-decoration: none;
  transition: transform 180ms var(--grow), background-color 180ms, color 180ms;
}

.page-games { justify-content: center; }
.games-title {
  margin: 0;
  font: 700 clamp(68px, 9.4vw, 136px)/1.1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--pink);
}
.page-games .rects { margin-top: clamp(32px, 5vh, 44px); }
.page-games .back { margin-top: clamp(56px, 9vh, 84px); }

/* ---------- Hover, only where there is a real pointer ---------- */

@media (hover: hover) and (pointer: fine) {
  .face:hover { transform: scale(1.08); }
  .dreams:hover { transform: scale(1.06); }
  .rect:hover {
    transform: translateY(-4px) rotate(calc(var(--tilt, 0) * 1deg));
    border-color: var(--ac);
    color: var(--ac-glow);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--ac) 16%, transparent), 0 0 40px color-mix(in srgb, var(--ac) 25%, transparent);
  }
  .back:hover { transform: scale(1.08); background: var(--ac); color: var(--ink); }
}
.face:active, .dreams:active { transform: scale(1.06); }
.back:active { transform: scale(1.06); background: var(--ac); color: var(--ink); }

/* ---------- Phone ---------- */

@media (max-width: 640px) {
  .page { padding-top: max(56px, env(safe-area-inset-top)); }
  .page-dark { padding-top: max(40px, env(safe-area-inset-top)); }
  .wordmark { margin-right: 1.33em; }
  .rects { flex-direction: column; gap: 12px; width: 100%; max-width: 420px; }
  .rect { width: 100%; height: 68px; border-radius: 22px; font-size: 22px; }
  .rect.lit, .rect:active { border-color: var(--ac); color: var(--ac-glow); }
  .more { margin-top: 64px; font-size: 46px; white-space: nowrap; text-shadow: 0 0 32px color-mix(in srgb, var(--ac) 35%, transparent); }
  .more-wide { display: none; }
  .more-narrow { display: block; }
  .more-narrow span { display: block; }
  .n1 { transform: rotate(-5deg) translateX(-22px); }
  .n2 { transform: rotate(5deg) translateX(10px); margin-top: 14px; }
  .back { width: 100px; height: 100px; margin-top: 72px; font-size: 20px; }
  .page-games .rects { max-width: 327px; }
  .page-games .more { margin-top: 48px; }
  .page-games .back { margin-top: 56px; }
}

/* ---------- Reduced motion: colour only, crossfade flip, instant page change ---------- */

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
  .page.entering { animation: none; }
  .face, .dreams, .rect, .back { transition: background-color 120ms, color 120ms, border-color 120ms; }
  .face:hover, .face:active, .dreams:hover, .dreams:active, .back:hover, .back:active { transform: none; }
  .rect:hover, .rect.lit { transform: none; }
  .face-inner { transition: none; transform: none !important; }
  .face-front, .face-back { backface-visibility: visible; transform: none; transition: opacity 120ms; }
  .face-back { opacity: 0; }
  .face[aria-pressed="true"] .face-front { opacity: 0; }
  .face[aria-pressed="true"] .face-back { opacity: 1; }
}
