@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lato-400.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/lato-700.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("fonts/lato-900.woff2") format("woff2");
}

:root {
  --black: #0a0a0a;
  --ink: #171717;
  --muted: #5c5c5c;
  --coral: #f96269;
  --coral-text: #bc3841;
  --coral-soft: #fff1f2;
  --blue: #bfd0d6;
  --bg: #efefef;
  --card: #ffffff;
  --line: #dedede;
  --line-soft: #ececec;
  --warning-bg: #fff5d9;
  --warning-line: #efd58d;
  --warning-ink: #684c00;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 70px rgba(10, 10, 10, 0.08);
  --font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --header-height: 72px;
  --container: 1180px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding-top: var(--header-height);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

[hidden] {
  display: none !important;
}

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--coral-text);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

::selection {
  background: var(--coral);
  color: var(--black);
}

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.container {
  width: min(calc(100% - 48px), var(--container));
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(-180%);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--coral);
  color: var(--black);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-height);
  background: var(--black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
}

.brand img {
  display: block;
  width: auto;
  height: 28px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  min-width: 0;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 160ms ease;
}

.header-link:hover {
  color: #fff;
}

.header-link .icon {
  width: 15px;
  height: 15px;
}

/* Steps */

.steps-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding-top: clamp(38px, 5vw, 64px);
  padding-bottom: 22px;
}

.privacy-line {
  display: block;
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.steps-section > .privacy-line {
  grid-column: 1 / -1;
  margin-top: 0;
}

.privacy-line .icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 5px;
  vertical-align: -2px;
}

/* Tool card */

.tool-section {
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.tool-card {
  position: relative;
  scroll-margin-top: calc(var(--header-height) + 18px);
  padding: clamp(22px, 3.6vw, 42px);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.tool-card.is-dragover {
  outline: 3px dashed var(--coral);
  outline-offset: -8px;
}

.panel {
  max-width: 100%;
}

.panel-heading {
  max-width: 640px;
}

.panel-heading + .dropzone {
  margin-top: 26px;
}

.step {
  margin: 0 0 8px;
  color: var(--coral-text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.panel-heading h2,
.panel-message h2,
.result-side h2 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1.1;
}

.panel-description,
.panel-message > p:not(.step):not(.message-detail):not(.inline-error) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* Dropzone */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 330px;
  padding: clamp(32px, 5vw, 54px) 24px;
  border: 2px dashed #d2d2d2;
  border-radius: var(--radius-sm);
  background: #fbfbfb;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--coral);
  background: #fff7f7;
}

.dropzone:active {
  transform: scale(0.998);
}

.dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--black);
}

.dropzone-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone-title {
  display: block;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 900;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

.dropzone-sub {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.fake-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 24px;
  padding: 0 32px;
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease;
}

.dropzone:hover .fake-btn {
  background: var(--coral);
  color: var(--black);
}

.dropzone-help {
  display: block;
  margin-top: 16px;
  color: #777;
  font-size: 12px;
}

/* Loading / messages */

.panel-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 620px;
  min-height: 360px;
  margin-inline: auto;
  padding: 42px 20px;
  text-align: center;
  justify-content: center;
}

.panel-message .step {
  margin-top: 16px;
}

.panel-message > p {
  max-width: 480px;
}

.message-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.message-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-icon-warning {
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.message-icon-error {
  background: var(--coral-soft);
  color: var(--coral-text);
}

.message-detail {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 30px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.btn:hover {
  background: var(--coral);
  color: var(--black);
}

.btn-outline {
  border-color: var(--black);
  background: transparent;
  color: var(--black);
}

.btn-outline:hover {
  background: var(--black);
  color: #fff;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:disabled:hover {
  background: var(--black);
  color: #fff;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.link-btn .icon {
  width: 15px;
  height: 15px;
}

.link-btn-center {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
}

.link-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: none;
}

input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.message-detail {
  overflow-wrap: anywhere;
}

/* Editor */

.editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  max-width: none;
}

.file-chip {
  max-width: 46%;
  margin: 4px 0 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: #f4f4f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 26px;
  align-items: start;
  margin-top: 26px;
}

.stage-column {
  min-width: 0;
}

.stage-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--black);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.stage-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.cropper-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 780;
  overflow: hidden;
  background: #111;
  cursor: grab;
  touch-action: none;
}

.cropper-stage:active {
  cursor: grabbing;
}

.cropper-stage:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.cropper-stage > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

.stage-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.62);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  pointer-events: none;
}

.stage-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px 0 0;
  color: #767676;
  font-size: 12px;
  text-align: center;
}

