:root {
  --bg: #f5f8ff;
  --surface: #ffffff;
  --line: #d7e2f2;
  --text: #1f2a3d;
  --text-sub: #51607a;
  --muted: #74839d;
  --pink: #ff8e9e;
  --blue: #2b78c5;
  --blue-soft: #e9f2fc;
  --pink-soft: #ffeef2;
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 20px 44px rgba(25, 62, 115, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  line-height: 1.55;
  background: radial-gradient(circle at 4% 6%, rgba(255, 142, 158, 0.17), transparent 34%),
  radial-gradient(circle at 96% 8%, rgba(43, 120, 197, 0.2), transparent 30%),
  linear-gradient(180deg, #f8fbff 0%, #f3f6fd 100%);
}

a {
  color: inherit;
}

.container {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(43, 120, 197, 0.12);
  background: rgba(248, 251, 255, 0.88);
  backdrop-filter: blur(10px);
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: clamp(1.02rem, 1.9vw, 1.26rem);
  letter-spacing: -0.02em;
  color: var(--blue);
}

.brand-icon {
  font-size: 1.2rem;
}

.header-nav a {
  text-decoration: none;
  color: var(--text-sub);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  border-bottom: 0;
  transition: color 0.22s ease, background-color 0.22s ease;
}

.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--pink);
  background: #eef5ff;
}

.lang-wrap {
  position: relative;
  margin: 0;
}

.lang-wrap::before {
  content: "🌐";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.lang-wrap::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--blue);
  font-weight: 700;
}

.lang-wrap select {
  min-width: 210px;
  border: 1px solid #bcd1ea;
  background: #fff;
  color: #2b3d5a;
  border-radius: 10px;
  padding: 10px 34px 10px 36px;
  font-size: 0.88rem;
  font-weight: 600;
  appearance: none;
}

main {
  padding: 24px 0 66px;
}

.page {
  animation: rise 0.3s ease both;
}

