/* 노리 공유 링크 웹 페이지. 디자인 기준: 캔버스 ShareLanding 보드 (390 폭) */

:root {
  --paper: #F4EFE6;
  --card: #FBF8F2;
  --ink: #1E2433;
  --ink-sub: #4D5566;
  --indigo: #24335A;
  --vermilion: #D9502F; /* 장식 전용. 글자색으로 쓰지 않는다 (대비 부족) */
  --line: #8A8270;
  --gutter: 28px;
  --col: 390px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans KR', system-ui, sans-serif;
}

:lang(ja) { font-family: 'IBM Plex Sans JP', system-ui, sans-serif; }

/* 종이 질감. 보드의 feTurbulence 필터와 같은 값 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.14 0 0 0 0 0.2 0.4 0 0 0 -0.15'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)'/%3E%3C/svg%3E");
}

a { color: inherit; }

.lang {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 6;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 13px;
  color: var(--ink-sub);
}

.landing {
  flex: 1;
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 54px var(--gutter) 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo { display: block; height: 54px; width: auto; margin: 0; }
.logo img { display: block; height: 100%; width: auto; }

.mascot { display: block; margin-top: 14px; width: 190px; height: auto; }

.title {
  margin: 18px 0 0;
  font-family: 'Gowun Batang', serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.32;
  letter-spacing: -0.03em;
}

/* 일본어 제목은 Klee One (앱과 같은 손글씨체. 2026-10-15 까지는 Shippori Mincho 라 무거워 보였다) */
.title:lang(ja) {
  font-family: 'Klee One', serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0;
}

.lead {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-sub);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.stores {
  margin-top: 22px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store {
  min-height: 56px;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 0 8px;
  padding: 0 22px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

/* 404 의 두 버튼 (스토어 배지가 아니다) */
.store-dark { background: #111214; color: #FFFFFF; }
.store-light { background: #FFFFFF; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.store:focus-visible, .lang:focus-visible, .badge:focus-visible, .store-web:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 2px;
}

/* 공식 스토어 배지 (v2.57, /app 의 안드로이드·PC 가 오는 곳). 배지 그림은 바꾸지 않는다(색·모양은 Apple·Google 지침대로) */
.badges {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  scroll-margin-top: 24px;
}
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 8px; text-decoration: none; }
.badge img { display: block; height: 48px; width: auto; }
/* 스토어 주소가 정해지기 전: 링크 없이 배지 아래에 "준비 중". 가짜 주소로 대신하지 않는다 (설계서 2-3b) */

.store-web {
  margin-top: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--indigo);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-sub);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 항공 우편 테두리 */
.airmail {
  flex: none;
  height: 10px;
  background: repeating-linear-gradient(135deg, var(--vermilion) 0 12px, var(--paper) 12px 18px, var(--indigo) 18px 30px, var(--paper) 30px 36px);
}

@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .title { font-size: 24px; }
  .store { padding: 8px 16px; }
  .badge img { height: 44px; }
}

.lead-alert { margin-top: 40px; font-size: 15px; font-weight: 400; color: var(--ink); }

/* ───────── 공유된 엽서 (/s/{ref_code}, 캔버스 SharedOwn·SharedReceived 보드) ───────── */

body.shared { background: #DCE5E6; }

.shared-main {
  flex: 1;
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 50px 24px 32px;
  display: flex;
  flex-direction: column;
}

.shared-head { margin: 0; font-size: 16px; font-weight: 600; line-height: 44px; }

.card {
  align-self: center;
  width: 100%;
  max-width: 280px;
  margin-top: 8px;
  padding: 10px 10px 12px;
  background: var(--card);
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(30, 36, 51, 0.05), 0 22px 40px -18px rgba(30, 36, 51, 0.55);
}

.photo-wrap { position: relative; }

.photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }

/* 사진 없는 엽서: 항공 우편 테두리를 두른 엽서 뒷면, 한 줄은 손글씨 (앱 카드 PostcardBack 과 같은 치수) */
.postcard-back {
  display: flex;
  padding: 5px;
  border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--vermilion) 0 10px, var(--card) 10px 15px, var(--indigo) 15px 25px, var(--card) 25px 30px);
}

.back-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  border-radius: 2px;
  background: var(--card);
}

