/* ==========================================
   ミルログ LP スタイル
   ========================================== */

/* ---------- Custom Properties ---------- */
:root {
  --blue:            #61A3F2;
  --peach:           #FBB99E;
  --lavender:        #C2AEEB;
  --bg:              #F2F2F7;
  --text-primary:    #3D4554;
  --text-secondary:  #757F93;
  --white:           #FFFFFF;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --shadow-card:  0 4px 24px rgba(97, 163, 242, 0.12);
  --shadow-phone: 0 24px 64px rgba(61, 69, 84, 0.22);
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 52px;
  letter-spacing: -0.02em;
}

/* ---------- Phone Frame ---------- */
.phone-frame {
  background: #1C1C1E;
  border-radius: 48px;
  padding: 10px;
  box-shadow: var(--shadow-phone);
  width: 260px;
  margin: 0 auto;
  position: relative;
}

.phone-frame img {
  border-radius: 40px;
  width: 100%;
  display: block;
}

.phone-frame--sm {
  width: 220px;
}

/* ---------- App Store Badge ---------- */
.btn-badge {
  display: inline-block;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-badge:hover {
  opacity: 0.82;
  transform: translateY(-2px);
}

.appstore-badge {
  height: 54px;
  width: auto;
  display: block;
}

/* ---------- Scroll Snap ---------- */
section,
footer {
  scroll-snap-align: start;
}

/* ---------- Global Nav ---------- */
.global-nav {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hamburger button */
.hamburger {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  position: relative;
  z-index: 110;
}

.hamburger__line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              width 0.3s ease;
  transform-origin: center;
}

/* Open state: three lines → X */
.hamburger.is-open .hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open .hamburger__line:nth-child(2) {
  opacity: 0;
  width: 0;
}
.hamburger.is-open .hamburger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 69, 84, 0.3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 150;
}

.nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Menu panel */
.nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  min-width: 220px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top right;
}

.nav-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.nav-menu__item {
  display: block;
  padding: 16px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease;
}

.nav-menu__item:last-child {
  border-bottom: none;
}

.nav-menu__item:hover {
  background: rgba(97, 163, 242, 0.08);
  color: var(--blue);
}

#nav-store {
  font-weight: 700;
  color: var(--blue);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #FFF1EB 0%, #EBF4FF 55%, #F2EEFF 100%);
  padding: 80px 0 0;
  overflow: hidden;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 56px;
}

.hero__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.hero__app-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.hero__app-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.hero__catch {
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero__sub {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.85;
}

.hero__mockup {
  padding-top: 8px;
  position: relative;
}

/* ---------- Problem ---------- */
.problem {
  background: linear-gradient(160deg, #FDE8DC 0%, #FDF0E8 60%, #EFF5FF 100%);
  padding: 100px 0;
}

.problem .section-title {
  color: var(--text-primary);
}

.problem__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.problem__card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(251, 130, 80, 0.10), 0 1px 4px rgba(0,0,0,0.06);
}

.problem__icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(251, 185, 158, 0.55),
    rgba(97, 163, 242, 0.30)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.problem__icon-wrap svg {
  width: 30px;
  height: 30px;
  color: #E07040;
}

.problem__card p {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.65;
}

.problem__resolve {
  text-align: center;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text-primary);
  padding: 32px 28px;
  background: var(--white);
  border-radius: var(--radius-lg);
  line-height: 1.6;
  box-shadow: 0 4px 20px rgba(251, 130, 80, 0.10), 0 1px 4px rgba(0,0,0,0.06);
}

.problem__resolve strong {
  color: var(--blue);
}

/* ---------- Features ---------- */
.features {
  background: var(--bg);
  padding: 100px 0;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
  margin-bottom: 88px;
}

.feature:last-child {
  margin-bottom: 0;
}

.feature__body {
  text-align: center;
  max-width: 480px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature__body.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.feature__num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
  background: rgba(97, 163, 242, 0.12);
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 18px;
}

.feature__title {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text-primary);
  line-height: 1.3;
}

.feature__desc {
  font-size: 0.975rem;
  color: var(--text-secondary);
  line-height: 1.85;
}

