:root {
  --sky: #6fb6e8;
  --cloud: #f8f4ec;
  --sun: #ff8a3d;
  --shiba: #d9582b;
  --red: #c8232c;
  --ink: #1b1a22;
  --concrete: #b8b0a6;
  --title: "Dela Gothic One", "Arial Black", sans-serif;
  --body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Trebuchet MS", sans-serif;
  --mono: "Sometype Mono", "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sky) url("../images/sky.webp") repeat center top / 720px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

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

a,
button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.wrap {
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
}

/* buttons: black plates cut on the same slant as the title */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 26px;
  border: 0;
  background: var(--ink);
  color: var(--cloud);
  font-family: var(--title);
  font-size: 1rem;
  text-decoration: none;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  transition: transform 0.15s, background-color 0.15s;
}

.btn:hover {
  background: var(--red);
  transform: translateX(4px);
}

.btn--red {
  background: var(--red);
}

.btn--red:hover {
  background: var(--ink);
}

/* header */
.top {
  position: relative;
  z-index: 20;
}

.top .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.top-plate {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 26px 8px 10px;
  background: var(--ink);
  color: var(--cloud);
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
}

.top-plate img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--cloud);
}

.top-name {
  font-family: var(--title);
  font-size: 1.05rem;
}

.top-links {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.top-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  background: var(--ink);
  color: var(--cloud);
  font-family: var(--title);
  font-size: 0.9rem;
  text-decoration: none;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  transition: background-color 0.15s;
}

.top-links a:hover {
  background: var(--red);
}

/* hero: the cold open */
.hero {
  padding: 28px 0 70px;
}

.hero-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 680px;
  width: 100%;
  border: 6px solid var(--ink);
  background: var(--ink);
}

.hero-shot {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* widescreen bars of the anime frame */
.hero-shot::before,
.hero-shot::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 5%;
  background: var(--ink);
  z-index: 1;
}

.hero-shot::before {
  top: 0;
}

.hero-shot::after {
  bottom: 0;
}

.hero-title {
  position: absolute;
  left: 4%;
  top: 10%;
  z-index: 3;
  width: fit-content;
  font-family: var(--title);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: #fff;
  -webkit-text-stroke: 0.09em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0.07em 0.07em 0 var(--red);
  transform: skewX(-9deg) rotate(-3deg);
  transform-origin: left bottom;
  animation: slam 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.hero-title span {
  display: block;
}

.hero-title span + span {
  margin-left: 0.55em;
}

@keyframes slam {
  from {
    transform: skewX(-9deg) rotate(-3deg) scale(1.25);
  }
}

.hero-line {
  position: absolute;
  left: 6%;
  bottom: 12%;
  z-index: 3;
  padding: 10px 22px;
  background: var(--cloud);
  border: 4px solid var(--ink);
  font-family: var(--title);
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  transform: skewX(-9deg);
}

.hero-kenta {
  position: absolute;
  right: 3%;
  bottom: -9%;
  z-index: 2;
  width: 33%;
  filter: drop-shadow(10px 8px 0 rgba(27, 26, 34, 0.35));
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  margin-left: 4%;
}

/* section titles */
.shot-title {
  display: inline-block;
  margin-bottom: 22px;
  padding: 6px 24px 8px;
  background: var(--ink);
  color: #fff;
  font-family: var(--title);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.1;
  transform: skewX(-9deg);
  box-shadow: 6px 6px 0 var(--red);
}

/* who he is: three slanted manga panels */
.who {
  padding: 0 0 80px;
}

.panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: clamp(440px, 46vw, 600px);
  padding: 8px;
  background: var(--ink);
  border: 6px solid var(--ink);
  overflow: hidden;
}

