/* =========================================================
   PaginaPDF v2.0.0b — style.css
   Pure CSS, no framework dependencies
   ========================================================= */

/* ── Reset & base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: Inter, -apple-system, Arial, sans-serif;
  background: #12110f;
  color: #f0e9db;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img, svg, video { display: block; max-width: 100%; }

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  --ink: #171512;
  --paper: #fffaf0;
  --bg: #12110f;
  --bg2: #1a1814;
  --accent: #f1b84b;
  --accent-hi: #ffcf6a;
  --muted: #b9ad9b;
  --line: rgba(255,250,240,0.14);
  --panel: rgba(255,250,240,0.06);
  --radius: 4px;
}

/* ── Background glow ─────────────────────────────────────── */
.site-glow {
  position: fixed;
  top: -20%; right: -8%;
  width: 60vw; height: 60vw;
  min-width: 480px; min-height: 480px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
    rgba(241,184,75,0.30) 0%,
    rgba(241,184,75,0.06) 42%,
    transparent 70%);
  filter: blur(8px);
  animation: glow-drift 18s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes glow-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-6%, 8%) scale(1.1); }
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18,17,15,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--paper);
}
.brand-symbol {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255,250,240,0.18), rgba(255,250,240,0.04));
  border: 1px solid rgba(255,250,240,0.22);
  color: var(--accent-hi);
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.header-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-link {
  color: #d4c9b6;
  font-size: 0.92rem;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 160ms, border-color 160ms;
}
.nav-link:hover {
  color: var(--accent-hi);
  border-color: var(--accent-hi);
}

/* ── Hero ────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  z-index: 1;
  padding: 5rem 2rem 4rem;
  min-height: 88vh;
  display: flex;
  align-items: center;
}
.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 4rem;
  align-items: center;
}
.hero-copy { animation: fade-up 700ms ease both; }

.kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-hi);
  margin-bottom: 1rem;
}
.hero-title {
  font-size: clamp(4rem, 11vw, 9.5rem);
  font-weight: 900;
  letter-spacing: -0.1em;
  line-height: 0.85;
  color: #fff8ec;
  margin-bottom: 1.5rem;
}
.hero-subtitle {
  font-size: clamp(1.5rem, 3.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.1;
  color: #fff7e8;
  margin-bottom: 1.25rem;
}
.hero-body {
  font-size: 1.05rem;
  color: #cec3af;
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 2rem;
}
.hero-body strong { color: var(--accent-hi); font-weight: 700; }
.hero-body code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.88em;
  background: rgba(255,250,240,0.09);
  border: 1px solid rgba(255,250,240,0.12);
  color: var(--accent);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #1a1400;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border: none;
  cursor: pointer;
  transition: background 160ms, transform 160ms;
}
.btn-primary:hover { background: var(--accent-hi); transform: translateY(-2px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  color: #e8ddc8;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(232,221,200,0.35);
  padding-bottom: 2px;
  transition: color 160ms, border-color 160ms;
}
.btn-ghost:hover { color: var(--accent-hi); border-color: var(--accent-hi); }

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
}
.badge-green {
  background: rgba(120,210,100,0.12);
  border: 1px solid rgba(120,210,100,0.28);
  color: #9ee493;
}
.badge-amber {
  background: rgba(241,184,75,0.12);
  border: 1px solid rgba(241,184,75,0.28);
  color: var(--accent-hi);
}

/* ── Hero visual ─────────────────────────────────────────── */
.hero-visual {
  position: relative;
  min-height: min(72vh, 620px);
  animation: fade-up 900ms 120ms ease both;
}
.visual-page {
  position: absolute;
  background: var(--paper);
  box-shadow: 0 36px 80px rgba(0,0,0,0.38);
}
.page-back {
  inset: 8% 0% 8% 16%;
  background: linear-gradient(155deg, rgba(255,250,240,0.2), rgba(255,250,240,0.06));
  border: 1px solid rgba(255,250,240,0.2);
  transform: rotate(5.5deg);
  animation: page-float 9s ease-in-out infinite;
}
.page-front {
  inset: 4% 10% 4% 4%;
  padding: clamp(1.2rem, 3vw, 2.2rem);
  transform: rotate(-2.5deg);
  animation: page-float 8s 350ms ease-in-out infinite reverse;
}
.visual-bar {
  width: 28%; height: 6px;
  background: var(--accent);
}
.visual-title-block {
  width: 82%; height: clamp(2.6rem, 8vw, 5rem);
  background: #191611;
  margin-top: 1.8rem;
}
.visual-line {
  width: 90%; height: 9px;
  background: #191611;
  opacity: 0.3;
  margin-top: 0.9rem;
}
.visual-line.narrow { width: 60%; }
.visual-image-block {
  height: 30%;
  background: linear-gradient(135deg, #28200f, #f1b84b);
  margin-top: 1.8rem;
}
.visual-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 1rem;
}
.visual-cols span {
  display: block;
  height: 5rem;
  background: #191611;
  opacity: 0.12;
}
.visual-label {
  position: absolute;
  bottom: 6%;
  right: 4%;
  background: var(--accent);
  color: #1a1400;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
}

