/* 로컬 Gaegu 손글씨 글꼴 — 휴대폰 상단 아웃라인 카운터 숫자 전용 (SIL OFL 1.1 라이선스는 /assets/fonts/OFL.txt에 보존) */
@font-face {
  font-family: "Gaegu";
  src: url("/assets/fonts/Gaegu-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gaegu";
  src: url("/assets/fonts/Gaegu-Regular.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --wall-paper: #eae3ce;
  --floor-olive: #566e43;
  --ink-dark: #1d252c;
  --ink-body: #252b30;
  --ink-muted: #5a5d52;
  --accent-green: #4f6d3a;
  --accent-olive-pill: #879d58;
  --accent-blue: #6ba8d6;
  --focus-ring: #3d6331;
  --font-sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  --font-hand: "Gaegu", -apple-system, BlinkMacSystemFont, sans-serif;
  font-family: var(--font-sans);
  color: var(--ink-dark);
  background-color: var(--wall-paper);
  color-scheme: light;
  font-synthesis: none;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2.5px solid var(--focus-ring);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  background: #1d252c;
  color: #faf7ef;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

/* ==========================================================================
   Full-Screen Tactile Wall & Floor Stage
   Horizon in 2000x2000 WebP is at 62.1% (y=1242).
   With background-position: center 62.1%, the horizon stays locked at 62.1vh
   across all viewport aspect ratios.
   ========================================================================== */
.background-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: var(--wall-paper);
}

.bg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-position: center 62.1%;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.55s ease-in-out;
}

.bg-layer.active {
  opacity: 1;
}

/* ==========================================================================
   Top-Right Floating Settings Gear Button
   ========================================================================== */
.top-controls {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 60;
}

.settings-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(24, 24, 20, 0.14);
  display: grid;
  place-items: center;
  padding: 0;
  color: #3a3d35;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.settings-fab:hover {
  background: #ffffff;
  transform: scale(1.04);
  box-shadow: 0 8px 22px rgba(24, 24, 20, 0.18);
}

.settings-fab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
}

/* ==========================================================================
   Main Split Hero Layout
   ========================================================================== */
.home-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1280px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 44px 20px 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  outline: none;
}

.left-stage,
.right-stage {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* On portrait mobile/tablet (< 860px), place the title & copy on the warm cream wall first,
   and place the iPhone below so its rug rests naturally on the 62.1vh floor horizon */
@media (max-width: 859px) {
  .right-stage {
    order: 1;
  }
  .left-stage {
    order: 2;
  }
}

/* ==========================================================================
   Hand-Drawn Charcoal iPhone Frame & Room Cutout
   ========================================================================== */
.phone-scene-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iphone-mockup {
  position: relative;
  width: clamp(168px, 23.5dvh, 232px);
  aspect-ratio: 1176 / 2409;
  user-select: none;
}

.iphone-frame-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  position: relative;
  z-index: 30;
}

