/* Cat Collecting Club: her room, as the app draws it.
   Colours from RoomBackdrop.swift and CatCoat.tuxedo; proportions from RoomSpace.swift. */

@font-face {
  /* The club's lettering, as in the app (ClubFont.swift). Open Font License: fonts/OFL.txt */
  font-family: "Caprasimo";
  src: url("/fonts/Caprasimo-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --ink: #2e2219;
  --muted: #5a4330;
  --wall: #F6E7CF;
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* From the bottom of the page up to the line she sits on. */
  --ground: calc(58px + env(safe-area-inset-bottom));
  /* Tuxedo's unit: 1.0 is her body width, and her room scales off it, as in
     the app. On a stacked screen she takes the height the words leave her:
     --above is roughly how tall the words and the floor in front of her run,
     and she stands 2.2 units tall. */
  --above: 455px;
  --u: clamp(92px, min(36vw, (100svh - var(--above)) / 2.2), 160px);
  /* From the bottom of the page up to where the floor meets the wall: a little
     behind her, as in the app (RoomSpace.wallJoin). */
  --join: calc(var(--ground) + var(--u) * 0.10 + 22px);
  --skirting: max(24px, calc(var(--u) * 0.20));
}

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

html {
  background: var(--wall);
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--rounded);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.room {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding:
    calc(22px + env(safe-area-inset-top))
    calc(24px + env(safe-area-inset-right))
    0
    calc(24px + env(safe-area-inset-left));
  background: linear-gradient(180deg, #F6E7CF 0%, #EED5B3 100%);
}

/* ── the room ─────────────────────────────────────────────────────────────── */

.floor {
  position: absolute;
  inset: auto 0 0 0;
  z-index: -1;
  height: var(--join);
  background: linear-gradient(180deg, #D9A86C, #C98F52);
}

/* Painted a shade lighter than the wall, with a lip catching the light along
   its top and a hairline under the lip. No shadow onto the floor: in the app
   that read as a gap under the board. */
.skirting {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--join);
  z-index: -1;
  height: var(--skirting);
  background: linear-gradient(180deg, #FBF2E1, #F5E9D4);
}
.skirting::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: max(3px, calc(var(--skirting) * 0.11));
  background: #FFFAF0;
  box-shadow: 0 1px 0 rgba(217, 190, 148, 0.55);
}

/* ── the words ────────────────────────────────────────────────────────────── */

.copy {
  max-width: 40rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon {
  display: block;
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 22.5%;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 10px 24px -10px rgba(0, 0, 0, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.06);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(62, 45, 30, 0.08);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #D9534A;
}

h1 {
  margin: 18px 0 0;
  font-family: "Caprasimo", ui-rounded, system-ui, serif;
  font-weight: 400;
  font-size: clamp(38px, 11.4vw, 64px);
  line-height: 1;
  color: var(--ink);
}

.tagline {
  margin: 12px 0 0;
  font-size: clamp(18px, 4.9vw, 22px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--muted);
  text-wrap: balance;
}

.about {
  max-width: 38ch;
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.nowrap { white-space: nowrap; }

/* how to play with her */
.hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}
.hint svg {
  flex-shrink: 0;
  margin-top: 3px;
  fill: var(--ink);
}
.hint .line { display: block; }

.credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
}

/* ── Tuxedo, sitting on her floor ─────────────────────────────────────────── */

/* Her drawing runs from 2.2 of her units above the ground to 0.18 below it. */
.tuxedo {
  display: block;
  flex-shrink: 0;
  width: calc(var(--u) * 2.1);
  height: calc(var(--u) * 2.38);
  margin: auto auto calc(var(--ground) - var(--u) * 0.18);
  overflow: visible;
  touch-action: pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── tablets standing up: the same, with more room ────────────────────────── */

@media (min-width: 600px) {
  :root {
    --ground: calc(76px + env(safe-area-inset-bottom));
    --above: 610px;
    /* capped where the app caps her on an iPad (RoomSpace.u) */
    --u: clamp(150px, min(56vw, (100svh - var(--above)) / 2.2), 240px);
  }

  .room {
    padding:
      calc(56px + env(safe-area-inset-top))
      calc(56px + env(safe-area-inset-right))
      0
      calc(56px + env(safe-area-inset-left));
  }

  .icon {
    width: 72px;
    height: 72px;
  }

  h1 {
    margin-top: 26px;
    font-size: clamp(56px, 9.4vw, 84px);
  }

  .tagline {
    margin-top: 16px;
    font-size: 24px;
  }

  .about {
    margin-top: 12px;
    font-size: 18px;
  }

  .hint {
    margin-top: 22px;
    font-size: 15px;
  }

  .credit {
    bottom: calc(22px + env(safe-area-inset-bottom));
  }
}

/* ── wide screens: the words on the wall, Tuxedo beside them ──────────────── */

@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  :root {
    --u: clamp(150px, min(26svh, 19vw), 270px);
    --ground: calc(var(--u) * 0.46);
  }

  .room {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 1fr var(--join);
    column-gap: min(4vw, 48px);
    padding: 0 max(56px, calc((100vw - 1240px) / 2));
  }

  .copy {
    grid-area: 1 / 1;
    align-self: center;
    padding: 56px 0 calc(var(--skirting) + 24px);
  }

  h1 {
    margin-top: 28px;
    font-size: clamp(52px, 5.6vw, 80px);
  }

  .tagline {
    margin-top: 18px;
    font-size: clamp(20px, 1.8vw, 24px);
  }

  .about {
    margin-top: 14px;
    font-size: 17px;
  }

  .hint {
    grid-area: 2 / 1;
    align-self: center;
    margin: 0 0 12px;
    font-size: 15px;
  }

  .tuxedo {
    grid-area: 1 / 2 / 3 / 3;
    align-self: end;
    margin: 0 0 calc(var(--ground) - var(--u) * 0.18);
  }

  .credit {
    left: max(56px, calc((100vw - 1240px) / 2));
    right: auto;
    bottom: 18px;
    text-align: left;
  }
}

/* Browsers without small-viewport units size her by width alone. */
@supports not (height: 1svh) {
  :root { --u: clamp(96px, 30vw, 150px); }
  @media (min-width: 600px) { :root { --u: clamp(150px, 40vw, 240px); } }
  @media (min-width: 900px) and (min-aspect-ratio: 5/4) { :root { --u: clamp(150px, min(26vh, 19vw), 270px); } }
}

/* the page that isn't there */
.home {
  color: var(--ink);
  font-weight: 600;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
