@font-face { font-family: "Bodoni Moda"; src: url(/fonts/bodoni-moda.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

/* 보안 인쇄 증서: 차가운 용지, 남색 판각 잉크, 도장 빨강 */
:root {
  --paper: #E6EAEE;
  --sheet: #F8F9F7;
  --ink: #18253A;
  --ink-2: #4D5A70;
  --line: #C6CED9;
  --red: #B4232A;
  --amber: #94600E;
  --green: #1D6A49;
  --accent: var(--ink);
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --text: "Public Sans", -apple-system, system-ui, "Apple SD Gothic Neo", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
body[data-status="red"], body[data-status="broken"] { --accent: var(--red); }
body[data-status="amber"] { --accent: var(--amber); }
body[data-status="green"] { --accent: var(--green); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.top, .page, .foot { width: min(1140px, 100% - 48px); margin-inline: auto; }

/* 머리 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.005em; }
.toplink { font-size: 14px; color: var(--ink-2); }

/* 본문 격자: 왼쪽은 질문과 판정, 오른쪽은 증서 */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  grid-template-areas: "intro sheet" "status sheet" "verdict sheet" "details sheet";
  grid-template-rows: auto auto auto 1fr;
  column-gap: clamp(40px, 6vw, 88px);
  align-items: start;
  padding-top: clamp(48px, 8vw, 104px);
}
.intro { grid-area: intro; }
.status { grid-area: status; }
.verdict { grid-area: verdict; }
.details { grid-area: details; }
.sheet { grid-area: sheet; position: sticky; top: 28px; }

h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(42px, 5.4vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  max-width: 11.5em;
  text-wrap: balance;
}
.lede { margin: 0 0 36px; color: var(--ink-2); font-size: 19px; line-height: 1.55; max-width: 31em; text-wrap: pretty; }

.bar {
  display: flex; align-items: center;
  background: var(--sheet);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 6px 6px 6px 18px;
}
.bar:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 16%, transparent); }
.scheme { color: var(--ink-2); font-family: var(--mono); font-size: 17px; user-select: none; }
#d { flex: 1; min-width: 0; font: inherit; font-family: var(--mono); font-weight: 500; font-size: 19px; color: var(--ink); background: none; border: 0; padding: 12px 8px 12px 1px; outline: none; }
#d::placeholder { color: #8A95A6; font-weight: 400; }
.bar button, .watch button {
  font: inherit; font-weight: 650; font-size: 17px;
  color: var(--sheet); background: var(--ink);
  border: 0; border-radius: 3px; padding: 13px 26px; cursor: pointer; white-space: nowrap;
}
.bar button:hover, .watch button:hover { background: #24364F; }
.bar button[disabled] { opacity: .55; cursor: progress; }
.count { margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }

.status { margin: 36px 0 0; color: var(--ink-2); }
.status::before { content: ""; display: inline-block; width: 9px; height: 15px; margin-right: 10px; border: 2.5px solid currentColor; border-radius: 5px; vertical-align: -2px; animation: sway 1s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }

/* 판정 */
.verdict { margin-top: 52px; padding-top: 26px; border-top: 3px solid var(--accent); }
.verdict h2 { font-family: var(--display); font-optical-sizing: auto; font-weight: 600; font-size: clamp(30px, 3.3vw, 42px); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 14px; color: var(--accent); text-wrap: balance; }
.verdict h2:focus { outline: none; }
.verdict p { margin: 0 0 10px; max-width: 34em; font-size: 18px; text-wrap: pretty; }
.verdict .summary { color: var(--ink-2); font-size: 15px; }

/* 증서 */
.sheet {
  margin: 0;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 78px clamp(24px, 3vw, 40px) 30px;
  outline: 1px solid var(--line);
  outline-offset: -11px;
  box-shadow: 0 1px 0 #fff inset, 0 30px 50px -30px rgba(24, 37, 58, .38), 0 2px 6px -2px rgba(24, 37, 58, .12);
  overflow: hidden;
  isolation: isolate;
}
.band {
  position: absolute; left: 11px; right: 11px; top: 11px; height: 46px;
  background: url(/band.svg) repeat-x center / 600px 46px;
  opacity: .5;
  border-bottom: 1px solid var(--line);
}
.rosette { position: absolute; right: -104px; bottom: -118px; width: 380px; height: 380px; opacity: .34; z-index: -1; pointer-events: none; }
.sheet-head { display: block; margin-bottom: 30px; }
.kicker { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.sheet-host { display: block; font-family: var(--mono); font-weight: 500; font-size: 22px; line-height: 1.3; }
.sheet-empty { margin: 0; color: var(--ink-2); }
/* 증서 아래 칸: 왼쪽은 검사 시각, 오른쪽은 도장 자리 */
.sheet-foot { margin: 34px 0 0; padding: 14px 60% 0 0; min-height: 100px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.sheet[data-state="loading"] .links, .sheet[data-state="loading"] .sheet-foot { opacity: .25; transition: opacity .3s; }
.sheet[data-state="loading"] .links li > div, .sheet[data-state="loading"] .sheet-foot { visibility: hidden; }

/* 사슬: 인증서 = 고리, 고리 사이 = 옆에서 본 고리 */
.links { list-style: none; margin: 0; padding: 0; }
.links li {
  --i: 0;
  position: relative;
  display: grid; grid-template-columns: 40px 1fr; column-gap: 20px;
  padding-bottom: 28px;
}
.links li:last-child { padding-bottom: 0; }
.links li:not(:last-child)::after {
  content: ""; position: absolute; left: 17px; top: 42px; bottom: -6px;
  width: 6px; border-radius: 3px; background: var(--ink); z-index: 0;
}
.links li.weak-next::after { background: var(--red); }
.ring {
  position: relative; z-index: 1; justify-self: center;
  width: 28px; height: 48px; margin-top: 1px;
  border: 5px solid var(--ink); border-radius: 14px;
  background: var(--sheet);
}
.links li.weak .ring { border-color: var(--red); }
.links li.weak .ring::after {
  content: ""; position: absolute; right: -8px; top: 13px;
  width: 11px; height: 9px; background: var(--sheet);
  transform: skewY(-32deg);
}
.role { display: block; font-size: 13px; color: var(--ink-2); }
.cname { display: block; font-family: var(--mono); font-size: 16px; line-height: 1.45; }
.meta { display: block; font-size: 15px; }
.links li.weak .meta { color: var(--red); font-weight: 650; }

/* 도장 */
.stamp {
  position: absolute; right: clamp(22px, 3vw, 38px); bottom: 38px; z-index: 2;
  color: var(--accent);
  border: 4px solid currentColor; border-radius: 9px;
  box-shadow: inset 0 0 0 3px var(--sheet), inset 0 0 0 5px currentColor;
  padding: 10px 16px 11px;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-9deg);
  mix-blend-mode: multiply;
  -webkit-mask-image: url(/ink.svg); mask-image: url(/ink.svg);
  -webkit-mask-size: 260px; mask-size: 260px;
  opacity: .9;
}
.stamp b { display: block; font-weight: 800; font-size: 32px; line-height: 1; letter-spacing: .08em; }
.stamp small { display: block; font-weight: 700; font-size: 10px; line-height: 1.2; letter-spacing: .12em; margin-top: 7px; }
.sheet[data-state="example"] .stamp { color: var(--red); }
.sheet[data-state="loading"] .stamp, .stamp:empty { display: none; }

/* 결과가 나올 때 한 번: 고리가 걸리고 도장이 찍힌다 */
.sheet.land .links li { animation: hook .36s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 140ms); }
.sheet.land .stamp { animation: thump .32s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--stamp-delay, .4s); }
@keyframes hook { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes thump { from { opacity: 0; transform: rotate(-15deg) scale(1.7); } to { opacity: .9; transform: rotate(-9deg) scale(1); } }

/* 세부 */
.details { margin-top: 8px; }
.notes { list-style: none; margin: 28px 0 0; padding: 0; font-size: 15px; color: var(--ink-2); max-width: 38em; }
.notes:empty { display: none; }
.notes li { padding: 10px 0; border-top: 1px solid var(--line); }
.notes li:last-child { border-bottom: 1px solid var(--line); }

.hostswrap { margin: 44px 0 0; }
.hostswrap h3, .watch h3 { font-family: var(--display); font-optical-sizing: auto; font-weight: 600; font-size: 25px; line-height: 1.2; margin: 0 0 12px; }
.hosts { list-style: none; margin: 0; padding: 0; }
.hosts li {
  display: grid; grid-template-columns: 1fr auto; column-gap: 16px; row-gap: 2px;
  padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px;
}
.hosts li:last-child { border-bottom: 1px solid var(--line); }
.hosts .h { font-family: var(--mono); font-size: 15px; }
.hosts .s { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; justify-self: end; white-space: nowrap; }
.hosts .s::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hosts .s.red, .hosts .s.broken { color: var(--red); } .hosts .s.amber { color: var(--amber); } .hosts .s.green { color: var(--green); } .hosts .s.error { color: var(--ink-2); }
.hosts .d { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; }

.watch { margin: 48px 0 0; padding: 26px 28px 22px; background: var(--sheet); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 3px; }
.watch p { margin: 0 0 16px; max-width: 34em; }
.watchrow { display: flex; gap: 8px; flex-wrap: wrap; }
#watchEmail { flex: 1 1 220px; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 3px; padding: 11px 14px; }
#watchEmail:focus { border-color: var(--ink); outline: none; }
.watchmsg { min-height: 1.6em; margin: 10px 0 0 !important; font-weight: 650; }
.watchmsg.ok { color: var(--green); } .watchmsg.bad { color: var(--red); }
.fine { font-size: 13px; color: var(--ink-2); margin-bottom: 0 !important; }

/* 설명 글(FAQ). 내용은 tools/faq.py 가 만든다 */
.explain { width: min(1140px, 100% - 48px); margin: 136px auto 0; padding-top: 44px; border-top: 1px solid var(--line); }
.explain-inner { max-width: 44rem; }
.explain h2 { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 4.6vw, 46px); line-height: 1.06; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.explain h3 { font-family: var(--display); font-weight: 650; font-size: 25px; line-height: 1.2; margin: 46px 0 12px; scroll-margin-top: 24px; }
.explain p, .explain li { font-size: 17px; line-height: 1.62; }
.explain p { margin: 0 0 14px; max-width: 40em; text-wrap: pretty; }
.explain ul { margin: 0 0 14px; padding-left: 1.25em; }
.explain li { margin-bottom: 4px; }
.explain code { font-family: var(--mono); font-size: .9em; background: var(--sheet); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; overflow-wrap: anywhere; }
.tablewrap { overflow-x: auto; margin: 8px 0 18px; }
.explain pre { margin: 0 0 14px; padding: 11px 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: 3px; overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.5; }
.explain pre code { background: none; border: 0; padding: 0; font-size: inherit; white-space: pre; overflow-wrap: normal; }
.explain table { width: 100%; min-width: 520px; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--line); font-size: 15px; }
.explain th { text-align: left; font-weight: 650; font-size: 13.5px; color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.explain td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.explain td:first-child { font-family: var(--mono); font-size: 14px; }
.explain td.k { white-space: nowrap; }
.explain tr.hit td.k { color: var(--red); font-weight: 650; }
.explain p.explain-src { margin-top: 44px; font-size: 14px; color: var(--ink-2); }

/* 알림 확인·그만 받기 페이지(서버가 그린다) */
.notice { width: min(1140px, 100% - 48px); margin: 96px auto 120px; }
.notice > * { max-width: 620px; }
.notice h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 6vw, 48px); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 20px; text-wrap: balance; }
.notice p { margin: 0 0 28px; font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 32em; }
.notice button { font: inherit; font-weight: 650; font-size: 17px; color: var(--sheet); background: var(--ink); border: 0; border-radius: 3px; padding: 13px 26px; cursor: pointer; }
.notice button:hover { background: #24364F; }
.notice button:focus-visible, .notice a:focus-visible { outline: 3px solid color-mix(in srgb, var(--ink) 40%, transparent); outline-offset: 3px; }
.notice-link { font-size: 16px !important; }

.foot { margin-top: 104px; padding: 24px 0 44px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.foot p { margin: 0 0 6px; }

/* 좁은 화면: 질문, 판정, 증서, 세부 순서로 한 줄 */
@media (max-width: 900px) {
  .page { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "status" "verdict" "sheet" "details"; grid-template-rows: none; padding-top: 44px; }
  .sheet { position: relative; top: 0; margin-top: 44px; }
  .verdict + .sheet { margin-top: 28px; }
}
@media (max-width: 520px) {
  .top, .page, .foot { width: calc(100% - 32px); }
  body { font-size: 16px; }
  .lede { font-size: 17px; }
  .scheme { display: none; }
  .bar { padding-left: 14px; }
  #d { font-size: 17px; }
  .bar button { padding: 12px 16px; }
  .sheet { padding: 72px 20px 24px; }
  .sheet-host { font-size: 18px; }
  .stamp { right: 18px; bottom: 26px; padding: 8px 12px 9px; }
  .sheet-foot { padding: 14px 0 104px; min-height: 0; }
  h1 { line-height: 1.07; }
  .stamp b { font-size: 27px; }
  .stamp small { font-size: 9px; }
  .watch { padding: 22px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet.land .links li, .sheet.land .stamp, .status::before { animation: none; }
}
