/*
Theme Name: Choco Mame
Theme URI: https://choco-mame.jp
Author: Choco Mame Studio
Description: Official theme for Choco Mame indie game studio. Dark noir aesthetic, bilingual JP/EN, with dynamic game cards, member profiles, and contact page.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 8.0
License: Proprietary
Text Domain: choco-mame
*/

/* ─── Variables ──────────────────────────────────────────────── */
:root {
  --bg:    #14151a;
  --bg2:   #1d1e25;
  --ink:   #e8e6e1;
  --ink2:  #c5c2bd;
  --mute:  #888680;
  --hair:  rgba(232,230,225,0.10);
  --hair2: rgba(232,230,225,0.18);
  --accent:#c89a78;
}

/* ─── Reset / Base ───────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 1;
}
a { color: inherit; }

/* ─── Layout ─────────────────────────────────────────────────── */
.cm-root { min-height: 100vh; display: flex; flex-direction: column; }
.cm-main {
  flex: 1;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  padding: 0 48px;
}

/* ─── Header ─────────────────────────────────────────────────── */
.cm-header-outer { width: 100%; }
.cm-header {
  max-width: 1180px; width: 100%; margin: 0 auto;
  padding: 28px 48px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px;
}
.cm-header-right {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cm-brand {
  text-decoration: none; color: var(--ink);
  transition: opacity 200ms ease;
}
.cm-brand:hover { opacity: 0.85; }

/* Typographic wordmark */
.cm-wordmark {
  display: inline-flex; align-items: baseline; gap: 14px;
}
.cm-wordmark-jp {
  font-family: "Noto Serif JP", serif;
  font-size: 30px; font-weight: 600; letter-spacing: 0.10em;
  color: var(--ink);
}
.cm-wordmark-en {
  font-size: 11px; letter-spacing: 0.36em;
  color: var(--mute);
}
.cm-wordmark-sm .cm-wordmark-jp { font-size: 20px; letter-spacing: 0.08em; }
.cm-wordmark-sm .cm-wordmark-en { font-size: 10px; letter-spacing: 0.32em; }

/* Language toggle */
.cm-lang {
  display: inline-flex; align-items: center;
  border: 1px solid var(--hair2);
  border-radius: 999px;
  padding: 3px;
}
.cm-lang-btn {
  background: transparent; border: none;
  padding: 4px 12px;
  font: inherit; font-size: 12px; letter-spacing: 0.08em;
  color: var(--mute); cursor: pointer;
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease;
}
.cm-lang-btn:hover { color: var(--ink); }
.cm-lang-btn.is-active {
  background: var(--ink); color: var(--bg);
}

/* Nav */
.cm-nav { display: flex; gap: 28px; align-items: baseline; flex-wrap: wrap; }
.cm-nav-item {
  position: relative;
  font-size: 14px; color: var(--ink2); text-decoration: none;
  letter-spacing: 0.04em; padding-bottom: 6px;
  transition: color 160ms ease;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.cm-nav-item::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--ink); opacity: 0;
  transition: opacity 160ms ease;
}
.cm-nav-item:hover { color: var(--ink); }
.cm-nav-item:hover::after { opacity: 0.3; }
.cm-nav-item.is-active { color: var(--ink); }
.cm-nav-item.is-active::after { opacity: 1; }
.cm-nav-ext { font-size: 10px; color: var(--mute); }

/* ─── Page Transitions ───────────────────────────────────────── */
.cm-page {
  transition: opacity 180ms ease, transform 240ms ease;
}
.cm-page.is-out {
  opacity: 0;
  transform: translateY(6px);
}

/* ─── Section Heading ────────────────────────────────────────── */
.cm-section-heading {
  display: flex; align-items: baseline; gap: 16px;
  padding-bottom: 24px; margin-bottom: 36px;
  border-bottom: 1px solid var(--hair2);
}
.cm-section-heading h2 {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(22px, 3.5vw, 28px); font-weight: 500; margin: 0; color: var(--ink);
  letter-spacing: 0.04em;
}
.cm-section-heading .cm-alt {
  font-size: 13px; color: var(--mute); letter-spacing: 0.05em;
}

/* ─── Cards ──────────────────────────────────────────────────── */
.cm-card { transition: transform 240ms ease, opacity 200ms ease; text-decoration: none; color: inherit; display: block; }
.cm-card:hover { transform: translateY(-3px); }
.cm-card-img {
  position: relative; overflow: hidden;
}
.cm-card-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(232,230,225,0) 0%, rgba(232,230,225,0.06) 70%, rgba(232,230,225,0.10) 100%);
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}
.cm-card:hover .cm-card-img::after { opacity: 1; }
.cm-card-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform 600ms cubic-bezier(0.2, 0.6, 0.2, 1), filter 300ms ease;
}
.cm-card:hover .cm-card-bg { transform: scale(1.04); filter: brightness(1.06); }
.cm-card-arrow {
  display: inline-block;
  transition: transform 260ms ease;
}
.cm-card:hover .cm-card-arrow { transform: translateX(4px); }