/* panels overlap a little and are cut on a slant, the ink shows through as the gutter */
.panel {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

.panel:nth-child(1) {
  margin-right: -3%;
  clip-path: polygon(0 0, 100% 0, 91% 100%, 0 100%);
}

.panel:nth-child(2) {
  margin: 0 -3%;
  clip-path: polygon(11% 0, 100% 0, 89% 100%, 2% 100%);
}

.panel:nth-child(3) {
  margin-left: -3%;
  clip-path: polygon(13% 0, 100% 0, 100% 100%, 4% 100%);
}

.panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-text {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 5%;
  padding: 12px 16px;
  background: var(--cloud);
  border: 3px solid var(--ink);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
}

.panel-text b {
  display: block;
  margin-bottom: 4px;
  color: var(--red);
  font-family: var(--title);
  font-weight: 400;
  font-size: 1.15rem;
}

.can-slide .slide-in {
  transform: translateY(44px);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.can-slide .slide-in:nth-child(2) {
  transition-delay: 0.08s;
}

.can-slide .slide-in:nth-child(3) {
  transition-delay: 0.16s;
}

.can-slide .slide-in.is-in {
  transform: none;
}

/* the rival */
.rival {
  padding: 10px 0 80px;
}

.rival-frame {
  position: relative;
  border: 6px solid var(--ink);
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 3% 100%);
}

.rival-frame img {
  width: 100%;
}

.rival-text {
  position: absolute;
  right: 3%;
  top: 8%;
  max-width: 360px;
  padding: 14px 20px;
  background: var(--cloud);
  border: 4px solid var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
  box-shadow: 6px 6px 0 var(--ink);
}

.rival-text p + p {
  margin-top: 6px;
  color: var(--red);
  font-family: var(--title);
  font-weight: 400;
  font-size: 1.4rem;
}

/* power up */
.power {
  padding: 10px 0 80px;
}

.power-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}

.stage {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 6px solid var(--ink);
  background: var(--ink) url("../images/stage.webp") center / cover;
  overflow: hidden;
  box-shadow: 10px 10px 0 var(--red);
}

.stage-frame {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 78%;
  transform: translateX(-50%);
  opacity: 0;
}

.stage-frame.is-on {
  opacity: 1;
}

.stage.is-shaking {
  animation: shake 0.45s linear;
}

@keyframes shake {
  20% { transform: translate(-10px, 4px); }
  40% { transform: translate(9px, -5px); }
  60% { transform: translate(-6px, 3px); }
  80% { transform: translate(4px, -2px); }
}

.power-panel {
  padding: 26px;
  background: var(--cloud);
  border: 5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}

.power-intro {
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 1.15rem;
}

.power-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin: 0 auto 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: var(--title);
  font-size: 1.15rem;
  line-height: 1.1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 8px 0 var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.power-btn.is-held {
  transform: translateY(6px) scale(0.97);
  box-shadow: 0 2px 0 var(--ink);
}

.power-btn:focus-visible {
  outline: 4px solid var(--sun);
  outline-offset: 4px;
}

.power-ring {
  position: absolute;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.power-ring circle {
  fill: none;
  stroke-width: 9;
}

.power-ring-track {
  stroke: rgba(27, 26, 34, 0.15);
}

.power-ring-fill {
  stroke: var(--sun);
  stroke-linecap: round;
}

.power-stats {
  display: flex;
  justify-content: center;
  gap: 26px;
  font-family: var(--mono);
  font-size: 1.05rem;
}

.power-stats span {
  font-weight: 700;
}

.power-line {
  min-height: 1.6em;
  margin-top: 12px;
  text-align: center;
  font-family: var(--title);
  font-size: 1.25rem;
  color: var(--red);
}

/* the coin: end card of the opening */
.coin {
  padding: 10px 0 90px;
}

.end-card {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 44px 44px;
  background: #fff;
  border: 6px solid var(--ink);
  box-shadow: 12px 12px 0 var(--ink);
  overflow: hidden;
}

.end-card::before {
  content: "";
  position: absolute;
  top: -20%;
  right: 16%;
  width: 70px;
  height: 140%;
  background: var(--red);
  transform: rotate(18deg);
}

.end-card > * {
  position: relative;
}

.ticker {
  font-family: var(--title);
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 1;
  -webkit-text-stroke: 0.06em var(--ink);
  paint-order: stroke fill;
  color: var(--shiba);
}

.end-line {
  margin: 10px 0 24px;
  font-weight: 700;
  font-size: 1.15rem;
}

.ca-box {
  display: block;
  width: 100%;
  margin-bottom: 22px;
  padding: 14px 18px;
  background: var(--cloud);
  border: 4px solid var(--ink);
  color: var(--ink);
  text-align: left;
  font-family: var(--mono);
  font-size: clamp(11px, 3.2vw, 18px);
  overflow-wrap: anywhere;
  min-height: 48px;
}

.ca-box[hidden] {
  display: none !important;
}

.ca-box:hover {
  background: #fff;
}

.ca-status {
  display: block;
  margin-top: 6px;
  color: var(--red);
  font-family: var(--title);
  font-size: 0.9rem;
}

.ca-box.is-copied .ca-status {
  color: var(--shiba);
}

.end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* footer: asleep on the roof */
.end {
  padding: 0 0 40px;
}

.end-frame {
  position: relative;
  border: 6px solid var(--ink);
  background: var(--ink);
}

.end-frame img {
  width: 100%;
}

.end-title {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%) skewX(-9deg);
  width: max-content;
  max-width: 92%;
  font-family: var(--title);
  font-size: clamp(1.4rem, 4.4vw, 3.4rem);
  color: #fff;
  -webkit-text-stroke: 0.08em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0.06em 0.06em 0 var(--red);
  text-align: center;
}

