/* ==========================================================================
   CutPic — sistema de design
   Paleta: tinta escura + papel + coral (corte) + ciano (grade)
   Tipografia: Space Grotesk (display) + Inter (texto)
   ========================================================================== */

:root {
  --ink: #14161f;
  --ink-panel: #1c1f2b;
  --ink-panel-2: #232735;
  --paper: #f6f3ec;
  --paper-dim: #eae6da;
  --line: #4b5063;
  --line-soft: rgba(255, 255, 255, 0.14);
  --coral: #ff5d3a;
  --coral-dim: #d9491f;
  --cyan: #33d9c6;
  --text-hi: #f6f3ec;
  --text-mid: #b9bccb;
  --text-low: #7d8093;
  --text-ink: #1c1f2b;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;

  --radius-s: 6px;
  --radius-m: 10px;
  --container: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* -------------------------------- crop-mark glyph, used as brand mark and
   as a recurring structural device (never purely decorative) ------------- */

.crop {
  position: relative;
  display: inline-block;
}

.crop::before,
.crop::after {
  content: "";
  position: absolute;
  background: currentColor;
}

/* -------------------------------- header ------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 22, 31, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-hi);
}

.brand-mark {
  width: 26px;
  height: 26px;
  border: 2px solid var(--coral);
  border-radius: 3px;
  position: relative;
  flex-shrink: 0;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: var(--cyan);
}

.brand-mark::before {
  top: 50%;
  left: -5px;
  width: 8px;
  height: 2px;
  transform: translateY(-50%);
}

.brand-mark::after {
  left: 50%;
  top: -5px;
  height: 8px;
  width: 2px;
  transform: translateX(-50%);
}

.brand-word {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.header-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-mid);
}

.header-nav a {
  text-decoration: none;
  transition: color 0.15s ease;
}

.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--text-hi);
}

/* -------------------------------- hero ---------------------------------- */

.hero {
  padding: 88px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 480px;
  background: radial-gradient(
      circle at 20% 20%,
      rgba(255, 93, 58, 0.16),
      transparent 55%
    ),
    radial-gradient(circle at 80% 10%, rgba(51, 217, 198, 0.12), transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 720px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-weight: 600;
}

.hero .tagline {
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--text-mid);
  margin: 0 0 28px;
  max-width: 46ch;
}

.hero .tagline strong {
  color: var(--cyan);
  font-weight: 600;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-s);
  padding: 14px 26px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--coral);
  color: #1a0d08;
  box-shadow: 0 0 0 1px rgba(255, 93, 58, 0.4), 0 12px 24px -10px rgba(255, 93, 58, 0.55);
}

.btn-primary:not(:disabled):hover,
.btn-primary:not(:disabled):focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(255, 93, 58, 0.55), 0 16px 30px -8px rgba(255, 93, 58, 0.65);
}

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--line-soft);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--text-hi);
  border-color: var(--text-mid);
}

.hero-meta {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-low);
}

/* -------------------------------- tool section --------------------------- */

.tool-section {
  padding: 20px 0 100px;
}

.tool-panel {
  background: var(--ink-panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-m);
  padding: 8px;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2px;
  background: var(--line-soft);
  border-radius: calc(var(--radius-m) - 4px);
  overflow: hidden;
}

@media (max-width: 860px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

.stage {
  background: var(--ink-panel-2);
  padding: 28px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.stage-controls {
  background: var(--ink-panel-2);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* dropzone with crop-mark corners */
.dropzone {
  flex: 1;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-s);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
  min-height: 340px;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--cyan);
  background: rgba(51, 217, 198, 0.04);
}

.dropzone.dragover {
  border-color: var(--coral);
  background: rgba(255, 93, 58, 0.06);
}

.dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border: 2px solid var(--coral);
  border-radius: 4px;
  position: relative;
}

.dropzone-icon::before,
.dropzone-icon::after {
  content: "";
  position: absolute;
  background: var(--cyan);
}

.dropzone-icon::before {
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.dropzone-icon::after {
  top: 50%;
  left: 50%;
  width: 2px;
  height: 18px;
  transform: translate(-50%, -50%);
}

.dropzone-title {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 6px;
}

.dropzone-sub {
  color: var(--text-low);
  font-size: 13.5px;
  margin: 0;
}

.dropzone-sub .link {
  color: var(--cyan);
}

/* preview stage: image + overlay canvas + corner crop marks */
.preview-wrap {
  flex: 1;
  display: none;
  flex-direction: column;
  gap: 16px;
}

.preview-wrap.active {
  display: flex;
}

.preview-frame {
  position: relative;
  background: repeating-conic-gradient(
      var(--ink) 0% 25%,
      #191b26 0% 50%
    )
    50% / 18px 18px;
  border-radius: var(--radius-s);
  overflow: hidden;
  flex: 1;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-frame img,
.preview-frame canvas.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-frame canvas.overlay {
  pointer-events: none;
}

.corner-mark {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--coral);
  pointer-events: none;
  z-index: 2;
}

.corner-mark.tl {
  top: 8px;
  left: 8px;
  border-top: 2px solid var(--coral);
  border-left: 2px solid var(--coral);
}
.corner-mark.tr {
  top: 8px;
  right: 8px;
  border-top: 2px solid var(--coral);
  border-right: 2px solid var(--coral);
}
.corner-mark.bl {
  bottom: 8px;
  left: 8px;
  border-bottom: 2px solid var(--coral);
  border-left: 2px solid var(--coral);
}
.corner-mark.br {
  bottom: 8px;
  right: 8px;
  border-bottom: 2px solid var(--coral);
  border-right: 2px solid var(--coral);
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-low);
}

