/* 쉽게 하는 문자열 조작 — "highlighter & ink": crisp cool paper, deep ink navy, a lemon highlighter swipe for whatever gets picked or cut. */
:root {
  --bg: #f4f6fb; --panel: #ffffff; --sunk: #eef1f8; --line: #e1e6f0; --line-strong: #cfd6e4;
  --fg: #151c33; --muted: #5d6680; --ink: #1b2440; --ink-fg: #ffffff;
  --hl: #ffe45c; --hl-fg: #151c33; --mark: #ffe45c; --err: #d92d4a; --ok: #12996f;
  --shadow: 0 1px 2px rgba(21, 28, 51, .05), 0 6px 18px rgba(21, 28, 51, .06);
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --mono: "JetBrains Mono", "D2Coding", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1222; --panel: #161b2e; --sunk: #12172a; --line: #262d45; --line-strong: #333b57;
  --fg: #e8ecf7; --muted: #98a1bb; --ink: #ffe45c; --ink-fg: #151c33;
  --hl: #ffe45c; --hl-fg: #151c33; --mark: #7a6a12; --err: #ff7d92; --ok: #4fd1a5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0e1222; --panel: #161b2e; --sunk: #12172a; --line: #262d45; --line-strong: #333b57;
  --fg: #e8ecf7; --muted: #98a1bb; --ink: #ffe45c; --ink-fg: #151c33;
  --hl: #ffe45c; --hl-fg: #151c33; --mark: #7a6a12; --err: #ff7d92; --ok: #4fd1a5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark }

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--sans); word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
a { color: inherit }
[hidden] { display: none !important }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.swipe { background: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 92%, transparent 92%); padding: 0 .08em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .swipe { background: linear-gradient(transparent 62%, rgba(255, 228, 92, .45) 62%, rgba(255, 228, 92, .45) 94%, transparent 94%); } }
:root[data-theme="dark"] .swipe { background: linear-gradient(transparent 62%, rgba(255, 228, 92, .45) 62%, rgba(255, 228, 92, .45) 94%, transparent 94%); }

/* header */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -.03em; white-space: nowrap; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--hl); color: var(--hl-fg); font-size: 15px; font-weight: 900; transform: rotate(-6deg); box-shadow: 2px 2px 0 var(--fg); }
.head-nav { display: flex; gap: 4px; }
.head-nav a { color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.head-nav a:hover { color: var(--fg); background: var(--sunk); }

/* footer */
.site-foot { margin-top: 24px; border-top: 1px solid var(--line); padding-block: 36px 40px; font-size: 14px; color: var(--muted); }
.foot-in { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.foot-in strong { color: var(--fg); font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.foot-in p { margin: 8px 0 0; max-width: 38ch; }
.foot-in nav { display: flex; flex-direction: column; gap: 7px; }
.foot-in nav b { color: var(--fg); font-size: 13px; margin-bottom: 2px; }
.foot-in a { color: var(--muted); text-decoration: none; }
.foot-in a:hover { color: var(--fg); }
.copyright { margin: 28px auto 0; font-size: 13px; }

/* type */
main { padding-block: 32px 48px; display: flex; flex-direction: column; gap: 36px; }
h1 { font-size: clamp(28px, 3.6vw, 38px); line-height: 1.22; margin: 0; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.35; margin: 0; letter-spacing: -.025em; font-weight: 800; text-wrap: balance; }
h3 { font-size: 17px; line-height: 1.4; margin: 0; letter-spacing: -.02em; font-weight: 700; }
.lead { margin: 10px 0 0; color: var(--muted); max-width: 60ch; font-size: 17px; }
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 12px; display: flex; gap: 6px; align-items: center; }
.crumb a { text-decoration: none; font-weight: 600; }
.crumb a:hover { color: var(--fg); }

/* tool icon tiles (per-tool --c) */
.ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--panel)); }
.ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.lg { width: 56px; height: 56px; border-radius: 16px; }
.ico.lg svg { width: 28px; height: 28px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico { color: color-mix(in srgb, var(--c) 55%, white); background: color-mix(in srgb, var(--c) 22%, var(--panel)); } }
:root[data-theme="dark"] .ico { color: color-mix(in srgb, var(--c) 55%, white); background: color-mix(in srgb, var(--c) 22%, var(--panel)); }
.tool-title { display: flex; align-items: center; gap: 16px; }

