@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans/DMSans-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  color-scheme: light;
  --nge-blue: #002c77;
  --nge-blue-light: #0b438f;
  --nge-yellow: #f6be00;
  --nge-yellow-hover: #ffd23b;
  --ink: #002c77;
  --muted: #607089;
  --line: #dce3ec;
  --surface: #ffffff;
  --background: #f3f6fa;
  --error: #b42318;
  --success: #087a4b;
  --shadow: 0 18px 50px rgba(16, 35, 63, 0.11);
  --radius-large: 28px;
  --radius-medium: 18px;
  --radius-small: 12px;
  font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 90% 0, rgba(246, 190, 0, 0.13), transparent 24rem), var(--background);
}

button, input { font: inherit; }
button, label, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--nge-blue);
  border-radius: 0.5rem;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--nge-yellow); outline-offset: 3px; }

.topbar {
  background: white;
  border-top: 7px solid var(--nge-yellow);
  border-bottom: 1px solid var(--line);
}

.header-inner, .page-shell, .site-footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

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

.brand {
  width: 108px;
  height: 54px;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin: 0;
}

.brand img { width: 106px; height: 53px; object-fit: contain; }

.header-label {
  margin: 0;
  color: var(--nge-blue);
  font-size: 0.78rem;
  font-weight: 800;
  /* letter-spacing: 0.14em; */
  text-transform: uppercase;
}

.page-shell { padding-block: clamp(2.25rem, 5vw, 3.75rem); }

.intro {
  display: flex;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
  /* border-bottom: 3px solid var(--nge-blue); */
}

.site-hero{
  flex: 0 1 auto;
}

.eyebrow, .preview-label {
  margin: 0 0 0.6rem;
  color: var(--nge-blue-light);
  font-size: 1rem;
  font-weight: 600;
  /* letter-spacing: 0.14em; */
  /* text-transform: uppercase; */
}

.eyebrow {
  color: var(--nge-blue-light);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1, h2, p { text-wrap: pretty; }

h1 {
  /* max-width: 680px; */
  margin: 0;
  color: var(--nge-blue);
  font-size: clamp(2.35rem, 5vw, 4.25rem);
  line-height: 0.98;
  font-weight: 900;
  margin-bottom: 1.5rem;
  /* letter-spacing: -0.055em; */
}

.page-excerpt {
  /* max-width: 390px; */
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.4;
}

.privacy-pill {
  flex: 1 0 auto;
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 1rem;
  /* margin-bottom: 1rem; */
  color: var(--nge-blue);
  background: rgba(246, 190, 0, 0.15);
  border: 1px solid rgba(246, 190, 0, 0.45);
  border-radius: var(--radius-small);
  font-size: 0.9rem;
  line-height: 1.35;
}

.privacy-pill svg { flex: 0 0 22px; width: 22px; fill: currentColor; }

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(390px, 0.97fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(0, 44, 119, 0.08);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.control-panel, .preview-panel { padding: clamp(1.5rem, 4vw, 3rem); }

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  color: white;
  background: radial-gradient(circle at 100% 0, rgba(246, 190, 0, 0.3), transparent 17rem), linear-gradient(145deg, #063782, var(--nge-blue) 60%);
}

.step + .step { padding-top: 2.25rem; border-top: 1px solid var(--line); }

.step-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.step-number {
  min-width: 2.5rem;
  padding-top: 0.15rem;
  color: var(--nge-blue);
  font-size: 1rem;
  font-weight: 1000;
  /* letter-spacing: 0.12em; */
}

.step-number::after {
  content: "";
  display: block;
  width: 1.6rem;
  height: 3px;
  margin-top: 0.3rem;
  background: var(--nge-yellow);
}

.step h2, .preview-panel h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.2;
  font-weight: 800;
}

.step-heading p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.88rem; }

