:root {
  color-scheme: light;
  --ink: #17221f;
  --muted: #68736f;
  --green: #123f38;
  --green-2: #20584f;
  --gold: #d7b45d;
  --paper: #f5f3ed;
  --card: #fffdf8;
  --line: #dcded8;
  --shadow: 0 18px 45px rgba(20, 47, 42, .11);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, select, input[type="range"] { cursor: pointer; }

.site-header {
  position: sticky; top: 0; z-index: 50; height: 64px; padding: 0 max(18px, calc((100vw - 1440px) / 2));
  display: flex; align-items: center; justify-content: space-between; background: rgba(245, 243, 237, .9);
  border-bottom: 1px solid rgba(18, 63, 56, .12); backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--green); color: var(--gold); font: 700 22px Georgia, serif; }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 11px; letter-spacing: .14em; }
.candidate-button { min-height: 42px; padding: 0 15px; border: 1px solid #cfd5d1; border-radius: 999px; background: #fff; }
.candidate-button span { color: #c74357; }
.candidate-button[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: #fff; }

.intro { padding: 52px max(18px, calc((100vw - 1380px) / 2)) 32px; background: var(--green); color: #fff; overflow: hidden; position: relative; }
.intro::after { content: "Aa"; position: absolute; right: 4vw; top: -55px; color: rgba(255,255,255,.04); font: 700 clamp(160px, 25vw, 360px)/1 Georgia, serif; pointer-events: none; }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .2em; }
.intro h1 { position: relative; margin: 0; font: 600 clamp(30px, 5vw, 52px)/1.1 Georgia, "Noto Serif KR", serif; letter-spacing: -.04em; }
.intro > p:not(.eyebrow) { position: relative; margin: 12px 0 28px; color: #cfdcd8; font-size: 16px; }
.copy-input-wrap { position: relative; z-index: 1; display: block; max-width: 1120px; }
.copy-input-wrap > span { position: absolute; top: 13px; left: 19px; color: #71807b; font-size: 12px; font-weight: 700; letter-spacing: .05em; }
.copy-input-wrap textarea { width: 100%; min-height: 116px; padding: 40px 60px 18px 18px; resize: none; border: 0; border-radius: 18px; outline: 0; background: #fff; color: #142620; box-shadow: var(--shadow); font: 500 clamp(28px, 5vw, 48px)/1.15 Georgia, serif; }
.copy-input-wrap textarea:focus { box-shadow: 0 0 0 4px rgba(215,180,93,.4), var(--shadow); }
.copy-input-wrap button { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf0ed; color: #54605c; font-size: 22px; }

.filters { padding: 20px max(18px, calc((100vw - 1380px) / 2)); background: #fff; border-bottom: 1px solid var(--line); }
.filter-row { display: flex; align-items: center; gap: 16px; }
.filter-topline { justify-content: space-between; }
.segmented { display: inline-flex; padding: 4px; border-radius: 12px; background: #eef0ec; }
.segmented button { border: 0; border-radius: 9px; padding: 9px 16px; background: transparent; color: #626d68; font-weight: 700; }
.segmented button.active { background: #fff; color: var(--green); box-shadow: 0 2px 8px rgba(30,50,45,.1); }
.search-box { width: min(360px, 42vw); display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf9; }
.search-box input { width: 100%; min-height: 42px; border: 0; outline: 0; background: transparent; }
.chip-scroller { display: flex; gap: 8px; margin: 18px 0 13px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.chip-scroller button, .type-filter button { flex: 0 0 auto; min-height: 38px; border: 1px solid #d9ddda; border-radius: 999px; padding: 0 14px; background: #fff; color: #46534f; font-weight: 700; }
.chip-scroller button.active { border-color: var(--green); background: var(--green); color: #fff; }
.type-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.type-filter > span { margin-right: 5px; color: var(--muted); font-size: 13px; font-weight: 800; }
.type-filter button { min-height: 32px; font-size: 13px; }
.type-filter button.active { border-color: #7da99f; background: #e0eee9; color: var(--green); }
.type-filter .reset { margin-left: auto; border: 0; text-decoration: underline; color: #69736f; }

.workspace { max-width: 1440px; margin: 0 auto; padding: 22px 30px 80px; }
.result-heading { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.result-heading strong { color: var(--green); font-size: 22px; }
#filterSummary { margin-left: 7px; color: var(--muted); font-size: 13px; }
.view-actions { display: flex; gap: 8px; }
.view-actions button { min-height: 40px; padding: 0 15px; border: 1px solid #cfd5d1; border-radius: 10px; background: #fff; font-weight: 750; }
.view-actions button:not(:disabled):hover { border-color: var(--green); }
.view-actions button:disabled { opacity: .45; cursor: not-allowed; }
.mobile-control { display: none; }
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 22px; align-items: start; }

.control-panel { position: sticky; top: 82px; max-height: calc(100vh - 96px); overflow-y: auto; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 26px rgba(26,48,41,.06); }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-header strong { font-size: 17px; }
fieldset { min-width: 0; padding: 0; margin: 0 0 19px; border: 0; }
legend { width: 100%; margin-bottom: 8px; color: #53615c; font-size: 13px; font-weight: 800; }
legend output { float: right; color: var(--green); }
input[type="range"] { width: 100%; accent-color: var(--green); }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mode-grid button, .icon-buttons button { min-height: 36px; border: 1px solid #d9ddda; border-radius: 8px; background: #fff; font-size: 13px; }
.mode-grid button.active, .icon-buttons button.active { border-color: var(--green); background: var(--green); color: #fff; }
.segmented.four { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.segmented.four button { padding: 8px 4px; font-size: 12px; }
.split-control { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.icon-buttons { display: flex; }
.icon-buttons button { width: 36px; }
.icon-buttons button:first-child { text-align: left; }
.icon-buttons button:nth-child(3) { text-align: right; }
select { width: 100%; min-height: 36px; padding: 0 8px; border: 1px solid #d9ddda; border-radius: 8px; background: #fff; }
.color-editors { display: grid; gap: 8px; }
.color-editor { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px 7px 12px; border: 1px solid #d9ddda; border-radius: 11px; color: #53615c; font-size: 13px; font-weight: 800; }
.color-value-wrap { display: flex; align-items: center; gap: 7px; }
.color-preview { width: 30px; height: 30px; flex: 0 0 auto; border: 2px solid #fff; border-radius: 50%; background: var(--selected-color); box-shadow: 0 0 0 1px #bbc3bf; }
.color-editor input { width: 84px; min-height: 34px; padding: 0 8px; border: 1px solid #d9ddda; border-radius: 8px; outline: 0; background: #f8faf8; color: #27332f; font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.color-editor input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,63,56,.12); }
.color-editor input.invalid { border-color: #c74357; background: #fff4f5; color: #a5253a; }
.color-help { margin: 8px 2px 0; color: #74807c; font-size: 11px; line-height: 1.45; }
.preset-block { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; color: #53615c; font-size: 12px; font-weight: 800; }
.swatches { display: flex; gap: 5px; }
.swatches button { width: 34px; height: 34px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #cfd4d0; }
.swatches button:hover { box-shadow: 0 0 0 2px var(--green); }
.foil-note { margin: 16px 0 0; color: #7a6c4c; font-size: 11px; line-height: 1.5; }
.apply-controls { display: none; width: 100%; min-height: 54px; margin-top: 18px; border: 0; border-radius: 12px; background: var(--green); color: #fff; font-size: 16px; font-weight: 850; box-shadow: 0 8px 20px rgba(18,63,56,.2); }

.font-results { min-width: 0; }
.font-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.font-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.font-card:hover { transform: translateY(-2px); border-color: #b9c8c3; box-shadow: 0 12px 28px rgba(25,55,47,.1); }
.font-preview { position: relative; isolation: isolate; min-height: 210px; padding: 36px 28px 26px; display: flex; align-items: center; overflow: hidden; background: var(--preview-bg, #fffdf8); color: var(--preview-color, #193c36); text-align: var(--preview-align, center); transition: background .15s; }
.font-preview.loading .preview-text { opacity: .18; }
.font-preview.loading::after { content: ""; position: absolute; z-index: 6; left: 14%; right: 14%; top: 92px; height: 22px; border-radius: 8px; background: linear-gradient(90deg,#ecefea 25%,#f7f8f5 50%,#ecefea 75%); background-size: 220% 100%; animation: shimmer 1.15s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.preview-text { position: relative; z-index: 3; width: 100%; overflow-wrap: anywhere; white-space: pre-line; font-size: var(--preview-size, 52px); font-weight: var(--preview-weight, 400); letter-spacing: var(--preview-spacing, 0); line-height: 1.16; transition: opacity .2s; }
.scene-top, .scene-logo-mark, .scene-caption, .scene-bottom, .scene-art { display: none; }

.font-card.mode-logo .font-preview { min-height: 240px; flex-direction: column; justify-content: center; padding: 38px 24px 30px; }
.font-card.mode-logo .scene-logo-mark { position: relative; z-index: 3; width: 42px; height: 42px; margin-bottom: 15px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 18px; }
.font-card.mode-logo .preview-text { overflow-wrap: normal; word-break: keep-all; text-transform: uppercase; font-size: clamp(26px, calc(var(--preview-size, 52px) * .78), 58px); }
.font-card.mode-logo .scene-caption { position: relative; z-index: 3; display: block; margin-top: 16px; font: 700 10px/1.2 Inter, sans-serif; letter-spacing: .2em; opacity: .72; }
.font-card.mode-card .font-preview { min-height: 0; aspect-ratio: 90/50; margin: 18px; padding: 22px; border-radius: 3px; box-shadow: 0 8px 24px rgba(20,25,23,.18); }

.font-card.mode-sign .font-preview { min-height: 250px; margin: 18px 18px 0; padding: 48px 24px 58px; align-items: center; background: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 34px), linear-gradient(145deg, #8c8982, #615f5b); color: #fff; box-shadow: inset 0 -34px 0 rgba(32,31,29,.32), 0 10px 22px rgba(0,0,0,.16); }
.font-card.mode-sign .font-preview::before { content: ""; position: absolute; left: 9%; right: 9%; bottom: 27px; height: 10px; border-radius: 2px; background: rgba(18,18,17,.52); box-shadow: 0 8px 12px rgba(0,0,0,.25); }
.font-card.mode-sign .preview-text { padding: 30px 20px; border: 6px solid #252725; border-radius: 3px; background: var(--preview-bg); color: var(--preview-color); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15), 0 14px 25px rgba(0,0,0,.34); }
.font-card.mode-sign .scene-caption { position: absolute; z-index: 3; left: 0; right: 0; bottom: 9px; display: block; color: rgba(255,255,255,.72); font: 700 9px/1.2 Inter, sans-serif; letter-spacing: .18em; text-align: center; }

.font-card.mode-sns .font-preview { min-height: 0; aspect-ratio: 1; margin: 18px 18px 0; padding: 72px 28px 64px; background-color: var(--preview-bg); background-image: linear-gradient(145deg, rgba(255,255,255,.34), transparent 45%); }
.font-card.mode-sns .scene-art { position: absolute; z-index: 1; display: block; border: 1px solid currentColor; opacity: .14; pointer-events: none; }
.font-card.mode-sns .scene-art-one { width: 62%; aspect-ratio: 1; right: -18%; top: 9%; border-radius: 50%; }
.font-card.mode-sns .scene-art-two { width: 42%; aspect-ratio: 1; left: -16%; bottom: 10%; border-radius: 42% 58% 55% 45%; transform: rotate(28deg); }
.font-card.mode-sns .scene-top { position: absolute; z-index: 4; left: 16px; right: 16px; top: 15px; display: flex; align-items: center; gap: 9px; font-family: Inter, sans-serif; text-align: left; }
.font-card.mode-sns .scene-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--preview-color); color: var(--preview-bg); font-size: 13px; font-weight: 900; }
.font-card.mode-sns .scene-account { min-width: 0; flex: 1; }
.font-card.mode-sns .scene-account strong, .font-card.mode-sns .scene-account small { display: block; }
.font-card.mode-sns .scene-account strong { font-size: 11px; letter-spacing: .02em; }
.font-card.mode-sns .scene-account small { margin-top: 2px; font-size: 8px; opacity: .65; }
.font-card.mode-sns .scene-more { font-size: 12px; letter-spacing: .1em; }
.font-card.mode-sns .scene-bottom { position: absolute; z-index: 4; left: 17px; right: 17px; bottom: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; font-family: Inter, sans-serif; text-align: left; }
.font-card.mode-sns .scene-bottom > span { font-size: 16px; letter-spacing: .08em; }
.font-card.mode-sns .scene-bottom small { max-width: 48%; font-size: 8px; line-height: 1.3; opacity: .68; text-align: right; }
.font-meta { display: flex; align-items: center; gap: 10px; padding: 14px 15px; border-top: 1px solid rgba(110,120,115,.14); background: #fff; }
.font-name { min-width: 0; flex: 1; }
.font-name strong, .font-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-name strong { font-size: 15px; }
.font-name span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.card-action { width: 40px; height: 40px; padding: 0; border: 1px solid #dce0dd; border-radius: 10px; background: #fff; font-size: 17px; }
.favorite-action.active { border-color: #e4a8b1; background: #fff0f2; color: #bd2942; }
.compare-action.active { border-color: #80a69d; background: #e2f0eb; color: var(--green); }
.detail-action { font-size: 21px; }
.support-badge { position: absolute; top: 11px; left: 11px; padding: 5px 8px; border-radius: 999px; background: rgba(15,31,27,.7); color: #fff; font-size: 10px; backdrop-filter: blur(8px); }
.load-more { display: block; width: min(380px, 100%); min-height: 48px; margin: 24px auto 0; border: 1px solid #bdc9c5; border-radius: 12px; background: #fff; font-weight: 800; }
.empty-state { padding: 80px 20px; border: 1px dashed #cbd1cd; border-radius: 16px; text-align: center; background: rgba(255,255,255,.5); }
.empty-state strong { font-size: 20px; }
.empty-state p { color: var(--muted); }
.empty-state button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--green); color: #fff; }

dialog { padding: 0; border: 0; color: var(--ink); box-shadow: 0 25px 80px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(9,24,20,.62); backdrop-filter: blur(4px); }
.font-dialog { width: min(640px, calc(100% - 28px)); border-radius: 18px; overflow: visible; }
.dialog-close { position: absolute; right: 13px; top: 13px; z-index: 1; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 24px; }
.dialog-preview { min-height: 220px; padding: 55px 30px 35px; display: grid; place-items: center; text-align: center; background: var(--green); color: var(--gold); overflow-wrap: anywhere; }
.dialog-preview div { white-space: pre-line; line-height: 1.15; }
.dialog-body { padding: 25px; }
.dialog-body h2 { margin: 0 0 6px; font: 600 28px Georgia, serif; }
.dialog-tags { color: var(--muted); font-size: 13px; }
.info-list { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; margin: 22px 0; font-size: 14px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 700; }
.license-note { padding: 12px; border-radius: 9px; background: #f5f0df; color: #6b5d39; font-size: 12px; line-height: 1.5; }
.dialog-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dialog-buttons a, .dialog-buttons button { min-height: 42px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid #cfd5d1; border-radius: 9px; background: #fff; color: inherit; text-decoration: none; font-weight: 800; }
.dialog-buttons a:first-child { border-color: var(--green); background: var(--green); color: #fff; }
.css-code { margin-top: 12px; padding: 12px; border-radius: 8px; background: #17221f; color: #d6e5df; overflow-x: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

.compare-dialog { width: min(1240px, calc(100% - 30px)); max-height: calc(100vh - 30px); border-radius: 20px; background: var(--paper); }
.compare-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; background: rgba(245,243,237,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.compare-header span, .compare-header strong { display: block; }
.compare-header span { color: var(--muted); font-size: 12px; }
.compare-header strong { margin-top: 3px; font-size: 18px; }
.compare-header button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; font-size: 24px; }
.compare-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px; }
.compare-item { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.compare-sample { min-height: 230px; padding: 25px; display: flex; align-items: center; overflow-wrap: anywhere; white-space: pre-line; }
.compare-label { padding: 13px 15px; border-top: 1px solid var(--line); font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 100; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 999px; background: #17221f; color: #fff; opacity: 0; pointer-events: none; transition: .2s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sheet-backdrop { display: none; }

@media (max-width: 1050px) {
  .font-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .site-header { height: 58px; }
  .intro { padding-top: 35px; }
  .intro > p:not(.eyebrow) { font-size: 14px; }
  .copy-input-wrap textarea { min-height: 102px; }
  .filter-topline { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .segmented { align-self: flex-start; }
  .type-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .type-filter .reset { margin-left: 0; }
  .workspace { padding: 15px 14px 70px; }
  .layout { display: block; }
  .mobile-control { display: inline-block; }
  .control-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 80; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px 20px 0 0; padding: 0; transform: translateY(105%); transition: transform .25s ease; }
  .control-panel.open { transform: translateY(0); }
  .panel-header { flex: 0 0 auto; margin: 0; padding: 20px 20px 14px; border-bottom: 1px solid #eef0ed; background: #fff; }
  .control-scroll { min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 16px 20px 18px; overscroll-behavior: contain; }
  .apply-controls { position: static; flex: 0 0 auto; display: block; width: auto; margin: 10px 20px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 8px 20px rgba(18,63,56,.24); }
  .sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(5,20,16,.52); }
  .sheet-backdrop:not([hidden]) { display: block; }
  .font-grid { grid-template-columns: 1fr; }
  .font-preview { min-height: 190px; padding: 30px 20px 22px; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-sample { min-height: 190px; }
}

@media (max-width: 430px) {
  .brand small { display: none; }
  .candidate-button { padding: 0 12px; }
  .intro { padding-left: 16px; padding-right: 16px; }
  .eyebrow { font-size: 10px; }
  .intro h1 { font-size: 31px; }
  .copy-input-wrap textarea { font-size: 30px; }
  .filters { padding: 15px 14px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding-left: 8px; padding-right: 8px; }
  .result-heading { align-items: flex-start; }
  #filterSummary { display: block; margin: 3px 0 0; }
  .font-meta { gap: 7px; padding: 12px; }
  .card-action { width: 38px; height: 38px; }
  .dialog-body { padding: 20px; }
  .info-list { grid-template-columns: 105px 1fr; }
}

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