:root {
  --ink: #101820;
  --paper: #fffdf8;
  --tone: #f1f4f0;
  --line: #06c755;
  --line-dark: #008f51;
  --muted: #65727a;
  --warm: #f4dfc8;
  --wood: #b8885d;
  --navy: #162635;
  --skin: #ffe3cf;
  --shadow: 0 24px 70px rgba(16, 24, 32, 0.16);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Meiryo", system-ui, sans-serif;
  color: var(--ink);
  background: #fff5e8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(6, 199, 85, 0.16), transparent 32%),
    radial-gradient(circle at 86% 16%, rgba(255, 187, 120, 0.24), transparent 34%),
    linear-gradient(180deg, #fff7e9 0%, #eefaf2 46%, #fffaf2 100%);
}

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

figure {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 48px) 72px;
}

.comic-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--line), #0aa698);
  box-shadow: 0 12px 28px rgba(6, 199, 85, 0.24);
}

.nav-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #cfe7da;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--line-dark);
  font-size: 14px;
  font-weight: 900;
}
.nav-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-link.home { background: #06c755; border-color: #06c755; color: #fff; box-shadow: 0 4px 12px rgba(6, 199, 85, .28); }
.nav-link.home:hover { background: #05b34c; }

.story-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  min-width: 0;
  margin-bottom: 42px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid #d7e7dd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.story-hero > * {
  min-width: 0;
}

.story-hero--text {
  display: block;
  max-width: 920px;
  margin-inline: auto;
}

.story-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: var(--line-dark);
  font-weight: 900;
  font-size: 13px;
}

.story-kicker::before {
  content: "";
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.story-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.story-hero p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 2px solid var(--line-dark);
  border-radius: 8px;
  background: var(--line);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(6, 199, 85, 0.22);
}

.hero-image {
  position: relative;
  min-width: 0;
  min-height: 360px;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: #ddd;
}

.hero-image img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  filter: contrast(1.03) saturate(1.04);
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.05), transparent 38%),
    radial-gradient(circle at 88% 18%, rgba(6, 199, 85, 0.2), transparent 24%);
  pointer-events: none;
}

.story-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.story-card {
  min-height: 168px;
  padding: 22px;
  border: 1px solid #cfe7da;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(16, 24, 32, 0.08);
}

.story-card span {
  color: var(--line-dark);
  font-size: 12px;
  font-weight: 900;
}

.story-card h2 {
  margin: 14px 0 8px;
  font-size: 24px;
  line-height: 1.3;
}

.story-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.comic-stack {
  display: grid;
  gap: 34px;
}

.comic-page {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 18px);
  overflow: hidden;
  border: 1px solid #cad8d0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.page-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  font-weight: 900;
}

.page-label span {
  color: var(--line-dark);
}

.page-label small {
  color: var(--muted);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  min-width: 0;
  grid-auto-rows: minmax(118px, 9.4vw);
  gap: 8px;
}

.panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: #fff6e8;
  isolation: isolate;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(16, 24, 32, 0.08) 1px, transparent 1.3px) 0 0 / 8px 8px,
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 42%);
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}

.panel.wide {
  grid-column: span 12;
  grid-row: span 3;
}

.panel.half {
  grid-column: span 6;
  grid-row: span 3;
}

.panel.third {
  grid-column: span 4;
  grid-row: span 3;
}

.panel.tall {
  grid-column: span 5;
  grid-row: span 5;
}

.panel.large {
  grid-column: span 7;
  grid-row: span 5;
}

.panel.full {
  grid-column: span 12;
  grid-row: span 5;
}

.panel img.panel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.04) saturate(1.04);
}

.scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(239, 246, 232, 0.93)),
    radial-gradient(circle at 70% 25%, rgba(6, 199, 85, 0.16), transparent 28%),
    radial-gradient(circle at 12% 88%, rgba(248, 172, 88, 0.2), transparent 28%);
}

.scene.dark {
  background:
    linear-gradient(180deg, #fff1dc, #d8eadb),
    repeating-linear-gradient(90deg, rgba(22, 38, 53, 0.08) 0 2px, transparent 2px 8px);
}

.speed {
  position: absolute;
  inset: -10%;
  background:
    repeating-conic-gradient(from 42deg at 64% 48%, transparent 0 8deg, rgba(16, 24, 32, 0.16) 9deg 10deg),
    radial-gradient(circle at 64% 48%, rgba(255, 255, 255, 0.6), transparent 32%);
  opacity: 0.58;
}

.salon-wall {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 24, 32, 0.08) 0 2px, transparent 2px 18%),
    linear-gradient(180deg, #fff2df 0 52%, #d9b98f 52% 100%);
}

.shelf {
  position: absolute;
  right: 6%;
  top: 18%;
  width: 28%;
  height: 10px;
  border: 2px solid var(--ink);
  background: #c7905d;
}

