/* ============================================
   Mofu and Friends — Miffy-inspired styles
   Palette: white + primary reds/yellows/blues/greens
   ============================================ */

:root {
  --red:       #e63946;
  --red-ink:   #c5262f;
  --yellow:    #ffd449;
  --yellow-ink:#f2b80a;
  --blue:      #4db6f0;
  --blue-ink:  #2196d0;
  --green:     #7bc67b;
  --orange:    #ff9a3c;
  --pink:      #ffb3b3;
  --cream:     #fff7e0;
  --sand:      #f6e7c8;
  --sky:       #e4f3fb;
  --ink:       #1a1a1a;
  --paper:     #ffffff;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --shadow:    0 10px 0 rgba(26,26,26,.08);
  --shadow-hard:0 8px 0 var(--ink);
  --ease:      cubic-bezier(.2,.8,.2,1);
  --nav-h:     72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "M PLUS Rounded 1c","Nunito",system-ui,-apple-system,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 16px;
}
.skip:focus { left: 16px; top: 16px; z-index: 999; }

/* -------- Header / Nav -------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
  height: var(--nav-h);
  display: flex; align-items: center;
}
.nav-row {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 900; font-size: 22px;
}
.brand-mark img { border: 2.5px solid var(--ink); border-radius: 50%; background: var(--cream); padding: 2px; }
.brand-name .dot { color: var(--red); }
.main-nav ul {
  display: flex; gap: 28px; list-style: none; margin: 0; padding: 0;
}
.main-nav a {
  text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 6px 0; border-bottom: 3px solid transparent;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.main-nav a:hover { border-color: var(--red); color: var(--red-ink); }

.nav-toggle {
  display: none; background: none; border: 0; padding: 8px; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 26px; height: 3px; background: var(--ink);
  border-radius: 2px; margin: 5px 0; transition: transform .25s var(--ease), opacity .2s;
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px;
  font-weight: 800; font-size: 15px;
  text-decoration: none; cursor: pointer;
  border: 3px solid var(--ink); border-radius: 999px;
  background: #fff; color: var(--ink);
  box-shadow: var(--shadow-hard);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 10px 10px 0 var(--ink); }
.btn:active { transform: translate(0,0); box-shadow: 4px 4px 0 var(--ink); }
.btn-red    { background: var(--red);    color: #fff; }
.btn-yellow { background: var(--yellow); }
.btn-outline{ background: #fff; }

/* -------- Hero -------- */
.hero {
  position: relative;
  padding: 72px 0 48px;
  background: #fff;
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.eyebrow {
  display: inline-block; margin: 0 0 12px;
  background: var(--yellow); color: var(--ink);
  padding: 6px 14px; border: 2.5px solid var(--ink); border-radius: 999px;
  font-weight: 800; font-size: 13px; letter-spacing: .04em;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 72px); line-height: 1.1; margin: 0 0 20px;
  font-weight: 900; letter-spacing: -.01em;
}
.hero h1 .hl {
  background: linear-gradient(transparent 58%, var(--yellow) 58%);
  padding: 0 6px;
}
.hero .lead { font-size: 18px; max-width: 460px; margin: 0 0 28px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-mascot {
  position: relative; aspect-ratio: 1/1; display: grid; place-items: center;
}
.hero-mascot .mascot-img {
  width: 86%; max-width: 420px; position: relative; z-index: 2;
  filter: drop-shadow(0 10px 0 rgba(26,26,26,.1));
}
.floaty { animation: floaty 4.5s ease-in-out infinite; transform-origin: center; }
@keyframes floaty {
  0%,100% { transform: translateY(0) rotate(-1deg); }
  50%     { transform: translateY(-10px) rotate(1deg); }
}
.blob {
  position: absolute; border-radius: 50%; z-index: 1;
}
.blob-yellow {
  width: 62%; aspect-ratio: 1; background: var(--yellow);
  top: 8%; right: 4%; border: 3px solid var(--ink);
}
.blob-blue {
  width: 38%; aspect-ratio: 1; background: var(--blue);
  bottom: 6%; left: 4%; border: 3px solid var(--ink);
  opacity: .92;
}
.hero .wave {
  position: absolute; bottom: -1px; left: 0; width: 100%; height: 80px; display: block;
}

/* -------- Section utilities -------- */
.band-cream { background: var(--cream); }
.band-sky   { background: var(--sky); }

.section-title {
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 900; margin: 0 0 8px; line-height: 1.15;
}
.section-head { text-align: center; margin-bottom: 40px; }
.section-head p { margin: 0; }

/* -------- About -------- */
.about { padding: 80px 0; }
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.panel {
  border: 3px solid var(--ink); border-radius: var(--radius-lg);
  padding: 32px; background: #fff; box-shadow: var(--shadow-hard);
}
.panel-red { background: var(--red); color: #fff; }
.panel-red .section-title { color: #fff; }
.facts { list-style: none; padding: 0; margin: 20px 0 0; }
.facts li {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 12px; padding: 10px 0; border-top: 2px dashed rgba(255,255,255,.4);
}
.facts li:first-child { border-top: 0; }
.facts strong { font-weight: 800; }

.about-visual {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.card {
  border: 3px solid var(--ink); border-radius: var(--radius-md);
  padding: 16px 16px 20px; text-align: center; background: #fff;
  box-shadow: var(--shadow-hard);
}
.card img { width: 85%; margin: 0 auto 6px; }
.card p { margin: 0; font-weight: 800; font-size: 18px; }
.card-yellow { background: var(--yellow); transform: rotate(-2deg); }
.card-blue   { background: var(--blue);   transform: rotate(2deg); color: #fff; }

/* -------- Friends -------- */
.friends { padding: 96px 0; background: #fff; }
.friend-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px;
}
.friend {
  border: 3px solid var(--ink); border-radius: var(--radius-lg);
  padding: 20px 16px 22px; text-align: center;
  box-shadow: var(--shadow-hard);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.friend:hover { transform: translate(-3px,-3px); box-shadow: 11px 11px 0 var(--ink); }
.friend img { width: 78%; margin: 0 auto 8px; }
.friend h3 { margin: 6px 0 4px; font-size: 22px; font-weight: 900; }
.friend p { margin: 0; font-size: 14px; }
.tile-cream  { background: var(--cream); }
.tile-sand   { background: var(--sand); }
.tile-yellow { background: var(--yellow); }
.tile-blue   { background: var(--blue); color: #fff; }
.tile-red    { background: var(--red);  color: #fff; }

/* -------- Stories -------- */
.stories { padding: 96px 0; }
.story-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.story {
  background: #fff; border: 3px solid var(--ink);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-hard);
  display: flex; flex-direction: column;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.story:hover { transform: translate(-3px,-3px); box-shadow: 11px 11px 0 var(--ink); }
.story-thumb {
  height: 180px; display: grid; place-items: center; border-bottom: 3px solid var(--ink);
}
.story-thumb img { width: 140px; }
.thumb-yellow { background: var(--yellow); }
.thumb-red    { background: var(--red); }
.thumb-blue   { background: var(--blue); }
.story-body { padding: 18px 20px 22px; }
.tag {
  display: inline-block; background: var(--ink); color: #fff;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800;
  letter-spacing: .05em;
}
.story-body h3 { margin: 8px 0 4px; font-weight: 900; font-size: 20px; }
.story-body p { margin: 0; }

/* -------- Shop -------- */
.shop { padding: 96px 0; background: #fff; }
.shop-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.shop-copy p { max-width: 460px; }
.shop-visual {
  position: relative; aspect-ratio: 1.1/1;
  background: var(--sky);
  border: 3px solid var(--ink); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}
.sticker {
  position: absolute; width: 40%; background: #fff;
  border: 3px solid var(--ink); border-radius: 50%;
  padding: 10px; box-shadow: var(--shadow-hard);
}
.sticker img { width: 100%; }
.sticker-1 { top: 8%;  left: 6%;  transform: rotate(-8deg); }
.sticker-2 { top: 10%; right: 6%; transform: rotate(6deg); background: var(--yellow); }
.sticker-3 { bottom: 8%; left: 14%; transform: rotate(4deg); background: var(--red); }
.sticker-4 { bottom: 6%; right: 10%; transform: rotate(-6deg); background: var(--blue); }

/* -------- Contact -------- */
.contact { padding: 96px 0; }
.contact-form {
  max-width: 560px; margin: 0 auto;
  display: grid; gap: 16px;
  background: #fff; border: 3px solid var(--ink);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow-hard);
}
.contact-form label { display: grid; gap: 6px; font-weight: 800; }
.contact-form input,
.contact-form textarea {
  font: inherit; padding: 12px 14px;
  border: 2.5px solid var(--ink); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 3px solid var(--yellow); outline-offset: 2px;
}
.form-done { margin: 0; font-weight: 800; color: var(--red-ink); }

/* -------- Footer -------- */
.site-footer {
  border-top: 3px solid var(--ink);
  background: var(--cream); padding: 28px 0;
}
.footer-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.footer-brand img { border: 2.5px solid var(--ink); border-radius: 50%; background: #fff; padding: 2px; }
.footer-note { margin: 0; font-size: 14px; }

/* -------- Responsive -------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero { padding: 48px 0 32px; }
  .hero-mascot { max-width: 420px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; }
  .shop-grid  { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: 1fr 1fr; }
  .friend-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: block; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: #fff; border-bottom: 3px solid var(--ink); padding: 12px 24px;
  }
  .main-nav.open ul { flex-direction: column; gap: 10px; }
  .nav-toggle { display: block; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .friend-grid { grid-template-columns: 1fr 1fr; }
  .story-grid  { grid-template-columns: 1fr; }
  .panel { padding: 22px; }
}

/* -------- Character page -------- */
.char-hero {
  padding: 64px 0 32px;
}
.char-hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.char-hero .mascot-img { width: 80%; max-width: 360px; margin: 0 auto; }
.char-meta {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: grid; gap: 8px;
}
.char-meta li {
  display: grid; grid-template-columns: 110px 1fr; gap: 12px;
  padding: 10px 0; border-top: 2px dashed rgba(26,26,26,.18);
}
.char-meta li:first-child { border-top: 0; }
.char-meta strong { font-weight: 800; }
.char-quote {
  display: inline-block; margin-top: 12px;
  background: var(--cream); border: 2.5px solid var(--ink);
  padding: 8px 16px; border-radius: 999px; font-weight: 800;
}
.poses {
  padding: 64px 0; background: var(--cream);
}
.pose-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.pose {
  background: #fff; border: 3px solid var(--ink);
  border-radius: var(--radius-md); padding: 20px;
  text-align: center; box-shadow: var(--shadow-hard);
}
.pose img { width: 70%; margin: 0 auto 8px; }
.pose-placeholder {
  height: 160px; display: grid; place-items: center;
  background: var(--sky); border: 2px dashed var(--ink);
  border-radius: var(--radius-sm); margin: 0 auto 8px;
  font-weight: 800; color: var(--ink); opacity: .6;
}
.char-nav {
  padding: 48px 0 96px; background: #fff;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.char-nav .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; width: 100%; }
.char-nav .btn { min-width: 180px; }

/* -------- Doc pages (company / terms / privacy / tokutei) -------- */
.doc-page {
  padding: 64px 0 96px;
  background: #fff;
}
.doc-page .container { max-width: 820px; }
.doc-page h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 24px;
  font-weight: 900;
}
.doc-page h2 {
  margin: 32px 0 12px; font-size: 22px; font-weight: 900;
  border-left: 6px solid var(--red); padding-left: 12px;
}
.doc-page table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  border: 2.5px solid var(--ink); border-radius: var(--radius-sm); overflow: hidden;
}
.doc-page th, .doc-page td {
  padding: 12px 14px; border-bottom: 2px dashed rgba(26,26,26,.18);
  text-align: left; vertical-align: top;
}
.doc-page th {
  background: var(--cream); width: 30%; font-weight: 800;
}
.doc-page tr:last-child th, .doc-page tr:last-child td { border-bottom: 0; }
.doc-page .updated { color: #666; font-size: 14px; }
.doc-page p { margin: 8px 0 16px; }
.doc-page ul, .doc-page ol { padding-left: 22px; }
.doc-page li { margin: 6px 0; }

/* -------- Email signup -------- */
.signup {
  background: #fff; border: 3px solid var(--ink); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-hard); max-width: 560px; margin: 24px auto 0;
}
.signup h3 { margin: 0 0 8px; font-weight: 900; font-size: 20px; }
.signup p { margin: 0 0 16px; }
.signup-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
}
.signup input[type=email] {
  font: inherit; padding: 12px 14px;
  border: 2.5px solid var(--ink); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
}
.signup input[type=email]:focus { outline: 3px solid var(--yellow); outline-offset: 2px; }
@media (max-width: 540px) {
  .signup-row { grid-template-columns: 1fr; }
}

/* -------- Footer extended links -------- */
.footer-links {
  display: flex; gap: 18px; flex-wrap: wrap; font-weight: 700; font-size: 14px;
}
.footer-links a {
  text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: 2px;
}
.footer-links a:hover { border-color: var(--red); color: var(--red-ink); }

/* -------- Friend tile link -------- */
.friend a {
  text-decoration: none; color: inherit; display: block;
}
.friend a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; border-radius: var(--radius-md); }

/* -------- Char page responsive -------- */
@media (max-width: 900px) {
  .char-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .pose-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .pose-grid { grid-template-columns: 1fr; }
}

/* -------- Reduced motion -------- */
@media (prefers-reduced-motion: reduce) {
  .floaty { animation: none; }
  * { transition: none !important; }
}