.landing {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.hero-title {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 26px 24px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.88), rgba(239, 248, 255, 0.9)),
  linear-gradient(135deg, rgba(255, 142, 158, 0.12), rgba(43, 120, 197, 0.12));
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-heading {
  margin: 0;
  font-size: clamp(1.72rem, 4vw, 2.38rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #213454;
  background: linear-gradient(120deg, #ff8e9e 10%, #2b78c5 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  margin: 12px auto 16px;
  color: var(--text-sub);
  font-size: clamp(0.95rem, 1.65vw, 1.03rem);
  font-weight: 500;
  line-height: 1.55;
  max-width: 44ch;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  border: 1px solid #c6daf3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #35557e;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.upload-panel,
.result-card,
.premium-box,
.legal-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 22px;
}

.upload-panel {
  position: relative;
}

.upload-box {
  position: relative;
  border: 1px dashed #acc4e2;
  border-radius: 22px;
  min-height: 348px;
  padding: 22px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(145deg, rgba(43, 120, 197, 0.06), rgba(255, 142, 158, 0.07)),
  #fbfdff;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.upload-box.is-dragover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(43, 120, 197, 0.15);
}

.upload-content {
  display: grid;
  justify-items: center;
}

.upload-icon {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 10px 28px rgba(43, 120, 197, 0.24);
  margin-bottom: 14px;
}

.upload-box strong {
  font-size: clamp(1.1rem, 1.9vw, 1.34rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.upload-box p {
  margin: 8px 0 0;
  color: var(--text-sub);
  font-size: 0.86rem;
}

.upload-note {
  color: #446285;
  font-weight: 600;
}

.upload-hints {
  margin-top: 13px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.upload-hints span {
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dbe7f6;
  color: #60708d;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
}

.upload-hints span::before {
  content: none;
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.camera-inline-wrap {
  margin: 10px 0 0;
  text-align: center;
}

.camera-inline {
  border: 0;
  background: transparent;
  color: #466796;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(18, 29, 45, 0.65);
  display: grid;
  place-items: center;
  padding: 18px;
}

.camera-card {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid #bfd2ea;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 24px 46px rgba(17, 34, 62, 0.3);
  overflow: hidden;
}

.camera-card video {
  width: 100%;
  border-radius: 12px;
  background: #091224;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  filter: none;
}

.camera-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.camera-actions .btn {
  margin: 0;
  border-width: 1px;
  box-shadow: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.camera-actions .btn-primary {
  border: 0;
  background: linear-gradient(120deg, var(--blue), var(--pink));
}

.camera-actions .btn-soft {
  border: 1px solid #c7d8ee;
  background: #fff;
}

.preview-wrap {
  margin-top: 14px;
}

.preview-wrap img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.button-row {
  display: block;
  margin-top: 12px;
}

button,
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
}

#analyzeBtn {
  display: block;
  width: 100%;
  min-height: 46px;
  border: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary {
  background: linear-gradient(120deg, var(--blue), var(--pink));
  color: #fff;
}

.btn-soft,
.btn-accent {
  border-color: #c7d8ee;
  background: #fff;
  color: #2f4c73;
}

.status {
  margin-top: 10px;
  min-height: 22px;
  color: #466490;
  font-size: 0.8rem;
  font-weight: 600;
}

.result-stack {
  display: grid;
  gap: 14px;
}

.result-card h1,
.premium-box h2,
.legal-page h1 {
  margin-top: 0;
  margin-bottom: 10px;
}

.score {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score strong {
  font-family: "Noto Sans KR", "Pretendard", sans-serif;
  font-size: clamp(2.1rem, 6vw, 3.35rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--blue);
  font-weight: 800;
}

.result-note {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
  color: var(--text-sub);
  font-size: 0.9rem;
}

.premium-box {
  background: linear-gradient(170deg, rgba(43, 120, 197, 0.07), rgba(255, 142, 158, 0.12)),
  #fff;
}

.premium-placeholder {
  margin-top: 12px;
  border-radius: var(--radius-md);
  border: 1px solid #c8daef;
  min-height: 154px;
  background: linear-gradient(140deg, #ffffff, #eef4fd);
  display: grid;
  place-items: center;
  color: #4d5f7d;
  text-align: center;
  padding: 12px;
}

.legal-page h1 {
  font-size: clamp(1.38rem, 3.5vw, 2.08rem);
}

.legal-page h2 {
  margin-top: 16px;
  font-size: 0.96rem;
}

.legal-page p,
.legal-page li {
  color: var(--text-sub);
  font-size: 0.9rem;
}

.site-footer {
  margin-top: 44px;
  border-top: 1px solid #d3e0f1;
  background: linear-gradient(180deg, #eef4fc 0%, #e8eff8 100%);
}

.footer-inner {
  min-height: 128px;
  display: grid;
  gap: 12px;
  padding: 24px 0 20px;
}

.footer-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d6e2f2;
}

.footer-brand {
  margin: 0;
  color: #2f4f7a;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.footer-tagline {
  margin: 0;
  color: #6f819f;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-meta {
  display: grid;
  gap: 6px;
}

.footer-meta p {
  margin: 0;
  color: #5e6f89;
  font-size: 0.82rem;
  font-weight: 500;
}

.footer-meta span {
  display: inline-block;
  min-width: 62px;
  color: #4f627f;
  font-weight: 700;
}

.footer-meta a {
  color: #436892;
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: #355781;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.footer-copy {
  margin: 0;
  color: #6e7f98;
  font-size: 0.76rem;
  font-weight: 500;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: #fff;
  border: 1px solid #cadbf0;
  border-radius: 10px;
  padding: 8px 12px;
  color: #3d5476;
  font-size: 0.8rem;
  box-shadow: 0 8px 24px rgba(33, 64, 111, 0.16);
}

.hidden,
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .container {
    width: min(1080px, calc(100% - 24px));
  }

  .header-inner {
    min-height: 64px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .brand {
    font-size: 0.98rem;
  }

  .header-nav a {
    font-size: 0.8rem;
  }

  .header-tools {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }

  .lang-wrap {
    margin-left: 0;
    margin-right: 0;
  }

  .lang-wrap select {
    min-width: 150px;
    width: min(220px, calc(100vw - 170px));
    font-size: 0.84rem;
  }

  main {
    padding-top: 12px;
  }

  .hero-title {
    padding: 20px 18px;
  }

  .lead {
    font-size: 0.9rem;
  }

  .upload-panel,
  .result-card,
  .premium-box,
  .legal-page {
    padding: 16px;
  }

  .upload-box {
    min-height: 290px;
    padding: 16px;
  }

  .upload-box strong {
    font-size: 1.02rem;
  }

  .upload-icon {
    width: 66px;
    height: 66px;
    font-size: 1.6rem;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .footer-meta span {
    min-width: 56px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .button-row {
    display: none !important;
  }
}