/* v2.61 노리 Plus 엽서지 (앱 AirmailBorder 와 같은 무늬·종이색) */
.back-inner { position: relative; }
.postcard-back.paper-sakura { background: radial-gradient(circle at 50% 50%, #E07A92 0 3.6px, transparent 4.2px) 0 0 / 15px 15px, radial-gradient(circle at 50% 50%, #F2B5C3 0 2.6px, transparent 3.2px) 7px 7px / 15px 15px, #FBE3E8; }
.postcard-back.paper-sakura .back-inner { background: #FFF4F5; }
.postcard-back.paper-night { background: radial-gradient(circle, #F6E7B8 0 1.1px, transparent 1.6px) 0 0 / 11px 11px, radial-gradient(circle, #F6E7B8 0 0.8px, transparent 1.2px) 5px 6px / 17px 17px, #24335A; }
.postcard-back.paper-night .back-inner { background: #F4F2EC; }
.postcard-back.paper-hanji { background: repeating-linear-gradient(78deg, rgba(120,96,60,0.16) 0 1px, transparent 1px 6px), repeating-linear-gradient(-12deg, rgba(120,96,60,0.10) 0 1px, transparent 1px 9px), #E2D5BC; }
.postcard-back.paper-hanji .back-inner { background: repeating-linear-gradient(80deg, rgba(120,96,60,0.04) 0 1px, transparent 1px 7px), #F6EFE1; }
.postcard-back.paper-gingham { background: repeating-linear-gradient(0deg, rgba(36,51,90,0.32) 0 6px, transparent 6px 12px), repeating-linear-gradient(90deg, rgba(36,51,90,0.32) 0 6px, transparent 6px 12px), #FBF8F2; }
.postcard-back.paper-maple { background: repeating-linear-gradient(135deg, #C8642A 0 10px, #F6E7B8 10px 15px, #8E3B1F 15px 25px, #F6E7B8 25px 30px); }
.postcard-back.paper-maple .back-inner { background: #FFF6EA; }
/* 노리 스티커: 앱처럼 오른쪽 위 한 곳, 사진 위에는 붙이지 않는다 (사진 없는 뒷면에만) */
.back-sticker { position: absolute; top: 12px; right: 14px; width: 56px; height: auto; transform: rotate(-6deg); filter: drop-shadow(0 3px 3px rgba(30,36,51,0.25)); }

.back-head { margin: 0; display: flex; flex-direction: column; font-size: 10px; line-height: 1.5; letter-spacing: 0.12em; color: var(--indigo); }
.back-en { font-weight: 600; }
.back-local { font-family: 'Gowun Batang', serif; }
.back-local:lang(ja) { font-family: 'Klee One', serif; }

.back-line {
  flex: 1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 24px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.back-line:lang(ja) { font-family: 'Klee One', serif; font-size: 22px; word-break: normal; word-break: auto-phrase; }

.tag {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 4px 10px;
  border-radius: 12px 12px 12px 4px;
  background: var(--card);
  color: var(--indigo);
  font-size: 11px;
  font-weight: 600;
}

.card-title {
  margin: 10px 2px 0;
  font-family: 'Gowun Batang', serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 일본어 제목은 문절 단위로 (届きま/した 처럼 끝 두세 글자만 넘어가지 않게). auto-phrase 를 모르는 브라우저(Safari 등)는 normal 로 */
.card-title:lang(ja), :lang(ja) .card-title { font-family: 'Klee One', serif; font-weight: 600; word-break: normal; word-break: auto-phrase; text-wrap: pretty; }

.card-lines {
  margin: 4px 2px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #3B4252;
  overflow-wrap: anywhere;
}

.marks { margin: 8px 2px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.pill {
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #E2B8A8;
  font-size: 11px;
  color: #B03E26;
}

.stamps { margin-left: auto; display: flex; gap: 2px; }
.stamps img { display: block; width: 20px; height: 20px; }

.card-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #CFC6B5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-foot img { display: block; width: 22px; height: 22px; border-radius: 50%; }
.card-foot-text { flex: 1; font-size: 11px; color: var(--ink-sub); }
.card-foot-mark { font-family: 'Shippori Mincho', serif; font-size: 12px; color: var(--indigo); }

.store-primary { margin-top: 22px; background: var(--indigo); color: var(--card); }
.shared-main .lead-alert { margin-top: 80px; text-align: center; }

/* ───────── 법적 문서 (/privacy, /terms, /community 와 /ja/…, legal/build.py 가 만든다) ───────── */
.doc {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
  font-size: 15px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.doc-home { display: inline-block; }
.doc-home img { display: block; height: 40px; width: auto; }
.doc-nav { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.doc-nav a { color: var(--ink-sub); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.doc-nav a[aria-current="page"] { color: var(--indigo); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.doc h1 {
  margin: 20px 0 0;
  font-family: 'Gowun Batang', serif;
  font-size: 30px;
  line-height: 1.32;
  letter-spacing: -0.03em;
}
.doc h1:lang(ja) { font-family: 'Shippori Mincho', serif; }
.doc-draft {
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  color: var(--ink-sub);
}
.doc-lead { margin: 16px 0 0; color: var(--ink-sub); }
.doc section { margin-top: 32px; }
.doc h2 { margin: 0; font-size: 17px; line-height: 1.5; font-weight: 600; color: var(--indigo); }
.doc p { margin: 10px 0 0; }
.doc ul { margin: 10px 0 0; padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc-table { margin-top: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.doc table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13px; line-height: 1.6; background: var(--card); }
.doc th, .doc td { padding: 8px 10px; border: 1px solid #D8D0C2; text-align: left; vertical-align: top; }
.doc th { font-weight: 600; color: var(--ink-sub); white-space: nowrap; }
/* Japanese wraps between any characters (keep-all would only break at punctuation) */
.doc:lang(ja) { word-break: normal; line-break: strict; }
.legal-links { margin: 14px 0 0; font-size: 12px; line-height: 2; color: var(--ink-sub); }
.legal-links a { color: var(--ink-sub); }
/* 공유 카드 페이지: "{지역}에 사는 누군가와 …" (나도 엽서 보내기 위) */
.promo { margin: 24px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink); text-align: center; word-break: keep-all; }
.promo:lang(ja) { word-break: normal; word-break: auto-phrase; line-break: strict; text-wrap: pretty; }
.promo + .store-primary { margin-top: 12px; }