/* Game card specifics */
.cm-card-meta {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 12px; color: var(--mute); letter-spacing: 0.06em;
  margin-bottom: 6px; flex-wrap: wrap;
}
.cm-card-title {
  font-family: "Noto Serif JP", serif;
  font-size: 22px; color: var(--ink); line-height: 1.3;
  font-weight: 500; margin-bottom: 10px;
}
.cm-card-about {
  font-size: 14px; color: var(--ink2); line-height: 1.7;
  text-wrap: pretty;
}
.cm-card-cta {
  margin-top: 14px; font-size: 13px; color: var(--accent);
  letter-spacing: 0.04em;
}
.cm-chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px; letter-spacing: 0.08em;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 500;
}
.cm-chip-top-left {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.cm-chip-top-right {
  position: absolute; top: 12px; right: 12px; z-index: 2;
}

/* Member card specifics */
.cm-member-initial {
  font-family: "Noto Serif JP", serif;
  font-size: 96px; color: var(--mute); opacity: 0.4;
  letter-spacing: 0.02em; position: relative; z-index: 1;
}
.cm-member-photo {
  position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%;
  z-index: 0;
}
.cm-member-name {
  font-family: "Noto Serif JP", serif;
  font-size: 22px; color: var(--ink); font-weight: 500; margin-bottom: 6px;
}
.cm-member-role {
  font-size: 14px; color: var(--ink2); margin-bottom: 12px; line-height: 1.5;
}
.cm-member-handle {
  font-size: 13px; color: var(--accent); letter-spacing: 0.04em;
}

/* ─── Works grid ─────────────────────────────────────────────── */
.cm-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 36px;
}

/* ─── Member grid ────────────────────────────────────────────── */
.cm-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 36px;
}

/* ─── Page header section ────────────────────────────────────── */
.cm-page-hero {
  padding-top: clamp(56px, 9vw, 96px);
  padding-bottom: clamp(40px, 7vw, 64px);
}
.cm-page-hero-label {
  font-size: 14px; color: var(--mute); letter-spacing: 0.06em; margin-bottom: 18px;
}
.cm-page-hero-h1 {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(32px, 6vw, 52px); font-weight: 500; margin: 0; color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.cm-page-hero-sub {
  margin-top: 18px; font-size: clamp(14px, 1.6vw, 16px); color: var(--ink2);
  max-width: 560px; line-height: 1.8;
}

/* ─── Contact ────────────────────────────────────────────────── */
.cm-contact-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  align-items: start;
  padding-bottom: clamp(56px, 9vw, 96px);
}
.cm-form { display: flex; flex-direction: column; gap: 28px; }
.cm-field { display: flex; flex-direction: column; gap: 8px; }
.cm-field-label { display: block; font-size: 13px; color: var(--ink2); letter-spacing: 0.04em; cursor: default; }
.cm-field-label .required { color: var(--accent); margin-left: 6px; }
.cm-input {
  width: 100%; padding: 12px 14px;
  background: var(--bg2); border: 1px solid var(--hair2);
  color: var(--ink); font: inherit; font-size: 15px;
  border-radius: 0; outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.cm-input:focus { border-color: var(--ink); background: var(--bg); }
.cm-textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
.cm-button {
  background: var(--ink); color: var(--bg);
  border: none; padding: 14px 32px;
  font: inherit; font-size: 14px; letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 160ms ease;
  width: fit-content;
}
.cm-button:hover { background: var(--accent); }
.cm-contact-aside {
  background: var(--bg2); padding: 28px;
  border: 1px solid var(--hair);
}
.cm-aside-h {
  font-family: "Noto Serif JP", serif;
  font-size: 18px; font-weight: 500; color: var(--ink); margin-bottom: 14px;
}
.cm-social-list { display: flex; flex-direction: column; gap: 12px; }
.cm-social-link {
  font-size: 14px; color: var(--ink); text-decoration: none;
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; border-bottom: 1px solid var(--hair);
  transition: color 160ms ease;
}
.cm-social-link:hover { color: var(--accent); }
.cm-social-arrow { color: var(--mute); }
.cm-presskit-link {
  font-size: 14px; color: var(--accent); text-decoration: none;
  letter-spacing: 0.04em;
  transition: opacity 160ms ease;
}
.cm-presskit-link:hover { opacity: 0.8; }
.cm-presskit-desc {
  font-size: 13px; color: var(--ink2); line-height: 1.7; margin-bottom: 14px;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.cm-footer {
  margin-top: 80px;
  border-top: 1px solid var(--hair);
  background: transparent;
}
.cm-footer-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 56px 48px 48px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px;
}
.cm-footer-h {
  font-size: 12px; color: var(--mute);
  letter-spacing: 0.16em; margin-bottom: 14px;
  text-transform: uppercase;
}
.cm-footer-link {
  display: block; font-size: 14px; color: var(--ink2);
  text-decoration: none; padding: 6px 0;
  transition: color 160ms ease;
}
.cm-footer-link:hover { color: var(--accent); }
.cm-footer-copy {
  font-size: 13px; color: var(--mute); margin-top: 14px;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .cm-header { padding: 24px 32px 0; }
  .cm-main { padding: 0 32px; }
  .cm-footer-inner { padding: 48px 32px 40px; grid-template-columns: 1fr 1fr; gap: 36px; }
  .cm-footer-col:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .cm-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 20px 0;
  }
  .cm-header-right {
    width: 100%;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
  }
  .cm-nav { gap: 10px 16px; }
  .cm-nav-item { font-size: 13px; padding-bottom: 4px; }
  .cm-wordmark-jp { font-size: 22px; letter-spacing: 0.08em; }
  .cm-wordmark-en { display: none; }
  .cm-main { padding: 0 20px; }
  .cm-footer-inner { grid-template-columns: 1fr; padding: 36px 20px; gap: 28px; }
  .cm-footer-col:first-child { grid-column: auto; }
  .cm-button { padding: 14px 24px; }
  .cm-contact-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  .cm-contact-aside { order: 2; }
  .cm-lang-btn { padding: 4px 10px; font-size: 11px; }
}

/* ─── Admin bar offset ───────────────────────────────────────── */
.admin-bar .cm-header-outer { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .cm-header-outer { top: 46px; }
}
