/* ==========================================================================
   학점출결 (CampusNote) — 사이트 스타일
   앱 아이콘의 파랑→인디고 그라디언트를 바탕으로, 체크 표시의 초록을 포인트로 쓴다.
   ========================================================================== */

/* --- 토큰 ---------------------------------------------------------------- */

:root {
  --accent: #3478f6;
  --accent-strong: #2458d6;
  --accent-soft: #e5edfe;
  --accent-2: #5e5ce6;
  --check: #2fa35e;
  --beta: #b35900;

  /* 흰 글씨를 올리는 버튼 바탕. 다크 모드에서도 글씨가 묻히지 않을 만큼 진하게 둔다. */
  --btn: #2458d6;
  --btn-hover: #1c49b8;

  --bg: #f7f9fd;
  --surface: #ffffff;
  --surface-alt: #eef2f8;
  --text: #151b2b;
  --text-muted: #667085;
  --border: #e0e5ef;

  --shadow-sm: 0 1px 2px rgba(21, 27, 43, 0.06), 0 2px 8px rgba(21, 27, 43, 0.04);
  --shadow-md: 0 4px 12px rgba(21, 27, 43, 0.08), 0 12px 32px rgba(21, 27, 43, 0.06);
  --shadow-lg: 0 12px 32px rgba(36, 88, 214, 0.14), 0 32px 64px rgba(21, 27, 43, 0.1);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --maxw: 1080px;
  --header-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #6e9cff;
    --accent-strong: #8fb3ff;
    --accent-soft: #1c2947;
    --accent-2: #8d8bf7;
    --check: #3ec476;
    --beta: #f5a04a;

    --btn: #3a6ee8;
    --btn-hover: #4b7cf0;

    --bg: #0e1118;
    --surface: #181c26;
    --surface-alt: #212633;
    --text: #eef1f7;
    --text-muted: #9aa3b5;
    --border: #313848;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  }
}

/* --- 리셋 ---------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

/* display 를 지정한 요소는 hidden 속성만으로 감춰지지 않는다. */
[hidden] {
  display: none !important;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
  word-break: keep-all;
}

p {
  margin: 0;
  word-break: keep-all;
}

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

/* --- 레이아웃 ------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 88px 0;
}

.section--tight {
  padding: 56px 0;
}

.section--alt {
  background: var(--surface-alt);
}

.section-head {
  max-width: 620px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-head .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 12px;
}

/* 페이지 이름이 한눈에 들어오도록 본문 제목보다 한 단계 크게 쓴다. */
.section-head .page-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 12px;
}

.section-head p {
  color: var(--text-muted);
}

/* --- 헤더 ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
}

.nav a:hover {
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--accent-strong);
}

.nav .btn {
  margin-left: 8px;
}

/* .nav a 의 색이 버튼 색을 이기지 않도록 되돌린다. */
.nav a.btn--primary {
  color: #fff;
}

.nav a.btn:hover {
  background: var(--btn-hover);
}

/* 좁은 화면에서는 메뉴를 숨기는 대신 촘촘하게 줄여 그대로 보여 준다.
   더 좁아지면 브랜드 이름을 접어 링크 자리를 만든다. */
@media (max-width: 680px) {
  .wrap {
    padding: 0 16px;
  }

  .nav {
    gap: 0;
  }

  .nav a:not(.btn) {
    padding: 6px 8px;
    font-size: 0.85rem;
  }

  .nav .btn {
    margin-left: 6px;
    padding: 7px 13px;
    font-size: 0.85rem;
  }
}

@media (max-width: 460px) {
  .brand-name {
    display: none;
  }

  /* 폰 폭에서는 메뉴가 한 줄에 다 들어가지 않는다. 같은 페이지 안으로 이동하는
     두 링크는 스크롤로 닿을 수 있으니 접어 두고, 다른 페이지로 가는 링크를 남긴다. */
  .nav a[href$="#features"],
  .nav a[href$="#spec"] {
    display: none;
  }

  .nav a:not(.btn) {
    padding: 6px 6px;
    font-size: 0.8rem;
  }

  .nav .btn {
    margin-left: 4px;
    padding: 7px 11px;
    font-size: 0.8rem;
  }
}

