/* =============================================
   common.css — Shared styles for WithDrAI site
   ============================================= */

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

/* ─── CSS Variables (Light Mode) ─── */
:root {
  /* 一白水気: 明るいブルー = 大吉（水生木） */
  --navy: #5A7A9B;
  --navy-deep: #4A6A88;
  --navy-light: #8AACC8;
  /* 九紫火気: 明るいラベンダー = 最大吉方 */
  --gold: #C4B5DA;
  --gold-soft: #E0D6EE;
  /* 三碧木気: 明るいミント = 比和 */
  --coral: #7DD4A8;
  --coral-soft: #A8E4C6;
  /* 一白水気: 白を全面に */
  --white: #FFFFFF;
  --off-white: #FBFDFB;
  --warm-gray: #F4F8F6;
  --text-primary: #4A6070;
  --text-secondary: #8BA0AE;
  --text-light: #B0C0CC;
}

/* ─── CSS Variables (Dark Mode) ─── */
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #B0D0E8;
    --navy-deep: #90B8D8;
    --navy-light: #C8E0F0;
    --gold: #E0D6F0;
    --gold-soft: #3A3050;
    --coral: #90E8B8;
    --coral-soft: #2A4038;
    --white: #1A2030;
    --off-white: #151C28;
    --warm-gray: #1E2535;
    --text-primary: #E8F0F4;
    --text-secondary: #B0C8D8;
    --text-light: #7898A8;
  }
}

/* ─── Typography / Base ─── */
html {
  scroll-behavior: smooth;
  font-size: 20px;
}

body {
  font-family: 'Noto Sans JP', 'DM Sans', sans-serif;
  color: var(--text-primary);
  background: var(--off-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Utility Classes ─── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

.section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.section-title .jp {
  display: block;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 500;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* ─── Buttons ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.2rem;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--white);
  background: var(--navy);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  letter-spacing: 0.04em;
}

.btn-primary:hover {
  background: var(--navy-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(39, 61, 82, 0.2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.2rem;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--navy);
  background: transparent;
  border: 1.5px solid var(--navy);
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  letter-spacing: 0.04em;
}

.btn-secondary:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-2px);
}

/* ─── Reveal Animations ─── */
/* Content is visible by default for SEO/no-JS */
.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Only animate when JS has loaded (body gets .js-loaded class) */
.js-loaded .reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-loaded .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s !important; }
.reveal-delay-2 { transition-delay: 0.2s !important; }
.reveal-delay-3 { transition-delay: 0.3s !important; }
.reveal-delay-4 { transition-delay: 0.4s !important; }

/* ─── Scroll Animation Types ─── */
/* Fade up (default) */
.js-loaded .reveal-fade {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-loaded .reveal-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide from left */
.js-loaded .reveal-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-loaded .reveal-slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right */
.js-loaded .reveal-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-loaded .reveal-slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up */
.js-loaded .reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-loaded .reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Rotate in */
.js-loaded .reveal-rotate {
  opacity: 0;
  transform: rotate(-3deg) translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-loaded .reveal-rotate.visible {
  opacity: 1;
  transform: rotate(0) translateY(0);
}

/* Ensure all reveal-* types are visible by default (no-JS fallback) */
.reveal-fade,
.reveal-slide-left,
.reveal-slide-right,
.reveal-scale,
.reveal-rotate {
  opacity: 1;
  transform: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Navigation ─── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.2rem 0;
  transition: all 0.4s ease;
}

nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 30px rgba(39, 61, 82, 0.06);
  padding: 0.8rem 0;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.nav-logo img {
  height: 38px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.04em;
  position: relative;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--coral);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  padding: 0.6rem 1.5rem;
  background: var(--navy);
  color: var(--white) !important;
  border-radius: 100px;
  transition: background 0.3s, transform 0.2s !important;
  text-decoration: none;
}

.nav-cta::after {
  display: none !important;
}

.nav-cta:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
}

/* Back link (used on sub-pages) */
.nav-back {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s;
}

.nav-back:hover {
  color: var(--navy);
}

/* Mobile hamburger menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--navy);
  transition: all 0.3s;
}

/* ─── Footer (Index — full footer) ─── */
footer {
  background: var(--warm-gray);
  padding: 4rem 0 2rem;
  color: var(--text-light);
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

footer a:hover {
  color: var(--navy);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(39, 61, 82, 0.08);
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 36px;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.8rem;
  line-height: 1.8;
  max-width: 300px;
}

.footer-links {
  display: flex;
  gap: 3rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s;
  font-weight: 300;
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  font-size: 0.72rem;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.05em;
}

/* Footer (Cocoro — simple footer) */
footer.footer-simple {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.8rem;
}

/* ─── Accessibility ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 0.8rem 1.5rem;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Focus visible styles */
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* ─── Dark Mode — Navigation ─── */
@media (prefers-color-scheme: dark) {
  nav.scrolled {
    background: rgba(21, 28, 40, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  }

  .footer-top {
    border-bottom: 1px solid rgba(138, 172, 200, 0.12);
  }

  .footer-links a {
    color: var(--text-secondary);
  }

  .footer-links a:hover {
    color: var(--gold);
  }

  .footer-bottom p {
    color: var(--text-secondary);
  }
}

/* ─── Responsive — Shared Components ─── */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  }

  .hamburger {
    display: flex;
  }

  .footer-top {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
