@font-face { font-family: "Paperlogy"; src: url("fonts/paperlogy-8.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Paperlogy"; src: url("fonts/paperlogy-6.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #f3f1ec;
  --paper: #fbfaf6;
  --card: #ffffff;
  --ink: #1c2329;
  --ink-2: #3a444c;
  --muted: #6c767e;
  --line: #e3dfd6;
  --line-2: #d3cdc0;
  --brand: #234a5c;
  --brand-soft: #e3ecf0;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28, 35, 41, .05), 0 10px 30px -12px rgba(28, 35, 41, .22);
  --shadow-lg: 0 30px 80px -20px rgba(10, 16, 20, .55);
  --display: "Paperlogy", "Pretendard Variable", Pretendard, sans-serif;
  --text: "Pretendard Variable", Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161a; --paper: #171c20; --card: #1d2328; --ink: #eef1f3; --ink-2: #cdd4d9; --muted: #98a2aa;
    --line: #2b3238; --line-2: #3a434a; --brand: #8cc0d6; --brand-soft: #1f2c33;
    --shadow: none; --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  --bg: #12161a; --paper: #171c20; --card: #1d2328; --ink: #eef1f3; --ink-2: #cdd4d9; --muted: #98a2aa;
  --line: #2b3238; --line-2: #3a434a; --brand: #8cc0d6; --brand-soft: #1f2c33;
  --shadow: none; --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--text); font-size: 17px; line-height: 1.6; word-break: keep-all;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* 머리말 */
.hero { color: #f5f2ea; background: radial-gradient(1000px 360px at 90% -20%, #3a7189 0%, transparent 60%), linear-gradient(160deg, #1b3a49 0%, #234a5c 60%, #2a566a 100%); }
.hero-in { max-width: 1400px; margin: 0 auto; padding: 16px 32px 14px; }
.kicker { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: rgba(245, 242, 234, .72); }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
.sub { margin: 6px 0 0; font-size: 16px; color: rgba(245, 242, 234, .82); }

/* 주제 고르기 */
.toolbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.toolbar-in { max-width: 1400px; margin: 0 auto; padding: 12px 32px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.topics { display: flex; gap: 8px; flex-wrap: wrap; }
.topic {
  display: inline-flex; align-items: center; gap: 10px; border: 1.5px solid var(--line-2); background: var(--card);
  border-radius: 14px; padding: 8px 18px 8px 14px; min-height: 54px; text-align: left; color: var(--ink-2);
  transition: border-color .15s, background .15s, color .15s;
}
.topic svg { width: 26px; height: 26px; }
.topic span { display: flex; flex-direction: column; line-height: 1.2; }
.topic b { font-family: var(--display); font-weight: 800; font-size: 18px; }
.topic small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.topic:hover { border-color: var(--brand); }
.topic[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.topic[aria-selected="true"] small { color: rgba(255, 255, 255, .78); }
.tools { display: flex; gap: 8px; }
.tool { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--card); border-radius: 12px; padding: 8px 14px; min-height: 46px; font-weight: 700; font-size: 15px; }
.tool:hover { border-color: var(--brand); color: var(--brand); }

/* 기후 카드 */
.grid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px 32px 26px; }
.tile {
  position: relative; display: flex; flex-direction: column; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--card); text-align: left; box-shadow: var(--shadow); border-top: 7px solid var(--c);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s;
}
.tile .pic { display: block; aspect-ratio: 11 / 5; overflow: hidden; background: var(--line); }
.tile .pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.tile:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 22px 40px -16px rgba(28, 35, 41, .45); }
.tile:hover .pic img { transform: scale(1.04); }
.tile .body { padding: 9px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.tile .nm { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.15; color: var(--c); }
.lbls { display: flex; flex-wrap: wrap; gap: 6px; }
.lbls span { font-size: 14px; font-weight: 600; color: var(--ink-2); background: color-mix(in srgb, var(--c) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); padding: 2px 10px; border-radius: 999px; }

/* 여섯 기후 한눈에 */
.all { max-width: 1400px; margin: 0 auto; padding: 18px 32px 30px; }
.all-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.all-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; }
.cols { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.colc { background: var(--card); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }
.colc-head { border: 0; background: var(--c); color: #fff; font-family: var(--display); font-weight: 800; font-size: 19px; padding: 10px 8px; }
.mini { margin: 0 8px; }
.mini img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; background: var(--line); }
.mini figcaption { font-size: 14px; font-weight: 700; line-height: 1.3; margin-top: 4px; }
.mini small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.colc .words { padding: 0 8px; margin-top: auto; }

.foot { max-width: 1400px; margin: 0 auto; padding: 8px 32px 40px; color: var(--muted); font-size: 14px; }

/* 카드 자세히 */
.detail { position: fixed; inset: 0; z-index: 20; background: rgba(9, 13, 16, .62); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.sheet { background: var(--paper); width: min(1400px, 100%); height: min(920px, 100%); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: rise .24s cubic-bezier(.2, .7, .2, 1); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px 14px 26px; background: var(--c); color: #fff; }
.d-topic { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, .85); }
.sheet-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(28px, 3vw, 38px); line-height: 1.1; }
.close { flex: none; border: 1px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .14); color: #fff; border-radius: 14px; width: 48px; height: 48px; display: grid; place-items: center; }
.close:hover { background: rgba(255, 255, 255, .26); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr); align-items: start; scrollbar-width: thin; }
.col { padding: 20px 26px; display: flex; flex-direction: column; gap: 12px; }
.col.climate { background: color-mix(in srgb, var(--c) 7%, var(--paper)); border-right: 1px solid var(--line); min-height: 100%; }
.row-tag { align-self: flex-start; margin: 0; font-family: var(--display); font-weight: 800; font-size: 17px; padding: 4px 14px; border-radius: 999px; background: #fbe3a6; color: #4a3a12; }
.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.facts li { padding: 9px 14px 9px 32px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); position: relative; font-size: 16.5px; line-height: 1.55; }
.facts li::before { content: ""; position: absolute; left: 14px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.places { margin: 0; display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); font-size: 15px; font-weight: 600; }
.places svg { margin-top: 3px; color: var(--c); }
.examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ex { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.ex-img { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--line); }
.ex-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(8, 12, 14, .8) 100%); }
.ex-img .lbl { position: absolute; left: 12px; right: 12px; bottom: 9px; z-index: 1; color: #fff; font-weight: 800; font-size: 17px; line-height: 1.25; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.ex-img .lbl small { display: block; font-weight: 600; font-size: 13px; color: rgba(255, 255, 255, .85); }
.credit { font-size: 11.5px; line-height: 1.35; color: var(--muted); padding: 0 2px; }
.credit a { color: inherit; }
.words { display: flex; gap: 6px; flex-wrap: wrap; }
.words span { background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 14px; padding: 3px 11px; border-radius: 999px; }
.tip { margin: 0; padding: 9px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 15px; font-weight: 600; }
.nav { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--paper); }
.nav button { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card); border-radius: 12px; padding: 8px 16px; min-height: 46px; font-weight: 700; }
.nav button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.nav button:disabled { opacity: .35; cursor: default; }

/* 인쇄 */
.print { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  body > *:not(.print) { display: none !important; }
  .print { display: block !important; color: #000; }
  .print h1 { font-family: var(--display); font-size: 16pt; margin: 0 0 4mm; }
  .p-row { break-inside: avoid; margin-bottom: 4mm; }
  .p-row h2 { font-family: var(--display); font-size: 13pt; margin: 0 0 2mm; padding-left: 3mm; border-left: 5px solid var(--c); }
  .p-pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; }
  .p-pics figure { margin: 0; }
  .p-pics img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
  .p-pics figcaption { font-size: 10pt; font-weight: 700; margin-top: 1mm; }
  .p-pics small { display: block; font-weight: 400; font-size: 7pt; color: #555; }
}

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-body { display: block; }
  .col.climate { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero-in, .toolbar-in, .all, .foot { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr; padding: 14px 16px 24px; gap: 12px; }
  .topics { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .tools { width: 100%; }
  .tool { flex: 1; justify-content: center; }
  .detail { padding: 0; }
  .sheet { height: 100%; border-radius: 0; }
  .col { padding: 16px; }
  .examples { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
