/* ------------------------------------------------------------------
   Cow Cat Can Fly 奶牛猫会飞 — randolf.dev
   Portrait one-tap flyer. Phone / tablet first-class.
   ------------------------------------------------------------------ */

.cc-page {
  padding-top: clamp(5.5rem, 9vh, 7rem);
  --cc-chrome: 300px;
}

.cc-head {
  margin-bottom: clamp(1.1rem, 2.6vh, 2.2rem);
}

.cc-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1em 0.55em;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin-bottom: 0.7rem;
}

.cc-head .page-lede {
  font-size: 0.95rem;
}

.cc-zh {
  font-size: 0.52em;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--accent);
}

.cc-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
}

/* --- stage -------------------------------------------------------- */

.cc-stage {
  position: relative;
  width: min(
    100%,
    460px,
    calc((100dvh - var(--cc-chrome)) * 0.5625)
  );
  aspect-ratio: 360 / 640;
  margin-inline: auto;
  border: 1px solid var(--line);
  background: #0b0e1a;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.cc-stage:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cc-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* --- controls ------------------------------------------------------ */

.cc-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
}

.cc-chips {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: flex;
  gap: 6px;
}

.cc-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.cc-chip {
  padding: 0.4rem 0.7rem;
  font-size: 10px;
  color: #c6cad6;
  background: rgba(8, 10, 18, 0.62);
  border-color: rgba(236, 236, 240, 0.16);
  backdrop-filter: blur(3px);
}

.cc-btn:hover {
  color: var(--fg);
  border-color: var(--dim);
}

.cc-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(201, 244, 77, 0.4);
}

.cc-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cc-hint {
  pointer-events: none;
}

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

/* --- phone --------------------------------------------------------- */

@media (max-width: 640px) {
  .cc-page {
    --cc-chrome: 236px;
    padding-top: 4.6rem;
  }

  .cc-head .section-label {
    display: none;
  }

  .cc-title {
    font-size: clamp(1.25rem, 5.4vw, 1.6rem);
  }

  .cc-head .page-lede {
    font-size: 0.85rem;
  }

  .cc-zh {
    letter-spacing: 0.18em;
  }

  .page-head.cc-head {
    margin-bottom: 0.85rem;
  }

  .cc-stage {
    width: min(100%, calc((100dvh - var(--cc-chrome)) * 0.5625));
    border-left: 0;
    border-right: 0;
  }

  .cc-controls {
    margin-top: 0.7rem;
  }

  .cc-hint {
    display: none;
  }
}

/* --- short landscape (tablet landscape / small laptop) -------------- */

@media (min-width: 700px) and (max-height: 860px) {
  .cc-page {
    --cc-chrome: 208px;
    padding-top: 4.8rem;
    padding-bottom: 1.4rem;
  }

  .cc-head {
    margin-bottom: 0.9rem;
  }

  .page-head.cc-head .page-lede {
    display: none;
  }

  .cc-title {
    font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  }

  .crumbs {
    margin-bottom: 0.5rem;
  }
}

/* --- reduced motion -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .cc-stage,
  .cc-btn {
    transition: none;
  }
}
