/* meloworkx — design tokens & modules (Editorial White) */
:root {
  --paper: #faf8f4;
  --ink: #16150f;
  --dim: #7d7a70;
  --faint: #d8d4ca;
  --coral: #e8543f;
  --hair: rgba(22, 21, 15, 0.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Hiragino Sans", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ---------- nav (extraNav/コンテンツがある時のみJSが生成) ---------- */
nav.site-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px;
  background: rgba(250, 248, 244, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hair);
}
nav.site-nav .brand { font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; }
nav.site-nav .brand em { font-style: normal; color: var(--coral); }
nav.site-nav ul { display: flex; gap: 28px; list-style: none; }
nav.site-nav a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; }
nav.site-nav a:hover { color: var(--coral); }

/* ---------- hero(ブランク期は全画面) ---------- */
.hero {
  flex: 1;
  display: grid; place-content: center;
  padding: 60px 24px;
  text-align: center;
}
.hero .est {
  font-size: 12px; color: var(--dim);
  letter-spacing: .34em; text-transform: uppercase;
  margin-bottom: 30px;
  opacity: 0; animation: fadeUp .8s ease .75s forwards;
}
.hero h1 {
  font-size: clamp(56px, 11vw, 150px);
  font-weight: 800; letter-spacing: -.035em; line-height: 1.0;
}
.hero h1 .dot { color: var(--coral); display: inline-block; opacity: 0; animation: dotIn .5s cubic-bezier(.34,1.56,.64,1) 1.05s forwards; }
.mask { display: block; overflow: hidden; }
.mask > span {
  display: block;
  transform: translateY(110%);
  animation: riseIn 1s cubic-bezier(.19,1,.22,1) .15s forwards;
}
@keyframes riseIn { to { transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes dotIn { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
.hero .contact-open {
  justify-self: center;
  margin-top: 44px;
  opacity: 0; animation: fadeUp .8s ease 1.2s forwards;
}

/* ---------- contact button ---------- */
.contact-open {
  appearance: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 12px 34px;
  transition: background .3s, color .3s, border-color .3s;
}
.contact-open:hover { background: var(--ink); color: var(--paper); }
.contact-open.on-dark { color: var(--paper); border-color: rgba(250,248,244,.4); margin-top: 34px; }
.contact-open.on-dark:hover { background: var(--coral); border-color: var(--coral); color: var(--paper); }

/* ---------- contact modal ---------- */
.cmodal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(22,21,15,.55);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 4vh 20px;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.cmodal.open { opacity: 1; pointer-events: auto; }
.cmodal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh; overflow-y: auto;
  background: var(--paper);
  border-radius: 6px;
  padding: 44px 44px 40px;
  box-shadow: 0 40px 90px -20px rgba(0,0,0,.45);
  transform: translateY(16px); transition: transform .35s cubic-bezier(.19,1,.22,1);
}
.cmodal.open .cmodal-card { transform: none; }
.cmodal-close {
  position: absolute; top: 16px; right: 16px;
  appearance: none; background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--dim); padding: 8px;
}
.cmodal-close:hover { color: var(--coral); }
.cmodal form label {
  display: block; margin-bottom: 18px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink);
}
.cmodal form .req { color: var(--coral); margin-left: 4px; }
.cmodal form input[type="text"],
.cmodal form input[type="email"],
.cmodal form textarea {
  display: block; width: 100%; margin-top: 8px;
  font: inherit; font-size: 15px; letter-spacing: normal; text-transform: none;
  color: var(--ink); background: #fff;
  border: 1px solid var(--hair); border-radius: 4px;
  padding: 12px 14px;
  transition: border-color .25s;
}
.cmodal form input:focus, .cmodal form textarea:focus {
  outline: none; border-color: var(--ink);
}
.cmodal form textarea { resize: vertical; min-height: 120px; }
.cmodal form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cmodal-foot { display: flex; align-items: center; gap: 18px; margin-top: 6px; }
.cmodal-foot .store-btn { margin-top: 0; border: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.cmodal-foot .store-btn:disabled { opacity: .5; cursor: default; }
.cmodal-status { font-size: 12.5px; color: var(--dim); }
.cmodal-done { text-align: center; padding: 30px 0 20px; }
.cmodal-done .done-title { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.cmodal-done .done-title .dot { color: var(--coral); }
.cmodal-done .done-sub { margin-top: 12px; font-size: 14px; color: var(--dim); }
@media (max-width: 560px) { .cmodal-card { padding: 34px 22px 30px; } }

/* ---------- footer ---------- */
footer.site-footer { border-top: 1px solid var(--hair); }
footer.site-footer .inner {
  max-width: 1240px; margin: 0 auto;
  padding: 26px 40px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--dim); letter-spacing: .04em;
  width: 100vw;
}
footer.site-footer a { color: var(--dim); text-decoration: none; margin-left: 22px; }
footer.site-footer a:hover { color: var(--coral); }

/* ---------- 共有モジュール(コンテンツ復活時に使用) ---------- */
section.block { max-width: 1240px; margin: 0 auto; padding: 96px 40px; width: 100%; }
.sec-label {
  font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--coral); margin-bottom: 44px;
  display: flex; align-items: center; gap: 14px;
}
.sec-label::before { content: ""; width: 34px; height: 2px; background: var(--coral); }
.sec-label .count { color: var(--dim); font-weight: 500; letter-spacing: .1em; }

