/* MM Logic Games — washi paper + sumi ink, indigo (aizome) accent.
   Type: Fraunces (display) / Hanken Grotesk (body). */

:root {
  --washi: #f4eee2;       /* warm paper */
  --washi-deep: #ece4d5;  /* alternate section ground */
  --paper: #fbf7ef;       /* raised card */
  --sumi: #211d17;        /* ink — primary text */
  --stone: #6b6353;       /* secondary text */
  --ai: #23486b;          /* indigo accent (aizome / Hokusai) */
  --ai-ink: #1b3752;      /* darker indigo for hover */
  --seal: #bf3f2d;        /* hanko vermilion — used sparingly */
  --line: rgba(33, 29, 23, 0.12);
  --line-soft: rgba(33, 29, 23, 0.07);

  /* muted washi tints for the puzzle rectangles */
  --t1: #c8d3df;  /* indigo wash */
  --t2: #e6cbc2;  /* seal wash */
  --t3: #cdd6c0;  /* moss */
  --t4: #ebdcb4;  /* ochre */
  --t5: #d8cad4;  /* plum */

  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--washi);
  color: var(--sumi);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--ai);
}

/* ---------- Header ---------- */
.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(244, 238, 226, 0.82);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-seal {
  display: inline-flex;
  width: 30px;
  height: 30px;
  color: var(--seal);
}

.logo-seal svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--sumi);
}

nav {
  display: flex;
  gap: 30px;
}

nav a {
  color: var(--stone);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--ai);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--ai);
  color: #f6f2ea;
}

.btn-primary:hover {
  background: var(--ai-ink);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--sumi);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--ai);
  color: var(--ai);
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 88px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--seal);
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: clamp(2.6rem, 5.4vw, 4.1rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
}

.tagline {
  font-size: 1.15rem;
  color: var(--stone);
  max-width: 460px;
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Signature puzzle ---------- */
.hero-puzzle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.shikaku {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  padding: 14px;
  background:
    repeating-linear-gradient(0deg, var(--line-soft) 0 1px, transparent 1px calc(100% / 6)),
    repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px calc(100% / 6)),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(33, 29, 23, 0.08);
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--sumi);
  border-radius: 3px;
  border: 1.5px solid rgba(33, 29, 23, 0.55);
  opacity: 0;
  transform: scale(0.9);
  animation: settle 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  animation-delay: calc(var(--i) * 0.09s);
}

.cell.t1 { background: var(--t1); }
.cell.t2 { background: var(--t2); }
.cell.t3 { background: var(--t3); }
.cell.t4 { background: var(--t4); }
.cell.t5 { background: var(--t5); }

@keyframes settle {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.puzzle-caption {
  font-size: 0.85rem;
  color: var(--stone);
  font-style: italic;
}

/* ---------- Sections ---------- */
section {
  padding: 84px 0;
}

.section-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--ai);
  margin-bottom: 28px;
  padding-bottom: 14px;
  position: relative;
}

.section-label::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 34px;
  height: 2px;
  background: var(--ai);
}

.prose p {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.45;
  margin-bottom: 18px;
  max-width: 720px;
  color: var(--sumi);
}

.prose p + p {
  font-size: 1.2rem;
  color: var(--stone);
}

/* ---------- Games ---------- */
.games {
  background: var(--washi-deep);
}

.game-card {
  display: flex;
  gap: 44px;
  align-items: center;
  background: var(--paper);
  padding: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(33, 29, 23, 0.08);
}

.game-art-img {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(33, 29, 23, 0.12);
}

.game-info h3 {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.game-status {
  color: var(--seal);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.game-info > p:not(.game-status) {
  color: var(--stone);
  font-size: 1.05rem;
  max-width: 560px;
}

.store-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.store-note {
  font-size: 0.85rem;
  color: var(--stone);
}

/* ---------- Contact ---------- */
.contact-lead {
  font-size: 1.15rem;
  color: var(--stone);
  margin-bottom: 14px;
}

.email {
  font-family: var(--display);
  font-size: 1.7rem;
  color: var(--ai);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.email:hover {
  border-bottom-color: var(--ai);
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer p {
  font-size: 0.875rem;
  color: var(--stone);
}

footer a {
  color: var(--stone);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ---------- Privacy / legal page ---------- */
.legal {
  padding: 72px 0 96px;
}

.legal h1 {
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.legal .updated {
  color: var(--stone);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.legal h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 38px;
  margin-bottom: 14px;
}

.legal p,
.legal li {
  font-size: 1rem;
  color: var(--stone);
  margin-bottom: 12px;
  max-width: 740px;
}

.legal ul {
  padding-left: 24px;
}

.legal a {
  color: var(--ai);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.legal a:hover {
  border-bottom-color: var(--ai);
}

.legal code {
  font-size: 0.9em;
  background: var(--washi-deep);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero {
    padding: 64px 0 56px;
  }

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

  .hero-copy {
    order: 1;
  }

  .hero-puzzle {
    order: 2;
  }

  section {
    padding: 60px 0;
  }

  .game-card {
    flex-direction: column;
    padding: 30px;
    text-align: center;
    gap: 26px;
  }

  .game-info > p:not(.game-status) {
    margin-left: auto;
    margin-right: auto;
  }

  .store-row {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .site-header .container {
    flex-direction: column;
    gap: 14px;
  }

  nav {
    gap: 22px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  footer .container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cell {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .btn:hover,
  .game-card:hover {
    transform: none;
  }
}
