/* ==========================================================================
   prototype.moe — Muji aesthetic, card-grid, sharp-angles, noise-texture
   Palette:
     #FAF8F3 Creamy Cream (primary background, Muji white)
     #C8BEB0 Warm Stone (secondary text, borders at 30% opacity)
     #3D3D3D Charcoal Soft (primary text)
     #E8C8C0 Craft Pink (subtle card tint, moe accent)
     #E8DDD0 Paper Tan (card alternate tint)
     #8B7B6B Muji Brown (tertiary text, labels)
     #C44536 Sharp Red (sharp-angles motif accent, minimal use)
   Fonts: Commissioner (headlines/decorative), Noto Sans JP (body)
   ========================================================================== */

:root {
  --cream: #FAF8F3;
  --warm-stone: #C8BEB0;
  --charcoal: #3D3D3D;
  --craft-pink: #E8C8C0;
  --paper-tan: #E8DDD0;
  --muji-brown: #8B7B6B;
  --sharp-red: #C44536;

  --gutter: clamp(16px, 4vw, 60px);
  --max-content: 960px;
}

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

html {
  scroll-behavior: smooth;
}

html, body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: "Noto Sans JP", "Commissioner", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ----- Noise-texture material overlay ----- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  z-index: 9999;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 320px 320px;
  mix-blend-mode: multiply;
}

/* ==========================================================================
   Section 1: Void Welcome
   ========================================================================== */

.void-welcome {
  position: relative;
  width: 100%;
  height: 100vh;
  background: var(--cream);
  overflow: hidden;
}

.wordmark-block {
  position: absolute;
  top: 38%;
  left: 38%;
  transform: translate(-12%, -50%);
  max-width: 42ch;
}

.wordmark {
  font-family: "Commissioner", system-ui, sans-serif;
  font-weight: 300;
  font-size: clamp(22px, 3vw, 40px);
  letter-spacing: 0.01em;
  color: var(--charcoal);
  margin-bottom: 1.4em;
  line-height: 1.2;
}

.subtitle {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 1.1vw, 15px);
  color: var(--muji-brown);
  letter-spacing: 0.02em;
  animation: calm-breath 4s ease-in-out infinite;
}

.subtitle .jp {
  display: block;
  margin-top: 0.4em;
  color: var(--warm-stone);
  font-size: 0.92em;
  letter-spacing: 0.05em;
}

@keyframes calm-breath {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1.0; }
}

/* ==========================================================================
   Shared section header
   ========================================================================== */

.section-header {
  position: relative;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.decor-numeral {
  position: absolute;
  top: -28px;
  right: var(--gutter);
  font-family: "Commissioner", sans-serif;
  font-weight: 200;
  font-size: clamp(48px, 6vw, 96px);
  letter-spacing: 0.02em;
  color: var(--warm-stone);
  opacity: 0.2;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.section-label {
  font-family: "Commissioner", sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muji-brown);
  margin-bottom: 12px;
}

.section-title {
  font-family: "Commissioner", sans-serif;
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: 0.005em;
  color: var(--charcoal);
  max-width: 28ch;
  line-height: 1.4;
}

/* ==========================================================================
   Section 2: Prototype Grid
   ========================================================================== */

.prototype-section {
  padding: 160px var(--gutter) 80px;
  position: relative;
}

.prototype-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  max-width: var(--max-content);
  margin: 120px auto 0;
  background: rgba(200, 190, 176, 0.18); /* gap visible as warm-stone hairline */
}