/* ── Sections layout ─────────────────────────────────────── */
.section-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}
.section-inner.narrow { max-width: 860px; }

.section-head {
  max-width: 720px;
  margin-bottom: 2.5rem;
}
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  color: #fff8ec;
  margin: 0.6rem 0 1rem;
}
.section-head p {
  color: #cec3af;
  font-size: 1rem;
  line-height: 1.75;
}

/* ── Converter section ───────────────────────────────────── */
.converter-section {
  position: relative;
  z-index: 1;
  padding: 5rem 2rem;
  background: linear-gradient(180deg, rgba(255,250,240,0.055), rgba(255,250,240,0.02));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.converter-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  align-items: start;
}

/* ── Source panel ────────────────────────────────────────── */
.source-panel {
  background: rgba(18,17,15,0.72);
  border: 1px solid var(--line);
  padding: 1.4rem;
  backdrop-filter: blur(18px);
}

.tab-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(255,250,240,0.13);
  margin-bottom: 0;
}
.tab-btn {
  background: transparent;
  border: none;
  color: #a89d8d;
  padding: 0.75rem 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 150ms, color 150ms;
}
.tab-btn:hover { color: #e8dcc8; }
.tab-btn.active {
  background: var(--paper);
  color: var(--ink);
}

.tab-pane { display: none; padding-top: 1.2rem; }
.tab-pane.active { display: block; animation: fade-in 200ms ease both; }

.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #e0d4c0;
}
.field-label input,
.field-label select { margin-top: 0; }

input[type="url"],
input[type="text"],
textarea,
select {
  width: 100%;
  background: rgba(255,250,240,0.07);
  border: 1px solid rgba(255,250,240,0.16);
  color: #fff8ec;
  padding: 0.8rem 0.9rem;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 150ms;
}
input[type="url"]:focus,
input[type="text"]:focus,
textarea:focus,
select:focus { border-color: var(--accent); }

textarea { min-height: 13rem; resize: vertical; line-height: 1.55; }

