﻿:root {
  color-scheme: light;
  --ink: #34302f;
  --muted: #7a6f70;
  --paper: #fff9f7;
  --surface: #ffffff;
  --line: #f0dedc;
  --rose: #f06d82;
  --teal: #69b7ac;
  --gold: #f1c95d;
  --sky: #9fc7f2;
  --soft-pink: #ffe7ea;
  --soft-mint: #e6f6f1;
  --shadow: 0 18px 45px rgba(101, 69, 72, 0.13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Open Sans", "Noto Sans TC", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(240, 109, 130, .08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(105, 183, 172, .07) 1px, transparent 1px),
    linear-gradient(120deg, rgba(255, 231, 234, .72), transparent 42%),
    linear-gradient(300deg, rgba(230, 246, 241, .88), transparent 38%),
    var(--paper);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

body.lightbox-open { overflow: hidden; }

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

button, a { font: inherit; }

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  min-height: 74px;
  padding: 10px clamp(18px, 4vw, 56px);
  background: rgba(255, 250, 248, 0.9);
  border-bottom: 1px solid rgba(240, 222, 220, 0.9);
  box-shadow: 0 10px 24px rgba(101, 69, 72, .05);
  backdrop-filter: blur(18px);
}

.brand img {
  width: clamp(88px, 8vw, 112px);
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(101, 69, 72, .12));
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.site-nav a,
.back-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: .92rem;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current],
.back-link:hover {
  color: var(--ink);
  border-color: rgba(240, 109, 130, .22);
  background: linear-gradient(180deg, #fff, var(--soft-pink));
}

.site-nav a:hover,
.back-link:hover { transform: translateY(-1px); }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, var(--soft-pink));
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.app {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 76px) 0 86px;
  outline: none;
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(330px, .95fr) minmax(360px, 1.05fr);
  align-items: center;
  gap: clamp(30px, 5vw, 68px);
  min-height: min(560px, calc(100vh - 112px));
}

.home-hero::before {
  content: "";
  position: absolute;
  left: -22px;
  top: clamp(8px, 4vw, 44px);
  width: 92px;
  height: 18px;
  border: 1px solid rgba(240, 109, 130, .22);
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, rgba(240, 109, 130, .16) 0 10px, rgba(241, 201, 93, .2) 10px 20px);
  transform: rotate(-9deg);
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--rose);
  font-size: .86rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(240, 109, 130, .24);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(101, 69, 72, .06);
}

h1 {
  margin: 0;
  font-family: "Trebuchet MS", "Open Sans", "Noto Sans TC", Arial, sans-serif;
  font-size: clamp(2.75rem, 5vw, 5.55rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: normal;
  color: #3b3434;
  text-shadow: 0 5px 0 rgba(255, 231, 234, .9);
}

.hero-art {
  margin: 0;
  justify-self: end;
  width: min(620px, 100%);
  padding: 12px;
  border: 1px solid rgba(240, 222, 220, .95);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.hero-art img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 440px;
  border-radius: 6px;
  object-fit: cover;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
  margin-top: clamp(22px, 4vw, 42px);
}

.character-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto auto;
  min-height: 250px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent), var(--line) 68%);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,255,255,.94)),
    linear-gradient(135deg, color-mix(in srgb, var(--accent), #fff 82%), #fff);
  box-shadow: 0 12px 26px rgba(101, 69, 72, .08);
  text-decoration: none;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.character-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent), #fff 62%));
}

.character-card::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 16px;
  width: 34px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--accent), #fff 42%);
  border-radius: 8px;
  background: rgba(255, 255, 255, .64);
  transform: rotate(8deg);
}

.character-card:hover {
  transform: translateY(-6px) rotate(-.5deg);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .48);
}

.card-icon {
  max-height: 158px;
  object-fit: contain;
  filter: drop-shadow(0 14px 16px rgba(101, 69, 72, .12));
}

.card-icon.secondary {
  position: absolute;
  right: 4px;
  bottom: 4px;
  max-height: 96px;
}

.card-name {
  margin-top: 14px;
  font-weight: 800;
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  overflow-wrap: anywhere;
  color: #44393a;
}

.card-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: .9rem;
}

.character-view {
  display: grid;
  gap: 26px;
  position: relative;
}

