/* 레이아웃: 출석부 한 장을 펼친 듯한 세로 흐름 — 왼쪽 정렬 글 + 오른쪽 출석부 견본, 아래로 규칙표처럼 이어지는 섹션 */
:root {
  --paper: #F6F1E7;      /* 바탕 종이 (앱과 같은 색) */
  --sheet: #FBF8F1;      /* 출석부 카드 */
  --deep: #ECE4D3;       /* 표 머리 */
  --ink: #1F1D1A;        /* 먹 */
  --ink-soft: #5C564D;
  --line: #D8CDB8;
  --pen: #D2412C;        /* 빨간 펜: 채점에만 */
  --chalk: #2F5D46;      /* 출석 도장 */
  --sticker: #F2C14E;    /* 포인트 스티커 */
  --sticker-ink: #6B4E00;
  --f-display: 'Black Han Sans', 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  --f-body: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --f-pen: 'Nanum Pen Script', 'Noto Sans KR', cursive;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171512; --sheet: #211E1A; --deep: #2C2823; --ink: #F1EBDF; --ink-soft: #B8AF9F;
    --line: #3D3830; --pen: #F0644F; --chalk: #7FBF9C; --sticker: #F2C14E; --sticker-ink: #F2C14E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171512; --sheet: #211E1A; --deep: #2C2823; --ink: #F1EBDF; --ink-soft: #B8AF9F;
  --line: #3D3830; --pen: #F0644F; --chalk: #7FBF9C; --sticker: #F2C14E; --sticker-ink: #F2C14E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: 17px; line-height: 1.7;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; }
.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.15; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.5px; }
h3 { font-size: 22px; }
p { margin: 0; }
.label { font-size: 13px; font-weight: 800; letter-spacing: 1.5px; color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }

/* 상단 */
.top { padding-block: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 22px; text-decoration: none; }
.logo i { width: 34px; height: 34px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; font-style: normal; color: var(--paper); font-size: 17px; box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 5px var(--pen); }
.top nav { display: flex; gap: 18px; font-size: 15px; font-weight: 600; }
.top nav a { text-decoration: none; color: var(--ink-soft); }
.top nav a:hover { color: var(--ink); }

/* 첫 화면 */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; padding-block: 40px 72px; }
.hero > * { min-width: 0; }
.hero h1 { font-size: clamp(52px, 9vw, 96px); letter-spacing: -2px; }
.hero h1 em { font-style: normal; color: var(--pen); }
.lead { font-size: 20px; margin-top: 20px; max-width: 30em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; min-height: 54px; padding: 0 22px; border-radius: 10px; font-weight: 800; font-size: 17px; text-decoration: none; border: 2px solid var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.note { margin-top: 14px; font-size: 14px; color: var(--ink-soft); }

/* 출석부 견본 */
.sheet {
  background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 12px; padding: 22px;
  box-shadow: 8px 8px 0 var(--deep); position: relative; max-width: 100%;
}
.sheet .head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.sheet .rate { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.sheet .rate b { font-family: var(--f-display); font-weight: 400; font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; }
.sheet .rate span { font-weight: 600; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); border: 1.5px solid var(--ink); border-radius: 6px; margin-top: 16px; overflow: hidden; }
.days div { text-align: center; font-size: 13px; font-weight: 800; padding: 4px 0; background: var(--deep); border-right: 1px solid var(--line); }
.days div:nth-child(7n) { border-right: 0; }
.days .cell { background: var(--sheet); height: 54px; display: grid; place-items: center; font-weight: 400; }
.stamp { width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--chalk); color: var(--chalk); display: grid; place-items: center; font-weight: 800; font-size: 12px; transform: rotate(-12deg); }
.grade { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; display: flex; gap: 14px; align-items: center; }
.grade .score { font-family: var(--f-pen); color: var(--pen); font-size: 58px; line-height: .9; border: 3px solid var(--pen); border-radius: 50%; width: 92px; height: 92px; display: grid; place-items: center; transform: rotate(-8deg); flex-shrink: 0; }
.grade p { font-family: var(--f-pen); color: var(--pen); font-size: 28px; line-height: 1.15; }
.grade small { display: block; font-family: var(--f-body); color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.chip { position: absolute; top: -16px; right: 18px; background: var(--sticker); color: #191919; font-weight: 800; font-size: 15px; padding: 6px 12px; border-radius: 6px; transform: rotate(3deg); }

/* 섹션 공통 */
section.block { padding-block: 72px; border-top: 1.5px solid var(--ink); }
.block-head { display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: end; margin-bottom: 36px; }
.block-head > * { min-width: 0; }
.block-head p { color: var(--ink-soft); max-width: 34em; }

/* 순서: 진짜 순서라 번호를 붙인다 */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1.5px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--sheet); }
.steps li { list-style: none; padding: 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.steps li:last-child { border-right: 0; }
.steps ol { margin: 0; padding: 0; display: contents; }
.steps .n { font-family: var(--f-display); font-size: 40px; line-height: 1; color: var(--pen); }
.steps p { font-size: 15px; color: var(--ink-soft); }

/* 기능 */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 3px solid var(--ink); min-width: 0; }
.feature p { font-size: 16px; color: var(--ink-soft); }
.feature .tag { align-self: flex-start; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 4px; background: var(--deep); color: var(--ink); }