select option { background: #1f1c18; color: #fff8ec; }

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.field-hint {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}
.field-hint strong { color: #e8dcc8; font-weight: 700; }
.field-hint em { color: #d4c9b4; font-style: normal; font-weight: 600; }
.field-hint code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.86em;
  background: rgba(255,250,240,0.09);
  border: 1px solid rgba(255,250,240,0.12);
  color: var(--accent);
  padding: 0.08rem 0.4rem;
  border-radius: 3px;
}

.file-input {
  padding: 0.75rem;
  margin-top: 0.45rem;
}
.file-input::file-selector-button {
  border: none;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  padding: 0.45rem 0.75rem;
  margin-right: 0.75rem;
  cursor: pointer;
}

.btn-action {
  background: var(--accent);
  border: none;
  color: #1a1400;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.8rem 1.1rem;
  transition: background 150ms, transform 150ms;
  white-space: nowrap;
}
.btn-action:hover { background: var(--accent-hi); transform: translateY(-1px); }
.btn-action.btn-wide { width: 100%; margin-top: 0.75rem; }

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 0.9rem;
  color: #cec3af;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.55;
  cursor: pointer;
}
.check-line input[type="checkbox"] {
  width: 1rem; height: 1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.consent-line { color: #fff2ce; }

.action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  margin-top: 1.1rem;
}

.btn-generate {
  background: var(--accent);
  border: none;
  color: #1a1400;
  font-weight: 900;
  font-size: 1rem;
  padding: 0.9rem 1.2rem;
  transition: background 150ms, transform 150ms, opacity 150ms;
  text-align: center;
}
.btn-generate:hover:not(:disabled) { background: var(--accent-hi); transform: translateY(-1px); }
.btn-generate:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-clear {
  background: transparent;
  border: 1px solid rgba(255,250,240,0.18);
  color: #e8dcc8;
  font-weight: 800;
  padding: 0.9rem 1rem;
  transition: border-color 150ms, color 150ms;
}
.btn-clear:hover { border-color: rgba(255,250,240,0.4); color: #fff; }

.status-box {
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(255,250,240,0.06);
  color: #d4c9b4;
  font-size: 0.9rem;
  line-height: 1.6;
}
.status-box.error   { border-color: #ff806d; color: #ffd4cd; background: rgba(255,128,109,0.06); }
.status-box.success { border-color: #9ee493; color: #e4ffe0; background: rgba(158,228,147,0.06); }

/* ── Print block report ──────────────────────────────────── */
.print-block-report {
  margin-top: 0.9rem;
  border: 1px solid rgba(241,184,75,0.3);
  background: rgba(241,184,75,0.05);
}
.print-block-report[hidden] { display: none; }

.report-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(241,184,75,0.18);
  color: var(--accent-hi);
  font-size: 0.85rem;
  font-weight: 800;
}
.report-count {
  margin-left: auto;
  background: rgba(241,184,75,0.18);
  color: var(--accent-hi);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
}
.report-list {
  list-style: none;
  padding: 0.5rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.report-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #ddd1bc;
  line-height: 1.5;
  flex-wrap: wrap;
}
.block-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  margin-top: 1px;
}
.block-badge.removed  { background: rgba(158,228,147,0.15); border: 1px solid rgba(158,228,147,0.3);  color: #9ee493; }
.block-badge.detected { background: rgba(255,128,109,0.14); border: 1px solid rgba(255,128,109,0.28); color: #ff9080; }
.block-where { color: #7a6e5e; font-size: 0.76rem; }

/* ── Diff panel (prima / dopo) ────────────────────────────── */
.diff-panel {
  margin-top: 0.9rem;
  border: 1px solid rgba(100,180,255,0.22);
  background: rgba(100,180,255,0.04);
}
.diff-panel[hidden] { display: none; }

.diff-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(100,180,255,0.16);
  color: #8ec5ff;
  font-size: 0.85rem;
  font-weight: 800;
}

.diff-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.diff-col {
  min-width: 0;
  overflow: hidden;
}
.diff-col:first-child {
  border-right: 1px solid rgba(255,250,240,0.08);
}

.diff-col-title {
  padding: 0.5rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.diff-col-before {
  background: rgba(255,80,60,0.08);
  color: #ff9080;
  border-bottom: 1px solid rgba(255,80,60,0.15);
}
.diff-col-after {
  background: rgba(100,220,80,0.08);
  color: #8ee088;
  border-bottom: 1px solid rgba(100,220,80,0.15);
}

.diff-col-body {
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 400px;
  overflow-y: auto;
}

.diff-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.diff-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a7e6e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.diff-code {
  margin: 0;
  padding: 0.55rem 0.7rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  border-radius: 3px;
  overflow-x: auto;
}
.diff-removed {
  background: rgba(255,60,40,0.08);
  border: 1px solid rgba(255,60,40,0.18);
  color: #ffb0a0;
  text-decoration: line-through;
  text-decoration-color: rgba(255,120,100,0.5);
}
.diff-added {
  background: rgba(80,220,60,0.07);
  border: 1px solid rgba(80,220,60,0.18);
  color: #b0f0a0;
}

@media (max-width: 640px) {
  .diff-columns { grid-template-columns: 1fr; }
  .diff-col:first-child { border-right: none; border-bottom: 1px solid rgba(255,250,240,0.08); }
}

/* ── Screen PDF report ───────────────────────────────────── */
.screen-report {
  margin-top: 0.9rem;
  border: 1px solid rgba(158,228,147,0.24);
  background: rgba(158,228,147,0.045);
}
.screen-report[hidden] { display: none; }

.screen-report-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(158,228,147,0.16);
  color: #9ee493;
  font-size: 0.85rem;
  font-weight: 800;
}
.screen-pill {
  margin-left: auto;
  background: rgba(158,228,147,0.14);
  border: 1px solid rgba(158,228,147,0.24);
  color: #dfffd9;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.screen-box {
  min-width: 0;
  padding: 0.85rem 1rem;
}
.screen-box:first-child { border-right: 1px solid rgba(255,250,240,0.08); }
.screen-box h4 {
  color: #fff7e8;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.55rem;
}
#ocrTextBox {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #d8ccb8;
  background: rgba(0,0,0,0.12);
  border: 1px solid rgba(255,250,240,0.08);
  padding: 0.6rem;
}
#screenLinkList {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
#screenLinkList li {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #cfc3b1;
}
#screenLinkList a {
  color: #9ee493;
  border-bottom: 1px solid rgba(158,228,147,0.35);
}

@media (max-width: 640px) {
  .screen-grid { grid-template-columns: 1fr; }
  .screen-box:first-child { border-right: none; border-bottom: 1px solid rgba(255,250,240,0.08); }
  .screen-pill { max-width: 100%; margin-left: 0; }
}

/* ── Preview panel ───────────────────────────────────────── */
.preview-panel {
  background: rgba(18,17,15,0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  min-height: 760px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0 1rem;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.preview-title-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #d4c9b4;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-badge {
  background: var(--accent);
  color: #1a1400;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
}
.page-badge[hidden] { display: none; }

.mode-group {
  display: flex;
  align-items: center;
  background: rgba(255,250,240,0.07);
  border: 1px solid rgba(255,250,240,0.12);
  padding: 3px;
  border-radius: var(--radius);
}
.mode-btn {
  background: transparent;
  border: none;
  color: #a89d8d;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
  transition: all 140ms;
}
.mode-btn:hover { color: #fff; }
.mode-btn.active { background: var(--paper); color: var(--ink); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: rgba(255,250,240,0.07);
  border: 1px solid rgba(255,250,240,0.14);
  color: #a89d8d;
  border-radius: var(--radius);
  padding: 0;
  transition: all 140ms;
}
.icon-btn:hover:not(:disabled) { background: rgba(255,250,240,0.16); color: #fff; }
.icon-btn:disabled { opacity: 0.38; cursor: not-allowed; }

.preview-state {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-hi);
}

.preview-stage {
  position: relative;
  flex: 1;
  min-height: 700px;
  background: #1e1c18;
}
#previewFrame {
  width: 100%;
  height: 100%;
  min-height: 700px;
  border: none;
  background: #ede5d5;
  display: block;
}

.empty-preview {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #8a7e6e;
  text-align: center;
  padding: 2rem;
  background: rgba(20,18,14,0.6);
}
.empty-icon { font-size: 3rem; }
.empty-preview p { font-size: 0.95rem; line-height: 1.65; }

.loading-veil {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: rgba(18,17,15,0.82);
  backdrop-filter: blur(6px);
  color: #d4c9b4;
  font-size: 0.95rem;
}
.loading-veil[hidden] { display: none; }
.empty-preview[hidden] { display: none; }

.loader-bar {
  width: min(320px, 70%);
  height: 4px;
  background: rgba(255,250,240,0.1);
  overflow: hidden;
  border-radius: 9999px;
}
.loader-fill {
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 9999px;
  animation: loader-sweep 1.1s ease-in-out infinite;
}
@keyframes loader-sweep {
  from { transform: translateX(-120%); }
  to   { transform: translateX(320%); }
}

/* ── Info sections ───────────────────────────────────────── */
.info-section {
  position: relative;
  z-index: 1;
  padding: 5rem 2rem;
  border-top: 1px solid var(--line);
}
.info-section h2 {
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1.05;
  color: #fff8ec;
  margin: 0.6rem 0 1.2rem;
}
.info-body {
  color: #cec3af;
  font-size: 1rem;
  line-height: 1.8;
  max-width: 760px;
}
.info-body.wide { max-width: 100%; }
.info-body strong { color: var(--accent-hi); font-weight: 700; }
.info-body code,
.cors-section code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.88em;
  background: rgba(255,250,240,0.09);
  border: 1px solid rgba(255,250,240,0.12);
  color: var(--accent);
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
}

.cors-section { background: rgba(255,250,240,0.025); }

.cors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.cors-card {
  background: rgba(18,17,15,0.6);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
}
.cors-card-full { grid-column: 1 / -1; }

.cors-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.cors-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #fff8ec;
  margin-bottom: 0.75rem;
}
.cors-card p {
  font-size: 0.92rem;
  color: #c4b9a5;
  line-height: 1.72;
}
.cors-card p strong { color: var(--accent-hi); }
.cors-card p em { color: #e8dcc8; font-style: normal; font-weight: 700; }

.ext-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ext-item {
  border-left: 3px solid rgba(241,184,75,0.38);
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ext-item strong { color: #fff7e8; font-size: 0.92rem; }
.ext-item span {
  color: #b8ad9c;
  font-size: 0.86rem;
  line-height: 1.6;
}
.ext-item code {
  display: block;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.81rem;
  background: rgba(255,250,240,0.07);
  border: 1px solid rgba(255,250,240,0.12);
  color: var(--accent);
  padding: 0.4rem 0.7rem;
  word-break: break-all;
}

/* ── Fullscreen modal ────────────────────────────────────── */
.fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: fade-in 180ms ease both;
}
.fullscreen-modal[hidden] { display: none; }

.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 1.5rem;
  min-height: 56px;
  background: #171512;
  border-bottom: 1px solid rgba(255,250,240,0.14);
  flex-shrink: 0;
}
.modal-bar-left,
.modal-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.modal-bar h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff7e8;
}

.btn-close-modal {
  background: rgba(255,250,240,0.1);
  border: 1px solid rgba(255,250,240,0.18);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  transition: background 140ms;
}
.btn-close-modal:hover { background: rgba(255,250,240,0.2); }

.modal-body { flex: 1; }
.modal-body iframe { width: 100%; height: 100%; border: none; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 2.5rem 2rem;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}
.footer-main {
  color: #8a7e6e;
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 680px;
}
.footer-version {
  color: #5a5048;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes page-float {
  0%, 100% { translate: 0 0; }
  50%       { translate: 0 -14px; }
}

/* ── Focus styles ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid rgba(255,207,106,0.65);
  outline-offset: 3px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { min-height: 480px; }
  .converter-shell { grid-template-columns: 1fr; }
  .preview-panel { min-height: 600px; }
  .preview-stage, #previewFrame { min-height: 550px; }
}

@media (max-width: 640px) {
  .header-inner { padding: 0 1rem; }
  .nav-link:not(:last-child) { display: none; }
  .hero-section { padding: 3rem 1rem 2.5rem; }
  .hero-title { font-size: clamp(3.2rem, 18vw, 5rem); }
  .hero-visual { min-height: 380px; }
  .converter-section,
  .info-section { padding: 3rem 1rem; }
  .section-inner { padding: 0 1rem; }
  .options-grid { grid-template-columns: 1fr; }
  .input-row { grid-template-columns: 1fr; }
  .action-row { grid-template-columns: 1fr; }
  .cors-grid { grid-template-columns: 1fr; }
  .modal-bar { padding: 0 1rem; }
  .preview-panel { min-height: 520px; }
  .preview-stage, #previewFrame { min-height: 470px; }
  .site-footer { padding: 2rem 1rem; }
}