/* --- 버튼 ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--btn);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background: var(--btn-hover);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
}

/* 스토어 버튼. 두 스토어가 같은 무게로 보이도록 브랜드 파랑 대신 글자색을 바탕으로 쓴다
   (라이트 모드는 검정, 다크 모드는 흰색 — 스토어 배지와 비슷한 느낌). */
.btn--store {
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}

.btn--store:hover {
  background: color-mix(in srgb, var(--text) 84%, var(--bg));
}

.btn--store svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: -2px;
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.88rem;
}

.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.btn[aria-disabled="true"]:hover {
  transform: none;
}

/* --- 히어로 -------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 72px 0 88px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -260px;
  left: 50%;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(
      ellipse at 30% 40%,
      color-mix(in srgb, var(--accent) 30%, transparent),
      transparent 62%
    ),
    radial-gradient(
      ellipse at 72% 55%,
      color-mix(in srgb, var(--accent-2) 24%, transparent),
      transparent 62%
    );
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.2rem);
  margin-bottom: 18px;
}

.hero-copy h1 .accent {
  background: linear-gradient(100deg, var(--accent-strong) 10%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy .lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 44ch;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

/* 점 색은 관리자 페이지에서 정한다. 값이 없으면 앱 아이콘의 체크 초록을 쓴다.
   color 로 받아 currentColor 로 퍼뜨리면 링 색도 함께 따라온다. */
.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  color: var(--status-dot, var(--check));
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 28%, transparent);
  animation: dot-pulse 1.8s ease-in-out infinite;
  /* 첫 방문에는 내용을 받은 뒤 색이 정해진다. 툭 바뀌지 않게 넘긴다. */
  transition: color 0.45s ease;
}

/* 점이 커졌다 작아지고, 둘레의 옅은 링이 함께 퍼진다. */
@keyframes dot-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 28%, transparent);
  }
  50% {
    transform: scale(1.35);
    box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 10%, transparent);
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-note {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hero-meta div {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.hero-meta strong {
  display: block;
  font-size: 1.02rem;
  color: var(--text);
}

@media (max-width: 880px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-copy .lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .hero-meta {
    justify-content: center;
  }
}

/* --- 히어로 목업 --------------------------------------------------------- */

/* 아직 앱 화면 이미지가 없어서 출석 탭을 HTML 로 그려 둔다.
   폰 프레임까지 들어간 목업 이미지가 생기면 .phone-wrap 을 <img class="hero-mockup"> 로 바꾸면 된다.
   안쪽 크기는 모두 em 이고, 글자 크기가 폰 폭(cqw)을 따라가서 좁은 화면에서도 비율이 그대로다. */
.phone-wrap {
  position: relative;
  width: min(300px, 78vw);
  margin: 0 0 0 auto;
  container-type: inline-size;
}

.phone {
  --ph-bg: #f2f2f7;
  --ph-card: #ffffff;
  --ph-text: #111318;
  --ph-muted: #8a8f98;
  --ph-line: #e3e4ea;
  --ph-accent: #345dd9;
  aspect-ratio: 300 / 630;
  padding: 3.4cqw;
  border-radius: 16cqw;
  background: #151821;
  box-shadow: inset 0 0 0 1.5px #2e3442, 0 24px 60px rgba(21, 27, 43, 0.26),
    0 6px 16px rgba(21, 27, 43, 0.12);
}

.phone-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 12.6cqw;
  background: var(--ph-bg);
  color: var(--ph-text);
  font-size: 3.67cqw;
  line-height: 1.35;
  text-align: left;
}

.phone-screen p {
  margin: 0;
}

.ph-status {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1.05em 2em 0.3em;
  font-size: 1.05em;
  font-weight: 700;
}

.ph-island {
  width: 7.6em;
  height: 2.2em;
  border-radius: 999px;
  background: #000;
}

.ph-battery {
  justify-self: end;
  width: 2.2em;
  height: 1.05em;
  border: 1.5px solid currentColor;
  border-radius: 0.35em;
  opacity: 0.75;
  background: linear-gradient(90deg, currentColor 70%, transparent 70%) content-box;
  padding: 1.5px;
}

.ph-title {
  padding: 0.3em 0.62em 0.25em;
  font-size: 2.6em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ph-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  padding: 0 1.1em;
  overflow: hidden;
}

.ph-card {
  padding: 1.05em 1.2em;
  border-radius: 1.3em;
  background: var(--ph-card);
}

.ph-strong {
  font-size: 1.2em;
  font-weight: 700;
}

.ph-sub {
  color: var(--ph-muted);
  font-size: 0.95em;
}

.ph-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5em;
  margin-top: 0.85em;
}

