/* Mame — shared styles for /kodechan/mame/ and /en/kodechan/mame/.
   Loaded after the site-wide /styles.css and /kodechan/kodechan.css so the
   header, footer, breadcrumbs, and section-label vocabulary stay identical
   to Kode-chan's room. Only the palette is warmed up (cream / pale pink) so
   the black cat reads clearly, and the same 980/720/440 breakpoints apply. */

.mame-body {
  --mame-cream: #fbf4ea;
  --mame-cream-deep: #f5e7d6;
  --mame-pink: #f6dcdc;
  --mame-pink-soft: #fcefed;
  --mame-rose: #a3445a;
  --mame-ink: #2b2421;
  --mame-brown: #66564c;
  --mame-line: rgba(88, 60, 44, 0.16);
  --mame-radius: 28px;
  --mame-shadow: 0 22px 50px rgba(92, 62, 40, 0.1);

  background:
    radial-gradient(circle at 12% 0%, rgba(246, 220, 220, 0.55), transparent 38%),
    linear-gradient(180deg, var(--mame-cream), #fffaf4 55%, var(--mame-cream));
}

.mame-main {
  padding-bottom: 72px;
  color: var(--mame-ink);
}

.mame-body .kode-breadcrumbs li:not(:last-child)::after {
  color: var(--mame-line);
}

.mame-body .kode-section-label {
  color: var(--mame-rose);
}

/* ---------- shared pieces ---------- */

.mame-section {
  padding: clamp(56px, 8vw, 96px) 0;
}

.mame-section + .mame-section {
  border-top: 1px dashed var(--mame-line);
}

.mame-head {
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.mame-head--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.mame-head h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.mame-head p:not(.kode-section-label),
.mame-copy p {
  margin: 0;
  color: var(--mame-brown);
  font-size: 1.02rem;
  line-height: 1.95;
}

.mame-copy p + p {
  margin-top: 14px;
}

.mame-button {
  min-height: 50px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--mame-ink);
  border-radius: 999px;
  background: var(--mame-ink);
  color: #fffaf4;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.mame-button:hover {
  background: #4a3d37;
  transform: translateY(-1px);
}

.mame-button:focus-visible,
.mame-scroll-box:focus-visible,
.mame-main a:focus-visible {
  outline: 3px solid var(--mame-rose);
  outline-offset: 3px;
}

.mame-figure {
  margin: 0;
}

.mame-figure img,
.mame-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.mame-photo {
  margin: 0;
  overflow: hidden;
  border-radius: 22px;
  background: var(--mame-cream-deep);
  box-shadow: var(--mame-shadow);
}

.mame-photo img {
  transition: transform 0.4s ease;
}

.mame-caption {
  margin-top: 12px;
  color: var(--mame-ink);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}

/* ---------- 01 / Hero ---------- */

.mame-hero {
  padding: 20px 0 clamp(40px, 6vw, 72px);
}

.mame-hero-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--mame-radius);
  background: var(--mame-cream-deep);
  box-shadow: var(--mame-shadow);
}

.mame-hero-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1672 / 941;
  object-fit: cover;
}

