/*
 * 차지노트 웹사이트의 모양.
 *
 * 앱과 같은 원칙이다: 색은 종이와 잉크 둘뿐이고(lib/core/theme.dart), 그림자와 그라데이션을 쓰지 않으며,
 * 고른 것은 채운 상자가 아니라 밑줄과 가는 선으로 알린다. 장식은 앱 아이콘에 있는 충전 막대 하나다.
 * 글꼴은 기기의 것을 쓴다. 바깥에서 받아 오는 것(웹 글꼴, 통계, 쿠키)이 하나도 없다.
 */

:root {
  --paper: #ffffff;
  --wash: #f2f2f2;
  --line: #e3e3e3;
  --ink: #000000;
  --graphite: #595959;
  --mist: #9a9a9a;
  /* 검은 바탕 위에서의 회색 단계. */
  --ink-soft: #ababab;
  --ink-rail: #2a2a2a;

  --gutter: clamp(20px, 5vw, 56px);
  --max: 1120px;
  /* 화면이 넓으면 내용을 가운데 --max 너비 안에 둔다. */
  --edge: max(var(--gutter), calc((100vw - var(--max)) / 2));

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard', 'Noto Sans KR', 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* 한글이 낱말 중간에서 끊기지 않게 한다. 아주 긴 낱말(주소 등)만 넘치지 않게 끊는다. */
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:focus-visible,
.table:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
}

.skip {
  position: absolute;
  left: var(--edge);
  top: -100px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

/* --------------------------------------------------------------------------------------------------
 * 충전 막대. 가는 레일 위에 굵은 막대. 앱 아이콘과 홈 화면의 배터리 막대와 같은 모양이다.
 * ------------------------------------------------------------------------------------------------ */

.charge {
  position: relative;
  height: 10px;
}

.charge::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 34%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--rail, var(--line));
}

.charge i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: currentColor;
}

.charge--mark {
  display: inline-block;
  width: 34px;
  height: 7px;
}

/* --------------------------------------------------------------------------------------------------
 * 머리글과 바닥글.
 * ------------------------------------------------------------------------------------------------ */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px var(--edge);
}

.top--ink {
  background: var(--ink);
  color: var(--paper);
  --rail: var(--ink-rail);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.top nav {
  display: flex;
  gap: clamp(16px, 3vw, 30px);
  font-size: 15px;
}

.top nav a {
  color: var(--graphite);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
}

.top--ink nav a {
  color: var(--ink-soft);
}

.top nav a:hover,
.top nav a[aria-current='page'] {
  color: inherit;
  border-bottom-color: currentColor;
}

.top--ink nav a:hover {
  color: var(--paper);
}

.foot {
  margin-top: 0;
  padding: 40px var(--edge) 64px;
  border-top: 1px solid var(--line);
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 15px;
}

.foot nav a {
  text-decoration: none;
}

.foot nav a:hover {
  text-decoration: underline;
}

.foot p {
  margin-top: 24px;
  max-width: 72ch;
  font-size: 13px;
  line-height: 1.7;
  color: var(--mist);
}

/* --------------------------------------------------------------------------------------------------
 * 랜딩: 맨 위와 맨 아래의 검은 띠.
 * ------------------------------------------------------------------------------------------------ */

.hero,
.closing {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(32px, 6vw, 72px) var(--edge) 0;
  background: var(--ink);
  color: var(--paper);
  --rail: var(--ink-rail);
  overflow: hidden;
}

.hero .words,
.closing .words {
  padding-bottom: clamp(40px, 7vw, 96px);
}

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

:lang(ko) .hero h1,
:lang(ko) .closing h2,
:lang(ko) .feature h2 {
  /* 한글은 자간을 덜 조이고 줄 사이를 조금 더 둔다. */
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.lede {
  margin-top: 22px;
  max-width: 34em;
  font-size: clamp(1.06rem, 1.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--graphite);
}

.hero .lede,
.closing .lede {
  color: var(--ink-soft);
  max-width: 26em;
}

.hero .charge,
.closing .charge {
  max-width: 440px;
  margin-top: clamp(32px, 4vw, 52px);
  height: 12px;
}

/* 페이지가 열릴 때 막대가 한 번 차오른다. 움직임은 이것 하나뿐이다. */
.hero .charge i {
  animation: fill 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}

@keyframes fill {
  from {
    width: 0;
  }
}

.soon {
  margin-top: 26px;
  font-size: 15px;
  color: var(--ink-soft);
}

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

/*
 * 스토어 배지. Apple 과 Google 의 원본 그림을 고치지 않고 같은 높이로 놓는다.
 * 두 회사의 지침: 높이 40px 이상, 둘레에 높이의 1/4 이상을 비운다. 그래서 간격을 14px 아래로 줄이지 않는다.
 */
.badge {
  display: block;
  border-radius: 8px;
  line-height: 0;
  text-decoration: none;
}

.badge img {
  display: block;
  width: auto;
  height: 46px;
}

/* 보는 기기의 스토어를 앞에 둔다 (site.js 가 data-platform 을 적는다). */
[data-platform='android'] [data-store='android'] {
  order: -1;
}

.get + .soon {
  margin-top: 16px;
}

/* --------------------------------------------------------------------------------------------------
 * 내려받기: 검은 띠에 스토어마다 QR 코드와 배지.
 * ------------------------------------------------------------------------------------------------ */

.hero--get {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
}

.stores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 28px 32px;
  margin-top: clamp(32px, 4vw, 48px);
}

.store {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* QR 코드는 흰 바탕과 둘레의 여백까지가 그림이다. 검은 띠 위에 흰 조각으로 놓인다. */
.store .qr {
  flex: none;
  width: 128px;
  height: 128px;
  border-radius: 10px;
}

.store h2 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.store .needs {
  margin-top: 2px;
  font-size: 14px;
  color: var(--ink-soft);
}

.store .badge {
  margin-top: 14px;
}

.hero--get .soon {
  max-width: 36em;
  margin-top: 24px;
}

.hero--get .scan + .soon {
  margin-top: 4px;
}

/* 기기는 아래가 띠 밖으로 잘려 나간다. */
.hero .shot,
.closing .shot {
  align-self: end;
  margin-bottom: -22%;
}

.shot img {
  display: block;
  width: min(360px, 100%);
  margin-inline: auto;
}

.closing h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

/* --------------------------------------------------------------------------------------------------
 * 랜딩: 기능.
 * ------------------------------------------------------------------------------------------------ */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(64px, 9vw, 128px) var(--edge);
}

/* 하나 걸러 기기를 왼쪽에 둔다. */
.feature:nth-of-type(odd) .shot {
  order: -1;
}

.feature h2 {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.feature .words > p {
  margin-top: 20px;
  max-width: 30em;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--graphite);
}

/* 사실 하나에 한 줄. 가는 선으로 나눈다 (앱의 목록과 같다). */
.feature ul,
.trust ul {
  margin-top: 28px;
  padding: 0;
  list-style: none;
  max-width: 34em;
}

.feature li,
.trust li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  line-height: 1.55;
}