.ph-chip {
  padding: 0.45em 0.5em;
  border-radius: 0.8em;
  background: color-mix(in srgb, var(--c) 12%, var(--ph-card));
  text-align: center;
}

.ph-chip b {
  display: block;
  font-size: 1.4em;
  color: var(--c);
  font-variant-numeric: tabular-nums;
}

.ph-chip span {
  font-size: 0.85em;
  color: var(--ph-muted);
}

/* 수업 카드 왼쪽의 색 막대는 앱에서 고른 수업 색이다. */
.ph-course {
  position: relative;
  padding-left: 1.75em;
}

.ph-course::before {
  content: "";
  position: absolute;
  left: 0.8em;
  top: 1.05em;
  bottom: 1.05em;
  width: 0.32em;
  border-radius: 999px;
  background: var(--c);
}

.ph-course-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6em;
}

.ph-name {
  font-size: 1.18em;
  font-weight: 700;
}

.ph-score {
  flex: 0 0 auto;
  text-align: right;
}

.ph-score b {
  font-size: 1.25em;
  font-variant-numeric: tabular-nums;
}

.ph-score span {
  display: block;
  font-size: 0.82em;
  color: var(--ph-muted);
}

.ph-bar {
  height: 0.5em;
  margin: 0.7em 0 0.5em;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
}

.ph-bar i {
  display: block;
  width: var(--p);
  height: 100%;
  border-radius: inherit;
  background: var(--c);
}

.ph-foot {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  color: var(--ph-muted);
}

.ph-note {
  margin-top: 0.45em !important;
  font-size: 0.88em;
  font-weight: 700;
  color: #a67c00;
}

.ph-tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 0.6em 0.4em 1.7em;
  border-top: 1px solid var(--ph-line);
  background: var(--ph-card);
}

.ph-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  font-size: 0.78em;
  font-weight: 600;
  color: var(--ph-muted);
}

.ph-tab svg {
  width: 2.1em;
  height: 2.1em;
}

.ph-tab.is-on {
  color: var(--ph-accent);
}

/* 폰 옆에 걸친 출결 고르기 카드. 탭 한 번으로 체크한다는 걸 보여 준다. */
.ph-float {
  position: absolute;
  left: -22%;
  bottom: 19%;
  width: 64%;
  padding: 1em 1.1em 1.1em;
  border: 1px solid var(--border);
  border-radius: 1.4em;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 3.67cqw;
  line-height: 1.35;
  text-align: left;
}

.ph-float p {
  margin: 0;
}

.ph-float-title {
  font-size: 1.12em;
  font-weight: 700;
}

.ph-float-sub {
  font-size: 0.9em;
  color: var(--text-muted);
}

.ph-picks {
  display: flex;
  gap: 0.35em;
  margin-top: 0.75em;
}

.ph-picks span {
  flex: 1;
  padding: 0.45em 0;
  border-radius: 0.7em;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  color: color-mix(in srgb, var(--c) 82%, var(--text));
  font-size: 0.9em;
  font-weight: 700;
  text-align: center;
}

.ph-picks span.is-on {
  background: var(--c);
  color: #fff;
}