/* Minimal Top Counter & Action inside Phone */
.phone-top-ui {
  position: absolute;
  top: 12.8%;
  left: 9%;
  right: 9%;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.phone-outline-digits {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: clamp(32px, 4.4vh, 48px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 2px;
  color: transparent;
  -webkit-text-stroke: 2px #52733b;
  font-variant-numeric: tabular-nums;
}

.phone-task-label {
  margin: 5px 0 0;
  font-family: var(--font-sans);
  font-size: clamp(12px, 1.5vh, 13.5px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: #3a3d34;
}

.start-action-wrap {
  position: relative;
  margin-top: 6px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.phone-action-btn {
  position: relative;
  border: 0;
  background: none;
  padding: 5px 18px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s ease;
}

.phone-action-btn:hover {
  transform: scale(1.04);
}

.phone-action-btn:active {
  transform: scale(0.96);
}

.hand-oval-svg {
  position: absolute;
  inset: -2px -6px;
  width: calc(100% + 12px);
  height: calc(100% + 4px);
  pointer-events: none;
}

.phone-action-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: clamp(14px, 1.75vh, 16px);
  font-weight: 600;
  color: #1f2428;
  letter-spacing: -0.3px;
}

.acorn-toast {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%);
  background: #486834;
  color: #fffdf6;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
  animation: toastPop 0.85s ease forwards;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes toastPop {
  0% { opacity: 0; transform: translateY(-30%) scale(0.88); }
  25% { opacity: 1; transform: translateY(-50%) scale(1.03); }
  80% { opacity: 1; transform: translateY(-55%) scale(1); }
  100% { opacity: 0; transform: translateY(-70%) scale(0.95); }
}

/* Bottom Room & Characters inside Phone (81% of iPhone width, bottom 7.2%) */
.phone-room-stage {
  position: absolute;
  left: 9.5%;
  width: 81%;
  height: 39%;
  bottom: 7.2%;
  z-index: 20;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.phone-room-stage.is-celebrating {
  transform: translateY(-4px) scale(1.02);
}

.room-scene-img {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.room-scene-img.active {
  opacity: 1;
}

/* ==========================================================================
   Right Column: Refined Brand Title, Concise Description, Store Badges
   ========================================================================== */
.app-content {
  width: 100%;
  max-width: 440px;
  text-align: center;
  padding: 0;
  background: transparent;
}

.brand-title {
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
  font-weight: 800;
  color: #1d252c;
  letter-spacing: -0.03em;
}

.hero-description {
  margin: 0 0 18px;
  font-family: var(--font-sans);
  font-size: clamp(14.5px, 1.45vw, 19px);
  line-height: 1.58;
  font-weight: 400;
  color: #262b2f;
  letter-spacing: -0.015em;
  word-break: keep-all;
}

/* Store Download Buttons */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.store-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 7px 15px;
  border-radius: 10px;
  background: #121417;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 16px rgba(18, 20, 23, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.store-badge-link:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 20px rgba(18, 20, 23, 0.28);
}

.store-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.store-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.12;
}

.store-text small {
  font-size: 9.5px;
  letter-spacing: 0.2px;
  opacity: 0.84;
}

.store-text strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* ==========================================================================
   Bottom-Right Fixed '방 꾸미기' Pill Button
   ========================================================================== */
.customize-room-btn {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60;
  min-height: 44px;
  padding: 9px 22px;
  border-radius: 999px;
  border: 0;
  background: var(--accent-olive-pill);
  color: #1c2218;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  box-shadow: 0 4px 14px rgba(24, 30, 18, 0.2);
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.customize-room-btn:hover {
  background: #94ab63;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(24, 30, 18, 0.26);
}

.customize-room-btn:active {
  transform: translateY(0) scale(0.97);
}

/* ==========================================================================
   Settings Bottom-Sheet Dialog
   ========================================================================== */
.settings-sheet {
  margin: auto auto 0 auto;
  width: min(100%, 520px);
  max-width: 100%;
  max-height: 82dvh;
  padding: 12px 24px 28px;
  border: 1px solid rgba(90, 84, 66, 0.2);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: #faf6ea;
  color: var(--ink-dark);
  box-shadow: 0 -12px 36px rgba(24, 24, 18, 0.2);
}

.settings-sheet::backdrop {
  background: rgba(24, 25, 20, 0.42);
  backdrop-filter: blur(2px);
}

.sheet-drag-handle {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: #cfc7b2;
  margin: 4px auto 12px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5decb;
}

.sheet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.sheet-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  color: #4f5246;
}

.sheet-close-btn:hover {
  background: rgba(80, 82, 68, 0.08);
}

.sheet-close-btn svg {
  width: 20px;
  height: 20px;
}

.sheet-body {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sheet-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sheet-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #262a22;
  font-size: 15.5px;
  font-weight: 600;
}

.sheet-nav-link:hover {
  background: #efe8d4;
}

.sheet-section-heading {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.sheet-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #353b2d;
  font-size: 15px;
}

.sheet-contact-link:hover {
  background: #efe8d4;
}

.sheet-contact-link svg {
  width: 18px;
  height: 18px;
}

.sheet-lang-select {
  min-width: 160px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #c6bea6;
  background: #ffffff;
  font-size: 15px;
  color: #252820;
}

/* ==========================================================================
   Desktop & Tablet Split Stage (Horizon Alignment at 62.1vh)
   ========================================================================== */
@media (min-width: 860px) {
  .home-container {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    height: 100dvh;
    padding: 0 48px;
    gap: 0;
  }

  /* Left column centered around 25% of stage, shifted up -2.4vh so iPhone spans 15.5vh..79.8vh */
  .left-stage {
    width: 48%;
    justify-content: center;
    transform: translateY(-2.4vh);
  }

  /* Right column starts at ~52%, shifted up -1.6vh so Title & Description sit on the cream wall and Store badges align at the 62.1vh horizon */
  .right-stage {
    width: 52%;
    justify-content: flex-start;
    padding-left: 28px;
    transform: translateY(-1.6vh);
  }

  .iphone-mockup {
    width: clamp(200px, 31.4vh, 322px);
    aspect-ratio: 1176 / 2409;
  }

  .app-content {
    text-align: left;
    max-width: 440px;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .brand-title {
    margin-bottom: 16px;
  }

  .hero-description {
    margin-bottom: 28px;
    line-height: 1.64;
  }

  .store-badges {
    justify-content: flex-start;
    gap: 14px;
  }

  .store-badge-link {
    min-height: 48px;
    padding: 8px 18px;
  }
}

/* Landscape Mobile / Short Viewport Handling */
@media (max-height: 620px) and (min-width: 600px) {
  .home-container {
    flex-direction: row;
    padding: 16px 24px 64px;
    gap: 20px;
  }

  .iphone-mockup {
    height: 74dvh;
    width: auto;
  }

  .phone-outline-digits {
    font-size: 32px;
  }

  .brand-title {
    font-size: 38px;
    margin-bottom: 10px;
  }

  .hero-description {
    font-size: 15px;
    margin-bottom: 16px;
  }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Subpages (FAQ, Privacy, Terms, 404) */
.doc-page {
  background: var(--wall-paper) url("/assets/bg-autumn-1.webp") center 62.1% / cover fixed no-repeat;
  min-height: 100dvh;
  padding: 40px 20px 80px;
}

.doc-container {
  max-width: 740px;
  margin: 0 auto;
  background: rgba(252, 249, 240, 0.95);
  border: 1px solid rgba(90, 84, 66, 0.18);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 10px 30px rgba(28, 27, 22, 0.08);
}

.doc-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-green);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.doc-container h1 {
  margin: 0 0 12px;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.doc-container h2 {
  margin: 28px 0 10px;
  font-size: 20px;
  color: #354929;
}

.doc-container p,
.doc-container li {
  font-size: 16px;
  line-height: 1.68;
  color: #2f3229;
}

.faq-item {
  border-bottom: 1px solid rgba(90, 84, 66, 0.16);
  padding: 14px 0;
}

.faq-item summary {
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-item p {
  margin: 10px 0 4px;
}
