:root {
  color-scheme: light;
  --bg: #f6fbff;
  --bg-deep: #e8f6fb;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --surface-soft: rgba(248, 253, 255, 0.94);
  --text: #1a1a2e;
  --muted: #6b7280;
  --line: rgba(18, 32, 40, 0.1);
  --primary: #67c7ea;
  --primary-dark: #3aa8d0;
  --accent: #ffd76a;
  --shadow: 0 24px 70px rgba(13, 30, 38, 0.1);
  --shadow-soft: 0 14px 36px rgba(13, 30, 38, 0.08);
  --radius: 26px;
  --radius-small: 18px;
  --max: 1220px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #203141;
  --bg-deep: #314b5d;
  --surface: rgba(39, 58, 74, 0.8);
  --surface-strong: rgba(45, 67, 84, 0.96);
  --surface-soft: rgba(52, 77, 96, 0.92);
  --text: #eef7fb;
  --muted: #c4d7df;
  --line: rgba(232, 236, 244, 0.12);
  --primary: #8ad8f3;
  --primary-dark: #b8ecfb;
  --accent: #ffe08a;
  --shadow: 0 26px 70px rgba(7, 10, 18, 0.28);
  --shadow-soft: 0 18px 48px rgba(9, 13, 22, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(103, 199, 234, 0.24), transparent 24%),
    radial-gradient(circle at 86% 0%, rgba(255, 215, 106, 0.24), transparent 22%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 38%, var(--bg) 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 75%);
  opacity: 0.45;
}

a { color: inherit; }
.wrap { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }

.page-shell {
  display: block;
}

.page-main {
  min-width: 0;
  width: 100%;
}

.ad-rail {
  display: none;
}

.ad-slot {
  padding: 16px;
  border-radius: 22px;
  border: 1px dashed color-mix(in srgb, var(--primary) 20%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  animation: fade-up 0.8s ease both;
}

.ad-slot strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 15px;
}

.ad-slot p {
  margin: 8px 0 0;
}

.ad-label {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-badge {
  min-width: 56px;
  height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #8fe3ff 52%, var(--accent));
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  letter-spacing: 0.12em;
}

html[data-theme="dark"] .brand-badge {
  background: linear-gradient(135deg, var(--primary), #7ed8f5 50%, var(--accent));
}

.footer-links,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-links a {
  text-decoration: none;
  color: var(--muted);
}

.footer-links a:hover { color: var(--text); }

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 88%, transparent), color-mix(in srgb, var(--accent) 18%, transparent));
  box-shadow: var(--shadow-soft);
}

.theme-toggle {
  appearance: none;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle.is-active {
  background: linear-gradient(135deg, #fff2b7, #ffe189);
  border: 1px solid #f0c78d;
  color: #6d5322;
}

.hero {
  padding: 22px 0 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-compact {
  padding: 22px 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 22px;
}

.hero-grid-compact {
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
}

.hero-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  padding: 32px;
  animation: fade-up 0.7s ease both;
}

.hero-card {
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 30%, transparent), transparent 70%);
  animation: float-orb 8s ease-in-out infinite;
}

.eyebrow,
.preview-chip {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 20%, transparent), color-mix(in srgb, var(--accent) 26%, transparent));
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 {
  margin-top: 12px;
  font-size: clamp(24px, 3.2vw, 34px);
  max-width: 18ch;
}

h2 { font-size: clamp(26px, 3vw, 36px); }
h3 { font-size: 22px; }

.lead {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  max-width: 42ch;
}

.muted { color: var(--muted); margin-top: 12px; }
.hero-actions { margin-top: 18px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: var(--shadow-soft);
}

.button.primary {
  background: linear-gradient(135deg, #fff4bd, #ffe28f);
  border-color: #f2c98f;
  color: #6b5222;
}

.button.secondary {
  border-color: #f2c98f;
  background: linear-gradient(135deg, #fff7d8, #ffecb4);
  color: #715a2c;
}

.hero-pills,
.check-list {
  margin: 16px 0 0;
  padding-left: 18px;
}

.hero-pills li + li,
.check-list li + li { margin-top: 10px; }

.panel-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-side-meta h2 {
  font-size: clamp(20px, 2vw, 26px);
}

.hero-preview {
  margin-top: 16px;
}

.hero-preview-card {
  padding: 18px;
  border-radius: var(--radius-small);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, var(--surface-soft)), color-mix(in srgb, var(--primary) 10%, var(--surface)));
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.hero-preview-card p {
  margin: 14px 0 0;
  color: var(--muted);
}

.hero-preview-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.18) 45%, transparent 70%);
  transform: translateX(-120%);
  animation: sheen 6.5s ease-in-out infinite;
}