/* 포인트 표 */
.table-scroll { overflow-x: auto; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--sheet); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 16px; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); }
th { background: var(--deep); font-size: 13px; letter-spacing: 1px; }
tr:last-child td { border-bottom: 0; }
td.p { font-family: var(--f-display); font-size: 22px; color: var(--sticker-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fine { margin-top: 14px; font-size: 14px; color: var(--ink-soft); }

/* 약속 */
.rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 40px; margin: 0; padding: 0; }
.rules li { list-style: none; padding: 14px 0 14px 34px; border-bottom: 1px solid var(--line); position: relative; }
.rules li::before { content: "✓"; position: absolute; left: 0; top: 12px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--chalk); color: var(--chalk); display: grid; place-items: center; font-size: 13px; font-weight: 800; }

/* 댓글 */
.comments-box { background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 12px; padding: 20px; min-height: 160px; }

/* 마지막 */
.closing { padding-block: 80px; border-top: 1.5px solid var(--ink); text-align: left; }
.closing h2 { font-size: clamp(34px, 6vw, 56px); }
.closing h2 span { font-family: var(--f-pen); color: var(--pen); font-size: 1.1em; }
footer { border-top: 1px solid var(--line); padding-block: 28px; font-size: 14px; color: var(--ink-soft); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 16px; }
  .block-head { grid-template-columns: 1fr; gap: 12px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(2) { border-right: 0; }
  .steps li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .features { grid-template-columns: 1fr 1fr; }
  .rules { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .top nav { display: none; }
  .steps { grid-template-columns: 1fr; }
  .steps li { border-right: 0; border-bottom: 1px solid var(--line); }
  .steps li:last-child { border-bottom: 0; }
  .features { grid-template-columns: 1fr; }
  .sheet .rate b { font-size: 52px; }
  .grade .score { width: 78px; height: 78px; font-size: 48px; }
}
@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: stamp .5s ease-out both; }
  .stamp:nth-of-type(2) { animation-delay: .1s; }
  @keyframes stamp { from { transform: rotate(-12deg) scale(1.6); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
}

/* ---------- 여러 페이지 공통: 글 페이지 ---------- */
.article { max-width: 720px; padding-block: 24px 72px; }
.article h1 { font-size: clamp(34px, 6vw, 52px); letter-spacing: -1px; margin-top: 8px; }
.article .meta { color: var(--ink-soft); font-size: 14px; margin-top: 12px; }
.article h2 { font-size: clamp(24px, 4vw, 30px); margin-top: 44px; }
.article h3 { margin-top: 28px; }
.article p, .article ul, .article ol, .article table { margin-top: 16px; }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin-top: 6px; }
.article .box { background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 12px; padding: 18px 20px; margin-top: 24px; }
.article .warn { border-color: var(--pen); }
.article .todo { background: var(--sticker); color: #191919; padding: 0 6px; border-radius: 4px; font-weight: 800; }
.crumbs { font-size: 14px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.guides { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.guide { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--sheet); text-decoration: none; min-width: 0; }
.guide:hover { box-shadow: 6px 6px 0 var(--deep); }
.guide p { font-size: 15px; color: var(--ink-soft); }
.guide .more { font-weight: 800; font-size: 15px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-links a { color: var(--ink-soft); }
.ad-slot { margin-block: 32px; min-height: 0; }
@media (max-width: 860px) { .guides { grid-template-columns: 1fr; } }
