/* =========================================================
   iwantpussy.today - stylesheet
   12-column grid, 20px gutter, 60px side / 20px top-bottom
   page margins, split left/right hero layout.
   The whole page is locked to the viewport height - no page
   scroll - so everything below is sized to fit rather than
   overflow. Mobile stacks in source order: logo, slogan
   (which now shows the random message), share, photo, advert.
   The photo has no text/gradient overlay - just the bottom
   action buttons.
   Motion respects prefers-reduced-motion throughout.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&display=swap');

:root {
  /* ---- color tokens ---- */
  --color-bg: #FFFFFF;
  --color-primary-tint: #FFE7DB;
  --color-text: #4A3B35;
  --color-text-muted: #8A7871;
  --color-border: #ECE4DD;

  /* the two accent actions from the spec, reused consistently */
  --color-blue: #0088FF;
  --color-blue-dark: #0072D6;
  --color-black: #000000;
  --color-black-dark: #1A1A1A;

  /* ---- type ----
     "Google Sans" isn't a publicly embeddable web font (Google doesn't
     distribute it via Google Fonts or any licensed CDN) - it's listed
     first so it renders on any device that already has it installed,
     and falls back to Poppins Bold, the closest freely-licensed match. */
  --font-display: 'Google Sans', 'Poppins', 'Trebuchet MS', sans-serif;
  --font-body: 'Google Sans', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --fs-body: 1rem;
  --fs-sm: 0.8rem;
  /* slogan scales with both viewport width AND height so it can never
     force the page taller than the screen */
  --fs-slogan: clamp(1.75rem, 3vh + 2vw, 70px);

  /* ---- page margins / grid (literal desktop spec, fluid below it) ---- */
  --margin-x: clamp(16px, 4vw, 60px);
  --margin-y: clamp(12px, 2.5vh, 20px);
  --grid-gutter: 20px;
  --gap-y: clamp(10px, 2vh, 20px);

  /* ---- shape / elevation ---- */
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow-card: 0 20px 48px -18px rgba(74, 59, 53, 0.28);
  --shadow-btn: 0 6px 16px -6px rgba(0, 0, 0, 0.24);

  /* ---- motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-med: 280ms;
  --dur-slow: 420ms;
}

/* ---------------------------------------------------------
   Reset
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  /* the real scrolling root is <html>, not <body> - overflow:hidden has
     to live here too or the page can still scroll even though .app is
     sized correctly */
  overflow: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  overscroll-behavior: none;
}

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--color-blue);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Page loader (shown briefly on first paint)
   --------------------------------------------------------- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  transition: opacity var(--dur-slow) var(--ease-out), visibility var(--dur-slow);
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-paw {
  width: 56px;
  height: 56px;
  color: var(--color-blue);
  animation: pulse-paw 1s var(--ease-out) infinite;
}

@keyframes pulse-paw {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* ---------------------------------------------------------
   Page shell - fills the viewport exactly, no scroll
   --------------------------------------------------------- */
.app {
  /* pinned to all four viewport edges directly - same proven technique
     as .page-loader above - instead of relying on height:100vh/dvh
     working correctly through the html/body chain */
  position: fixed;
  inset: 0;
  padding: var(--margin-y) var(--margin-x);
  display: flex;
  flex-direction: column;
  gap: var(--gap-y);
  overflow: hidden;
}

/* ---------------------------------------------------------
   12-column grid, 20px gutter - left/right split.
   Mobile: single column, panel-left auto height, panel-right
   (the photo) fills whatever is left - this is also exactly
   the "logo, slogan, share, image" order since it's just
   source order with no reordering needed.
   --------------------------------------------------------- */
.layout-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: var(--gap-y);
}

.panel {
  min-height: 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.app.is-ready .panel { opacity: 1; transform: none; }
.app.is-ready .panel-right { transition-delay: 80ms; }

@media (min-width: 1024px) {
  .layout-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: 1fr;
    gap: var(--grid-gutter);
  }
  .panel-left  { grid-column: span 6; }
  .panel-right { grid-column: span 6; }
}

/* ---------------------------------------------------------
   Left panel - logo, slogan, share buttons (+ advert on
   desktop, moved here by script.js)
   --------------------------------------------------------- */
.panel-left {
  display: flex;
  flex-direction: column;
    justify-content: space-between;
  gap: var(--gap-y);
  min-height: 0;
  overflow: hidden;
}


.logo {
  height: clamp(28px, 5vh, 44px);
  width: auto;
  align-self: flex-start; /* pin to the left regardless of stretch behavior */
}

/* the slogan now displays the same random message shown to the visitor -
   it's swapped by the "I want different pussy" button, hence the
   transition/is-swapping state living here */
.slogan {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-slogan);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin: 0;
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}

.slogan.is-swapping {
  opacity: 0;
  transform: translateY(6px);
}

.share-row {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--grid-gutter);
}

/* ---------------------------------------------------------
   Buttons (shared)
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 var(--grid-gutter);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  box-shadow: var(--shadow-btn);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.btn-facebook { background: var(--color-blue); }
.btn-facebook:hover { background: var(--color-blue-dark); }

.btn-x { background: var(--color-black); }
.btn-x:hover { background: var(--color-black-dark); }

/* ---------------------------------------------------------
   Right panel - cat photo hero (fills all remaining height)
   --------------------------------------------------------- */
.panel-right {
  display: flex;
}

.image-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-primary-tint);
}

.cat-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.cat-image.is-loaded {
  opacity: 1;
  transform: scale(1);
}

/* shimmer skeleton while an image is (re)loading */
.image-frame.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg,
    var(--color-primary-tint) 30%,
    #ffffff 50%,
    var(--color-primary-tint) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* empty state (no photos in /cats yet) */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: var(--grid-gutter);
  color: var(--color-text-muted);
}

.empty-state svg { width: clamp(40px, 8vh, 64px); height: clamp(40px, 8vh, 64px); color: var(--color-blue); }
.empty-state p { margin: 0; font-size: var(--fs-sm); max-width: 26ch; }

.photo-actions {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  width: 100%;
  max-width: calc(100% - 40px);
  display: flex;
  justify-content: center;
}

.photo-button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn-shuffle { background: var(--color-blue); }
.btn-shuffle:hover { background: var(--color-blue-dark); }

.btn-shuffle .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-shuffle.is-loading .btn-spinner { display: inline-block; }
.btn-shuffle.is-loading .btn-label { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.btn-donate { background: var(--color-black); }
.btn-donate:hover { background: var(--color-black-dark); }

.share-toast {
  position: fixed;
  left: 50%;
  bottom: var(--margin-y);
  transform: translate(-50%, 12px);
  background: var(--color-text);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
  z-index: 50;
}

.share-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------
   Ad slot - horizontal/leaderboard shape.
   Lives after the photo on mobile (source order); script.js
   moves it into #panelLeft, under the share buttons, on
   desktop (≥1024px) - see js/script.js.
   --------------------------------------------------------- */
.ad-slot {
  flex-shrink: 0;
  width: 100%;
}

.ad-slot .ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 6px;
}

.ad-slot .adsbygoogle {
  width: 100%;
  min-height: 60px;
  max-height: 120px;
  aspect-ratio: 728 / 90;
  border-radius: 12px;
  background: repeating-linear-gradient(
    135deg,
    var(--color-border),
    var(--color-border) 10px,
    #fff 10px,
    #fff 20px
  );
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.site-footer p { margin: 0; }

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