/* 사각사각(SAGAK) 전용 스타일 — 종이·연필·잉크·도장 (앱 PRD §7 토큰, Flexoki) */
:root {
  --pg-base: #FFFCF0;
  --pg-board: #F2F0E5;
  --pg-card: #FBF9F1;
  --rule-soft: #DAD8CE;
  --rule-strong: #B7B5AC;
  --ink: #100F0F;
  --ink-muted: #6F6E69;
  --ink-faint: #9F9D96;
  --seal: #AF3029;
  --accent: #205EA6;
  --ink-red: #AF3029;
  --ink-blue: #205EA6;
  --ink-yellow: #AD8301;
  --ink-green: #66800B;
  --ink-tan: #DDB962;
  --shadow: rgba(16, 15, 15, 0.13);
  --stamp-paper: #FFFFFF;
  --serif: Fraunces, "Times New Roman", Georgia, serif;
  --sans: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", system-ui, sans-serif;
  --sans-jp: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --num: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --pg-base: #100F0F;
    --pg-board: #1C1B1A;
    --pg-card: #282726;
    --rule-soft: #343331;
    --rule-strong: #575653;
    --ink: #CECDC3;
    --ink-muted: #96948E;
    --ink-faint: #6F6E69;
    --seal: #D14D41;
    --accent: #4385BE;
    --ink-red: #D14D41;
    --ink-blue: #4385BE;
    --ink-yellow: #D0A215;
    --ink-green: #879A39;
    --ink-tan: #D9BA7A;
    --shadow: rgba(0, 0, 0, 0.5);
    --stamp-paper: #34332F;
  }
}

html[lang="ja"] { --sans: var(--sans-jp); }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--pg-base);
  background-image: var(--grain);
  background-size: 140px 140px;
  background-blend-mode: multiply;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--seal); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; display: block; }

.sg-skip {
  position: absolute; left: -999px; top: 0; z-index: 20;
  background: var(--ink); color: var(--pg-card); padding: 10px 16px; border-radius: 0 0 8px 0;
  font-size: 14px; font-weight: 600;
}
.sg-skip:focus { left: 0; }

.sg-wrap { width: min(1120px, 100% - clamp(32px, 8vw, 96px)); margin: 0 auto; }

/* ── 헤더 ───────────────────────────────────────────── */
.sg-head {
  border-bottom: 1px solid var(--rule-soft);
  background: color-mix(in srgb, var(--pg-base) 88%, transparent);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(1.2) blur(8px);
}
.sg-head__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 64px; }
.sg-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.sg-brand:hover { color: var(--ink); text-decoration: none; }
.sg-brand img { width: 26px; height: 26px; border-radius: 6px; box-shadow: 0 0 0 1px var(--rule-soft); }
.sg-brand__name { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.sg-brand__latin { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--ink-faint); }
.sg-nav { display: flex; align-items: center; gap: 22px; }
.sg-nav a { font-size: 14px; font-weight: 500; color: var(--ink-muted); }
.sg-nav a:hover { color: var(--ink); text-decoration: none; }
.sg-langs { display: flex; align-items: center; gap: 2px; }
.sg-langs a, .sg-langs span {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--ink-muted); font-family: var(--sans);
}
.sg-langs .is-on { background: var(--ink); color: var(--pg-card); }
.sg-langs a:hover { color: var(--ink); text-decoration: none; }
@media (max-width: 720px) { .sg-nav { display: none; } }

/* ── 공통 조판 ──────────────────────────────────────── */
.sg-sec { padding: clamp(56px, 8vw, 92px) 0; }
.sg-sec--alt { background: var(--pg-board); }
.sg-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--seal); text-transform: uppercase;
}
.sg-h2 {
  margin: 12px 0 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(25px, 3.6vw, 34px); line-height: 1.32; letter-spacing: -0.01em;
  word-break: keep-all;
}
.sg-lede {
  margin: 16px 0 0; font-size: clamp(15px, 1.6vw, 16.5px); line-height: 1.75;
  color: var(--ink-muted); max-width: 620px; word-break: keep-all;
}
.sg-p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--ink-muted); word-break: keep-all; }

