/* ============================================
   BUKIYOU Entry Mode System
   ============================================ */

/* ── FOUC Prevention ── */
html.mode-pending body > *:not(#entry-selector):not(script) {
  visibility: hidden;
}

/* ── Selection Overlay ── */
.entry-selector {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #f5f3ef;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.entry-selector.is-visible {
  display: flex;
  opacity: 1;
}

.entry-selector.is-leaving {
  opacity: 0;
}

.entry-selector__inner {
  width: 100%;
  max-width: 960px;
  padding: clamp(32px, 6vw, 64px);
  text-align: center;
}

/* ── Identity ── */
.entry-selector__identity {
  margin-bottom: clamp(48px, 8vw, 80px);
}

.entry-selector__logo {
  display: block;
  font-family: 'Cormorant Garamond', 'Noto Serif JP', serif;
  font-weight: 300;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: 0.4em;
  color: #2a2420;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.entry-selector__tagline {
  display: block;
  font-family: 'Noto Serif JP', serif;
  font-weight: 300;
  font-size: clamp(14px, 2vw, 18px);
  color: #8a8070;
  letter-spacing: 0.1em;
}

/* ── Cards Grid ── */
.entry-selector__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2vw, 24px);
  margin-bottom: clamp(32px, 5vw, 48px);
}

/* ── Card Base ── */
.entry-card {
  position: relative;
  background: #fff;
  border: 1px solid #e0dcd6;
  border-radius: 0;
  padding: clamp(32px, 4vw, 48px) clamp(20px, 3vw, 32px);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: clamp(200px, 30vw, 280px);
  justify-content: center;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.entry-card:focus-visible {
  outline: 2px solid #2a2420;
  outline-offset: 2px;
}

/* ── Card Accent Strip (top bar showing mode color) ── */
.entry-card__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.entry-card--clean .entry-card__accent {
  background: #7a9b8f;
}

.entry-card--clean:hover {
  border-color: #7a9b8f;
}

.entry-card--original .entry-card__accent {
  background: #e8b84b;
}

.entry-card--original:hover {
  border-color: #e8b84b;
}

.entry-card--tech .entry-card__accent {
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
}

.entry-card--tech:hover {
  border-color: #7c3aed;
}

/* ── Card Text ── */
.entry-card__label {
  display: block;
  font-family: 'Noto Serif JP', serif;
  font-weight: 400;
  font-size: clamp(15px, 1.8vw, 18px);
  color: #2a2420;
  letter-spacing: 0.05em;
  line-height: 1.6;
}

.entry-card__desc {
  display: block;
  font-family: 'Noto Serif JP', serif;
  font-weight: 300;
  font-size: clamp(11px, 1.2vw, 13px);
  color: #8a8070;
  letter-spacing: 0.05em;
}

/* ── Escape Button ── */
.entry-selector__escape {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Noto Serif JP', serif;
  font-weight: 300;
  font-size: clamp(12px, 1.3vw, 14px);
  color: #a09888;
  letter-spacing: 0.1em;
  padding: 8px 16px;
  transition: color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.entry-selector__escape:hover {
  color: #2a2420;
}

/* ── Mobile: Stack Cards ── */
@media (max-width: 680px) {
  .entry-selector__cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entry-card {
    min-height: auto;
    padding: 28px 24px;
    flex-direction: row;
    gap: 12px;
    text-align: left;
  }

  .entry-card__accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    width: auto;
  }

  .entry-card__label {
    font-size: 15px;
  }

  .entry-card__desc {
    font-size: 12px;
  }
}


/* ============================================
   MODE VARIABLE OVERRIDES
   ============================================ */

/* ── QUIET MODE ──
   Based on: wireframes/design-full-breader.html (BREADER Story Style)
   Warm grey background, Cormorant Garamond, calm and editorial */

html.mode-clean {
  --amber: #7a9b8f;
  --amber-dim: #5f8274;
  --dark: #e8e4da;
  --darker: #dedad0;
  --deepest: #d0ccc2;
  --charcoal: #2a2420;
  --cream: #f0ece4;
  --cream-dim: #e8e4da;
  --text-dark: #2a2420;
  --text-mid: #7a7060;
  --text-body: rgba(42, 36, 32, 0.65);
  --text-dim: rgba(42, 36, 32, 0.35);
  --text-faint: rgba(42, 36, 32, 0.2);
  --line-faint: rgba(42, 36, 32, 0.06);
  --nav-bg: rgba(232, 228, 218, 0.97);
  --nav-text: rgba(42, 36, 32, 0.5);
  --nav-text-dim: rgba(42, 36, 32, 0.35);
  --border-faint: rgba(42, 36, 32, 0.1);
  --border-color: rgba(42, 36, 32, 0.06);
  --glow-color: rgba(122, 155, 143, 0.15);
}

/* Quiet: invert dark-on-light sections */
html.mode-clean body {
  background: #e8e4da;
  color: #2a2420;
}


/* ── PASSION MODE ──
   Current default design — no overrides needed.
   Dark #1a1208 × amber #e8b84b */

/* html.mode-original uses the existing :root defaults */


/* ── AI MODE ──
   Based on: wireframes/design-vol3-08.html (Cyber Glitch)
   Deep purple, violet + cyan accents, monospace, scanlines */

html.mode-tech {
  --amber: #7c3aed;
  --amber-dim: #5b21b6;
  --dark: #080612;
  --darker: #050410;
  --deepest: #030208;
  --charcoal: #e2d9f3;
  --cream: #e2d9f3;
  --cream-dim: #c8bfe0;
  --text-dark: #e2d9f3;
  --text-mid: #5a4d80;
  --text-body: rgba(226, 217, 243, 0.65);
  --text-dim: rgba(226, 217, 243, 0.35);
  --text-faint: rgba(226, 217, 243, 0.2);
  --line-faint: rgba(226, 217, 243, 0.04);
  --nav-bg: rgba(8, 6, 18, 0.96);
  --nav-text: rgba(226, 217, 243, 0.5);
  --nav-text-dim: rgba(226, 217, 243, 0.35);
  --border-faint: rgba(226, 217, 243, 0.1);
  --border-color: rgba(226, 217, 243, 0.04);
  --glow-color: rgba(124, 58, 237, 0.2);
  --accent-secondary: #06b6d4;
}

html.mode-tech body {
  background: #080612;
  color: #e2d9f3;
}

/* AI mode: scanline overlay */
html.mode-tech body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 9990;
}


/* ============================================
   FLOATING BUTTONS — Mobile mode change & scroll top
   ============================================ */

/* Hide WP theme default back-to-top — replaced by .bk-float-top */
#back-to-top {
  display: none !important;
}

.bk-float {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 9995;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.bk-float.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.bk-float-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  transition: transform 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  outline: none !important;
  filter: none !important;
  text-shadow: none !important;
}

.bk-float-btn svg {
  display: block;
  flex-shrink: 0;
}

.bk-float-btn:active {
  transform: scale(0.92);
}

/* ── Default (Original mode) ── */
.bk-float-top {
  background: #1a1208;
  color: #e8b84b;
}

.bk-float-mode {
  background: #e8b84b;
  color: #1a1208;
}

/* ── Clean mode ── */
html.mode-clean .bk-float-top {
  background: #3a4a44;
  color: #7a9b8f;
}

html.mode-clean .bk-float-mode {
  background: #7a9b8f;
  color: #fff;
}

/* ── Tech mode ── */
html.mode-tech .bk-float-top {
  background: #1a1530;
  color: #7c3aed;
}

html.mode-tech .bk-float-mode {
  background: #7c3aed;
  color: #fff;
}
