/* 공개 페이지(소개, 처리방침, 약관, 계정 삭제, 문의) 전용. 정원 앱의 CSS 와 섞지 않는다. */
:root {
  --ink: #1f3320;
  --ink-soft: rgba(31, 51, 32, 0.72);
  --leaf: #94b884;
  --leaf-light: #d3e6c2;
  --cream: #fcf5e0;
  --paper: #fffdf6;
  --hand: 'Gaegu', 'Gowun Batang', cursive;
  --body: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  /* 한글은 단어(어절) 중간에서 줄을 바꾸지 않는다 */
  word-break: keep-all; overflow-wrap: break-word;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ─── 머리와 발 ─── */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1040px; margin: 0 auto;
  padding: max(env(safe-area-inset-top), 14px) 20px 10px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--hand); font-weight: 700; font-size: 26px;
  text-decoration: none; letter-spacing: 1px;
}
/* 앱 아이콘: 머리말에는 작게, 소개 첫 화면에는 홈 화면의 아이콘처럼 크게 */
.brand-icon { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 2px 6px rgba(31, 51, 32, 0.22); }
.app-icon {
  width: 84px; height: 84px; border-radius: 19px; margin: 0 0 18px;
  box-shadow: 0 10px 22px rgba(31, 51, 32, 0.25);
}
.header-cta {
  font-family: var(--hand); font-weight: 700; font-size: 17px; text-decoration: none;
  padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--ink);
}
.header-cta:hover { background: var(--ink); color: var(--cream); }