/* tool */
.tool { display: flex; flex-direction: column; gap: 16px; }
.opts { background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); padding: 20px 22px; display: flex; flex-wrap: wrap; gap: 18px 40px; align-items: flex-start; }
.opt-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.opt-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input { font: 15px var(--sans); padding: 9px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--fg); min-width: 0; max-width: 100%; transition: border-color .15s; }
.input:hover { border-color: var(--muted); }
.input:focus { border-color: var(--fg); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--hl) 70%, transparent); }
.input.num { width: 120px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.input.code { width: 104px; font-family: var(--mono); }
.input.wide { width: 240px; font-family: var(--mono); }
.input:disabled { opacity: .45; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--panel); display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.check input::after { content: ""; width: 10px; height: 6px; border: 2.5px solid var(--hl-fg); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .15s; }
.check input:checked { background: var(--hl); border-color: var(--hl); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--sunk); border-radius: 12px; max-width: 100%; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 7px 13px; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 9px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.seg label:hover span { color: var(--fg); }
.seg input:checked + span { background: var(--panel); color: var(--fg); box-shadow: 0 1px 3px rgba(21, 28, 51, .12); }
.seg input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 1px; }
.io { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px 10px; }
.panel-head label, .panel-head .ttl { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.stat { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; background: var(--sunk); padding: 3px 10px; border-radius: 999px; }
.text { display: block; width: 100%; height: 300px; resize: vertical; border: 0; margin: 0; padding: 8px 18px 14px; background: transparent; color: var(--fg); font: 14px/22px var(--mono); white-space: pre; overflow: auto; tab-size: 4; outline: none; font-variant-ligatures: none; }
.text.soft { white-space: pre-wrap; font-family: var(--sans); font-size: 16px; line-height: 26px; }
.text::placeholder { color: var(--muted); opacity: .7; }
.text[readonly] { background: transparent; }
.panel:focus-within { box-shadow: var(--shadow), 0 0 0 2px var(--fg); }
.panel:has(.text[readonly]):focus-within { box-shadow: var(--shadow); }
.editor { position: relative; height: 300px; }
.editor .text, .mirror { position: absolute; inset: 0; height: 100%; resize: none; }
.mirror { margin: 0; padding: 8px 18px 14px; font: 14px/22px var(--mono); white-space: pre; overflow: hidden; color: transparent; pointer-events: none; tab-size: 4; font-variant-ligatures: none; }
.mirror mark { background: var(--mark); color: transparent; border-radius: 3px; }
.panel-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--line); margin-top: auto; }
.btn { font: 600 14px var(--sans); padding: 8px 14px; border: 0; border-radius: 10px; background: var(--sunk); color: var(--fg); cursor: pointer; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--ink-fg); margin-left: auto; padding-inline: 18px; }
.btn.primary:hover { filter: brightness(1.15); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.hint { font-size: 13px; color: var(--muted); }
.hint.err { color: var(--err); font-weight: 600; }

/* char count */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 6px 14px 14px; }
.stat-cell { background: var(--sunk); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-cell b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.25; }
.stat-cell b.small { font-size: 18px; line-height: 1.6; }
.stat-cell span { font-size: 13px; color: var(--muted); }
.stat-cell.key { background: var(--hl); }
.stat-cell.key b, .stat-cell.key span { color: var(--hl-fg); }
.target { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); }
.bar { height: 10px; background: var(--sunk); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 999px; transition: width .25s; }
.bar i.over { background: var(--err); }
.target-msg { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.target-msg.over { color: var(--err); }

/* ads: empty slots take no space until a code is pasted in */
.ad { display: flex; justify-content: center; min-width: 0; overflow: hidden; }
.ad:empty { display: none; }

/* guide */
.guide { display: flex; flex-direction: column; gap: 36px; max-width: 780px; }
.guide section { display: flex; flex-direction: column; gap: 12px; }
.guide p, .guide li { margin: 0; }
.guide ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px; }
.guide ol li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.guide ol li::before { content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--hl); color: var(--hl-fg); font-weight: 800; font-size: 14px; }
.guide ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.guide code, .doc code { font-family: var(--mono); font-size: .88em; background: var(--sunk); padding: 2px 6px; border-radius: 6px; }
.ex { font: 14px/22px var(--mono); background: var(--panel); box-shadow: var(--shadow); border-radius: 14px; padding: 16px 18px; margin: 0; overflow-x: auto; white-space: pre; }
.ex mark { background: var(--mark); color: inherit; border-radius: 3px; }
.ex .dim { color: var(--muted); }
.tbl-wrap { overflow-x: auto; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.tbl { border-collapse: collapse; width: 100%; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td code { background: none; padding: 0; }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 20px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; border: 2px solid var(--muted); border-top: 0; border-left: 0; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); text-decoration: none; min-width: 0; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow), 0 14px 30px rgba(21, 28, 51, .08); }
.card h3 { margin-top: 4px; }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.card .eg { font: 12.5px/20px var(--mono); color: var(--muted); border-top: 1px dashed var(--line-strong); padding-top: 10px; margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .go { position: absolute; top: 22px; right: 20px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); color: var(--muted); transition: background .2s, color .2s; }
.card .go svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.card:hover .go { background: var(--hl); color: var(--hl-fg); }
.section { display: flex; flex-direction: column; gap: 16px; }

