:root {
  --ink: #131314;
  --muted: #5c6770;
  --line: #d9e1ea;
  --paper: #ffffff;
  --blue: #0a63c8;
  --blue-deep: #022969;
  --blue-press: #084e9e;
  --blue-soft: #e7f1fb;
  --wash: #f4f8fc;
  --footer: #022969;
  --radius: 12px;
  --header: 72px;
  --max: 1120px;
  --shadow: 0 16px 40px rgba(2, 41, 105, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
#converter, #sample, #keep, .page-hero { scroll-margin-top: 140px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
}
html[lang="ko"] body { word-break: keep-all; }
img, canvas { max-width: 100%; }
a { color: var(--blue); }
a:hover { color: var(--blue-press); }
h1, h2, h3 { color: var(--blue-deep); line-height: 1.2; letter-spacing: -0.03em; }
h1 { margin: 0 0 12px; font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { margin: 0 0 10px; font-size: clamp(1.45rem, 2.4vw, 1.9rem); }
h3 { margin: 0 0 8px; font-size: 1.15rem; }
p { margin: 0 0 12px; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #8eb7ea; outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: 0;
  transform: translateY(-120%);
  background: var(--blue);
  color: white;
  padding: 8px 12px;
  z-index: 20;
}
.skip-link:focus { transform: none; }

.lang-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 8px 18px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  border-bottom: 1px solid #c9ddf3;
}
.lang-prompt[hidden] { display: none; }
.lang-prompt p { margin: 0; font-weight: 650; }

.chrome {
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.nav {
  min-height: var(--header);
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-deep);
  font-weight: 760;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
}
.brand:hover { color: var(--blue); }
.nav-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}
.nav-links, .footer-grid ul { display: flex; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.nav-links a, .nav-toggle {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.nav-links a[aria-current="page"] { color: var(--blue); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  min-width: 44px;
  min-height: 40px;
}
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch button {
  border: 0;
  background: white;
  color: var(--muted);
  padding: 6px 10px;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; }

.container { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.hero { padding: 64px 0 28px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.lede { max-width: 46rem; color: #243140; font-size: 1.12rem; }
.hero-actions, .tool-actions, .sample-actions, .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-press); color: white; }
.btn-ghost { background: white; color: var(--blue-deep); border-color: #b9cbe0; }
.btn-ghost:hover { background: var(--wash); color: var(--blue-deep); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.section { padding: 28px 0; }
.band { background: var(--wash); border-block: 1px solid #e6eef6; }
.tool-grid, .sample-grid, .card-grid, .pricing-grid, .split { display: grid; gap: 18px; }
.tool-grid, .sample-grid, .split { grid-template-columns: 1fr 1fr; }
.card-grid, .pricing-grid { grid-template-columns: repeat(3, 1fr); }
.panel, .card, .price-card, .sheet, .prose {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel, .card, .price-card { padding: 20px; }
.panel h2, .card h2, .price-card h2 { font-size: 1.2rem; }
.drop { position: relative; }
#file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.drop {
  border: 1.5px dashed #b7cbe4;
  border-radius: 10px;
  background: var(--wash);
  min-height: 180px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
}
.drop.drag { border-color: var(--blue); background: var(--blue-soft); }
.file-meta, .status, .hint { color: var(--muted); }
.status { min-height: 1.5em; color: var(--blue-deep); font-weight: 650; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.preview, .sheet-copy { min-height: 220px; }
.preview .empty { color: var(--muted); }
.pv-p { margin: 0 0 10px; }
.pv-formula {
  margin: 14px 0;
  padding: 12px;
  text-align: center;
  color: var(--blue-deep);
  background: var(--wash);
  border-radius: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}
.tag {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.pv-table { margin: 12px 0 16px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { border: 1px solid #c5d7ea; padding: 8px 10px; text-align: left; }
th { background: var(--blue-soft); color: var(--blue-deep); }
.sheet { padding: 0; overflow: auto; }
#sample-canvas { display: block; width: 100%; height: auto; background: white; border-bottom: 1px solid var(--line); }
.sheet-copy { color: #1d2732; padding: 18px; }
.sheet-title { font-size: 1.25rem; font-weight: 750; color: var(--blue-deep); }
.sheet-formula { text-align: center; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; color: var(--blue-deep); }
.sample-note { color: var(--muted); font-size: 0.95rem; }

.page-hero { padding: 42px 0 10px; }
.prose { padding: 8px 0 28px; box-shadow: none; border: 0; background: transparent; max-width: 46rem; }
.prose h2 { margin-top: 28px; }
.prose ol, .prose ul { margin: 0 0 14px; padding-left: 1.2rem; }
.price { margin: 8px 0; font-size: 2.4rem; color: var(--blue-deep); font-weight: 760; letter-spacing: -0.04em; }
.price-card p:last-child { color: var(--muted); }

.site-footer { margin-top: 48px; background: var(--footer); color: #d5e4f5; }
.site-footer a { color: white; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; padding: 36px 0 28px; }
.footer-grid h3 { color: white; font-size: 0.95rem; }
.footer-grid ul { display: grid; gap: 6px; }
.footer-brand { color: white; font-weight: 760; font-size: 1.15rem; margin-bottom: 8px; }
.footer-note { border-top: 1px solid rgba(255,255,255,0.16); padding: 14px 0 22px; color: #b7cbe4; font-size: 0.92rem; }

.modal-dialog {
  border: 0;
  border-radius: 14px;
  padding: 22px;
  width: min(440px, calc(100% - 32px));
  box-shadow: var(--shadow);
}
.modal-dialog::backdrop { background: rgba(2, 41, 105, 0.35); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-panel.open { display: flex; }
  .nav-links { flex-direction: column; gap: 2px; }
  .nav-links a, .nav-actions { padding: 8px 0; }
  .nav-actions { flex-wrap: wrap; }
  .tool-grid, .sample-grid, .card-grid, .pricing-grid, .split, .footer-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  .container { width: min(var(--max), calc(100% - 28px)); }
  .panel-head { align-items: flex-start; flex-direction: column; }
}
