/* PixoChat coming-soon landing
   Brand palette anchored on Nintendo DS Lite hardware colors:
   - DS Coral Pink #F5B5C0 (primary)
   - DS Ice Blue   #B8D4E8 (primary)
   - Pop Pink      #FF6FB3 (accent)
   - Electric Blue #5BC0FF (accent)
*/

:root {
  --ds-coral-pink: #F5B5C0;
  --ds-ice-blue:   #B8D4E8;
  --pop-pink:      #FF6FB3;
  --electric-blue: #5BC0FF;
  --ink:           #2A1F2D;
  --paper:         #FFF8FB;
}

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

html, body { height: 100%; }

/* Disable iOS Safari rubber-band overscroll on the y-axis. Without this,
   pulling past the top or bottom of the page reveals the underlying viewport
   background — which is white by default — because background-attachment:
   fixed clips the gradient to the viewport itself, not the overscroll area.
   overscroll-behavior-y: none stops the rubber-band gesture entirely.
   background-color on html is a defensive fallback that paints brand color
   into any rubber-band area that older iOS versions might still expose. */
html {
  overscroll-behavior-y: none;
  background-color: var(--ds-coral-pink);
}

body {
  font-family: 'VT323', ui-monospace, 'Cascadia Code', 'JetBrains Mono', monospace;
  color: var(--ink);
  background: linear-gradient(135deg, var(--ds-coral-pink) 0%, var(--ds-ice-blue) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

/* ----- Bilingual visibility + typography -----
   Each translatable element appears twice in the DOM with lang="en" and
   lang="ja". CSS hides the inactive language based on the html element's
   lang attribute. Japanese text uses DotGothic16 (pixel-coded Japanese-
   supporting Google Font; closest available substitute for the planning-
   doc-recommended PixelMplus, which is not on Google Fonts).
*/

html[lang="en"] [lang="ja"] { display: none; }
html[lang="ja"] [lang="en"] { display: none; }

[lang="ja"] {
  font-family: 'DotGothic16', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}

/* Wordmark (PixoChat) is the international wordmark per the planning
   context — stays Latin/Press Start 2P in both language modes. */

main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  text-align: center;
  max-width: 42rem;
  margin-inline: auto;
}

.wordmark {
  font-family: 'Press Start 2P', ui-monospace, monospace;
  font-size: clamp(1.5rem, 6vw, 2.75rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 2.5rem;
  background: linear-gradient(120deg, var(--pop-pink) 0%, var(--electric-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.6));
}

.hero {
  font-size: clamp(1.25rem, 3.4vw, 1.75rem);
  font-weight: 400;
  line-height: 1.45;
  max-width: 32rem;
  margin-inline: auto;
  margin-bottom: 2rem;
  color: var(--ink);
}

.status {
  font-family: 'Press Start 2P', ui-monospace, monospace;
  font-size: clamp(0.7rem, 1.6vw, 0.85rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  color: var(--ink);
  opacity: 0.85;
}

.contact {
  font-size: clamp(1rem, 2.4vw, 1.25rem);
}

.contact a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 1px;
  transition: color 120ms ease;
}

.contact a:hover,
.contact a:focus-visible {
  color: var(--pop-pink);
  outline: none;
}

footer {
  font-size: 0.95rem;
  text-align: center;
  padding: 1.25rem;
  color: var(--ink);
  opacity: 0.6;
}

/* Language toggle button — top-right corner, shows the OTHER language as the
   click target ("currently English; tap to switch to Japanese") */
.lang-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(255, 248, 251, 0.7);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  background: rgba(255, 248, 251, 0.95);
  outline: none;
  transform: scale(1.03);
}

.lang-toggle:active {
  transform: scale(0.98);
}

/* The toggle uses the same global lang-visibility rules as the rest of the
   page. Each span's lang attribute marks WHEN it should be visible — not the
   language of the text inside. The text inside is the OTHER language so the
   button reads as "tap to switch to <other>". When html[lang="en"], the
   <span lang="en">日本語</span> is visible (showing "日本語" as the switch
   target); when html[lang="ja"], the <span lang="ja">English</span> is
   visible. No toggle-specific override needed. */

/* Decorative sparkles — kawaii vocabulary garnish, on-thesis without revealing the product */
.sparkle {
  position: absolute;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  color: var(--paper);
  user-select: none;
  pointer-events: none;
  opacity: 0.85;
  filter: drop-shadow(0 1px 2px rgba(255, 111, 179, 0.35));
}

.sparkle-tl { top: 8%;  left: 10%; }
.sparkle-tr { top: 12%; right: 12%; }
.sparkle-bl { bottom: 18%; left: 14%; }
.sparkle-br { bottom: 14%; right: 10%; }

@media (prefers-reduced-motion: no-preference) {
  .sparkle {
    animation: twinkle 4s ease-in-out infinite;
  }
  .sparkle-tr { animation-delay: 1s; }
  .sparkle-bl { animation-delay: 2s; }
  .sparkle-br { animation-delay: 3s; }

  @keyframes twinkle {
    0%, 100% { opacity: 0.45; transform: scale(0.92); }
    50%      { opacity: 0.95; transform: scale(1.08); }
  }
}

@media (max-width: 480px) {
  .sparkle-tl, .sparkle-tr, .sparkle-bl, .sparkle-br {
    font-size: 0.95rem;
  }
}

/* Respect Apple's dark-mode preference even though the page is light-by-design.
   Strengthen contrast for accessibility on darker viewports. */
@media (prefers-contrast: more) {
  body { color: #000; }
  footer { opacity: 0.85; }
  .status { opacity: 1; }
}
