/* ============================================================
   Cueply Support — Global Styles
   Design system copied exactly from haruhiromatsumoto.privacy
   ============================================================ */

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

:root {
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", -apple-system, sans-serif;
  --text-xs: 11px; --text-sm: 12px; --text-base: 14px; --text-md: 17px;
  --text-lg: 19px; --text-xl: 24px; --text-2xl: 28px; --text-3xl: 40px;

  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-overlay: rgba(255, 255, 255, 0.82);
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-card: #FFFFFF;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #e8e8ed;
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #AEAEB2;
  --divider: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --link: #FA6401;
  --link-hover: #e05800;
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --radius-xs: 4px; --radius-sm: 10px; --radius-md: 16px;
  --radius-lg: 22px; --radius-xl: 28px; --radius-full: 9999px;
  --nav-height: 58px; --nav-top: 10px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration-fast: 100ms;
}

html {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
a { color: var(--link); text-decoration: none; transition: color var(--duration-fast) var(--ease); }
a:hover { color: var(--link-hover); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; outline: none; }

/* ── Nav ── */
.nav-spacer {
  height: calc(env(safe-area-inset-top, 0px) + var(--nav-height) + var(--nav-top) + 10px);
  flex-shrink: 0;
}

.nav {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--nav-top));
  left: 12px;
  right: 12px;
  height: var(--nav-height);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface-overlay);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-radius: 20px;
  border: 1px solid var(--divider);
}

.nav__logo { display: flex; align-items: center; height: 32px; text-decoration: none; flex-shrink: 0; }
.nav__logo-img { height: 32px !important; max-height: 32px; width: auto; max-width: none; display: block; object-fit: contain; }
.nav__right { display: flex; align-items: center; gap: 10px; }
.nav__app-link {
  display: flex; align-items: center; height: 34px; padding: 0 14px;
  border-radius: var(--radius-full); font-family: var(--font-display);
  font-size: var(--text-base); font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; background: transparent; color: var(--text-secondary);
  border: 1px solid var(--divider); text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.nav__app-link:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* ── Language Toggle ── */
.lang-toggle-wrap { display: flex; justify-content: center; padding: 0 22px 36px; }
.lang-toggle { position: relative; display: inline-flex; background: var(--bg-tertiary); border-radius: var(--radius-full); padding: 3px; }
.lang-slider {
  position: absolute; top: 3px; left: 3px; height: calc(100% - 6px);
  border-radius: var(--radius-full); background: var(--surface);
  box-shadow: var(--shadow-xs); pointer-events: none; z-index: 0;
  transition: left 0.24s cubic-bezier(0.4, 0, 0.2, 1), width 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}
.lang-btn {
  position: relative; z-index: 1; display: flex; align-items: center;
  padding: 7px 22px; border-radius: var(--radius-full); font-size: var(--text-sm);
  font-weight: 500; color: var(--text-secondary);
  transition: color 0.15s ease; border: none; background: none;
  cursor: pointer; font-family: var(--font); white-space: nowrap;
}
.lang-btn.is-active { color: var(--text-primary); font-weight: 600; }

.lang-section { display: none; }
.lang-section.is-active { display: block; }

/* Japanese typography */
.lang-section[data-lang="ja"] { font-family: var(--font-ja); line-height: 1.85; }
.lang-section[data-lang="ja"] .article-body { font-family: var(--font-ja); line-height: 1.85; }
.lang-section[data-lang="ja"] .article-header__title,
.lang-section[data-lang="ja"] .article-body h2,
.lang-section[data-lang="ja"] .article-body h3 { font-family: var(--font-ja); letter-spacing: 0; }
.lang-section[data-lang="ja"] .support-section__title,
.lang-section[data-lang="ja"] .contact-card__title { font-family: var(--font-ja); letter-spacing: 0; }

.doc-link-row { display: flex; justify-content: center; gap: 8px; padding: 0 22px 16px; }
.doc-link { font-size: var(--text-sm); color: var(--text-secondary); text-decoration: none; padding: 6px 18px; border-radius: var(--radius-full); border: 1px solid var(--border); transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.doc-link:hover { color: var(--text-primary); border-color: var(--text-secondary); background: var(--bg-tertiary); }

@media (max-width: 600px) { .lang-btn { padding: 7px 16px; } }

/* ── Footer ── */
.footer { background-color: var(--bg-secondary); border-top: 1px solid var(--border); }
.footer__inner { max-width: 1040px; margin: 0 auto; padding: 28px 22px; }
.footer__bottom { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.footer__logo-img { height: 30px; width: auto; display: block; object-fit: contain; }
.footer__bottom-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; flex-wrap: wrap; gap: 12px;
}
.footer__copyright { font-size: var(--text-xs); color: var(--text-tertiary); line-height: 1.6; }
.footer__links { display: flex; gap: 20px; list-style: none; flex-wrap: wrap; }
.footer__links a { font-size: var(--text-xs); color: var(--text-tertiary); text-decoration: none; transition: color var(--duration-fast) var(--ease); }
.footer__links a:hover { color: var(--link); }

@media (max-width: 600px) {
  .footer__bottom-row { flex-direction: column; align-items: flex-start; }
}