/* ---------- Privacy ---------- */
.privacy-section {
  background: var(--white);
  padding: 100px 0;
}

.privacy-card {
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 60px 44px;
  box-shadow: var(--shadow-card);
}

.privacy-card__icon {
  margin: 0 auto 28px;
  width: 60px;
  height: 60px;
}

.privacy-card__icon svg {
  width: 100%;
  height: 100%;
}

.privacy-card__title {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  line-height: 1.4;
  color: var(--text-primary);
}

.privacy-card__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 28px;
}

.link-text {
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.link-text:hover {
  opacity: 0.65;
}

/* ---------- CTA ---------- */
.cta-section {
  background: linear-gradient(135deg, var(--blue) 0%, var(--lavender) 100%);
  padding: 100px 0;
  text-align: center;
  color: var(--white);
}

.cta-section__icon {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  margin: 0 auto 28px;
}

.cta-section__title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.cta-section__sub {
  font-size: 0.95rem;
  opacity: 0.82;
  margin-bottom: 36px;
}


/* ---------- Footer ---------- */
.footer {
  background: var(--text-primary);
  color: rgba(255, 255, 255, 0.55);
  padding: 52px 0;
  text-align: center;
}

.footer__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 18px;
}

.footer__nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer__nav a {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.2s;
}

.footer__nav a:hover {
  color: var(--white);
}