.end-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  font-size: 0.95rem;
}

.end-note {
  max-width: 560px;
  padding: 8px 14px;
  background: var(--cloud);
  border: 3px solid var(--ink);
}

/* intro */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  transition: transform 0.45s cubic-bezier(0.7, 0, 0.3, 1);
}

.intro.is-closing {
  transform: translateY(-101%);
}

.intro-line {
  font-family: var(--title);
  font-size: clamp(1.4rem, 5vw, 2.8rem);
  animation: line-in 0.4s both;
}

.intro-line--late {
  color: var(--sun);
  animation-delay: 1s;
}

.intro-tap {
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--concrete);
}

@keyframes line-in {
  from {
    transform: translateX(-30px) skewX(-9deg);
    opacity: 0;
  }
}

/* 404 */
.lost {
  padding: 40px 0 60px;
}

.lost-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  padding: 28px;
  background: var(--cloud);
  border: 6px solid var(--ink);
  box-shadow: 12px 12px 0 var(--red);
}

.lost-card img {
  border: 4px solid var(--ink);
}

.lost-title {
  margin-bottom: 14px;
  font-family: var(--title);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1;
}

.lost-card p {
  margin-bottom: 22px;
  font-weight: 700;
  font-size: 1.15rem;
}

@media (max-width: 900px) {
  .power-grid {
    grid-template-columns: 1fr;
  }

  .rival-text {
    position: static;
    max-width: none;
    margin: 0;
    border-width: 4px 0 0;
    box-shadow: none;
  }

  .rival-frame {
    clip-path: none;
  }
}

@media (max-width: 600px) {
  .top-name {
    display: none;
  }

  .top-plate {
    padding-right: 22px;
  }

  .hero {
    padding: 18px 0 44px;
  }

  .hero-frame {
    aspect-ratio: 4 / 5;
  }

  .hero-shot img {
    object-position: 62% center;
  }

  .hero-title {
    font-size: clamp(2.6rem, 17vw, 5rem);
    top: 8%;
  }

  .hero-kenta {
    width: 58%;
    right: -2%;
    bottom: -6%;
  }

  .hero-line {
    left: 4%;
    top: 37%;
    bottom: auto;
    max-width: 46%;
    padding: 8px 12px;
    font-size: 1rem;
    line-height: 1.2;
  }

  .panels {
    grid-template-columns: 1fr;
    height: auto;
  }

  .panel:nth-child(n) {
    margin: 0;
    aspect-ratio: 4 / 5;
    clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
  }

  .panel + .panel {
    margin-top: -10px;
    clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%);
  }

  .end-card {
    padding: 28px 20px 30px;
  }

  .end-card::before {
    right: -4%;
    width: 40px;
  }

  .end-line {
    margin-right: 30px;
  }

  .lost-card {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