/* home */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 24px 8px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.15; }
.points { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.points li { font-size: 14px; font-weight: 600; background: var(--panel); box-shadow: var(--shadow); border-radius: 999px; padding: 6px 14px; display: inline-flex; align-items: center; gap: 7px; }
.points li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.demo { background: var(--panel); border-radius: 22px; box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 14px; transform: rotate(1.2deg); min-width: 0; }
.demo-bar { display: flex; gap: 6px; }
.demo-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.demo pre { margin: 0; font: 14px/26px var(--mono); white-space: pre; overflow: hidden; }
.demo pre mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 1px 0; }
.demo .arrow { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.demo .arrow::before, .demo .arrow::after { content: ""; height: 1px; flex: 1; background: var(--line-strong); }
.demo .res { display: flex; flex-wrap: wrap; gap: 8px; }
.demo .res span { font: 600 14px var(--mono); background: var(--ink); color: var(--ink-fg); padding: 6px 12px; border-radius: 9px; }
.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.notes div { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.notes p { margin: 0; color: var(--muted); font-size: 15px; }
.notes b { font-size: 13px; font-weight: 800; color: var(--hl-fg); background: var(--hl); border-radius: 7px; padding: 2px 8px; align-self: flex-start; }

/* documents */
.doc { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.doc h2 { margin-top: 20px; font-size: 19px; }
.doc p, .doc li { margin: 0; }
.doc ul, .doc ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.doc a { text-decoration-color: var(--hl); text-decoration-thickness: 3px; text-underline-offset: 2px; }
.doc .meta { color: var(--muted); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); background: var(--ink); color: var(--ink-fg); padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .demo { transform: none; }
}
@media (max-width: 760px) {
  .io, .notes { grid-template-columns: minmax(0, 1fr); }
  .text, .editor { height: 220px; }
  .foot-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot-in > div { grid-column: 1 / -1; }
  .head-nav a { padding: 8px 10px; font-size: 14px; }
  .opts { padding: 16px; gap: 18px; }
  .stat-cell b { font-size: 22px; }
  main { padding-block: 22px 40px; }
}
@media (max-width: 400px) {
  .logo { font-size: 16px; gap: 8px; }
  .logo-mark { width: 28px; height: 28px; font-size: 13px; }
  .head-nav a[href*="about"] { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.mailbox { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); box-shadow: var(--shadow); border-radius: 16px; padding: 18px 20px; }
.mailbox b { font: 600 18px var(--mono); user-select: all; min-width: 0; }