.mini-pages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mini-pages span {
  display: block;
  aspect-ratio: 0.75;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), color-mix(in srgb, var(--accent) 18%, transparent)),
    repeating-linear-gradient(180deg, rgba(18, 32, 40, 0.12) 0 8px, transparent 8px 18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.section { padding: 16px 0 24px; }
.intro-panel p + p { margin-top: 14px; }

.info-stack {
  display: grid;
  gap: 18px;
}

.tools-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.tool-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.tool-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(13, 30, 38, 0.12);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
}

.tool-header p {
  margin: 10px 0 0;
  color: var(--muted);
}

.tool-form { display: grid; gap: 14px; }
.upload-box,
.field { display: grid; gap: 8px; }

.upload-box span,
.field span {
  font-size: 14px;
  font-weight: 700;
}

.upload-box input,
.field input,
.field select {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.upload-box input:focus,
.field input:focus,
.field select:focus {
  outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-color: var(--primary);
}

.upload-box input[type="file"] {
  padding: 8px 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 94%, transparent), color-mix(in srgb, var(--accent) 14%, var(--surface-soft)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.upload-box input[type="file"]:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
}

.upload-box input[type="file"]::file-selector-button {
  appearance: none;
  border: 1px solid #efc694;
  margin-right: 12px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff3b6, #ffe089);
  color: #6b5222;
  font: inherit;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(242, 201, 143, 0.35);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.upload-box input[type="file"]::file-selector-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 28px rgba(242, 201, 143, 0.42);
}

.upload-box input[type="file"]::-webkit-file-upload-button {
  appearance: none;
  border: 1px solid #efc694;
  margin-right: 12px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff3b6, #ffe089);
  color: #6b5222;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(242, 201, 143, 0.35);
}

.preview-area {
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 96%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
  color: var(--muted);
  display: grid;
  gap: 14px;
  transition: border-color 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

.tool-panel:hover .preview-area {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--line));
}

.preview-empty,
.preview-loading {
  color: var(--muted);
  font-size: 14px;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.preview-meta span {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.preview-grid img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  animation: pop-in 0.35s ease both;
}

.pdf-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.pdf-page-card {
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  box-shadow: var(--shadow-soft);
  animation: pop-in 0.38s ease both;
}

.pdf-page-card img {
  display: block;
  width: 100%;
  aspect-ratio: 0.75;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.pdf-page-card strong {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.preview-doc {
  width: 100%;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.result-box { display: grid; gap: 12px; }
.result-box a { color: var(--primary-dark); font-weight: 800; }

.status-line {
  font-size: 14px;
  font-weight: 700;
}

.status-line.error { color: #dd5d4d; }
.status-line.success { color: var(--primary-dark); }

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.faq-grid article {
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 98%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
  border: 1px solid var(--line);
}

.faq-grid p {
  margin: 10px 0 0;
  color: var(--muted);
}

.legal-section { padding: 34px 0 48px; }

.legal-panel-compact {
  max-width: 880px;
}

.legal-copy {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  color: var(--muted);
  max-width: 78ch;
  font-size: 13px;
  line-height: 1.7;
}

.legal-panel-compact h1 {
  font-size: clamp(24px, 3vw, 32px);
  max-width: none;
}

.site-footer { padding: 28px 0 48px; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes float-orb {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-18px, -14px, 0);
  }
}

@keyframes sheen {
  0%, 100% {
    transform: translateX(-120%);
  }
  45%, 60% {
    transform: translateX(120%);
  }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid-compact { grid-template-columns: 1fr; }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .wrap { width: min(calc(100% - 22px), var(--max)); }
  .hero-card,
  .panel { padding: 22px; }
  .tools-layout { grid-template-columns: 1fr; }
  h1 { max-width: none; }
  .theme-switch {
    width: 100%;
    justify-content: center;
  }
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
