
:root {
  --paper: #f4eddf;
  --paper-2: #ebe2cf;
  --ink: #24211d;
  --orange: #f47a32;
  --yellow: #ffd84b;
  --muted: #685e50;
  --rule: #b9ae9a;
  --mono: "Sunshine Mono", ui-monospace, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --pad: clamp(20px, 5vw, 64px);
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.75 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
code, pre, textarea { font-family: var(--mono); }
p code, li code { font-size: 0.94em; background: var(--paper-2); padding: 0 4px; border-radius: 3px; }
h2, h3 { font-family: var(--mono); font-weight: 700; line-height: 1.3; margin: 0; }
h2 { font-size: clamp(26px, 4vw, 40px); margin-bottom: 16px; }
h3 { font-size: 20px; margin-bottom: 8px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--yellow); }
::selection { background: var(--yellow); color: var(--ink); }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 10; }
.skip:focus { top: 12px; }

.top, main > section, .foot { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px;
  padding-block: 12px; border-bottom: 1px solid var(--rule);
}
.brand { font: 700 18px/44px var(--mono); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; font-family: var(--mono); font-size: 15px; }
.top nav a:hover { text-decoration: underline; }

main > section { padding-block: clamp(56px, 9vw, 112px); border-bottom: 1px solid var(--rule); }
.note { color: var(--muted); max-width: 64ch; }

/* 첫 화면: 글자가 놓인 칸을 그대로 보여 준다. 1ch = 영문 한 칸 */
.hero { padding-top: clamp(40px, 7vw, 88px); }
.version { font: 400 15px/1 var(--mono); color: var(--muted); margin: 0 0 28px; }
.grid-text { margin: 0; font-family: var(--mono); font-weight: 700; letter-spacing: 0; }
.grid-text span {
  display: block; width: fit-content; max-width: 100%;
  background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px);
  background-size: 1ch 100%;
  border: 1px solid var(--rule); border-width: 1px 1px 1px 0;
}
.hero-en { font-size: clamp(26px, 7.4vw, 76px); line-height: 1.3; }
.hero-ko { font-size: clamp(56px, 19vw, 208px); line-height: 1.18; border-top: 0 !important; background-color: var(--yellow); }
.tagline { font: 700 clamp(20px, 3vw, 30px)/1.4 var(--mono); margin: 32px 0 8px; }
.lead { max-width: 40em; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px;
  border-radius: 4px; font: 650 15px/1.2 var(--sans); text-decoration: none; border: 2px solid var(--ink);
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--yellow); color: var(--ink); text-decoration: none; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--paper-2); text-decoration: none; }

/* 써 보기 */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 24px 0 16px; }
.size { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-right: 8px; font-size: 15px; }
.size span { white-space: nowrap; }
.size output { font-family: var(--mono); display: inline-block; min-width: 4ch; }
.size input { width: min(220px, 52vw); min-height: 44px; accent-color: var(--ink); }
.toggle {
  min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 4px; cursor: pointer;
  border: 2px solid var(--ink); background: transparent; color: var(--ink); font: 600 15px/1 var(--sans);
}
.toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.toggle[aria-pressed="true"]::before { content: "✓ "; }