.prototype-card {
  padding: 32px;
  background: var(--cream);
  transition: background-color 0.25s ease-out, transform 0.25s ease-out;
  cursor: default;
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prototype-card:hover,
.prototype-card.is-touch {
  background: rgba(232, 200, 192, 0.15);
  transform: scale(1.02);
  z-index: 2;
}

.prototype-card[data-card="2"],
.prototype-card[data-card="5"],
.prototype-card[data-card="8"] {
  background: rgba(232, 221, 208, 0.35);
}

.prototype-card[data-card="2"]:hover,
.prototype-card[data-card="5"]:hover,
.prototype-card[data-card="8"]:hover,
.prototype-card[data-card="2"].is-touch,
.prototype-card[data-card="5"].is-touch,
.prototype-card[data-card="8"].is-touch {
  background: rgba(232, 200, 192, 0.4);
}

.card-icon {
  width: 24px;
  height: 24px;
  display: block;
  transition: transform 0.4s ease-out;
}

.card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.prototype-card:hover .card-icon {
  transform: rotate(-3deg);
}

.card-title {
  font-family: "Commissioner", sans-serif;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--charcoal);
  margin-top: 4px;
}

.card-desc {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muji-brown);
}

/* ==========================================================================
   Section 3: Material Showcase
   ========================================================================== */

.material-section {
  padding: 120px 0 100px;
  position: relative;
  background: var(--cream);
}

.material-section .section-header {
  margin-bottom: 60px;
}

.showcase-strip {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 60px 24px 60px;
  scrollbar-width: thin;
  scrollbar-color: var(--warm-stone) transparent;
}

.showcase-strip::-webkit-scrollbar {
  height: 6px;
}

.showcase-strip::-webkit-scrollbar-track {
  background: transparent;
}

.showcase-strip::-webkit-scrollbar-thumb {
  background: rgba(200, 190, 176, 0.5);
}

.showcase-item {
  flex: 0 0 auto;
  min-width: 280px;
  scroll-snap-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.showcase-canvas {
  position: relative;
  width: 280px;
  height: 200px;
  filter: contrast(0.95);
  overflow: hidden;
}

.showcase-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* per-item noise overlay -- craft paper material */
.showcase-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='8'/><feColorMatrix values='0 0 0 0 0.24  0 0 0 0 0.24  0 0 0 0 0.24  0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23m)'/></svg>");
  mix-blend-mode: multiply;
}

.showcase-caption {
  font-family: "Commissioner", sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muji-brown);
  padding-left: 2px;
}

.showcase-hint {
  text-align: center;
  margin-top: 30px;
  font-family: "Commissioner", sans-serif;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warm-stone);
}

/* ==========================================================================
   Section 4: Closing Breath
   ========================================================================== */

.closing-breath {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px var(--gutter);
  background: var(--cream);
}

.haiku {
  text-align: center;
  max-width: 36ch;
}

.haiku-line {
  font-family: "Commissioner", sans-serif;
  font-weight: 300;
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: 0.005em;
  line-height: 1.7;
  color: var(--charcoal);
  margin-bottom: 0.4em;
}

.haiku-line:nth-child(2) {
  color: var(--muji-brown);
}

.haiku-mark {
  margin-top: 1.6em;
  font-family: "Commissioner", sans-serif;
  font-weight: 200;
  font-size: 24px;
  color: var(--sharp-red);
  letter-spacing: 0.4em;
  user-select: none;
}

.page-footer {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-mark {
  font-family: "Commissioner", sans-serif;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--charcoal);
}

.footer-meta {
  font-family: "Commissioner", sans-serif;
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warm-stone);
}

/* ==========================================================================
   Responsive — narrow screens
   ========================================================================== */

@media (max-width: 800px) {
  .prototype-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 80px;
  }

  .wordmark-block {
    left: 8%;
    top: 38%;
    transform: translate(0, -50%);
    padding-right: 8%;
  }

  .prototype-section {
    padding-top: 100px;
  }
}

@media (max-width: 520px) {
  .prototype-grid {
    grid-template-columns: 1fr;
  }

  .showcase-canvas {
    width: 240px;
    height: 170px;
  }

  .showcase-item {
    min-width: 240px;
  }

  .decor-numeral {
    font-size: 56px;
    top: -16px;
  }
}