.shelf::before,
.shelf::after {
  content: "";
  position: absolute;
  bottom: 10px;
  width: 12px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 7px 7px 3px 3px;
  background: #fff2df;
}

.shelf::before {
  left: 18%;
}

.shelf::after {
  left: 44%;
  height: 34px;
}

.phone-ui,
.tablet-ui,
.note-ui {
  position: absolute;
  z-index: 2;
  border: 3px solid var(--ink);
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 8px 8px 0 rgba(16, 24, 32, 0.12);
}

.phone-ui {
  width: 27%;
  height: 52%;
  right: 9%;
  bottom: 10%;
  border-radius: 14px;
}

.tablet-ui {
  width: 44%;
  height: 42%;
  right: 7%;
  bottom: 10%;
  border-radius: 8px;
  transform: rotate(-2deg);
}

.note-ui {
  width: 38%;
  height: 48%;
  left: 7%;
  bottom: 12%;
  border-radius: 3px;
  transform: rotate(2deg);
}

.phone-ui::before,
.tablet-ui::before,
.note-ui::before {
  content: "";
  position: absolute;
  inset: 14% 12% auto;
  height: 3px;
  background: var(--line);
  box-shadow:
    0 18px 0 rgba(16, 24, 32, 0.22),
    0 36px 0 rgba(16, 24, 32, 0.22),
    0 54px 0 rgba(16, 24, 32, 0.22);
}

.check-list {
  position: absolute;
  left: 9%;
  top: 16%;
  width: 42%;
  height: 48%;
  border: 3px solid var(--ink);
  background: rgba(255, 253, 247, 0.94);
  transform: rotate(-3deg);
}

.check-list::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-left: 8px solid var(--line);
  box-shadow:
    0 28px 0 -1px var(--line),
    0 56px 0 -1px var(--line),
    0 84px 0 -1px var(--line);
}

.person {
  position: absolute;
  z-index: 2;
  width: 28%;
  height: 78%;
  bottom: 0;
}

.person.left {
  left: 10%;
}

.person.center {
  left: 35%;
}

.person.right {
  right: 9%;
}

.person::before {
  content: "";
  position: absolute;
  top: 4%;
  left: 32%;
  width: 34%;
  height: 22%;
  border: 3px solid var(--ink);
  border-radius: 50% 50% 46% 46%;
  background: var(--skin);
}

.person::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 58%;
  height: 58%;
  border: 3px solid var(--ink);
  border-bottom: 0;
  border-radius: 36% 36% 0 0;
  background: var(--navy);
}

.person.customer::after {
  background: #fff3e4;
}

.person.customer::before {
  top: 8%;
}

.hair {
  position: absolute;
  z-index: 3;
  top: 1%;
  left: 28%;
  width: 42%;
  height: 25%;
  border: 3px solid var(--ink);
  border-radius: 50% 50% 38% 38%;
  background:
    radial-gradient(circle at 48% 5%, rgba(255, 255, 255, 0.18), transparent 20%),
    #1b1b1d;
}

.person.customer .hair {
  top: 4%;
  height: 28%;
  border-radius: 50% 50% 52% 52%;
}

.eyes {
  position: absolute;
  z-index: 4;
  top: 15%;
  left: 41%;
  width: 18%;
  height: 3%;
  border-top: 3px solid var(--ink);
  box-shadow: 22px 0 0 -1px var(--ink);
}

.desk {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26%;
  border-top: 3px solid var(--ink);
  background: linear-gradient(180deg, #c59a6d, #a9784f);
}

.bubble {
  position: absolute;
  z-index: 8;
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: 13px 16px;
  border: 3px solid var(--ink);
  border-radius: 46% 54% 48% 52% / 54% 48% 52% 46%;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  text-align: center;
  font-size: clamp(14px, 1.5vw, 21px);
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  box-shadow: 6px 8px 0 rgba(16, 24, 32, 0.08);
}

.bubble.small {
  min-height: 56px;
  padding: 10px 13px;
  font-size: clamp(13px, 1.2vw, 17px);
}

.bubble.long {
  border-radius: 18px;
}

.bubble.thought {
  border-radius: 32px;
  border-style: dashed;
}

.bubble::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  right: 18%;
  bottom: -13px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: #fff;
  transform: rotate(45deg);
}

.bubble.tail-left::after {
  right: auto;
  left: 18%;
}

.bubble.tail-top::after {
  top: -13px;
  bottom: auto;
  transform: rotate(225deg);
}

.caption {
  position: absolute;
  z-index: 9;
  left: 4%;
  right: 4%;
  bottom: 4%;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: rgba(16, 24, 32, 0.92);
  color: #fff;
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 900;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.narration {
  position: absolute;
  z-index: 9;
  left: 4%;
  top: 4%;
  max-width: 62%;
  padding: 10px 13px;
  border-left: 5px solid var(--line);
  background: rgba(255, 252, 244, 0.95);
  color: var(--ink);
  font-weight: 900;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.sfx {
  position: absolute;
  z-index: 7;
  color: rgba(16, 24, 32, 0.78);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(28px, 4.6vw, 64px);
  font-weight: 900;
  transform: rotate(-8deg);
  letter-spacing: 0;
}

.page-art-wrap {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: #fff;
  isolation: isolate;
}

.page-art-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.04), transparent 36%),
    radial-gradient(circle at 92% 6%, rgba(6, 199, 85, 0.08), transparent 18%);
  z-index: 1;
  display: none;
}