/* 한 칸으로 접히면 글이 가운데 정렬되므로 목업도 가운데로 돌아온다.
   위쪽 히어로 미디어쿼리가 아니라 여기 있어야 오른쪽 정렬을 덮어쓴다. */
@media (max-width: 880px) {
  .phone-wrap {
    margin-right: auto;
  }
}

/* 아주 좁으면 옆 카드가 화면 밖으로 잘리지 않게 폰 안쪽으로 당긴다. */
@media (max-width: 520px) {
  .ph-float {
    left: -8%;
    bottom: 16%;
  }
}

@media (prefers-color-scheme: dark) {
  .phone {
    --ph-bg: #000000;
    --ph-card: #1c1c1e;
    --ph-text: #f2f2f7;
    --ph-muted: #8e8e93;
    --ph-line: #2c2c2e;
    --ph-accent: #5a83f2;
    box-shadow: inset 0 0 0 1.5px #3a4050, 0 24px 60px rgba(0, 0, 0, 0.6);
  }

  .ph-note {
    color: #e3b53a;
  }
}

/* --- 기능 카드 ----------------------------------------------------------- */

.grid {
  display: grid;
  gap: 20px;
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
}

.card {
  padding: 28px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* 최근 업데이트가 한 개뿐일 때 카드가 화면 폭 전체로 늘어나지 않게 가운데에 둔다. */
.grid--3 > .card:only-child {
  width: 100%;
  max-width: 440px;
  justify-self: center;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.card .icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.card .icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.card p {
  font-size: 0.94rem;
  color: var(--text-muted);
}

/* --- 앱 둘러보기 --------------------------------------------------------- */

/* 목업이 몇 장이든 옆으로 밀어 볼 수 있다.
   safe center 는 화면에 다 들어올 때만 가운데로 모으고, 넘치면 왼쪽부터
   시작해 첫 장이 잘려 보이지 않게 한다. */
/* 화면 좌우 끝까지 이어진다. 목업이 많으면 가장자리에서 잘리며 들어오고 나간다.
   좌우 여백은 본문 기둥(--maxw)의 시작선에 맞춰, 첫 장이 제목과 같은 선에서 시작한다. */
.shots {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-block: 8px 20px;
  padding-inline: max(24px, calc((100% - var(--maxw)) / 2 + 24px));
  scroll-padding-inline: max(24px, calc((100% - var(--maxw)) / 2 + 24px));
}

.shots::-webkit-scrollbar {
  height: 8px;
}

.shots::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.shots::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 45%, var(--border));
}

/* 목업 이미지에 프레임이 이미 그려져 있어 따로 테두리를 두르지 않는다. */
/* figure 는 좌우에 기본 여백이 있어 간격이 gap 보다 넓어진다. */
.shot {
  flex: 0 0 auto;
  width: 300px;
  max-width: 72vw;
  margin: 0;
  scroll-snap-align: center;
  text-align: center;
}

.shot img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 32px rgba(29, 27, 40, 0.18));
}

.shot figcaption {
  margin-top: 18px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
}

@media (prefers-color-scheme: dark) {
  .shot img {
    filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.5));
  }
}

/* 좁은 화면에서는 본문 좌우 여백이 16px 이라 시작선을 함께 맞춘다. */
@media (max-width: 680px) {
  .shots {
    gap: 24px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
  }

  .shot {
    width: 230px;
  }
}

/* 스크린샷 파일이 아직 없을 때 대신 보이는 자리. 목업 이미지와 같은 비율로 폰 모양만 잡아 둔다.
   assets/screens/ 에 파일을 넣으면 site.js 가 이 자리를 알아서 치운다. */
.shot .empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  aspect-ratio: 990 / 2012;
  border: 2px dashed var(--border);
  border-radius: 44px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.86rem;
}

.shot .empty svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
  opacity: 0.75;
}

/* --- 계산 방식 ----------------------------------------------------------- */

.calc {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
  align-items: start;
}