/* ── 히어로 ─────────────────────────────────────────── */
.sg-hero { padding: clamp(48px, 7vw, 78px) 0 clamp(56px, 8vw, 84px); }
.sg-hero__in { display: flex; align-items: center; gap: clamp(36px, 6vw, 80px); flex-wrap: wrap; }
.sg-hero__col { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.sg-hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(36px, 5.4vw, 60px); line-height: 1.14; letter-spacing: -0.02em;
  word-break: keep-all;
}
.sg-hero__sub { margin: 0; font-size: clamp(15px, 1.8vw, 17px); line-height: 1.75; color: var(--ink-muted); max-width: 470px; word-break: keep-all; }
.sg-hero__art { flex: none; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.sg-hero__icon {
  width: clamp(132px, 18vw, 186px); height: clamp(132px, 18vw, 186px);
  border-radius: 22%; box-shadow: 0 0 0 1px var(--rule-soft), 0 22px 40px -20px var(--shadow);
}
.sg-hero__latin { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; color: var(--ink-faint); }

.sg-stores { display: flex; gap: 12px; flex-wrap: wrap; }
.sg-store {
  display: flex; align-items: center; gap: 11px; padding: 11px 20px; border-radius: 12px;
  background: var(--ink); min-width: 150px; text-decoration: none;
}
.sg-store:hover { text-decoration: none; opacity: 0.88; }
.sg-store.is-disabled { opacity: 0.45; pointer-events: none; }
.sg-store > span { display: flex; flex-direction: column; gap: 1px; }
.sg-store__sub { font-size: 10.5px; font-weight: 500; letter-spacing: 0.03em; color: var(--pg-card); opacity: 0.72; }
.sg-store__label { font-size: 15px; font-weight: 700; color: var(--pg-card); }
.sg-store svg { flex: none; }
.sg-note { font-size: 13px; color: var(--ink-faint); }

.sg-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sg-chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--rule-soft);
  background: var(--pg-card); font-size: 12.5px; font-weight: 500; color: var(--ink-muted);
  white-space: nowrap;
}

/* ── 규칙 · 예제 보드 ───────────────────────────────── */
.sg-rules { display: flex; gap: clamp(32px, 6vw, 72px); align-items: center; flex-wrap: wrap; }
.sg-rules__col { flex: 1 1 340px; min-width: 0; }
.sg-rule-list { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.sg-rule { display: flex; gap: 16px; align-items: flex-start; }
.sg-rule__n { font-family: var(--num); font-size: 13px; font-weight: 600; color: var(--seal); padding-top: 2px; }
.sg-rule__t { display: block; font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 5px; }
.sg-boards { flex: none; display: flex; align-items: center; gap: clamp(14px, 2.4vw, 26px); flex-wrap: wrap; justify-content: center; }
.sg-board-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sg-board-cap { font-size: 12.5px; color: var(--ink-muted); }
.sg-arrow { font-family: var(--serif); font-size: 22px; color: var(--ink-faint); }
.sg-board {
  position: relative; width: clamp(180px, 24vw, 212px); aspect-ratio: 1;
  background: var(--pg-board); border: 1.5px solid var(--rule-strong); border-radius: 4px;
}
.sg-sec--alt .sg-board { background: var(--pg-card); }
.sg-board__layer { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); }
.sg-board__rule { box-shadow: inset 0 0 0 0.7px var(--rule-soft); }
.sg-board__rect { position: relative; border-radius: 2px; }
.sg-board__wash { position: absolute; inset: 0; opacity: 0.2; border-radius: 2px; }
.sg-board__num {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--num); font-size: clamp(12px, 1.6vw, 15px); font-weight: 600;
}

/* ── 카드 3장 ───────────────────────────────────────── */
.sg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; margin-top: 40px; }
.sg-card {
  background: var(--pg-card); border: 1px solid var(--rule-soft); border-radius: 16px;
  padding: clamp(24px, 3vw, 30px); display: flex; flex-direction: column; gap: 14px;
}
.sg-card__glyph {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--rule-soft);
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.sg-card__t { font-family: var(--serif); font-size: 21px; font-weight: 600; }

