/* momeet Landing */

:root {
  --ink: #1a1a1a;
  --ink-light: #555;
  --ink-muted: #999;
  --surface: #fff;
  --surface-alt: #f5f4f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --radius-sm: 6px;
  --radius-md: 12px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  overscroll-behavior-y: none;
}

/* 모바일(뷰포트 높이 낮음): 가로 바운스 방지 */
/* 데스크톱/맥북(뷰포트 높이 높음): 트랙패드 좌우 스와이프(뒤로가기) 유지 */
@media (max-height: 999px) {
  body {
    overscroll-behavior-x: none;
  }
}

body.landing-active {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, Roboto, 'Helvetica Neue', 'Noto Sans KR', sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Nav ===== */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-decoration: none;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-light);
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 50px;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  background: var(--ink);
  color: var(--surface);
}

/* ===== Hero ===== */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10rem 2rem 6rem;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.hero::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('svg/bg-hero-grid.svg') center top / 960px auto no-repeat;
  pointer-events: none;
  z-index: -1;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: #eff6ff;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  margin-bottom: 2rem;
  width: fit-content;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1.5px;
  margin-bottom: 1.5rem;
}

.hero h1 span {
  color: var(--accent);
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--ink-light);
  line-height: 1.8;
  max-width: 520px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #333;
}

.btn-ghost {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-light);
  text-decoration: none;
  padding: 0.85rem 0.5rem;
  transition: color 0.2s;
}

.btn-ghost:hover {
  color: var(--ink);
}

/* ===== Bento Grid ===== */
.bento {
  padding: 4rem 2rem 6rem;
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

.bento::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: url('svg/bg-features-blob.svg') center / contain no-repeat;
  pointer-events: none;
  z-index: -1;
}

.bento-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.bento-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 3rem;
  max-width: 420px;
}

.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1rem;
}

.bento-card {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 2rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.bento-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.bento-card.wide {
  grid-column: 1 / -1;
}

.bento-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  color: var(--surface);
}

.bento-card-icon.cal { background: #eff6ff; }
.bento-card-icon.todo { background: #f0fdf4; }
.bento-card-icon.tmr { background: #fff7ed; }

.bento-card-icon img {
  display: block;
}

.bento-card h3 {
  font-size: 1.1rem;
  font-weight: 650;
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.bento-card p {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.7;
}

/* ===== How it works ===== */
.how {
  padding: 6rem 2rem;
  background: var(--surface-alt);
}

.how-inner {
  max-width: 600px;
  margin: 0 auto;
}

.how .bento-label,
.how .bento-title {
  text-align: left;
}

.how-list {
  list-style: none;
  counter-reset: step;
}

.how-item {
  counter-increment: step;
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.how-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.how-item:last-child {
  border-bottom: none;
}

.how-item::before {
  content: counter(step);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.1rem;
}

.how-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.how-item p {
  font-size: 0.9rem;
  color: var(--ink-light);
}

/* ===== CTA ===== */
.cta {
  padding: 6rem 2rem;
  text-align: center;
  position: relative;
  background: var(--ink);
  color: var(--surface);
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('svg/bg-cta-dots.svg') repeat;
  pointer-events: none;
}

.cta-inner {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.cta h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
  color: var(--surface);
}

.cta p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 2rem;
}

.cta .btn-primary {
  background: var(--surface);
  color: var(--ink);
}

.cta .btn-primary:hover {
  background: #e5e5e5;
}

/* ===== Flutter: hide while landing is active ===== */
/* visibility:hidden → 레이아웃 유지 (ResizeObserver 정상), 렌더링·이벤트 차단, 자식 상속 */
/* display:none 사용 금지 — Flutter가 사이즈 0으로 인식, 복원 시 빈 화면 (issue #141801) */
body.landing-active #flutter-host {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ===== Landing enter/exit transitions ===== */
#landing {
  opacity: 0;
  overflow-x: hidden;
  animation: landingFadeIn 0.6s ease-out 0.1s forwards;
}

#landing.fade-out {
  animation: landingFadeOut 0.3s ease-in forwards;
}

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

@keyframes landingFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ===== Loading indicator ===== */
.loading-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-muted);
  z-index: 100;
  overflow: hidden;
}