.calc-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.calc-rules div {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.calc-rules dt {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.calc-rules dd {
  margin: 2px 0 0;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

.calc-example {
  padding: 24px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.calc-case {
  margin-bottom: 8px !important;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.calc-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.calc-steps li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.94rem;
}

.calc-steps li:last-child {
  border-bottom: 0;
}

.calc-steps span {
  color: var(--text-muted);
  word-break: keep-all;
}

.calc-steps b {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.calc-steps .calc-sum b {
  font-size: 1.25rem;
  color: var(--accent-strong);
}

.calc-foot {
  margin-top: 10px !important;
  font-size: 0.84rem;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .calc {
    grid-template-columns: 1fr;
  }
}

/* --- 스펙 테이블 --------------------------------------------------------- */

.specs {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.specs dl {
  margin: 0;
}

.specs .row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  padding: 15px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}

.specs .row:last-child {
  border-bottom: 0;
}

.specs dt {
  color: var(--text-muted);
  font-weight: 600;
}

.specs dd {
  margin: 0;
}

@media (max-width: 520px) {
  .specs .row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* --- 다운로드 CTA -------------------------------------------------------- */

.cta {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 40px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--accent) 12%, var(--surface)),
    color-mix(in srgb, var(--accent-2) 10%, var(--surface))
  );
  box-shadow: var(--shadow-md);
}

.cta img.appicon {
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.cta h2 {
  font-size: clamp(1.5rem, 3.6vw, 2rem);
  margin-bottom: 10px;
}

.cta p {
  color: var(--text-muted);
  margin-bottom: 26px;
}

.cta .store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* --- 패치노트 ------------------------------------------------------------ */

.log-layout {
  display: grid;
  grid-template-columns: 208px 1fr;
  gap: 48px;
  align-items: start;
}

.log-side {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.log-side h2 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* 정식 묶음 다음에 오는 베타 묶음은 사이를 띄우고 색으로 구분한다. */
.log-side h2 + ol {
  margin-bottom: 0;
}

.log-side ol + h2 {
  margin-top: 26px;
}

.log-side ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-side a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.log-side a:hover {
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
}

.log-side a .when {
  margin-left: auto;
  font-size: 0.76rem;
  font-weight: 500;
  opacity: 0.75;
}

.log-side a.is-latest {
  color: var(--accent-strong);
}

.release {
  position: relative;
  padding: 0 0 40px 30px;
  border-left: 2px solid var(--border);
}

.release:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.release::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border);
}

.release.is-latest::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent);
}

.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.release-head h2 {
  font-size: 1.5rem;
  margin: 0;
}

.tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.tag--latest {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: transparent;
}

/* 베타는 정식과 한눈에 구분되도록 다른 색을 쓴다. */
.tag--beta {
  background: color-mix(in srgb, var(--beta) 16%, var(--surface));
  color: var(--beta);
  border-color: transparent;
}

/* 정식/베타 고르기 */
.channel-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}

/* 베타 항목은 타임라인 점 색도 달리해 목록에서 바로 구분된다. */
.release.is-beta::before {
  border-color: var(--beta);
  background: var(--beta);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--beta) 20%, transparent);
}

.log-side a .tag--beta {
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 0.68rem;
}

/* 버전마다 붙인 제목. 버전 번호 다음으로 눈에 들어와야 한다. */
.release-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 2px 0 4px;
}