.file-name {
  color: var(--text-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.link-btn {
  background: none;
  border: none;
  color: var(--cyan);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* controls */
.control-block h2 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 4px;
  font-weight: 600;
}

.control-block p.hint {
  margin: 0 0 16px;
  color: var(--text-low);
  font-size: 13.5px;
}

.stepper-row {
  display: flex;
  gap: 14px;
}

.stepper {
  flex: 1;
  background: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-s);
  padding: 12px 14px;
}

.stepper label {
  display: block;
  font-size: 12px;
  color: var(--text-low);
  margin-bottom: 8px;
}

.stepper-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stepper-controls button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text-hi);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.stepper-controls button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.stepper-controls input {
  width: 46px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-hi);
  font-family: var(--font-display);
  font-size: 20px;
  -moz-appearance: textfield;
}

.stepper-controls input::-webkit-outer-spin-button,
.stepper-controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.page-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-s);
  padding: 16px 18px;
  margin-top: 16px;
}

.page-count .num {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--cyan);
  line-height: 1;
}

.page-count .label {
  font-size: 13.5px;
  color: var(--text-mid);
}

.generate-block {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.generate-block .btn-primary {
  justify-content: center;
  width: 100%;
  padding: 16px;
  font-size: 16px;
}

.status-line {
  font-size: 13px;
  color: var(--text-low);
  min-height: 18px;
}

.status-line.ok {
  color: var(--cyan);
}

.privacy-note {
  font-size: 12.5px;
  color: var(--text-low);
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
  margin-top: 4px;
}

.privacy-note a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* -------------------------------- steps ---------------------------------- */

.steps {
  padding: 20px 0 100px;
}

.steps h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 36px);
  margin: 0 0 40px;
  font-weight: 600;
  max-width: 20ch;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-m);
  overflow: hidden;
}

@media (max-width: 760px) {
  .step-list {
    grid-template-columns: 1fr;
  }
}

.step {
  background: var(--ink-panel);
  padding: 32px 26px;
}

.step .step-num {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--coral);
  margin: 0 0 14px;
}

.step h3 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 10px;
  font-weight: 600;
}

.step p {
  color: var(--text-mid);
  font-size: 14.5px;
  margin: 0;
}

/* -------------------------------- footer --------------------------------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 32px 0;
}

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

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 13.5px;
  color: var(--text-mid);
}

.footer-links a {
  text-decoration: none;
}

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

.footer-copy {
  font-size: 13px;
  color: var(--text-low);
}

/* -------------------------------- legal pages ----------------------------- */

.legal-hero {
  padding: 64px 0 20px;
}

.legal-hero .eyebrow-crop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--coral);
  margin-bottom: 14px;
}

.legal-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 48px);
  margin: 0 0 10px;
  font-weight: 600;
}

.legal-hero .updated {
  color: var(--text-low);
  font-size: 13.5px;
}

.legal-body {
  padding: 20px 0 100px;
  max-width: 720px;
}

.legal-body h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 40px 0 12px;
  font-weight: 600;
}

.legal-body h2:first-child {
  margin-top: 0;
}

.legal-body p {
  color: var(--text-mid);
  margin: 0 0 14px;
  font-size: 15px;
}

.legal-body ul {
  color: var(--text-mid);
  font-size: 15px;
  padding-left: 20px;
  margin: 0 0 14px;
}

.legal-body li {
  margin-bottom: 8px;
}

.legal-body strong {
  color: var(--text-hi);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 8px;
}

.back-link:hover {
  text-decoration: underline;
}

/* -------------------------------- responsivo: tablet e celular ------------ */

@media (max-width: 640px) {
  .wrap {
    padding: 0 18px;
  }

  .site-header .wrap {
    height: 58px;
  }

  .brand-word {
    font-size: 18px;
  }

  .header-nav {
    gap: 14px;
    font-size: 13px;
  }

  .hero {
    padding: 44px 0 32px;
  }

  .hero-inner {
    max-width: 100%;
  }

  .hero .tagline {
    max-width: none;
  }

  .hero-cta-row {
    gap: 12px;
  }

  .hero-cta-row .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .tool-section {
    padding: 4px 0 64px;
  }

  .tool-panel {
    padding: 6px;
    border-radius: var(--radius-s);
  }

  .stage,
  .stage-controls {
    padding: 18px;
  }

  .dropzone {
    min-height: 240px;
    padding: 28px 16px;
  }

  .preview-frame {
    min-height: 240px;
  }

  .stepper-row {
    gap: 10px;
  }

  .stepper {
    padding: 10px 12px;
  }

  .page-count {
    padding: 14px 16px;
  }

  .steps {
    padding: 4px 0 64px;
  }

  .steps h2 {
    margin-bottom: 24px;
  }

  .step {
    padding: 24px 20px;
  }

  .legal-hero {
    padding: 40px 0 16px;
  }

  .legal-body {
    padding: 16px 0 64px;
  }

  .legal-body h2 {
    margin: 32px 0 10px;
  }

  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

@media (max-width: 460px) {
  .header-nav {
    gap: 12px;
    font-size: 12.5px;
  }

  .header-nav .nav-optional {
    display: none;
  }

  .stepper-row {
    flex-direction: column;
  }

  .stepper-controls input {
    font-size: 18px;
  }

  .page-count {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .page-count .num {
    font-size: 30px;
  }

  .stepper-controls button {
    width: 34px;
    height: 34px;
  }

  .dropzone-title {
    font-size: 17px;
  }

  .file-name {
    max-width: 50%;
  }

  .footer-links {
    gap: 16px;
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .wrap {
    padding: 0 14px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .stage,
  .stage-controls {
    padding: 14px;
  }
}

/* -------------------------------- utility --------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.hidden {
  display: none !important;
}
