/* ══════════════════════════════════════════════════════════════
   주식회사 세이프셀 — 2026 개편
   계측기의 조판. 종이 바탕, 순수한 검정 활자, 신호색 하나.
   눈금(tick)을 구조 장치로 쓴다 — 이 회사가 하는 일이 재는 것이므로.
   ══════════════════════════════════════════════════════════════ */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css");

:root {
  color-scheme: light;

  --paper:   #FAFAF9;
  --paper-2: #F1F2F0;
  --panel:   #F1F2F0;
  --ink:     #000000;
  --ink-2:   #4A4D49;
  --ink-3:   #868A84;
  --rule:    #DCDED9;
  --hair:    #E8EAE5;
  --signal:  #E09200;   /* 주의 — 위험 직전의 색. 이 회사가 파는 순간 */
  --signal-d:#B47400;
  --field:   #111112;

  --sans: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo",
          "Noto Sans KR", system-ui, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, "Noto Sans Mono", monospace;

  --gut: 24px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: -.011em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.shell { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

/* ── 상단 ─────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hair);
}
.nav .shell { display: flex; align-items: center; gap: 8px 28px; min-height: 62px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand svg { width: 24px; height: 24px; display: block; }
.brand b { font-weight: 800; font-size: 15px; letter-spacing: .01em; }
.nav nav {
  display: flex; gap: 2px; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
}
@media (min-width: 900px) { .nav nav { -webkit-mask-image: none; mask-image: none; } }
.nav nav::-webkit-scrollbar { display: none; }
.nav nav a { white-space: nowrap; flex: none; }
.nav nav a {
  position: relative; padding: 7px 11px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  border-radius: 7px;
}
.nav nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 1px;
  height: 2px; background: var(--signal);
}

/* ── 표제 (메인) ──────────────────────────────────────── */
.hero { padding: clamp(56px, 11vw, 128px) 0 clamp(40px, 7vw, 76px); }
.eyebrow { font-size: 13.5px; font-weight: 600; color: var(--ink-3); margin: 0 0 clamp(20px,3vw,34px); }
.hero h1 {
  margin: 0; font-weight: 800;
  font-size: clamp(40px, 8.4vw, 104px); line-height: 1.07; letter-spacing: -.045em;
}
.hero h1 .dim { color: var(--ink-3); }
.hero h1 em {
  font-style: normal; white-space: nowrap;
  background: linear-gradient(transparent 81%, var(--signal) 81%, var(--signal) 96%, transparent 96%);
}
.hero .sub {
  margin: clamp(26px,4vw,40px) 0 0; max-width: 34em;
  font-size: clamp(15.5px, 1.5vw, 17.5px); line-height: 1.78; color: var(--ink-2);
}
.hero .sub b { color: var(--ink); font-weight: 700; }

/* 계측 띠 — 머리 아래에 붙는 눈금 읽기 */
.gauge {
  margin-top: clamp(40px, 6vw, 72px);
  border-top: 2px solid var(--ink);
  display: grid; gap: 0;
  grid-template-columns: repeat(2, 1fr);
}
.gauge > div { padding: 20px 20px 22px; position: relative; }
.gauge > div::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 18px; width: 1px; background: var(--rule);
}
.gauge > div:nth-child(odd) { padding-left: 0; }
.gauge > div:nth-child(odd)::before { display: none; }
.gauge > div:nth-child(n+3) { border-top: 1px solid var(--hair); }
@media (min-width: 760px) {
  .gauge { grid-template-columns: repeat(4, 1fr); }
  .gauge > div:nth-child(odd) { padding-left: 20px; }
  .gauge > div:nth-child(odd)::before { display: block; }
  .gauge > div:first-child { padding-left: 0; }
  .gauge > div:first-child::before { display: none; }
  .gauge > div:nth-child(n+3) { border-top: 0; }
}
.gauge .v {
  font-size: clamp(27px, 3.4vw, 40px); font-weight: 800; line-height: 1;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums;
}
.gauge .v span, .gauge .v small { font-size: .46em; font-weight: 700; margin-left: 3px; letter-spacing: -.01em; }
.gauge .k { font-size: 12.5px; line-height: 1.55; color: var(--ink-3); margin-top: 9px; max-width: 15em; }

/* ── 표제 (분야 페이지) ──────────────────────────────── */
.phead { padding: clamp(44px, 7vw, 86px) 0 clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--hair); }
.phead .tag { display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 0 0 22px; }
.phead .tag i { font-style: normal; width: 26px; height: 2px; background: var(--signal); display: block; }
.phead h1 {
  margin: 0; font-weight: 800; letter-spacing: -.04em;
  font-size: clamp(30px, 5.6vw, 62px); line-height: 1.08;
}
.phead .en { margin: 16px 0 0; font-size: 13.5px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.phead .abs {
  margin: clamp(26px,3.6vw,38px) 0 0; max-width: 44em;
  font-size: 15.5px; line-height: 1.8; color: var(--ink-2);
}
.phead .abs b { color: var(--ink); font-weight: 700; }

/* 머리글 요약 — 색으로 본문과 구분한다 */
.phead .abs, .lead {
  border-left: 3px solid var(--signal);
  background: linear-gradient(90deg, #FDF4E4 0%, rgba(253,244,228,.45) 55%, rgba(253,244,228,0) 100%);
  padding: 19px 24px 19px 21px; border-radius: 0 7px 7px 0;
}
.phead .abs > b:first-child { color: var(--signal-d); }
@media (max-width: 560px) { .phead .abs, .lead { padding: 16px 16px 16px 15px; } }

/* ── 본문 ─────────────────────────────────────────────── */
main { padding-bottom: 40px; position: relative; }
/* 왼쪽 눈금 레일 — 넓은 화면에서만 */
@media (min-width: 1240px) {
  main::before {
    content: ""; position: absolute; left: calc((100% - var(--max)) / 2 - 26px);
    top: 56px; bottom: 60px; width: 9px; pointer-events: none;
    background:
      linear-gradient(var(--rule), var(--rule)) left / 1px 100% no-repeat,
      repeating-linear-gradient(to bottom, var(--rule) 0 1px, transparent 1px 26px);
  }
}

section { padding-top: clamp(52px, 7vw, 86px); scroll-margin-top: 76px; }

h2 {
  margin: 0 0 clamp(24px, 3vw, 34px);
  font-weight: 800; letter-spacing: -.032em;
  font-size: clamp(21px, 2.6vw, 29px); line-height: 1.25;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px;
}
h2 .no {
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3);
  font-variant-numeric: tabular-nums; align-self: center;
}
h2 .t { display: inline; }
h2::after { content: ""; height: 1px; background: var(--rule); grid-column: 1 / -1; margin-top: 14px; }

h3 {
  margin: clamp(34px,4vw,46px) 0 13px; font-size: 16.5px; font-weight: 700; letter-spacing: -.02em;
  display: flex; align-items: baseline; gap: 11px;
}
h3 .no { font-size: 12.5px; font-weight: 600; color: var(--signal-d); font-variant-numeric: tabular-nums; flex: none; }
h4 { margin: 20px 0 7px; font-size: 14.5px; font-weight: 700; }

p { margin: 0 0 13px; max-width: 42em; }
p:last-child { margin-bottom: 0; }
.lead { font-size: 16.5px; line-height: 1.8; color: var(--ink-2); max-width: 40em; }
.lead b { color: var(--ink); font-weight: 700; }
.small { font-size: 13.5px; color: var(--ink-2); }
strong, b { font-weight: 700; }

ul.body, ol.body { margin: 0 0 13px; padding-left: 1.2em; max-width: 42em; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; max-width: 44em; }
ul.plain li { padding-left: 20px; position: relative; color: var(--ink-2); }
ul.plain li::before {
  content: ""; position: absolute; left: 0; top: .74em; width: 7px; height: 2px; background: var(--ink);
}
ul.plain b { color: var(--ink); }

/* ── 분야 목록 (메인) ────────────────────────────────── */
.index { border-top: 2px solid var(--ink); }
.index a {
  display: grid; align-items: start; gap: 4px 26px;
  grid-template-columns: 1fr; padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  transition: padding-left .22s cubic-bezier(.2,.7,.3,1), background-color .22s;
}
@media (min-width: 880px) {
  .index a { grid-template-columns: 58px minmax(0,1fr) minmax(0,1.05fr) 28px; align-items: center; padding: 30px 0; }
}
.index a:hover { background: var(--paper-2); padding-left: 14px; }
.index .n { font-size: 13px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.index a:hover .n { color: var(--signal-d); }
.index .ttl { font-size: clamp(20px, 2.6vw, 28px); font-weight: 800; letter-spacing: -.035em; line-height: 1.2; }
.index .ttl small { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-top: 6px; }
.index .dsc { font-size: 14.5px; color: var(--ink-2); line-height: 1.68; }
.index .go { justify-self: end; width: 20px; height: 20px; position: relative; align-self: center; display: none; }
@media (min-width: 880px) { .index .go { display: block; } }
.index .go::before, .index .go::after {
  content: ""; position: absolute; background: var(--ink-3); transition: background-color .2s, transform .22s;
}
.index .go::before { left: 2px; right: 2px; top: 9px; height: 1.5px; }
.index .go::after { right: 2px; top: 4px; width: 9px; height: 9px; border-right: 1.5px solid var(--ink-3);
                    border-top: 1.5px solid var(--ink-3); background: none; transform: rotate(45deg); }
.index a:hover .go::before { background: var(--signal-d); transform: translateX(3px); }
.index a:hover .go::after { border-color: var(--signal-d); transform: rotate(45deg) translate(2px,-2px); }

/* ── 수치 ─────────────────────────────────────────────── */
.figs { display: grid; gap: 0; grid-template-columns: repeat(2, 1fr); border-top: 2px solid var(--ink); margin: 26px 0; }
@media (min-width: 760px) { .figs { grid-template-columns: repeat(4, 1fr); } }
.figs > div { padding: 18px 18px 20px; position: relative; }
.figs > div::before { content: ""; position: absolute; left: 0; top: 0; bottom: 16px; width: 1px; background: var(--rule); }
.figs > div:nth-child(odd) { padding-left: 0; }
.figs > div:nth-child(odd)::before { display: none; }
.figs > div:nth-child(n+3) { border-top: 1px solid var(--hair); }
@media (min-width: 760px) {
  .figs > div:nth-child(odd) { padding-left: 18px; }
  .figs > div:nth-child(odd)::before { display: block; }
  .figs > div:first-child { padding-left: 0; }
  .figs > div:first-child::before { display: none; }
  .figs > div:nth-child(n+3) { border-top: 0; }
}
.figs .v { font-size: clamp(25px, 3vw, 34px); font-weight: 800; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.figs .v span, .figs .v small { font-size: .46em; font-weight: 700; margin-left: 3px; }
.figs .k { font-size: 12.5px; line-height: 1.55; color: var(--ink-3); margin-top: 8px; }

/* ── 그림 ─────────────────────────────────────────────── */
figure { margin: 30px 0; }
figure .board { background: var(--panel); border: 1px solid var(--hair); border-radius: 6px; padding: 22px 20px 18px; }
figure svg { width: 100%; height: auto; display: block; }
figure .board img { width: 100%; height: auto; display: block; border-radius: 3px; }
figure video { width: 100%; display: block; border-radius: 6px; background: #0e0e10; }
figcaption { font-size: 12.5px; line-height: 1.65; color: var(--ink-3); margin-top: 11px; max-width: 48em; }
figcaption b { color: var(--ink); font-weight: 700; margin-right: 8px; }

ol.legend { list-style: none; counter-reset: lg; margin: 18px 0 0; padding: 0; display: grid; gap: 11px 26px; font-size: 13px; line-height: 1.6; }
@media (min-width: 700px) { ol.legend { grid-template-columns: 1fr 1fr; } }
ol.legend li { counter-increment: lg; position: relative; padding-left: 28px; color: var(--ink-2); }
ol.legend li::before {
  content: counter(lg); position: absolute; left: 0; top: .1em; width: 19px; height: 19px;
  border-radius: 50%; background: var(--ink); color: var(--paper);
  font-size: 11px; font-weight: 700; text-align: center; line-height: 19px; font-variant-numeric: tabular-nums;
}
ol.legend b { color: var(--ink); display: block; font-weight: 700; }

/* ── 표 ───────────────────────────────────────────────── */
.tcap { font-size: 12.5px; color: var(--ink-3); margin: 30px 0 9px; }
.tcap b { color: var(--ink); font-weight: 700; margin-right: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table caption { text-align: left; font-size: 12.5px; color: var(--ink-3); padding-bottom: 9px; }
thead th { text-align: left; font-weight: 700; font-size: 13px; padding: 9px 14px 9px 0;
           border-bottom: 2px solid var(--ink); white-space: nowrap; }
tbody td, tbody th { text-align: left; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--hair);
                     vertical-align: top; font-weight: 400; color: var(--ink-2); }
tbody th { font-weight: 700; color: var(--ink); width: 11em; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 2px solid var(--ink); }
td.n, th.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
td b { color: var(--ink); font-variant-numeric: tabular-nums; }
.scrollx { overflow-x: auto; }
.scrollx table { min-width: 560px; }

/* ── 상자 ─────────────────────────────────────────────── */
.box { border-left: 2px solid var(--ink); padding: 2px 0 2px 20px; margin: 26px 0; max-width: 46em; }
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.formula { font-family: var(--mono); font-size: 14px; line-height: 1.9; background: var(--paper-2);
           border-radius: 5px; padding: 14px 16px; margin: 14px 0; overflow-x: auto; letter-spacing: 0; }
.caveat { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin: 26px 0;
          padding: 16px 18px; background: #FBF4E6; border-left: 2px solid var(--signal); border-radius: 0 5px 5px 0; }
.caveat b { color: var(--ink); }

.kv { margin: 22px 0; border-top: 1px solid var(--rule); }
.kv > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding: 12px 0;
            border-bottom: 1px solid var(--hair); }
.kv dt { font-weight: 700; font-size: 14px; }
.kv dd { margin: 0; color: var(--ink-2); font-size: 14px; }

.two { display: grid; gap: 26px; }
@media (min-width: 820px) { .two { grid-template-columns: 1fr 1fr; gap: 34px; } }

/* ── 단추 ─────────────────────────────────────────────── */
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 0; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 12px 20px; border-radius: 999px;
       font-size: 14px; font-weight: 700; background: var(--ink); color: var(--paper);
       transition: transform .18s cubic-bezier(.2,.7,.3,1), background-color .18s; }
.btn:hover { transform: translateY(-1px); background: #26262a; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.btn.ghost:hover { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--ink-3); }

/* ── 꼬리 ─────────────────────────────────────────────── */
footer { margin-top: clamp(64px, 9vw, 110px); background: var(--field); color: #9A9C98; }
footer .shell { padding-top: 46px; padding-bottom: 46px; display: grid; gap: 30px; }
@media (min-width: 820px) { footer .shell { grid-template-columns: 1.1fr 1fr; align-items: start; } }
footer .mk { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.02em; margin: 0 0 10px; }
footer p { color: #9A9C98; font-size: 13.5px; margin: 0 0 5px; max-width: 32em; }
footer a { color: #E6E7E4; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #4A4C49; }
footer a:hover { text-decoration-color: var(--signal); }
footer .cols { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
footer .cols h5 { margin: 0 0 9px; font-size: 12px; font-weight: 700; color: #6E716D; }
footer .cols a { display: block; margin: 4px 0; text-decoration: none; font-size: 13.5px; }
footer .cols a:hover { color: var(--signal); }
footer .fine { grid-column: 1 / -1; border-top: 1px solid #27282A; padding-top: 18px; font-size: 12.5px; color: #6E716D; }

@media (max-width: 520px) {
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  tbody th { width: auto; }
}

/* ── 한 번만 움직인다 ───────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .82s cubic-bezier(.16,.84,.24,1) both; }
  .rise:nth-child(2) { animation-delay: .07s; }
  .rise:nth-child(3) { animation-delay: .13s; }
  .rise.d1 { animation-delay: .14s; } .rise.d2 { animation-delay: .26s; } .rise.d3 { animation-delay: .40s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