.rv { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.19,1,.22,1); }
.rv.in { opacity: 1; transform: none; }

/* apps */
.app-card {
  display: grid; grid-template-columns: 380px 1fr;
  gap: 60px; align-items: center;
  border-top: 1px solid var(--ink);
  padding: 64px 8px;
}
.app-card:last-of-type { border-bottom: 1px solid var(--hair); }
.app-card.flip { grid-template-columns: 1fr 380px; }
.app-card.flip .stage { order: 2; }
.stage {
  background: #f1ede4; border-radius: 18px;
  display: grid; place-items: center; padding: 44px 24px;
}
.stage img.shot {
  width: 218px; border-radius: 30px;
  box-shadow: 0 24px 48px -20px rgba(22,21,15,.35);
  transition: transform .5s cubic-bezier(.19,1,.22,1);
}
.app-card:hover .stage img.shot { transform: translateY(-8px) rotate(-1.2deg); }
.app-info h3 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.app-info .sub { color: var(--dim); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; }
.app-info p.desc { margin-top: 20px; font-size: 15px; max-width: 460px; }
.app-meta { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--hair); border-radius: 999px; padding: 6px 14px; color: var(--dim);
}
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 30px; padding: 12px 26px;
  background: var(--ink); color: var(--paper);
  border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none;
  transition: background .3s;
}
.store-btn:hover { background: var(--coral); }
.store-btn.soon { background: transparent; color: var(--dim); border: 1px solid var(--hair); pointer-events: none; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 22px; }
.piece { text-decoration: none; color: var(--ink); cursor: zoom-in; }
.piece .frame { aspect-ratio: 16/10; overflow: hidden; border-radius: 4px; background: var(--faint); }
.piece img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .8s cubic-bezier(.19,1,.22,1);
}
.piece:hover img { transform: scale(1.04); }
.piece .cap { display: flex; gap: 14px; align-items: baseline; margin-top: 12px; font-size: 13px; }
.piece .cap .no { color: var(--coral); font-weight: 700; font-size: 11px; }
.piece .cap .t { font-weight: 600; }
.piece .cap .y { color: var(--dim); margin-left: auto; font-size: 12px; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(22,21,15,.94);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
  padding: 5vh 5vw; cursor: zoom-out;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 4px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox .lb-cap { position: absolute; bottom: 4vh; left: 0; right: 0; text-align: center; color: rgba(250,248,244,.75); font-size: 13px; letter-spacing: .08em; }
.lightbox .lb-close { position: absolute; top: 26px; right: 34px; color: rgba(250,248,244,.7); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }

/* contact(黒帯) */
.contact { background: var(--ink); color: var(--paper); }
.contact .inner { max-width: 1240px; margin: 0 auto; padding: 110px 40px 120px; }
.contact h2 { font-size: clamp(40px, 7vw, 92px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.contact a.mail { color: var(--paper); text-decoration: none; border-bottom: 3px solid var(--coral); transition: color .3s; }
.contact a.mail:hover { color: var(--coral); }

@media (max-width: 880px) {
  .app-card, .app-card.flip { grid-template-columns: 1fr; gap: 34px; }
  .app-card.flip .stage { order: 0; }
  .gallery { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  nav.site-nav { padding: 16px 20px; }
  section.block, footer.site-footer .inner, .contact .inner { padding-left: 20px; padding-right: 20px; }
  footer.site-footer .inner { flex-direction: column; gap: 10px; }
  footer.site-footer a { margin: 0 12px; }
}
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .mask > span { transform: none; animation: none; }
  .hero .est, .hero .contact-open, .hero h1 .dot { opacity: 1; animation: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .piece img, .stage img.shot { transition: none; }
  html { scroll-behavior: auto; }
}