.drop-zone {
  min-height: 164px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
  justify-content: center;
  padding: 1.4rem;
  text-align: center;
  background: #f8fafc;
  border: 2px dashed #b8c5d6;
  border-radius: var(--radius-medium);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone.is-dragging { background: #fff9df; border-color: var(--nge-yellow); transform: scale(1.01); }
.upload-icon { width: 30px; fill: var(--nge-blue); }
.drop-title, .drop-subtitle { margin: 0; }
.drop-title { color: var(--ink); font-weight: 800; }
.drop-subtitle { margin-top: 0.2rem; color: var(--muted); font-size: 0.85rem; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.button:not(:disabled):not(.is-disabled):hover { transform: translateY(-2px); }

.button-secondary {
  min-height: 38px;
  padding: 0.6rem 1.15rem;
  color: var(--nge-blue);
  background: white;
  border-color: #cbd5e1;
  font-size: 0.85rem;
}

.button-secondary:hover { border-color: var(--nge-blue); }

.file-summary {
  min-height: 54px;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  background: #eef7f2;
  border: 1px solid #c6e6d4;
  border-radius: var(--radius-small);
  color: var(--success);
  font-size: 0.88rem;
}

.file-summary svg { flex: 0 0 22px; width: 22px; fill: currentColor; }

.file-summary span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  padding: 0.35rem;
  color: var(--nge-blue);
  background: transparent;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.badge-option {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem;
  color: var(--ink);
  background: white;
  border: 2px solid var(--line);
  border-radius: var(--radius-small);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.badge-option:hover { border-color: #91a4be; transform: translateY(-2px); }
.badge-option.is-selected { border-color: var(--nge-yellow); box-shadow: 0 0 0 3px rgba(246, 190, 0, 0.2); }

.badge-preview {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(45deg, #edf1f6 25%, transparent 25%), linear-gradient(-45deg, #edf1f6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #edf1f6 75%), linear-gradient(-45deg, transparent 75%, #edf1f6 75%), white;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-size: 14px 14px;
  border-radius: 8px;
}

.badge-preview img {
  width: 100%;
  height: 100%;
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
  image-rendering: auto;
}

.check-icon {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 22px;
  padding: 3px;
  fill: var(--nge-blue);
  background: var(--nge-yellow);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 150ms ease, transform 150ms ease;
}

.badge-option.is-selected .check-icon { opacity: 1; transform: scale(1); }

.status-message { min-height: 1.3rem; margin-top: auto; color: var(--muted); font-size: 0.88rem; }
.status-message.is-error { color: var(--error); font-weight: 700; }
.status-message.is-success { color: var(--success); }

.preview-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.preview-label { color: var(--nge-yellow); }

.format-badge {
  flex: 0 0 auto;
  padding: 0.5rem 0.7rem;
  color: #dce8ff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  /* letter-spacing: 0.05em; */
}

.canvas-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f5f7fa;
  border: 6px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  box-shadow: 0 20px 45px rgba(0, 15, 45, 0.28);
}

.canvas-frame canvas { width: 100%; height: 100%; display: block; }

.preview-empty {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: center;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.preview-empty strong { color: var(--ink); font-size: 1.05rem; }
.preview-empty > span:last-child { font-size: 0.86rem; }

.empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 0.5rem;
  color: var(--nge-blue);
  background: rgba(0, 44, 119, 0.08);
  border-radius: 50%;
}

.empty-icon svg { width: 30px; fill: currentColor; }
.preview-actions { display: flex; gap: 0.75rem; margin-top: 1.4rem; }
.button-primary { flex: 1; color: var(--nge-blue); background: var(--nge-yellow); }
.button-primary:hover { background: var(--nge-yellow-hover); }
.button-primary svg { width: 20px; fill: currentColor; }
.button-ghost { color: white; background: transparent; border-color: rgba(255, 255, 255, 0.35); }
.button-ghost:hover { border-color: white; }
.button:disabled, .button.is-disabled { cursor: not-allowed; opacity: 0.48; }
.button.is-disabled { pointer-events: none; }
.preview-note { margin: 2rem 0 0; color: #c6d6f0; font-size: 0.77rem; text-align: center; }
.site-footer { padding-bottom: 2.5rem; color: var(--muted); font-size: 0.82rem; line-height: 1.5; text-align: center; }
.site-footer strong { color: var(--nge-blue); }

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

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .intro { align-items: flex-start; flex-direction: column; }
  .studio-grid { grid-template-columns: 1fr; }
  .preview-panel { min-height: 0; }
  .canvas-frame { width: min(100%, 560px); margin-inline: auto; }
}

@media (max-width: 560px) {
  .header-inner, .page-shell, .site-footer { width: min(100% - 1.2rem, 1180px); }
  .header-inner { min-height: 72px; }
  .brand { width: 94px; height: 47px; }
  .brand img { width: 92px; height: 46px; }
  .header-label { font-size: 0.7rem; }
  .page-shell { padding-block: 2rem; }
  .intro { margin-bottom: 1.5rem; }
  .privacy-pill { width: 100%; border-radius: var(--radius-small); }
  .studio-grid { border-radius: 20px; }
  .control-panel, .preview-panel { padding: 1.25rem; }
  .control-panel { gap: 1.6rem; }
  .step + .step { padding-top: 1.6rem; }
  .step-number { min-width: 2rem; }
  .badge-grid { gap: 0.45rem; }
  .badge-option { padding: 0.4rem; font-size: 0.66rem; }
  .preview-heading { align-items: flex-start; flex-direction: column; }
  .preview-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