.release-date {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.release-body {
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 860px) {
  .log-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .log-side {
    position: static;
  }

  .log-side ol {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* --- 공지사항 ------------------------------------------------------------ */

.notice-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.notice[open] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.notice summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}

.notice summary::-webkit-details-marker {
  display: none;
}

.notice summary:hover .notice-title {
  color: var(--accent-strong);
}

.notice-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.04rem;
  font-weight: 700;
  word-break: keep-all;
}

/* 펼침 표시. 열리면 위를 향한다. */
.notice-title::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.notice[open] .notice-title::after {
  transform: translateY(2px) rotate(-135deg);
}

.notice-date {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.notice-body {
  margin: 0 22px 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* --- 마크다운 본문 ------------------------------------------------------- */

.md > *:first-child {
  margin-top: 0;
}

.md > *:last-child {
  margin-bottom: 0;
}

.md h1 {
  font-size: 1.4rem;
  margin: 28px 0 12px;
}

.md h2 {
  font-size: 1.12rem;
  margin: 26px 0 10px;
}

.md h3 {
  font-size: 0.98rem;
  margin: 22px 0 8px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.md p {
  margin: 0 0 14px;
}

.md ul,
.md ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.md li {
  margin-bottom: 6px;
}

.md li::marker {
  color: var(--accent);
}

.md a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.md strong {
  font-weight: 700;
}

.md code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 0.87em;
}

.md pre {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.md pre code {
  padding: 0;
  background: none;
  font-size: 0.85rem;
  line-height: 1.6;
}

.md blockquote {
  margin: 0 0 16px;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

.md hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.md table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.md th,
.md td {
  padding: 9px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.md th {
  background: var(--surface-alt);
  font-weight: 700;
}

/* --- 상태 표시 ----------------------------------------------------------- */

.state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.state--error {
  max-width: 620px;
  margin: 0 auto;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
}

.state--error h3 {
  color: var(--text);
  margin-bottom: 8px;
}

.state--error code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* --- 관리자 화면 --------------------------------------------------------- */

.login-box {
  max-width: 400px;
  margin: 40px auto;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-box h1 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.login-box p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.login-box .btn {
  width: 100%;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
}

.field > span em {
  font-style: normal;
  font-weight: 500;
  opacity: 0.8;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.field input:focus,
.field textarea:focus,
.editor:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.form-error {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #d9666a 14%, var(--surface));
  border: 1px solid color-mix(in srgb, #d9666a 40%, transparent);
  font-size: 0.88rem;
}

.form-note {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.admin-bar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 216px 1fr;
  gap: 36px;
  align-items: start;
}

.admin-side h2 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.admin-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-side-head h2 {
  margin: 0;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}

.admin-item:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.admin-item.is-on {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.admin-item .when {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 500;
  opacity: 0.8;
}

.admin-empty {
  padding: 10px 12px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.admin-main {
  padding: 28px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}

.color-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-field input[type="color"] {
  flex: 0 0 auto;
  width: 46px;
  height: 42px;
  padding: 3px;
  cursor: pointer;
}

.color-field input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
}

.color-field .btn {
  flex: 0 0 auto;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
}

.editor-head em {
  font-style: normal;
  font-weight: 500;
  opacity: 0.8;
}

.editor-tabs {
  display: flex;
  gap: 4px;
}

.chip {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.chip.is-on {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-strong);
}

.editor {
  width: 100%;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
}

.editor-preview {
  min-height: 200px;
  padding: 20px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
  .admin-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 22px 20px;
  }
}

/* --- 푸터 ---------------------------------------------------------------- */

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.site-footer nav {
  display: flex;
  gap: 18px;
}

/* --- 등장 애니메이션 ----------------------------------------------------- */

/* .js 는 site.js 가 붙인다. 스크립트가 없거나 실패하면 본문이 그냥 보인다. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .badge .dot {
    animation: none;
  }

  .card:hover,
  .btn:hover {
    transform: none;
  }
}

/* --- 개인정보처리방침 ---------------------------------------------------- */

/* 긴 글 한 덩어리라 카드 하나에 담고, 조항마다 윗줄로 끊어 읽기 쉽게 한다. */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.legal-dates {
  margin-bottom: 24px !important;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.legal h2 {
  margin: 32px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 1.16rem;
}

/* 본문 마크다운과 달리 소제목도 본문 색으로 둔다. 조항 안에서 한 단계 구분만 하면 된다. */
.legal h3 {
  margin: 20px 0 8px;
  font-size: 0.98rem;
  color: var(--text);
}

.legal td,
.legal th {
  vertical-align: top;
}

@media (max-width: 640px) {
  .legal {
    padding: 26px 20px;
  }

  /* 위탁 표는 좁은 화면에서 옆으로 밀어 본다. */
  .legal table {
    display: block;
    overflow-x: auto;
  }
}
