/* ======================================
   Google Fonts
   ====================================== */
@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;500;700;900&family=Quicksand:wght@400;500;600;700&display=swap');

/* ======================================
   CSS Custom Properties (App Pastel Palette)
   ====================================== */
:root {
  --primary: oklch(0.75 0.12 230);       /* Pastel Blue */
  --primary-light: oklch(0.88 0.08 230); /* Lighter Blue for hover/bg */
  --secondary: oklch(0.85 0.12 60);      /* Pastel Orange */
  --secondary-light: oklch(0.92 0.08 60);
  --accent: oklch(0.88 0.1 150);         /* Mint Green */
  --accent-light: oklch(0.94 0.06 150);
  --bg: oklch(0.98 0.01 85);             /* Warm Cream */
  --card: rgba(255, 255, 255, 0.88);
  --text: oklch(0.35 0.02 280);          /* Soft Charcoal */
  --muted: oklch(0.6 0.02 280);
  --border: oklch(0.88 0.02 85);
  --shadow-sm: 0 2px 8px oklch(0.35 0.02 280 / 0.06);
  --shadow-md: 0 8px 24px oklch(0.35 0.02 280 / 0.10);
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Type colors (very pale) */
  --type-tsurukame: oklch(0.96 0.03 350); /* Pale Pink */
  --type-wasa: oklch(0.96 0.03 150);      /* Pale Green */
  --type-tabibito: oklch(0.96 0.03 60);   /* Pale Orange */
  --type-ueki: oklch(0.96 0.03 170);      /* Pale Emerald */
  --type-shuki: oklch(0.96 0.03 300);     /* Pale Purple */
  --type-shokyo: oklch(0.96 0.03 230);    /* Pale Blue */
}

/* ======================================
   Reset & Base
   ====================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Zen Maru Gothic', 'Quicksand', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  /* Dot pattern paper texture */
  background-image:
    radial-gradient(circle, oklch(0.82 0.02 85) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text);
  line-height: 1.6;
}

/* Quicksand for numbers and English text */
h1, h2, h3, .brand__name, .btn, .card__title, .banner__title {
  font-family: 'Quicksand', 'Zen Maru Gothic', sans-serif;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ======================================
   Fade-in Animation
   ====================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero,
.section,
.prose {
  animation: fadeIn 0.6s ease-out both;
}

.hero { animation-delay: 0.1s; }
.section:nth-of-type(1) { animation-delay: 0.2s; }
.section:nth-of-type(2) { animation-delay: 0.3s; }
.section:nth-of-type(3) { animation-delay: 0.4s; }

.card,
.type {
  animation: fadeInUp 0.5s ease-out both;
}
.card:nth-child(1), .type:nth-child(1) { animation-delay: 0.15s; }
.card:nth-child(2), .type:nth-child(2) { animation-delay: 0.25s; }
.card:nth-child(3), .type:nth-child(3) { animation-delay: 0.35s; }
.type:nth-child(4) { animation-delay: 0.45s; }
.type:nth-child(5) { animation-delay: 0.55s; }
.type:nth-child(6) { animation-delay: 0.65s; }

/* ======================================
   Header
   ====================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: oklch(0.98 0.01 85 / 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand__name {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand__meta {
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: background 0.2s, color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-light);
}

/* ======================================
   Hero
   ====================================== */
.hero {
  padding: 48px 0 24px;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.hero__copy h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.35;
  font-weight: 900;
  color: var(--text);
}

.accent {
  color: var(--primary);
  font-weight: 900;
}

.lead {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

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

.note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.hero__visual {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-height: 240px;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ======================================
   Sections
   ====================================== */
.section {
  padding: 32px 0;
}

.section h2 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  text-align: center;
}

/* ======================================
   Cards (Paper-card style)
   ====================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card__title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text);
}

.card__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 14px;
}

/* ======================================
   Type Grid (Problem Types)
   ====================================== */
.typeGrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.type {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 12px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.type:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.type img {
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  width: 72px;
  height: 72px;
}

.type div {
  margin-top: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

/* Type-specific pale backgrounds */
.type--tsurukame { background: var(--type-tsurukame); }
.type--wasa      { background: var(--type-wasa); }
.type--tabibito  { background: var(--type-tabibito); }
.type--ueki      { background: var(--type-ueki); }
.type--shuki     { background: var(--type-shuki); }
.type--shokyo    { background: var(--type-shokyo); }

/* ======================================
   Story
   ====================================== */
.story {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 32px 32px;
  box-shadow: var(--shadow-sm);
}

.story p {
  color: var(--text);
  line-height: 2;
  font-size: 15px;
  margin: 0 0 20px;
}

.story p:last-child {
  margin-bottom: 0;
}

.story strong {
  color: var(--primary);
  font-weight: 700;
}

/* ======================================
   Banner
   ====================================== */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.banner:hover {
  box-shadow: var(--shadow-md);
}

.banner__title {
  font-weight: 900;
  font-size: 16px;
  color: var(--text);
}

.banner__text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ======================================
   Buttons (App-style)
   ====================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Quicksand', 'Zen Maru Gothic', sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-height: 48px;
}

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

.btn--primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px oklch(0.75 0.12 230 / 0.35);
}

.btn--primary:hover {
  box-shadow: 0 6px 20px oklch(0.75 0.12 230 / 0.45);
}

.btn--ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
  box-shadow: var(--shadow-md);
}

.btn[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* ======================================
   Prose (Privacy, Contact pages)
   ====================================== */
.prose {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}

.prose h1 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
}

.prose h2 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  text-align: left;
}