.stage-hint .icon {
  width: 15px;
  height: 15px;
}

.editor-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #f8f8f8;
}

.side-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.side-title-row h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.zoom-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #d9d9d9;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.icon-btn:hover {
  border-color: var(--black);
  background: var(--black);
  color: #fff;
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

input[type="range"] {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: 0;
  accent-color: var(--coral);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: #d7d7d7;
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--coral);
  -webkit-appearance: none;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #d7d7d7;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--coral);
}

.meta-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.meta-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.meta-list dt {
  color: var(--muted);
  font-size: 12px;
}

.meta-list dd {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.crop-warning,
.result-warning,
.inline-error {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--warning-line);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning-ink);
  font-size: 12px;
  line-height: 1.4;
}

.inline-error {
  border-color: #f1b5b8;
  background: #fff2f2;
  color: #8b1c24;
}

.spinner {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 780ms linear infinite;
}

.spinner-dark {
  width: 42px;
  height: 42px;
  border-width: 3px;
  border-color: #e6e6e6;
  border-top-color: var(--coral);
  margin-bottom: 18px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result */

.panel-result {
  padding: 4px 0;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.result-preview {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f5f5f5;
}

.result-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 780;
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
}

.result-badge {
  position: absolute;
  top: 22px;
  left: 22px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

.result-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-title-row h2 {
  font-size: clamp(26px, 3.4vw, 34px);
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--black);
}

.success-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.result-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 15px 16px;
  border-radius: 10px;
  background: #f5f5f5;
}

.result-stats span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.result-stats strong {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.result-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.result-note.is-success {
  color: #326b44;
  font-weight: 700;
}

.result-side .btn {
  margin-top: 6px;
}

/* Steps */

.info-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 210px;
  padding: clamp(18px, 2.2vw, 26px);
  border: 3px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--black);
  text-align: center;
}

.info-card-coral {
  border-color: var(--coral);
}

.info-card-blue {
  border-color: var(--blue);
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.info-card-coral .info-icon {
  background: var(--coral);
}

.info-card-blue .info-icon {
  background: var(--blue);
}

.info-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-card h2 {
  margin: 10px 0 6px;
  font-size: clamp(21px, 2.4vw, 26px);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.info-card p {
  margin: 0;
  max-width: 440px;
  font-size: 14px;
  line-height: 1.55;
}

.noscript {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid var(--warning-line);
  border-radius: 10px;
  background: var(--warning-bg);
  color: var(--warning-ink);
  font-size: 13px;
}

/* Footer */

.site-footer {
  margin-top: clamp(40px, 5vw, 64px);
  padding: 24px 0;
  background: var(--black);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
}

.footer-nav a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Cropper overrides */

.cropper-container {
  touch-action: none;
}

.cropper-view-box {
  outline: 0;
  box-shadow: none;
}

.cropper-line,
.cropper-point {
  display: none;
}

.cropper-modal {
  opacity: 0;
}

.cropper-face {
  background-color: transparent;
}

.cropper-bg {
  background: none;
}

/* Responsive */

@media (max-width: 900px) {
  .editor-grid,
  .result-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .editor-side > .crop-warning,
  .editor-side > .btn,
  .editor-side > .inline-error,
  .editor-side > .link-btn-center {
    grid-column: 1 / -1;
  }

  .steps-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-side {
    max-width: 620px;
  }
}

@media (max-width: 680px) {
  :root {
    --header-height: 62px;
  }

  .container {
    width: min(calc(100% - 32px), var(--container));
  }

  .brand img {
    height: 23px;
  }

  .header-nav {
    gap: 16px;
  }

  .header-link {
    font-size: 10px;
    letter-spacing: 0.7px;
  }

  .steps-section {
    padding-top: 34px;
  }

  .tool-card {
    padding: 18px;
  }

  .dropzone {
    min-height: 300px;
    padding: 34px 16px;
  }

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

  .fake-btn {
    width: 100%;
    max-width: 280px;
  }

  .editor-heading {
    flex-direction: column;
    gap: 12px;
  }

  .file-chip {
    max-width: 100%;
    margin: 0;
  }

  .editor-side {
    display: flex;
    align-items: stretch;
    padding: 18px;
  }

  .panel-message {
    min-height: 320px;
    padding: 30px 6px;
  }

  .message-actions {
    flex-direction: column;
    width: 100%;
  }

  .message-actions .btn {
    width: 100%;
  }

  .result-stats strong {
    font-size: 20px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .header-link {
    font-size: 9px;
  }

  .brand img {
    height: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