/* ── 화면 쇼케이스 ──────────────────────────────────── */
.sg-show { display: flex; flex-direction: column; gap: clamp(48px, 7vw, 72px); margin-top: 44px; }
.sg-show__row { display: flex; align-items: center; gap: clamp(28px, 5vw, 60px); flex-wrap: wrap; justify-content: center; }
.sg-show__row--rev { flex-direction: row-reverse; }
.sg-phone {
  flex: none; position: relative; width: min(268px, 82vw); padding: 5.6% 2.4% 2.4%;
  border-radius: 8.6%; background: var(--pg-card);
  box-shadow: 0 0 0 1px var(--rule-soft), 0 26px 46px -22px var(--shadow);
}
.sg-phone::before {
  content: ""; position: absolute; top: 2.4%; left: 50%; transform: translateX(-50%);
  width: 2.4%; aspect-ratio: 1; border-radius: 50%; background: #14171c;
}
.sg-phone img { width: 100%; height: auto; border-radius: 6.4% / 2.9%; }
.sg-show__text { flex: 1 1 320px; min-width: 0; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.sg-show__n { font-family: var(--num); font-size: 13px; font-weight: 600; color: var(--seal); }
.sg-show__t { font-family: var(--serif); font-size: clamp(21px, 2.6vw, 26px); font-weight: 600; line-height: 1.35; word-break: keep-all; }

/* ── 우표 ───────────────────────────────────────────── */
.sg-stamps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr)); gap: 20px; margin-top: 40px; }
.sg-stamp-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sg-stamp {
  position: relative; width: 100%; max-width: 156px; aspect-ratio: 4 / 5;
  background-color: var(--stamp-paper);
  background-image:
    radial-gradient(circle 4.9px at 7px 0, var(--pg-base) 99%, transparent 100%),
    radial-gradient(circle 4.9px at 7px 14px, var(--pg-base) 99%, transparent 100%),
    radial-gradient(circle 4.9px at 0 7px, var(--pg-base) 99%, transparent 100%),
    radial-gradient(circle 4.9px at 14px 7px, var(--pg-base) 99%, transparent 100%);
  background-size: 14px 14px;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-position: top left, bottom left, left top, right top;
  filter: drop-shadow(0 8px 16px var(--shadow));
}
.sg-sec--alt .sg-stamp {
  background-image:
    radial-gradient(circle 4.9px at 7px 0, var(--pg-board) 99%, transparent 100%),
    radial-gradient(circle 4.9px at 7px 14px, var(--pg-board) 99%, transparent 100%),
    radial-gradient(circle 4.9px at 0 7px, var(--pg-board) 99%, transparent 100%),
    radial-gradient(circle 4.9px at 14px 7px, var(--pg-board) 99%, transparent 100%);
}
.sg-stamp__face {
  position: absolute; inset: 15px; display: grid; gap: 1.6px; padding: 1.6px;
  background: var(--ink); border-radius: 2px;
}
.sg-stamp__face > i { display: block; border-radius: 1px; background: var(--stamp-paper); }
.sg-stamp__mark {
  position: absolute; left: 4px; bottom: 4px; width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--seal); color: var(--seal); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; font-family: var(--mono);
  opacity: 0.88; transform: rotate(-7deg);
}
.sg-stamp__mark b { font-size: 10px; font-weight: 600; }
.sg-stamp__mark span { font-size: 7px; letter-spacing: 0.14em; }
.sg-stamp__cap { font-size: 12px; color: var(--ink-muted); }

.sg-series { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; margin-top: 28px; }
.sg-series > div { padding: 16px 18px; border-radius: 12px; background: var(--pg-card); border: 1px solid var(--rule-soft); }
.sg-series b { display: block; font-size: 14.5px; font-weight: 700; margin-bottom: 5px; }
.sg-series span { font-size: 13px; color: var(--ink-muted); line-height: 1.6; }

/* ── 노트 12권 ──────────────────────────────────────── */
.sg-notes { display: flex; gap: clamp(32px, 6vw, 72px); align-items: flex-start; flex-wrap: wrap; }
.sg-notes__col { flex: 1 1 300px; max-width: 380px; }
.sg-notes__list { flex: 1 1 420px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 40px; }
.sg-note-row { display: flex; align-items: baseline; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--rule-soft); }
.sg-note-row i { font-family: var(--num); font-style: normal; font-size: 12px; font-weight: 600; color: var(--ink-faint); width: 22px; flex: none; }
.sg-note-row b { font-family: var(--serif); font-size: 16px; font-weight: 600; width: 112px; flex: none; }
.sg-note-row span { font-size: 13.5px; color: var(--ink-muted); }

/* ── 만듦새 ─────────────────────────────────────────── */
.sg-craft { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 34px 48px; margin-top: 40px; }
.sg-craft__item { display: flex; gap: 16px; align-items: flex-start; }
.sg-craft__glyph {
  flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--rule-soft);
  background: var(--pg-card); display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.sg-craft__t { display: block; font-size: 15.5px; font-weight: 700; margin-bottom: 6px; }

/* ── FAQ ────────────────────────────────────────────── */
.sg-faq { margin-top: 36px; }
.sg-faq details { border-bottom: 1px solid var(--rule-soft); }
.sg-faq summary {
  cursor: pointer; list-style: none; padding: 20px 0; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; font-size: 16px; font-weight: 700; word-break: keep-all;
}
.sg-faq summary::-webkit-details-marker { display: none; }
.sg-faq summary svg { flex: none; transition: transform 0.2s ease; color: var(--ink-faint); }
.sg-faq details[open] summary svg { transform: rotate(180deg); }
.sg-faq p { margin: 0 0 20px; font-size: 14.5px; line-height: 1.75; color: var(--ink-muted); max-width: 760px; }

/* ── 마지막 CTA · 푸터 ──────────────────────────────── */
.sg-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding: clamp(28px, 4vw, 40px) clamp(24px, 4vw, 44px); border-radius: 20px;
  background: var(--pg-card); border: 1px solid var(--rule-soft);
}
.sg-foot { border-top: 1px solid var(--rule-soft); margin-top: clamp(40px, 6vw, 56px); padding: 24px 0 40px; }
.sg-foot__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.sg-foot__note { font-size: 12.5px; color: var(--ink-faint); }
.sg-foot__links { display: flex; gap: 22px; flex-wrap: wrap; }
.sg-foot__links a { font-size: 12.5px; color: var(--ink-muted); }

/* ── 스크롤 등장 ────────────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(8px); transition: opacity 0.45s ease, transform 0.45s ease; }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