.mame-hero-copy {
  position: absolute;
  inset: 0 auto 0 0;
  width: 46%;
  padding: clamp(28px, 4.4vw, 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(
    90deg,
    rgba(251, 244, 234, 0.94) 0%,
    rgba(251, 244, 234, 0.86) 62%,
    rgba(251, 244, 234, 0) 100%
  );
}

.mame-hero h1 {
  margin: 10px 0 0;
  font-size: clamp(3rem, 6.4vw, 5.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.mame-hero-catch {
  margin: 16px 0 0;
  font-size: clamp(1.1rem, 1.9vw, 1.55rem);
  font-weight: 700;
  line-height: 1.55;
}

.mame-hero-lead {
  margin: 14px 0 26px;
  color: var(--mame-brown);
  font-size: clamp(0.92rem, 1.15vw, 1.02rem);
  line-height: 1.9;
}

.mame-scroll {
  position: absolute;
  left: clamp(28px, 4.4vw, 60px);
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--mame-brown);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.mame-scroll::after {
  content: "";
  width: 48px;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  animation: mame-scroll-line 2.4s ease-in-out infinite;
}

@keyframes mame-scroll-line {
  0%,
  100% {
    transform: scaleX(0.35);
    opacity: 0.5;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* ---------- 02 / Story ---------- */

.mame-story-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 26px);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: mame-story;
}

.mame-story-list li {
  position: relative;
}

.mame-story-list .mame-photo {
  aspect-ratio: 1448 / 1086;
}

.mame-story-step {
  display: grid;
  gap: 2px;
  margin-top: 14px;
}

.mame-story-step span {
  color: var(--mame-rose);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.mame-story-step strong {
  font-size: 1rem;
  line-height: 1.5;
}

/* ---------- 03 / Profile ---------- */

.mame-profile {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.mame-profile-visual {
  margin: 0;
  padding: clamp(18px, 3vw, 34px);
  border-radius: 50%;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 45%, #fff, var(--mame-pink) 72%);
}

.mame-profile-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.mame-profile-list {
  margin: 0;
  border-top: 1px solid var(--mame-line);
}

.mame-profile-list > div {
  display: grid;
  grid-template-columns: minmax(96px, 0.32fr) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--mame-line);
}

.mame-profile-list dt {
  color: var(--mame-rose);
  font-size: 0.82rem;
  font-weight: 800;
}

.mame-profile-list dd {
  margin: 0;
  font-weight: 600;
}

.mame-profile-list small {
  display: block;
  color: var(--mame-brown);
  font-size: 0.82rem;
  font-weight: 500;
}

.mame-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mame-tags li {
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--mame-pink-soft);
  border: 1px solid var(--mame-pink);
  font-size: 0.88rem;
}

.mame-features {
  margin-top: clamp(40px, 6vw, 64px);
  padding: clamp(22px, 3.4vw, 40px);
  border: 1px solid var(--mame-line);
  border-radius: var(--mame-radius);
  background: #fff;
  box-shadow: var(--mame-shadow);
}

.mame-features h3 {
  margin: 0 0 18px;
  font-size: 1.15rem;
  text-align: center;
}

/* Wide images with baked-in text (features / growth). On narrow screens the
   box scrolls horizontally inside itself so the lettering keeps a readable
   size; the page body never scrolls sideways. */
.mame-scroll-box {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
}

.mame-scroll-hint {
  display: none;
  margin: 10px 0 0;
  color: var(--mame-brown);
  font-size: 0.8rem;
  text-align: center;
}

/* ---------- 04 / Life with Mame ---------- */

.mame-life-grid,
.mame-together-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mame-life-grid .mame-photo,
.mame-together-grid .mame-photo {
  aspect-ratio: 1;
}

/* ---------- 05 / Kode-chan & Mame ---------- */

.mame-together-section {
  background: linear-gradient(180deg, var(--mame-pink-soft), rgba(252, 239, 237, 0));
}

.mame-together-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.mame-together-lead .mame-photo {
  aspect-ratio: 1672 / 941;
}

.mame-together-lead .mame-head {
  margin-bottom: 0;
}

/* ---------- 06 / Memories ---------- */

.mame-memories .mame-scroll-box {
  box-shadow: var(--mame-shadow);
}

.mame-scroll-box img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- 07 / Follow ---------- */

.mame-follow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding: clamp(28px, 5vw, 56px);
  border-radius: var(--mame-radius);
  background: #fff;
  border: 1px solid var(--mame-line);
  box-shadow: var(--mame-shadow);
}

.mame-follow .mame-head {
  margin-bottom: 0;
}

.mame-follow .mame-head p.mame-follow-handle {
  margin: 0;
  color: var(--mame-rose);
  font-weight: 700;
}

.mame-follow-actions {
  margin-top: 8px;
}

.mame-follow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mame-follow-grid .mame-photo {
  aspect-ratio: 1;
  border-radius: 18px;
  box-shadow: none;
}

/* ---------- 08 / Kode-chan world ---------- */

.mame-world {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  overflow: hidden;
  border-radius: var(--mame-radius);
  background: var(--mame-ink);
  color: #fffaf4;
  box-shadow: var(--mame-shadow);
}

.mame-world-visual {
  margin: 0;
  min-height: 100%;
}

.mame-world-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
  aspect-ratio: 1672 / 941;
}

.mame-world-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(28px, 4.4vw, 56px);
}

.mame-world-copy .kode-section-label {
  color: #f3b9c3;
}

.mame-world-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.2;
}

.mame-world-copy p:not(.kode-section-label) {
  margin: 0;
  color: rgba(255, 250, 244, 0.86);
  line-height: 1.95;
}

.mame-world-copy .mame-button {
  justify-self: start;
  margin-top: 8px;
  border-color: #fffaf4;
  background: #fffaf4;
  color: var(--mame-ink);
}

.mame-world-copy .mame-button:hover {
  background: var(--mame-pink);
}

.mame-world-copy .mame-button:focus-visible {
  outline-color: #f3b9c3;
}

/* ---------- hover (pointer devices only) ---------- */

@media (hover: hover) {
  .mame-life-grid .mame-photo:hover img,
  .mame-together-grid .mame-photo:hover img,
  .mame-story-list .mame-photo:hover img {
    transform: scale(1.03);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .mame-story-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mame-life-grid,
  .mame-together-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mame-together-lead,
  .mame-follow,
  .mame-world {
    grid-template-columns: 1fr;
  }

  .mame-profile {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

/* The overlay hero needs roughly 380px of height for the copy; below this
   width the 16:9 image becomes too short, so the copy moves under the image
   instead of shrinking over it. */
@media (max-width: 900px) {
  .mame-hero-stage {
    border-radius: 24px;
  }

  .mame-hero-img {
    aspect-ratio: 3 / 2;
    object-position: 76% 50%;
  }

  .mame-hero-copy {
    position: static;
    width: auto;
    padding: 26px 24px 30px;
    background: var(--mame-cream);
  }

  .mame-scroll {
    display: none;
  }
}

@media (max-width: 720px) {
  .mame-profile {
    grid-template-columns: 1fr;
  }

  .mame-profile-visual {
    width: min(78%, 320px);
    justify-self: center;
  }

  .mame-scroll-box > img {
    width: 760px;
    max-width: none;
  }

  .mame-scroll-hint {
    display: block;
  }

  .mame-features {
    padding: 18px 14px;
  }
}

@media (max-width: 560px) {
  .mame-story-list {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 440px) {
  .mame-life-grid,
  .mame-together-grid {
    gap: 12px;
  }

  .mame-caption {
    font-size: 0.86rem;
  }

  .mame-profile-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .mame-hero-img {
    aspect-ratio: 1 / 1;
    object-position: 74% 50%;
  }

  .mame-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mame-scroll::after {
    animation: none;
  }

  .mame-photo img,
  .mame-button {
    transition: none;
  }

  .mame-life-grid .mame-photo:hover img,
  .mame-together-grid .mame-photo:hover img,
  .mame-story-list .mame-photo:hover img,
  .mame-button:hover {
    transform: none;
  }
}