.footer__copy {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  html {
    font-size: 81.25%; /* 16px → 13px、rem全体を約18.75%縮小 */
  }

  .hero {
    padding: 56px 0 0;
  }

  .hero__catch {
    font-size: 2.4rem;
  }

  .hero__sub {
    font-size: 0.9rem;
  }

  .problem,
  .features,
  .privacy-section,
  .cta-section {
    padding: 64px 0;
  }

  .section-title {
    margin-bottom: 36px;
  }

  .problem__card {
    padding: 28px 20px;
  }

  .problem__resolve {
    padding: 24px 20px;
  }

  .feature {
    gap: 32px;
    margin-bottom: 56px;
  }

  .privacy-card {
    padding: 40px 28px;
  }

  .cta-section__icon {
    width: 60px;
    height: 60px;
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  .hero__inner {
    flex-direction: row;
    text-align: left;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
  }

  .hero__text {
    flex: 1;
    max-width: 520px;
    padding-bottom: 72px;
  }

  .hero__brand {
    justify-content: flex-start;
  }

  .hero__mockup {
    flex-shrink: 0;
    padding-top: 0;
    align-self: flex-end;
  }

  .feature {
    flex-direction: row;
    text-align: left;
    gap: 80px;
    align-items: center;
    justify-content: center;
  }

  .feature--reverse {
    flex-direction: row-reverse;
  }

  .feature__body {
    text-align: left;
    flex: 1;
  }

  .feature__screen {
    flex-shrink: 0;
  }
}

@media (min-width: 1024px) {
  .phone-frame {
    width: 300px;
  }

  .phone-frame img {
    border-radius: 44px;
  }

  .phone-frame--sm {
    width: 250px;
  }
}

/* ---------- Theme Toggle Button ---------- */
.theme-toggle {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  position: relative;
  z-index: 110;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ライト時: moon表示、sun非表示 */
.theme-toggle__sun  { opacity: 0; transform: scale(0.7); }
.theme-toggle__moon { opacity: 1; transform: scale(1); }

/* ダーク時: sun表示、moon非表示 */
html[data-theme="dark"] .theme-toggle__sun  { opacity: 1; transform: scale(1); }
html[data-theme="dark"] .theme-toggle__moon { opacity: 0; transform: scale(0.7); }

/* ---------- Dark Mode ---------- */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-toggle {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }
  html:not([data-theme="light"]) .theme-toggle__sun  { opacity: 1; transform: scale(1); }
  html:not([data-theme="light"]) .theme-toggle__moon { opacity: 0; transform: scale(0.7); }
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --blue:            #8AC2F7;
    --peach:           #F1A694;
    --lavender:        #A08DE6;
    --bg:              #1C1C1E;
    --white:           #2C2C2E;
    --text-primary:    rgba(255, 255, 255, 0.90);
    --text-secondary:  rgba(255, 255, 255, 0.68);
    --shadow-card:     0 4px 24px rgba(0, 0, 0, 0.34);
    --shadow-phone:    0 24px 64px rgba(0, 0, 0, 0.5);
  }
  html:not([data-theme="light"]) body { background: var(--bg); }
  html:not([data-theme="light"]) .hero {
    background: linear-gradient(160deg, rgba(241,166,148,0.26) 0%, rgba(138,194,247,0.22) 55%, rgba(160,141,230,0.18) 100%);
  }
  html:not([data-theme="light"]) .problem {
    background: linear-gradient(160deg, rgba(241,166,148,0.20) 0%, rgba(241,166,148,0.14) 60%, rgba(138,194,247,0.16) 100%);
  }
  html:not([data-theme="light"]) .problem__card,
  html:not([data-theme="light"]) .problem__resolve {
    background: rgba(138,194,247,0.12);
    box-shadow: 0 4px 20px rgba(0,0,0,0.34), 0 1px 4px rgba(0,0,0,0.2);
    border: 1px solid rgba(138,194,247,0.34);
  }
  html:not([data-theme="light"]) .hamburger {
    background: rgba(255,255,255,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  }
  html:not([data-theme="light"]) .nav-menu {
    background: rgba(44,44,46,0.96);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  }
  html:not([data-theme="light"]) .nav-menu__item { border-bottom-color: rgba(255,255,255,0.06); }
  html:not([data-theme="light"]) .nav-overlay { background: rgba(0,0,0,0.5); }
  html:not([data-theme="light"]) .cta-section {
    background: linear-gradient(135deg, #8AC2F7 0%, #A08DE6 100%);
  }
  html:not([data-theme="light"]) .footer {
    background: #111113;
  }
  html:not([data-theme="light"]) .cta-section {
    color: #FFFFFF;
  }
  html:not([data-theme="light"]) .footer__name {
    color: #FFFFFF;
  }
  html:not([data-theme="light"]) .footer__nav a:hover {
    color: #FFFFFF;
  }
}

html[data-theme="dark"] {
  --blue:            #8AC2F7;
  --peach:           #F1A694;
  --lavender:        #A08DE6;
  --bg:              #1C1C1E;
  --white:           #2C2C2E;
  --text-primary:    rgba(255, 255, 255, 0.90);
  --text-secondary:  rgba(255, 255, 255, 0.68);
  --shadow-card:     0 4px 24px rgba(0, 0, 0, 0.34);
  --shadow-phone:    0 24px 64px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] body { background: var(--bg); }
html[data-theme="dark"] .hero {
  background: linear-gradient(160deg, rgba(241,166,148,0.26) 0%, rgba(138,194,247,0.22) 55%, rgba(160,141,230,0.18) 100%);
}
html[data-theme="dark"] .problem {
  background: linear-gradient(160deg, rgba(241,166,148,0.20) 0%, rgba(241,166,148,0.14) 60%, rgba(138,194,247,0.16) 100%);
}
html[data-theme="dark"] .problem__card,
html[data-theme="dark"] .problem__resolve {
  background: rgba(138,194,247,0.12);
  box-shadow: 0 4px 20px rgba(0,0,0,0.34), 0 1px 4px rgba(0,0,0,0.2);
  border: 1px solid rgba(138,194,247,0.34);
}
html[data-theme="dark"] .hamburger {
  background: rgba(255,255,255,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .nav-menu {
  background: rgba(44,44,46,0.96);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
html[data-theme="dark"] .nav-menu__item { border-bottom-color: rgba(255,255,255,0.06); }
html[data-theme="dark"] .nav-overlay { background: rgba(0,0,0,0.5); }
html[data-theme="dark"] .cta-section {
  background: linear-gradient(135deg, #8AC2F7 0%, #A08DE6 100%);
}
html[data-theme="dark"] .footer {
  background: #111113;
}
html[data-theme="dark"] .cta-section {
  color: #FFFFFF;
}
html[data-theme="dark"] .footer__name {
  color: #FFFFFF;
}
html[data-theme="dark"] .footer__nav a:hover {
  color: #FFFFFF;
}