.prose p {
  color: var(--muted);
  line-height: 1.85;
  font-size: 15px;
}

.prose ul {
  color: var(--muted);
  line-height: 1.85;
}

.prose a:not(.btn) {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.prose a:not(.btn):hover {
  opacity: 0.7;
}

/* ======================================
   Iframe Wrap
   ====================================== */
.iframeWrap {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.iframeWrap iframe {
  width: 100%;
  height: 900px;
  border: 0;
  display: block;
}

/* ======================================
   Footer
   ====================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer__links {
  display: flex;
  gap: 16px;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer a:hover {
  color: var(--primary);
}

/* ======================================
   Responsive: Tablet (max-width: 900px)
   ====================================== */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero__copy h1 {
    font-size: 28px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .typeGrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .banner {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }
}

/* ======================================
   Responsive: Mobile (max-width: 600px)
   ====================================== */
@media (max-width: 600px) {
  body {
    background-size: 16px 16px;
  }

  .container {
    padding: 0 16px;
  }

  /* Header */
  .header__inner {
    gap: 8px;
    padding: 12px 0;
  }

  .brand {
    min-width: unset;
  }

  .brand__name {
    font-size: 15px;
  }

  .brand__meta {
    font-size: 11px;
  }

  .nav {
    justify-content: flex-end;
    gap: 4px;
  }

  .nav a {
    font-size: 13px;
    padding: 8px 10px;
    min-height: 44px;
  }

  /* Hero */
  .hero {
    padding: 28px 0 16px;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero__copy h1 {
    font-size: 24px;
    line-height: 1.4;
  }

  .lead {
    font-size: 14px;
  }

  .hero__visual {
    min-height: 180px;
    border-radius: var(--radius-md);
  }

  /* Section headings */
  .section h2 {
    font-size: 20px;
  }

  /* Type Grid: 2 columns on mobile */
  .typeGrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .type {
    padding: 14px 8px 10px;
  }

  .type img {
    width: 56px;
    height: 56px;
  }

  .type div {
    font-size: 13px;
  }

  /* Cards: 1 column on mobile */
  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    padding: 18px 16px;
  }

  /* Banner: stack vertically */
  .banner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 18px 16px;
  }

  /* Buttons: touch-friendly */
  .btn {
    padding: 14px 22px;
    font-size: 14px;
    min-height: 48px;
    width: 100%;
    justify-content: center;
  }

  .cta {
    flex-direction: column;
  }

  /* Footer: stack vertically */
  .footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .footer__links {
    gap: 12px;
  }

  .footer a {
    min-height: 44px;
  }

  /* Prose page adjustments */
  .prose {
    padding: 22px 18px;
    border-radius: var(--radius-md);
  }

  .prose h1 {
    font-size: 20px;
  }

  .prose h2 {
    font-size: 16px;
  }

  /* Iframe */
  .iframeWrap iframe {
    height: 600px;
  }
}