.page-art {
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.02) saturate(1.03);
}

.page-art-wrap .bubble {
  z-index: 4;
  min-height: auto;
  padding: clamp(7px, 1.25vw, 15px) clamp(9px, 1.45vw, 18px);
  font-size: clamp(10px, 1.55vw, 18px);
  line-height: 1.45;
  box-shadow: 4px 6px 0 rgba(16, 24, 32, 0.1);
}

.page-art-wrap .bubble.small {
  padding: clamp(6px, 1vw, 12px) clamp(8px, 1.2vw, 15px);
  font-size: clamp(9px, 1.32vw, 15px);
}

.page-art-wrap .bubble.long {
  border-radius: 18px;
}

.page-art-wrap .bubble.thought {
  background: rgba(255, 255, 255, 0.94);
  border-style: solid;
  border-radius: 26px;
}

.page-art-wrap .bubble.no-tail::after {
  display: none;
}

.page-art-wrap .caption {
  z-index: 5;
  padding: clamp(7px, 1.1vw, 13px) clamp(10px, 1.5vw, 18px);
  font-size: clamp(10px, 1.45vw, 16px);
  line-height: 1.55;
  text-align: center;
  border: 0;
  border-radius: 4px;
  background: rgba(16, 24, 32, 0.88);
}

.page-art-wrap .page-narration {
  left: auto;
  max-width: none;
  z-index: 5;
  padding: clamp(8px, 1.15vw, 14px) clamp(10px, 1.35vw, 16px);
  border-left: 5px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 252, 244, 0.94);
  font-size: clamp(10px, 1.34vw, 16px);
  box-shadow: 4px 6px 0 rgba(16, 24, 32, 0.08);
}

.accent {
  color: var(--line-dark);
}

.ending-copy {
  width: min(1040px, 100%);
  margin: 34px auto 0;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 8px;
  background: linear-gradient(135deg, #0f1b1a, #073d2a);
  color: #fff;
  box-shadow: var(--shadow);
}

.ending-copy h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.25;
}

.ending-copy p {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.85;
}

@media (max-width: 940px) {
  .story-hero {
    grid-template-columns: 1fr;
  }

  .hero-image,
  .hero-image img {
    min-height: 280px;
  }

  .story-switch {
    grid-template-columns: 1fr;
  }

  .panel-grid {
    grid-auto-rows: minmax(92px, 18vw);
  }

  .panel.half,
  .panel.third,
  .panel.tall,
  .panel.large {
    grid-column: span 12;
    grid-row: span 3;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 16px 10px 48px;
  }

  .comic-nav {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 16px;
  }

  .story-hero {
    padding: 16px;
    margin-bottom: 24px;
    overflow: hidden;
  }

  .story-hero h1 {
    font-size: 38px;
  }

  .story-hero p {
    font-size: 15px;
    line-height: 1.78;
  }

  .comic-stack {
    gap: 22px;
  }

  .comic-page {
    padding: 8px;
  }

  .page-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 0 2px;
  }

  .panel-grid {
    display: block;
  }

  .panel {
    width: 100%;
    min-height: 310px;
    margin-bottom: 8px;
  }

  .panel.wide,
  .panel.half,
  .panel.third,
  .panel.tall,
  .panel.large,
  .panel.full {
    min-height: 310px;
  }

  .panel.full {
    min-height: 430px;
  }

  .bubble {
    min-height: 58px;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.48;
    max-width: 88%;
  }

  .bubble.small {
    font-size: 13px;
  }

  .caption {
    font-size: 14px;
  }

  .narration {
    max-width: 86%;
    font-size: 14px;
  }

  .page-art-wrap {
    border-width: 2px;
  }

  .page-art-wrap .bubble {
    padding: 6px 8px;
    border-width: 2px;
    font-size: 10px;
    line-height: 1.42;
    box-shadow: 3px 4px 0 rgba(16, 24, 32, 0.09);
  }

  .page-art-wrap .bubble.small {
    padding: 5px 7px;
    font-size: 9px;
  }

  .page-art-wrap .bubble::after {
    width: 13px;
    height: 13px;
    bottom: -8px;
    border-right-width: 2px;
    border-bottom-width: 2px;
  }

  .page-art-wrap .caption {
    padding: 6px 8px;
    font-size: 10px;
    line-height: 1.45;
  }

  .page-art-wrap .page-narration {
    padding: 6px 8px;
    border-left-width: 3px;
    font-size: 9px;
    line-height: 1.42;
  }
}
