@font-face {
  font-family: "Noto Sans KR";
  src: url("/static/fonts/NotoSansKR-wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
}

:root {
  --bg: #f2f2f0;
  --paper: rgba(255, 255, 255, 0.88);
  --paper-strong: #ffffff;
  --ink: #111111;
  --muted: #5f5f5a;
  --accent: #111111;
  --line: rgba(17, 17, 17, 0.12);
  --line-strong: rgba(17, 17, 17, 0.22);
  --shadow: 0 22px 48px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 26%),
    linear-gradient(180deg, #f7f7f5 0%, #ededeb 100%);
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.main-column {
  min-width: 0;
}

.sidebar-column {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 24px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(242, 242, 240, 0.78);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
  z-index: 1000;
}

.loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.loading-panel {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.loading-kicker,
.loading-copy {
  margin: 0;
}

.loading-kicker {
  color: var(--muted);
  letter-spacing: 0.24em;
  font-size: 0.78rem;
  font-weight: 700;
}

.loading-panel h2 {
  margin-top: 10px;
}

.loading-copy {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.progress-track {
  margin-top: 18px;
  height: 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  overflow: hidden;
}

.progress-bar {
  width: 42%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #111111 0%, #5a5a56 100%);
  animation: progress-sweep 1.15s ease-in-out infinite;
}

@keyframes progress-sweep {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(320%);
  }
}

.site-header {
  margin-bottom: 24px;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 246, 244, 0.9));
  box-shadow: var(--shadow);
}

.brand-mark {
  display: flex;
  place-items: center;
  align-items: center;
  justify-content: center;
  width: 94px;
  height: 94px;
  border-radius: 22px;
  background: var(--ink);
  color: white;
  font-family: "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-style: normal;
}

.brand-copy h1 {
  margin-top: 4px;
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  font-weight: 800;
}

.brand-kicker,
.brand-tagline {
  margin: 0;
}

.brand-kicker {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.brand-tagline {
  margin-top: 8px;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.hero,
.upload-card,
.result-header,
.font-result-header,
.sidebar-card,
.info-card,
.flash {
  background: rgba(255, 250, 243, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero,
.result-header,
.font-result-header {
  padding: 36px;
}

.upload-card,
.sidebar-card,
.info-card {
  margin-top: 24px;
  padding: 28px;
}

.sidebar-card {
  margin-top: 0;
  background: rgba(255, 255, 255, 0.92);
}

.tab-card-header {
  display: grid;
  gap: 14px;
}

.tab-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.tab-button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.tab-panel {
  margin-top: 14px;
}

.sidebar-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.rank-list,
.recent-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.rank-list li,
.recent-list li {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.rank-list li {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.rank-list span,
.recent-list span {
  color: var(--muted);
  line-height: 1.5;
}

.rank-list strong,
.recent-list strong {
  font-weight: 650;
}

.more-button {
  margin-top: 14px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.empty-row {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.24em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
  font-family: "Noto Sans KR", "Segoe UI", sans-serif;
  line-height: 1.2;
  font-weight: 800;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.lead,
.info-card header p,
.upload-help,
.secondary-link,
small,
.hero-note {
  color: var(--muted);
}

.lead {
  max-width: 760px;
  margin-top: 16px;
  font-size: 1.05rem;
  line-height: 1.8;
  font-weight: 400;
}

.hero-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  max-width: 720px;
  line-height: 1.6;
}

.upload-form {
  display: grid;
  gap: 16px;
}

.upload-label {
  font-weight: 700;
  letter-spacing: 0.03em;
}

input[type="file"] {
  padding: 22px;
  border-radius: 22px;
  border: 1px dashed var(--line-strong);
  background: var(--paper-strong);
  cursor: pointer;
}
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 48px;
  border-radius: 999px;
  border: none;
  padding: 0 22px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  font-family: "Noto Sans KR", "Segoe UI", sans-serif;
  transition: transform 180ms ease, opacity 180ms ease;
}

.secondary-link:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.secondary-link {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.result-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.font-result {
  margin-top: 30px;
}

.font-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.field-grid {
  display: grid;
  gap: 16px;
  margin: 24px 0 0;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

dt {
  font-weight: 650;
}

dd {
  margin: 0;
  line-height: 1.65;
  font-weight: 400;
}

dd a {
  color: var(--ink);
  word-break: break-all;
}

small {
  display: block;
  margin-top: 6px;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.flash {
  padding: 16px 18px;
}

.flash-error {
  border-color: var(--line-strong);
}

.failure-card {
  border-color: rgba(17, 17, 17, 0.18);
}

.failure-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.failure-list li {
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.failure-list span {
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 1120px);
    padding-top: 20px;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-column {
    position: static;
  }

  .brand-lockup {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 72px;
    height: 72px;
  }

  .hero,
  .upload-card,
  .result-header,
  .font-result-header,
  .sidebar-card,
  .info-card {
    padding: 22px;
    border-radius: 22px;
  }

  .result-header,
  .font-result-header,
  .field-row {
    grid-template-columns: 1fr;
  }
}