.character-heading {
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: clamp(22px, 5vw, 64px);
  align-items: center;
  padding: clamp(18px, 3vw, 34px) 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent), var(--line) 58%);
}

.portrait-stack {
  position: relative;
  min-height: 230px;
  display: grid;
  place-items: center;
}

.portrait-stack::before {
  content: "";
  position: absolute;
  inset: 12% 4%;
  border: 1px solid color-mix(in srgb, var(--accent), #fff 50%);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.35) 1px, transparent 1px),
    color-mix(in srgb, var(--accent), #fff 76%);
  background-size: 18px 18px;
  transform: rotate(-4deg);
}

.portrait-icon {
  position: relative;
  max-height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(39, 38, 37, .15));
}

.portrait-icon.offset {
  position: absolute;
  right: 4px;
  bottom: 0;
  max-height: 150px;
}

.summary {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1rem, 1.9vw, 1.2rem);
  line-height: 1.75;
}

.credit {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 8px 0 0;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent), #fff 52%);
  border-left: 5px solid var(--accent);
  color: var(--ink);
  background: color-mix(in srgb, var(--accent), #fff 88%);
  border-radius: 4px;
  font-weight: 700;
}

.gallery {
  columns: 3 260px;
  column-gap: 18px;
}

.gallery-item {
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  break-inside: avoid;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent), var(--line) 72%);
  border-radius: 8px;
  background: #fff;
  cursor: zoom-in;
  box-shadow: 0 10px 22px rgba(101, 69, 72, .08);
}

.gallery-item img {
  width: 100%;
  height: auto;
  transition: transform .24s ease;
}

.gallery-item:hover img { transform: scale(1.025); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 64px 20px 28px;
  background: rgba(20, 20, 20, .78);
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: min(1100px, 96vw);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.paw-burst {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.paw-print {
  position: fixed;
  width: 28px;
  height: 26px;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--turn)) scale(.72);
  animation: pawFloat 780ms ease-out var(--delay) forwards;
}

.paw-print .toe,
.paw-print .pad {
  position: absolute;
  display: block;
  background: rgba(240, 109, 130, .82);
  box-shadow: 0 3px 0 rgba(255, 255, 255, .8);
}

.paw-print .toe {
  width: 7px;
  height: 8px;
  border-radius: 50%;
}

.paw-print .toe-a {
  left: 2px;
  top: 8px;
  transform: rotate(-24deg);
}

.paw-print .toe-b {
  left: 7px;
  top: 1px;
  transform: rotate(-8deg);
}

.paw-print .toe-c {
  right: 7px;
  top: 1px;
  transform: rotate(8deg);
}

.paw-print .toe-d {
  right: 2px;
  top: 8px;
  transform: rotate(24deg);
}

.paw-print .pad {
  left: 8px;
  bottom: 1px;
  width: 13px;
  height: 12px;
  border-radius: 58% 58% 52% 52%;
}

@keyframes pawFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(10px) rotate(var(--turn)) scale(.58);
  }
  18% {
    opacity: .96;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(calc(var(--drift) * 18px), -54px) rotate(calc(var(--turn) + 12deg)) scale(1.06);
  }
}

@media (max-width: 1080px) {
  .site-nav {
    justify-content: flex-start;
  }

  .site-nav a {
    min-height: 36px;
    padding: 0 10px;
    font-size: .88rem;
  }

  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .hero-art {
    justify-self: stretch;
  }

  .hero-art img {
    max-height: none;
  }

  .character-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header { grid-template-columns: 1fr auto; }
  .menu-toggle { display: block; }
  .site-nav {
    grid-column: 1 / -1;
    display: none;
    justify-content: start;
    padding-top: 8px;
  }
  .menu-open .site-nav { display: flex; }
  .home-hero, .character-heading { grid-template-columns: 1fr; }
  .hero-art { justify-self: center; }
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .site-header { padding: 12px 14px; }
  .app { width: min(100% - 24px, 1180px); padding-top: 26px; }
  .home-hero { min-height: auto; }
  h1 { font-size: clamp(2.35rem, 14vw, 3.2rem); }
  .brand img { width: 82px; }
  .character-grid { grid-template-columns: 1fr; }
  .character-card { min-height: 220px; }
  .gallery { columns: 1; }
}