.editor {
  display: block; width: 100%; min-height: 22em; resize: vertical; padding: 20px 22px;
  border: 0; border-radius: 6px; background: var(--ink); color: var(--paper); caret-color: var(--yellow);
  font-size: 16px; line-height: 1.6; tab-size: 2; white-space: pre; overflow: auto;
  font-feature-settings: "calt" 1; font-variant-ligatures: contextual;
}
.editor.light { background: #fffaf0; color: var(--ink); caret-color: var(--orange); box-shadow: inset 0 0 0 1px var(--rule); }
.editor.bold { font-weight: 700; }
.editor.no-liga { font-feature-settings: "calt" 0; font-variant-ligatures: no-contextual; }

/* 특징 */
.feature {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px 48px; align-items: center;
  padding-block: 36px; border-top: 1px solid var(--rule);
}
.feature:first-of-type { border-top: 0; padding-top: 8px; }
.feature-text p { margin: 0; color: var(--muted); }
.specimen { margin: 0; font-family: var(--mono); background: var(--ink); color: var(--paper); border-radius: 6px; padding: 20px 22px; overflow-x: auto; }
.specimen.cells {
  font-size: clamp(17px, 2.4vw, 24px); line-height: 1.7;
  background-image: linear-gradient(to right, rgba(244, 237, 223, 0.18) 1px, transparent 1px);
  background-size: 1ch 100%; background-position: 22px 0; background-origin: padding-box;
}
.specimen.cells code { font: inherit; }
.big { font-size: clamp(38px, 7vw, 72px); line-height: 1.2; white-space: nowrap; }
.big.round { font-size: clamp(30px, 3.8vw, 46px); white-space: normal; }
.liga-table { display: grid; gap: 6px; font-size: clamp(20px, 3vw, 30px); }
.liga-table div { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.liga-table .off { font-feature-settings: "calt" 0; font-variant-ligatures: no-contextual; color: #cfc4b0; }
.liga-head { font: 400 14px/1.4 var(--sans); color: #cfc4b0; }
.sizes p, .weights p { margin: 0; line-height: 1.8; }
.sizes span, .weights span { display: inline-block; width: 5.5ch; color: #cfc4b0; font-weight: 400; }
.weights { font-size: clamp(20px, 3vw, 30px); }
.w400 { font-weight: 400; }
.w700 { font-weight: 700; }

/* 설치 */
.os { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 48px; margin: 28px 0 40px; }
.os ol { margin: 0; padding-left: 1.4em; }
.code-block { position: relative; margin-top: 12px; }
.code-block pre {
  margin: 0; padding: 22px; padding-top: 60px; border-radius: 6px; background: var(--ink); color: var(--paper);
  font-size: 14.5px; line-height: 1.6; overflow-x: auto;
}
.copy {
  position: absolute; top: 10px; right: 10px; min-height: 44px; min-width: 64px; padding: 0 16px; cursor: pointer;
  border: 0; border-radius: 4px; background: var(--yellow); color: var(--ink); font: 650 15px/1 var(--sans);
}
.copy:hover { background: var(--paper); }
.copy-status { min-height: 1.75em; margin: 8px 0 0; color: var(--muted); font-size: 15px; }

/* 만든 기록 */
.story-lead { max-width: 40em; font-size: 19px; margin: 0 0 40px; }
.chapters { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--ink); }
.chapters li { position: relative; padding: 0 0 36px 28px; max-width: 46em; }
.chapters li:last-child { padding-bottom: 0; }
.chapters li::before {
  content: ""; position: absolute; left: -8px; top: 8px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
}
.chapters li:last-child::before { background: var(--yellow); }
.chapters h3 { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: baseline; }
.chapters h3 a { display: inline-flex; flex-wrap: wrap; gap: 0 14px; align-items: baseline; min-height: 44px; text-decoration-thickness: 1px; }
.chapters p { margin: 0 0 10px; color: var(--muted); }
.chapters .v { font-size: 16px; padding: 2px 8px; border-radius: 3px; background: var(--ink); color: var(--paper); }
.chapters li:last-child .v { background: var(--yellow); color: var(--ink); }

/* 상태·라이선스 */
.status ul { padding-left: 1.2em; max-width: 64ch; }
.status li { margin-bottom: 8px; }
.license p { max-width: 64ch; }

.foot { padding-block: 40px 56px; font-size: 15px; color: var(--muted); }
.foot strong { color: var(--ink); font-family: var(--mono); margin-right: 8px; }
.foot p { margin: 0 0 6px; }

@media (max-width: 760px) {
  .feature { grid-template-columns: minmax(0, 1fr); }
  .top nav a { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