.feature .shot img {
  width: min(330px, 82%);
}

.trust {
  padding: clamp(64px, 9vw, 120px) var(--edge);
  border-top: 1px solid var(--line);
}

.trust h2 {
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.trust .columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 72px);
  margin-top: 44px;
}

.trust h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.trust ul {
  margin-top: 14px;
}

.trust .columns + p {
  margin-top: 40px;
  max-width: 44em;
  color: var(--graphite);
}

/* --------------------------------------------------------------------------------------------------
 * 문서: 처리방침, 약관, 계정 삭제 안내, 지원.
 * ------------------------------------------------------------------------------------------------ */

.doc {
  max-width: calc(44rem + var(--gutter) * 2);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) 96px;
}

.doc h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.doc .meta {
  margin-top: 14px;
  font-size: 15px;
  color: var(--mist);
}

.doc header > p:not(.meta) {
  margin-top: 28px;
}

.doc .lede {
  max-width: none;
}

.doc h2 {
  margin-top: 64px;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  scroll-margin-top: 24px;
}

.doc section {
  scroll-margin-top: 24px;
}

.doc h3 {
  margin-top: 36px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  scroll-margin-top: 24px;
}

.doc p,
.doc ul,
.doc ol,
.doc .table {
  margin-top: 16px;
}

.doc ul,
.doc ol {
  padding-left: 1.3em;
}

.doc li + li {
  margin-top: 8px;
}

.doc li::marker {
  color: var(--mist);
}

/* 요약과 차례는 위아래의 가는 선 사이에 둔다. */
.doc .summary,
.doc .toc {
  margin-top: 40px;
  padding: 26px 0 28px;
  border-top: 1px solid var(--line);
}

.doc .toc {
  margin-top: 0;
  border-bottom: 1px solid var(--line);
}

.doc .summary h2,
.doc .toc h2 {
  margin-top: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--mist);
}

.doc .toc ol {
  columns: 2;
  column-gap: 40px;
  font-size: 15px;
}

.doc .toc li {
  break-inside: avoid;
}

.doc .toc a {
  text-decoration: none;
}

.doc .toc a:hover {
  text-decoration: underline;
}

.table {
  overflow-x: auto;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}

.doc th,
.doc td {
  padding: 13px 20px 13px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc th:last-child,
.doc td:last-child {
  padding-right: 0;
}

.doc thead th {
  border-top: 0;
  padding-top: 0;
  font-weight: 500;
  color: var(--mist);
  white-space: nowrap;
}

.doc tbody th {
  min-width: 7.5em;
  font-weight: 600;
}

.doc tbody td {
  min-width: 11em;
}

.faq > h2:first-child {
  margin-top: 56px;
}

/* 없는 주소. */
.lost {
  padding: clamp(72px, 14vw, 160px) var(--edge);
}

.lost h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.lost p {
  margin-top: 16px;
  color: var(--graphite);
}

/* --------------------------------------------------------------------------------------------------
 * 좁은 화면.
 * ------------------------------------------------------------------------------------------------ */

@media (max-width: 820px) {
  .hero,
  .closing,
  .feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero .words,
  .closing .words {
    padding-bottom: 8px;
  }

  .hero .shot,
  .closing .shot {
    margin-top: 28px;
    margin-bottom: -34%;
  }

  .shot img,
  .feature .shot img {
    width: min(300px, 74%);
  }

  /* 휴대폰으로 보고 있으면 QR 코드를 비출 일이 없다. 배지만 남긴다. */
  .store .qr,
  .scan {
    display: none;
  }

  .hero--get .scan + .soon {
    margin-top: 24px;
  }

  /* 좁은 화면에서는 늘 글이 먼저, 기기가 다음이다. */
  .feature:nth-of-type(odd) .shot {
    order: 0;
  }

  .trust .columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc .toc ol {
    columns: 1;
  }
}

/* 아주 좁은 화면의 머리글에는 받기와 언어만 둔다. 지원은 바닥글에 있다. */
@media (max-width: 420px) {
  .top {
    gap: 12px;
  }

  .top nav {
    gap: 14px;
    font-size: 14px;
  }

  .top nav .nav-support {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero .charge i {
    animation: none;
  }
}

@media print {
  .top nav,
  .foot nav,
  .skip {
    display: none;
  }

  .doc {
    padding-top: 0;
  }
}