.loading-strip-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease-out;
}

.loading-pct {
  font-variant-numeric: tabular-nums;
}

.loading-strip .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ===== Disabled CTA button ===== */
.btn-enter-app.disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.btn-enter-app.loading {
  background:
    linear-gradient(var(--ink), var(--ink)) no-repeat left / var(--load-pct, 0%) 100%,
    rgba(26, 26, 26, 0.25);
  transition: background-size 0.4s ease-out;
}

.cta .btn-enter-app.loading {
  background:
    linear-gradient(var(--surface), var(--surface)) no-repeat left / var(--load-pct, 0%) 100%,
    rgba(255, 255, 255, 0.3);
  transition: background-size 0.4s ease-out;
}

.loading-strip.error {
  color: #dc2626;
  background: #fef2f2;
  border-top-color: #fecaca;
}

/* ===== Loading Screen (non-landing routes) ===== */
#loading {
  opacity: 1;
  transition: opacity 0.4s ease-out;
}

#loading.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  z-index: 200;
}

.loading-logo {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink);
  margin-bottom: 2rem;
}

/* ===== Productivity Cycle Animation ===== */
.loading-anim {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* 회전 accent 아크 */
.anim-arc {
  animation: arcSpin 2.5s linear infinite;
  transform-origin: 36px 36px;
}

@keyframes arcSpin {
  to { transform: rotate(360deg); }
}

/* stroke-draw + opacity 를 자식 요소에 직접 적용 (SVG g 요소는 CSS opacity 애니메이션 미지원) */
.anim-phase > * {
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  opacity: 0;
}

.anim-phase-1 > * { animation: iconDraw 4.5s ease-in-out infinite; }
.anim-phase-2 > * { animation: iconDraw 4.5s ease-in-out -3s infinite; }
.anim-phase-3 > * { animation: iconDraw 4.5s ease-in-out -1.5s infinite; }

@keyframes iconDraw {
  0%      { stroke-dashoffset: 150; opacity: 0; }
  5%      { stroke-dashoffset: 150; opacity: 1; }
  22%     { stroke-dashoffset: 0;   opacity: 1; }
  27%     { stroke-dashoffset: 0;   opacity: 1; }
  33.33%  { stroke-dashoffset: -150; opacity: 0; }
  100%    { stroke-dashoffset: -150; opacity: 0; }
}

/* 물결 도트 + phase 색상 전환 */
.anim-wave {
  display: flex;
  gap: 5px;
  align-items: center;
}

.wave-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  animation: wave 1.4s ease-in-out infinite,
             dotColor 4.5s ease-in-out infinite;
}

.wave-dot:nth-child(2) { animation-delay: 0.15s, 0s; }
.wave-dot:nth-child(3) { animation-delay: 0.3s, 0s; }

@keyframes wave {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

@keyframes dotColor {
  0%, 30%       { background: #2563eb; }
  33.33%, 63%   { background: #16a34a; }
  66.67%, 96%   { background: #ea580c; }
  100%          { background: #2563eb; }
}

.loading-text {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* ===== Footer ===== */
.landing-footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-muted);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .landing-nav {
    padding: 0.75rem 1.25rem;
  }

  .hero {
    padding: 7rem 1.5rem 4rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .bento {
    padding: 3rem 1.5rem 4rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-card.wide {
    grid-column: auto;
  }

  .bento-title {
    font-size: 1.4rem;
  }

  .how {
    padding: 4rem 1.5rem;
  }

  .cta {
    padding: 4rem 1.5rem;
  }

  .cta h2 {
    font-size: 1.4rem;
  }
}