.site-footer {
  margin-top: 56px; padding: 26px 20px max(env(safe-area-inset-bottom), 28px);
  background: var(--ink); color: rgba(252, 245, 224, 0.78);
  text-align: center; font-size: 14px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-note { margin-top: 12px; font-family: var(--hand); font-size: 16px; opacity: 0.7; }

.button {
  display: inline-block; text-decoration: none; text-align: center;
  font-family: var(--hand); font-weight: 700; font-size: 21px;
  padding: 12px 26px; border-radius: 12px;
}
.button.primary { background: var(--ink); color: var(--cream); box-shadow: 0 6px 16px rgba(31, 51, 32, 0.25); }
.button.primary:hover { transform: translateY(-1px); }

/* ─── 소개 ─── */
body.landing { background: linear-gradient(180deg, var(--leaf-light) 0, #e9f1dc 520px, var(--paper) 900px); }

.hero {
  max-width: 1040px; margin: 0 auto; padding: 28px 20px 40px;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: center;
}
.hero h1 {
  margin: 0 0 14px; font-family: var(--hand); font-weight: 700;
  font-size: clamp(38px, 6vw, 58px); line-height: 1.12; letter-spacing: 0.5px;
}
.lead { margin: 0 0 22px; font-size: 18px; color: var(--ink-soft); max-width: 30em; }
.hint { margin: 16px 0 0; font-size: 14px; color: var(--ink-soft); max-width: 30em; }

/* 폰 모양 액자 — 실제 화면을 찍은 그림을 넣는다 */
.phone {
  justify-self: center; width: min(100%, 300px); aspect-ratio: 390 / 844;
  border-radius: 34px; padding: 9px; background: var(--ink);
  box-shadow: 0 22px 44px rgba(31, 51, 32, 0.28);
}
.phone img, .phone video { width: 100%; height: 100%; object-fit: cover; border-radius: 26px; display: block; }
.phone.small { width: min(100%, 250px); border-radius: 30px; padding: 8px; }
.phone.small img { border-radius: 23px; }

.feature {
  max-width: 880px; margin: 0 auto; padding: 34px 20px;
  display: grid; grid-template-columns: 250px 1fr; gap: 40px; align-items: center;
}
.feature.reverse { grid-template-columns: 1fr 250px; }
.feature.reverse .phone { order: 2; }
.feature h2, .steps h2 {
  margin: 0 0 10px; font-family: var(--hand); font-weight: 700; font-size: 34px; line-height: 1.2;
}
.feature p { margin: 0; font-size: 17px; color: var(--ink-soft); }

/* 작은 기능들 — 그 자리만 확대해 찍은 네모 영상. 위의 기능들과 같은 줄 모양이고 그림이 더 크다 */
.feature.closeup { grid-template-columns: 340px 1fr; }
.feature.closeup.reverse { grid-template-columns: 1fr 340px; }
.feature.reverse .clip { order: 2; }
.clip { justify-self: center; width: min(100%, 340px); }
.clip video {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: 30px; background: var(--leaf); border: 8px solid var(--ink);
  box-shadow: 0 22px 44px rgba(31, 51, 32, 0.28);
}
/* 추억 심기 영상은 조금 더 길다(680×768) — 사진이 있는 추억 카드가 네모에는 다 안 들어온다 */
.clip.tall video { aspect-ratio: 680 / 768; }

.points {
  max-width: 1040px; margin: 20px auto 0; padding: 0 20px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.point {
  padding: 20px 20px 22px; border-radius: 16px;
  background: #eef4e4; border: 1px solid rgba(31, 51, 32, 0.08);
}
.point h3 { margin: 0 0 6px; font-family: var(--hand); font-weight: 700; font-size: 25px; }
.point p { margin: 0; font-size: 15.5px; color: var(--ink-soft); }

.steps { max-width: 680px; margin: 0 auto; padding: 52px 20px 0; text-align: center; }
.steps ol {
  margin: 0 0 26px; padding: 0; list-style: none; counter-reset: step; text-align: left;
}
.steps li {
  counter-increment: step; position: relative; padding: 12px 0 12px 52px;
  border-bottom: 1px dashed rgba(31, 51, 32, 0.18); font-size: 16.5px; color: var(--ink-soft);
}
.steps li strong { color: var(--ink); }
.steps li::before {
  content: counter(step); position: absolute; left: 4px; top: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--leaf); color: var(--ink);
  font-family: var(--hand); font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}

/* ─── 나비 ─── 앱의 나비 세 마리. 정원에서처럼 페이지에 붙어 있어서(absolute) 스크롤하면 같이 움직이고,
   화면 밖으로 나가면 butterflies.js 가 지금 보이는 화면으로 다시 날려 보낸다. 글 위를 날고, 눌리지 않는다.
   상자(.butterflies)는 페이지 전체를 덮고 넘치는 것을 자른다 — 나비가 페이지 길이를 늘리지 않게.
   자리(.butterfly 의 left/top 과 스크립트가 주는 transform)와 돌아다니기(.roam 의 animation)는 따로다.
   나는 길은 앱의 lgRoamPink / Cream / Blue 를 화면 크기(vw, vh)로 옮긴 것 — 앱의 정원은 320×600 이다.
   자리와 길은 한 화면 안에 다 들어오게 잡혀 있다: 다시 들어온 나비는 그 화면을 벗어나지 않는다. */
body.landing { position: relative; }
.butterflies { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.butterfly { position: absolute; display: block; width: 36px; height: 24px; will-change: transform; }
.butterfly .roam {
  display: block; width: 100%; height: 100%; overflow: visible;
  /* 풀밭이 아니라 밝은 종이 위를 날기 때문에 옅은 그림자가 없으면 크림색 나비가 안 보인다 */
  filter: drop-shadow(0 1px 1.5px rgba(31, 51, 32, 0.32));
}
.butterfly .wings { transform-origin: 0 0; }
.butterfly.pink  { left: 15vw; top: 16vh; }
.butterfly.cream { left: 80vw; top: 74vh; }
.butterfly.blue  { left: 26vw; top: 65vh; }
.butterfly.pink .roam  { animation: siteRoamPink 38s ease-in-out infinite; }
.butterfly.cream .roam { animation: siteRoamCream 42s ease-in-out infinite; }
.butterfly.blue .roam  { animation: siteRoamBlue 40s ease-in-out infinite; }
.butterfly.pink .wings  { animation: siteFlap 0.42s ease-in-out infinite; }
.butterfly.cream .wings { animation: siteFlap 0.5s ease-in-out infinite; }
.butterfly.blue .wings  { animation: siteFlap 0.46s ease-in-out infinite; }
@keyframes siteFlap {
  0%, 100% { transform: scaleX(1); }
  50%      { transform: scaleX(0.42); }
}
@keyframes siteRoamPink {
  0%   { transform: translate(0, 0) rotate(0deg); }
  12%  { transform: translate(14vw, 7.5vh) rotate(18deg); }
  25%  { transform: translate(9.4vw, 18.3vh) rotate(-14deg); }
  39%  { transform: translate(-4.7vw, 30.8vh) rotate(24deg); }
  55%  { transform: translate(-9.4vw, 15.8vh) rotate(15deg); }
  72%  { transform: translate(6.3vw, -3.3vh) rotate(-20deg); }
  88%  { transform: translate(11.7vw, 10vh) rotate(-10deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes siteRoamCream {
  0%   { transform: translate(0, 0) rotate(0deg); }
  13%  { transform: translate(-14vw, 9.2vh) rotate(18deg); }
  28%  { transform: translate(-7.8vw, 19.2vh) rotate(-22deg); }
  43%  { transform: translate(6.3vw, 5.8vh) rotate(-14deg); }
  58%  { transform: translate(10.9vw, -12.5vh) rotate(24deg); }
  73%  { transform: translate(-4.7vw, -25vh) rotate(18deg); }
  88%  { transform: translate(-12.5vw, -11.7vh) rotate(-12deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes siteRoamBlue {
  0%   { transform: translate(0, 0) rotate(0deg); }
  12%  { transform: translate(11.3vw, -8.7vh) rotate(-20deg); }
  24%  { transform: translate(31.9vw, -6.3vh) rotate(18deg); }
  36%  { transform: translate(50vw, -12vh) rotate(-14deg); }
  49%  { transform: translate(60.6vw, -23.3vh) rotate(22deg); }
  61%  { transform: translate(44.4vw, -30vh) rotate(18deg); }
  74%  { transform: translate(20vw, -23.7vh) rotate(-24deg); }
  87%  { transform: translate(2.5vw, -14.7vh) rotate(-12deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@media (max-width: 760px) {
  .butterfly { width: 28px; height: 18.7px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 16px; text-align: center; }
  .lead, .hint, .app-icon { margin-left: auto; margin-right: auto; }
  .feature, .feature.reverse { grid-template-columns: 1fr; gap: 22px; text-align: center; padding: 28px 20px; }
  /* 좁은 화면에서는 설명이 먼저, 그 아래에 화면 그림 — 폰 그림 둘이 연달아 나오지 않게 */
  .feature .phone, .feature.reverse .phone { order: 1; justify-self: center; }
  .points { grid-template-columns: 1fr; }
  .feature.closeup, .feature.closeup.reverse { grid-template-columns: 1fr; }
  .feature .clip, .feature.reverse .clip { order: 1; width: min(100%, 320px); }
}

/* hidden 은 꼭 숨는다 — .button 처럼 display 를 정한 것은 hidden 을 붙여도 보인다 */
[hidden] { display: none !important; }

/* ─── 문서 (처리방침, 약관, 계정 삭제, 문의) ─── */
body.doc { background: var(--paper); }
.doc-page { max-width: 720px; margin: 0 auto; padding: 18px 20px 0; font-size: 16px; }
.doc-page h1 { margin: 6px 0 18px; font-family: var(--hand); font-weight: 700; font-size: 40px; line-height: 1.15; }
.doc-page h2 { margin: 34px 0 8px; font-size: 20px; line-height: 1.35; }
.doc-page h3 { margin: 24px 0 4px; font-size: 17px; }
.doc-page p { margin: 0 0 12px; }
.doc-page ul, .doc-page ol { margin: 0 0 12px; padding-left: 22px; }
.doc-page li { margin-bottom: 6px; }
.doc-page a { text-decoration: underline; text-underline-offset: 3px; }
.doc-page table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 15px; }
.doc-page th, .doc-page td {
  text-align: left; vertical-align: top; padding: 9px 10px;
  border-top: 1px solid rgba(31, 51, 32, 0.14);
}
.doc-page th { font-weight: 600; background: #f3f0e2; white-space: nowrap; }
.doc-page tbody tr:last-child td { border-bottom: 1px solid rgba(31, 51, 32, 0.14); }
.effective { margin-top: 30px; color: var(--ink-soft); }
.contact-line { font-size: 18px; }

.draft-banner {
  margin: 0 0 18px; padding: 12px 14px; border-radius: 10px;
  background: #fff3c4; border: 1px solid #e3c65a; font-size: 15px;
}
mark.todo { background: #ffe58a; padding: 1px 5px; border-radius: 4px; }

/* ─── 홈 화면에 추가하기 (/install) ─── */
.install-page .app-icon { margin: 10px 0 14px; }
.install-lead { font-size: 17px; color: var(--ink-soft); }
.install-page .device {
  margin-top: 20px; padding: 18px 20px 14px; border-radius: 16px;
  background: #eef4e4; border: 1px solid rgba(31, 51, 32, 0.08);
}
.install-page .device h2 { margin: 0 0 10px; font-family: var(--hand); font-weight: 700; font-size: 28px; line-height: 1.2; }
.install-page .device .button { border: 0; cursor: pointer; margin-bottom: 4px; }
/* 스크립트가 기기를 가렸으면 그 기기의 안내만 남긴다(안 가렸으면 넷 다 보인다) */
.install-page[data-device] .device { display: none; }
.install-page[data-device="inapp"] .device[data-device="inapp"],
.install-page[data-device="ios"] .device[data-device="ios"],
.install-page[data-device="android"] .device[data-device="android"],
.install-page[data-device="desktop"] .device[data-device="desktop"] { display: block; }
.install-steps { margin: 0 0 6px; padding: 0; list-style: none; counter-reset: install; }
.install-steps li {
  counter-increment: install; position: relative; padding: 9px 0 9px 42px;
  border-top: 1px dashed rgba(31, 51, 32, 0.16); margin: 0;
}
.install-steps li:first-child { border-top: 0; }
.install-steps li::before {
  content: counter(install); position: absolute; left: 0; top: 8px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--leaf); color: var(--ink);
  font-family: var(--hand); font-weight: 700; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
}
.glyph { width: 22px; height: 22px; vertical-align: -5px; margin: 0 1px; fill: currentColor; }
.install-note { margin: 8px 0 0 !important; font-size: 14.5px; color: var(--ink-soft); }
.install-address {
  padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 1px solid rgba(31, 51, 32, 0.14);
  font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-size: 15px; word-break: break-all;
}
.install-invite { margin: 16px 0 0 !important; padding: 12px 14px; border-radius: 10px; background: #fff3c4; border: 1px solid #e3c65a; }
.install-invite strong { font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; letter-spacing: 2px; }
.install-done { font-weight: 600; }
.install-more { margin-top: 16px !important; }
.install-skip { margin-top: 6px !important; color: var(--ink-soft); }
.link-button {
  background: none; border: 0; padding: 0; color: var(--ink-soft); cursor: pointer;
  font: inherit; text-decoration: underline; text-underline-offset: 3px;
}
