/*
 * 앵무도사 공개 사이트 스타일 (#19) — 앱 소개 첫 화면 + 정책·지원 문서.
 *
 * 전제: 심사자·이용자가 **로그인 없이 휴대폰에서** 읽는다. 그래서
 *   - 웹폰트·외부 요청이 없고, 자바스크립트는 첫 화면의 배너 넘기기 하나뿐이다(없어도 내용은 다 보인다).
 *   - 본문 17px / 행간 1.75 / 한 줄 최대 ~40자 — 한국어 장문 약관 기준.
 *   - 명도 대비는 WCAG AA(본문 4.5:1) 이상. 다크 모드도 같은 기준으로 따로 잡는다.
 *   - 터치 목표는 44px 이상(내비게이션·링크).
 */

:root {
  --bg: #fdf9f1;
  --surface: #ffffff;
  --text: #1f1c17;
  --muted: #55504a;
  --line: #ddd5c7;
  --accent: #6b4b16;
  --tbd-bg: #fff2c2;
  --tbd-line: #8a6d00;
  --warn-bg: #fff4e5;
  --warn-line: #9a5b00;
  --cta-bg: #1f1c17;
  --cta-text: #ffffff;
  --icon-shadow: rgba(60, 40, 10, 0.18);
  --band-1: #e9fad0;
  --band-2: #ffe9d6;
  --band-3: #fff3c4;
  --device: #1f1c17;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --surface: #211e1a;
    --text: #f2ede4;
    --muted: #c8c0b4;
    --line: #453f37;
    --accent: #f0c477;
    --tbd-bg: #4a3a05;
    --tbd-line: #f0c477;
    --warn-bg: #3a2a12;
    --warn-line: #f0b069;
    --cta-bg: #f2ede4;
    --cta-text: #171512;
    --icon-shadow: rgba(0, 0, 0, 0.5);
    --band-1: #2b3618;
    --band-2: #3d2a1c;
    --band-3: #3a3214;
    --device: #000000;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR',
    'Malgun Gothic', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 12px 16px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  z-index: 10;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.site-header-inner,
.doc,
.site-footer,
.notice {
  max-width: 44rem;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/*
 * 상단 메뉴 — 왼쪽에 앱 이름(첫 화면으로), 그 아래(넓은 화면에서는 오른쪽)에 문서 탭 한 줄.
 * 밑줄 링크를 줄줄이 늘어놓지 않는다. 지금 보는 페이지는 굵은 글씨와 아래 막대로 표시한다
 * (색만으로 구분하지 않는다). 아주 좁은 화면에서는 줄을 꺾지 않고 옆으로 민다.
 */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  padding-top: 10px;
}

.site-name {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.site-name a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}

.site-name img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.site-header nav {
  margin: 0 -20px;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-header nav::-webkit-scrollbar {
  display: none;
}

.site-header nav ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.site-header nav li {
  margin: 0;
  flex: none;
}

.site-header nav a {
  display: block;
  min-height: 44px;
  line-height: 42px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav a:hover {
  color: var(--text);
}

.site-header nav a[aria-current='page'] {
  color: var(--text);
  font-weight: 800;
  border-bottom-color: var(--accent);
}

/* 확정 전 안내 — 이 사이트가 확정 정책이 아님을 첫 화면에서 알린다. */
.notice {
  margin-top: 12px;
  margin-bottom: 4px;
}

.notice > div {
  background: var(--warn-bg);
  border: 2px solid var(--warn-line);
  border-radius: 10px;
  padding: 14px 16px;
}

.notice p {
  margin: 0;
  font-size: 15px;
}

.notice p + p {
  margin-top: 8px;
}

.doc {
  padding-top: 8px;
  padding-bottom: 40px;
}

h1 {
  font-size: 26px;
  line-height: 1.4;
  letter-spacing: -0.4px;
  margin: 24px 0 16px;
}

h2 {
  font-size: 20px;
  line-height: 1.45;
  margin: 36px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 17.5px;
  margin: 24px 0 8px;
}

p {
  margin: 12px 0;
}

ul,
ol {
  margin: 12px 0;
  padding-left: 22px;
}

li {
  margin: 6px 0;
}

li > ul,
li > ol {
  margin: 6px 0;
}

blockquote {
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  font-size: 15.5px;
}

blockquote p {
  margin: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

a {
  color: var(--accent);
}

/* 확정되지 않은 값. 배경색만으로 구분하지 않도록 테두리와 기호를 함께 준다. */
mark.tbd {
  background: var(--tbd-bg);
  color: var(--text);
  border: 1px dashed var(--tbd-line);
  border-radius: 5px;
  padding: 0 4px;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 15px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  /* 본문의 anywhere 를 되돌린다 — 좁은 칸에서 '구분' 같은 두 글자가 세로로 쪼개졌다.
     표는 이미 가로로 스크롤되므로 단어를 깨지 않아도 읽을 수 있다. */
  overflow-wrap: normal;
}

th {
  font-weight: 700;
  background: var(--bg);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.doc-list {
  list-style: none;
  padding: 0;
}

.doc-list li {
  margin: 12px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.doc-list a {
  display: block;
  padding: 16px 18px;
  font-weight: 700;
  text-decoration: none;
}

.doc-list a:hover,
.doc-list a:focus-visible {
  text-decoration: underline;
}

.doc-list .sub {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 15px;
  margin-top: 4px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  padding-bottom: 48px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 6px 0;
}

.build-note {
  font-size: 13px;
  opacity: 0.85;
}

/*
 * 첫 화면(앱 소개). 문서 페이지와 같은 폭·색을 쓰고, 맨 위만 가운데 정렬한 소개 영역이다.
 * 이미지는 앱 아이콘과 앱 화면이고, 자바스크립트는 배너 넘기기(assets/carousel.js) 하나다.
 */
.landing .hero {
  text-align: center;
  padding: 28px 0 8px;
}

.landing .app-icon {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 27px;
  box-shadow: 0 10px 28px var(--icon-shadow);
}

.landing h1 {
  font-size: 36px;
  letter-spacing: -0.8px;
  margin: 22px 0 2px;
}

.landing .tagline {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.landing .lead {
  max-width: 34rem;
  margin: 10px auto;
  color: var(--muted);
}

.landing .lead:first-of-type {
  color: var(--text);
  font-weight: 600;
}

.download {
  margin: 26px 0 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.store-button,
.store-pending {
  display: inline-block;
  min-height: 52px;
  line-height: 52px;
  margin: 0;
  padding: 0 28px;
  border-radius: 26px;
  font-size: 17px;
  font-weight: 700;
}

.store-button {
  background: var(--cta-bg);
  color: var(--cta-text);
  text-decoration: none;
}

.store-button:hover {
  opacity: 0.88;
}

/* 아직 누를 수 없다는 것을 색만이 아니라 점선 테두리와 문구로 알린다. */
.store-pending {
  line-height: 48px;
  border: 2px dashed var(--line);
  background: var(--surface);
  color: var(--text);
}

.store-pending-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}

.facts li {
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

/*
 * 주요 기능 — 기능마다 배너 한 칸. 색 면 위에 라벨·제목·설명을 놓고, 앱 화면을 휴대폰 틀에 넣어
 * 배너 아래쪽에 걸친다. 좁은 화면에서는 글 아래에 화면이 오고, 넓은 화면에서는 좌우로 놓되 한 칸씩 방향을 바꾼다.
 */
.is-landing .site-header-inner,
.is-landing .site-footer,
.landing {
  max-width: 60rem;
}

.landing > section {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}

.landing > .feature-section {
  max-width: none;
}

/*
 * 배너는 한 줄로 놓고 한 장씩 넘긴다(가로 스크롤 + 스냅). 휴대폰에서는 손가락으로 밀어 넘기고,
 * 화살표·점 표시는 assets/carousel.js 가 켠다. 스크립트가 없을 때는 다음 배너가 살짝 보이게 해서
 * 옆으로 더 있다는 것을 알린다.
 */
.carousel {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  grid-template-areas:
    'track track track'
    'prev dots next';
  align-items: center;
  row-gap: 12px;
  margin: 20px 0 8px;
}

.carousel [hidden] {
  display: none !important;
}

.features {
  grid-area: track;
  position: relative;
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-radius: 28px;
}

.features::-webkit-scrollbar {
  display: none;
}

.feature {
  flex: 0 0 88%;
  scroll-snap-align: start;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 28px;
  background: var(--band-1);
}

.carousel.is-ready .feature {
  flex-basis: 100%;
}

.carousel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.carousel-button:hover {
  border-color: var(--text);
}

.carousel-prev {
  grid-area: prev;
}

.carousel-next {
  grid-area: next;
}

.carousel-dots {
  grid-area: dots;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.carousel-dots li {
  margin: 0;
}

/* 점은 작게 보이지만 누르는 영역은 넉넉하게 둔다. 지금 배너는 색과 길이 둘 다로 표시한다. */
.carousel-dot {
  display: block;
  width: 28px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.carousel-dot::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--line);
}

.carousel-dot[aria-current='true']::before {
  width: 22px;
  background: var(--text);
}

/* 화면에는 보이지 않고 화면낭독기에만 "2 / 5" 를 알린다. */
.carousel-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .carousel-dot::before {
    transition: width 0.2s ease, background-color 0.2s ease;
  }
}

.feature:nth-child(3n + 2) {
  background: var(--band-2);
}

.feature:nth-child(3n) {
  background: var(--band-3);
}

.feature-text {
  padding: 32px 26px 0;
}

.feature .eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: -0.5px;
}

.feature-text p:last-child {
  margin: 0;
  color: var(--muted);
}

/* 휴대폰 틀 — 위쪽만 둥글고 아래는 배너 끝에 잘려 걸친다. 이미지도 화면 위쪽 72% 만 담겨 있다. */
.feature-shot {
  width: min(250px, 74%);
  margin: 26px auto 0;
  border: 7px solid var(--device);
  border-bottom: 0;
  border-radius: 36px 36px 0 0;
  overflow: hidden;
  background: #ffffff;
  align-self: end;
}

.feature-shot img {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 40rem) {
  body {
    font-size: 17.5px;
  }

  .site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 6px;
  }

  .site-header nav {
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .site-header nav a {
    padding-top: 3px;
  }

  .landing h1 {
    font-size: 44px;
  }

  .features {
    gap: 20px;
  }

  .feature {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    align-items: center;
    min-height: 420px;
  }

  .feature-text {
    padding: 40px 16px 40px 76px;
  }

  /* 넓은 화면에서는 화살표가 배너 양옆 가운데에 올라온다. 점 표시는 배너 아래에 남는다. */
  .carousel {
    grid-template-columns: 1fr;
    grid-template-areas:
      'track'
      'dots';
  }

  .carousel-button {
    position: absolute;
    top: calc((100% - 56px) / 2 - 24px);
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 14px var(--icon-shadow);
  }

  .carousel-prev {
    left: 14px;
  }

  .carousel-next {
    right: 14px;
  }

  .feature h3 {
    font-size: 32px;
  }

  .feature-text p:last-child {
    font-size: 18px;
  }

  .feature-shot {
    width: 270px;
    margin-top: 44px;
  }

  /* 한 칸씩 좌우를 바꾼다. 글과 그림의 읽는 순서(마크업)는 그대로다. */
  .feature:nth-child(even) .feature-text {
    order: 2;
    padding: 40px 76px 40px 16px;
  }

  h1 {
    font-size: 30px;
  }
}
