/* ============================================================
   MAZECUT — styles.css

   Visual direction:
   - Dark photographic studio
   - Warm orange / cream accents
   - Large editorial typography
   - Strong contrast
   - Separate mobile layout instead of a squeezed desktop view

   This file is intentionally expanded and commented so it is
   easier to edit in VS Code.
   ============================================================ */


/* ============================================================
   01. DESIGN TOKENS
   ============================================================ */

:root {
  /* Main surfaces */
  --background: #111111;
  --surface: #171717;
  --surface-raised: #1d1d1d;
  --surface-soft: #222222;

  /* Text */
  --text: #f4f4f1;
  --text-soft: #c8c6bf;
  --muted: #8e8e8a;
  --muted-dark: #646460;

  /* Lines */
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* Brand accents */
  --orange: #ff5a36;
  --orange-hover: #ff7151;
  --yellow: #f6c453;
  --cream: #f2eee4;

  /* Status */
  --success: #83e6ac;
  --danger: #ff6969;

  /* Fonts */
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;

  /* Layout */
  --page-padding: clamp(18px, 3.4vw, 58px);
  --topbar-height: 76px;

  /* Radius */
  --radius-small: 10px;
  --radius-medium: 18px;
  --radius-large: 28px;

  /* Easing */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}


/* ============================================================
   02. RESET
   ============================================================ */

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


html {
  background: var(--background);
  scroll-behavior: auto;
}


body {
  margin: 0;

  min-width: 320px;

  overflow-x: hidden;

  background:
    radial-gradient(
      circle at 85% 8%,
      rgba(255, 90, 54, 0.08),
      transparent 23%
    ),
    var(--background);

  color: var(--text);

  font-family: var(--font-sans);

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


button,
input {
  font: inherit;
}


button {
  color: inherit;
  cursor: pointer;
}


button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}


a {
  color: inherit;
  text-decoration: none;
}


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


[hidden] {
  display: none !important;
}


::selection {
  background: var(--yellow);
  color: #111111;
}


.noscript {
  display: block;

  padding: 12px;

  background: var(--danger);
  color: #111111;

  text-align: center;
  font-weight: 700;
}


/* ============================================================
   03. SMALL SHARED UTILITIES
   ============================================================ */

.mono,
.eyebrow {
  color: var(--muted);

  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}


.eyebrow {
  margin: 0 0 20px;
}


.accent {
  color: var(--orange);
}


/* Transparent-image checkerboard */

.checkerboard {
  background-color: #eeeeeb;

  background-image:
    linear-gradient(
      45deg,
      #d4d4d0 25%,
      transparent 25%
    ),
    linear-gradient(
      -45deg,
      #d4d4d0 25%,
      transparent 25%
    ),
    linear-gradient(
      45deg,
      transparent 75%,
      #d4d4d0 75%
    ),
    linear-gradient(
      -45deg,
      transparent 75%,
      #d4d4d0 75%
    );

  background-size: 24px 24px;

  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
}


/* ============================================================
   04. BUTTONS
   ============================================================ */

.btn {
  min-height: 48px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 0 18px;

  border: 1px solid transparent;
  border-radius: 999px;

  font-size: 10px;
  font-weight: 700;

  transition:
    transform 0.25s var(--ease-out),
    background 0.20s ease,
    border-color 0.20s ease,
    color 0.20s ease;
}


.btn:hover {
  transform: translateY(-2px);
}


.btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}


.btn--primary {
  background: var(--orange);
  color: #111111;
}


.btn--primary:hover {
  background: var(--orange-hover);
}


.btn--quiet {
  border-color: var(--line-strong);

  background: transparent;
  color: var(--text-soft);
}


.btn--quiet:hover {
  border-color: rgba(255, 255, 255, 0.30);
}


.btn--download {
  width: 100%;
  min-height: 56px;

  justify-content: space-between;

  border-radius: 13px;

  background: var(--cream);
  color: #111111;

  font-size: 11px;
}


/* ============================================================
   05. FIXED TOPBAR
   ============================================================ */

.topbar {
  position: fixed;
  z-index: 100;

  top: 0;
  left: 0;
  right: 0;

  height: var(--topbar-height);

  display: grid;

  grid-template-columns:
    1fr
    auto
    1fr;

  align-items: center;

  padding:
    0
    var(--page-padding);

  border-bottom:
    1px solid
    var(--line);

  background:
    rgba(17, 17, 17, 0.90);

  backdrop-filter:
    blur(16px);

  -webkit-backdrop-filter:
    blur(16px);
}


/* Logo / brand */

.brand {
  justify-self: start;

  min-width: 0;

  display: flex;
  align-items: center;
  gap: 11px;
}


.brand img {
  width: 38px;
  height: 38px;

  flex: 0 0 auto;
}


.brand > span {
  min-width: 0;

  display: flex;
  flex-direction: column;
}


.brand strong {
  font-size: 13px;
  letter-spacing: -0.02em;
}


.brand small {
  margin-top: 2px;

  color: var(--muted);

  font-family: var(--font-mono);
  font-size: 7px;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* Center status */

.topbar__status {
  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--muted);

  font-family: var(--font-mono);
  font-size: 7px;

  letter-spacing: 0.09em;
  text-transform: uppercase;
}


.topbar__status i {
  width: 6px;
  height: 6px;

  flex: 0 0 auto;

  border-radius: 50%;

  background: var(--success);

  box-shadow:
    0
    0
    12px
    rgba(131, 230, 172, 0.55);
}


/* Right-side jump link */

.topbar__jump {
  justify-self: end;

  display: flex;
  align-items: center;
  gap: 10px;

  color: var(--text-soft);

  font-family: var(--font-mono);
  font-size: 8px;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ============================================================
   06. HERO
   ============================================================ */

.hero {
  min-height: 100svh;

  display: grid;

  grid-template-rows:
    auto
    1fr
    auto;

  padding:
    calc(var(--topbar-height) + 38px)
    var(--page-padding)
    28px;

  overflow: hidden;
}


/* Top / bottom technical labels */

.hero__meta,
.hero__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding-bottom: 14px;

  border-bottom:
    1px solid
    var(--line);

  color: var(--muted);

  font-family: var(--font-mono);
  font-size: 7px;

  letter-spacing: 0.12em;
}


.hero__footer {
  justify-content: flex-start;

  gap:
    clamp(
      22px,
      4vw,
      62px
    );

  padding:
    14px
    0
    0;

  border-top:
    1px solid
    var(--line);

  border-bottom: 0;
}


/* Hero content split */

.hero__grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.1fr)
    minmax(420px, 0.9fr);

  align-items: center;

  gap:
    clamp(
      40px,
      7vw,
      120px
    );

  padding:
    clamp(
      54px,
      7vh,
      88px
    )
    0;
}


/* Main heading */

.hero__copy h1 {
  margin: 0;

  font-size:
    clamp(
      62px,
      8.5vw,
      146px
    );

  line-height: 0.78;

  letter-spacing: -0.075em;
}


.hero__copy h1 span {
  display: block;
}


.hero__lede {
  max-width: 610px;

  margin:
    32px
    0
    0;

  color: var(--text-soft);

  font-size:
    clamp(
      13px,
      1.2vw,
      17px
    );

  line-height: 1.7;
}


.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;

  margin-top: 31px;
  padding-bottom: 6px;

  border-bottom:
    1px solid
    var(--orange);

  color: var(--orange);

  font-family: var(--font-mono);
  font-size: 9px;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ============================================================
   07. HERO VISUAL
   ============================================================ */

.hero__visual {
  position: relative;

  justify-self: end;

  width:
    min(
      39vw,
      610px
    );

  aspect-ratio: 0.9;
}


/* Two stacked demo cards */

.photo-card {
  position: absolute;

  width: 53%;
  aspect-ratio: 0.82;

  overflow: hidden;

  border:
    1px solid
    var(--line-strong);

  border-radius: 23px;

  box-shadow:
    0
    32px
    80px
    rgba(0, 0, 0, 0.34);
}


.photo-card--original {
  top: 6%;
  left: 6%;

  transform:
    rotate(-8deg);

  background:
    linear-gradient(
      145deg,
      #665044,
      #2d2826 50%,
      #7c6650
    );
}


.fake-person {
  position: absolute;

  inset:
    20%
    24%
    0;

  border-radius:
    55%
    55%
    18%
    18%;

  background:
    radial-gradient(
      circle at 50% 18%,
      #d6af91 0 18%,
      transparent 19%
    ),
    linear-gradient(
      180deg,
      transparent 0 27%,
      #222222 28% 100%
    );
}


.photo-card--cut {
  right: 4%;
  bottom: 3%;

  transform:
    rotate(5deg);
}


.fake-cutout {
  position: absolute;

  inset:
    15%
    22%
    0;

  border-radius: 48%;

  background:
    radial-gradient(
      circle at 50% 16%,
      #242424 0 16%,
      transparent 17%
    ),
    linear-gradient(
      180deg,
      transparent 0 27%,
      #242424 28% 100%
    );
}


/* Decorative orbital lines */

.orbit {
  position: absolute;

  border:
    1px solid
    rgba(255, 90, 54, 0.18);

  border-radius: 50%;
}


.orbit--one {
  width: 75%;
  aspect-ratio: 1;

  top: 2%;
  right: -12%;
}


.orbit--two {
  width: 44%;
  aspect-ratio: 1;

  left: 9%;
  bottom: 3%;
}


/* Small editorial labels */

.sticker {
  position: absolute;
  z-index: 4;

  padding:
    8px
    10px;

  background: var(--yellow);
  color: #111111;

  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 500;

  letter-spacing: 0.10em;
}


.sticker--one {
  top: 20%;
  left: 0;

  transform:
    rotate(-8deg);
}


.sticker--two {
  right: 0;
  bottom: 18%;

  background: var(--orange);

  transform:
    rotate(5deg);
}


/* ============================================================
   08. SECTION LAYOUT
   ============================================================ */

.studio,
.process-section {
  padding:
    clamp(
      90px,
      9vw,
      150px
    )
    var(--page-padding);
}


.studio {
  border-top:
    1px solid
    var(--line);

  background: #141414;
}


.section-heading {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(280px, 0.58fr);

  align-items: end;

  gap:
    clamp(
      40px,
      7vw,
      110px
    );

  margin-bottom:
    clamp(
      48px,
      6vw,
      88px
    );
}


.section-heading h2 {
  margin: 0;

  font-size:
    clamp(
      58px,
      7vw,
      112px
    );

  line-height: 0.88;

  letter-spacing: -0.065em;
}


.section-heading > p {
  margin: 0;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.65;
}


.section-heading.compact {
  grid-template-columns: 1fr;
}


/* ============================================================
   09. UPLOAD STATE
   ============================================================ */

.upload-state,
.processing-state {
  max-width: 1120px;
  margin: 0 auto;
}


.drop-zone {
  position: relative;

  min-height: 580px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding:
    clamp(
      28px,
      5vw,
      70px
    );

  overflow: hidden;

  border:
    1px solid
    var(--line-strong);

  border-radius:
    var(--radius-large);

  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(255, 90, 54, 0.08),
      transparent 30%
    ),
    #191919;

  text-align: center;

  transition:
    transform 0.25s var(--ease-out),
    border-color 0.25s ease,
    background 0.25s ease;
}


.drop-zone::before {
  content: "";

  position: absolute;

  inset: 22px;

  border:
    1px dashed
    var(--line);

  border-radius: 19px;

  pointer-events: none;
}


/* Dragging state */

.drop-zone.is-dragging {
  transform: scale(1.008);

  border-color:
    var(--orange);

  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(255, 90, 54, 0.16),
      transparent 38%
    ),
    #191919;
}


/* Decorative corner marks */

.corner {
  position: absolute;

  width: 26px;
  height: 26px;

  border-color:
    var(--orange);
}


.tl {
  top: 20px;
  left: 20px;

  border-top: 1px solid;
  border-left: 1px solid;
}


.tr {
  top: 20px;
  right: 20px;

  border-top: 1px solid;
  border-right: 1px solid;
}


.bl {
  bottom: 20px;
  left: 20px;

  border-bottom: 1px solid;
  border-left: 1px solid;
}


.br {
  right: 20px;
  bottom: 20px;

  border-right: 1px solid;
  border-bottom: 1px solid;
}


/* Upload icon */

.drop-icon {
  position: relative;

  width: 86px;
  height: 86px;

  display: grid;
  place-items: center;

  margin-bottom: 30px;

  border:
    1px solid
    var(--line-strong);

  border-radius: 50%;

  background: #111111;
}


.drop-icon span {
  position: absolute;

  width: 128px;
  height: 1px;

  background:
    var(--line-strong);

  transform:
    rotate(-45deg);
}


.drop-icon b {
  position: relative;
  z-index: 2;

  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: var(--orange);
  color: #111111;

  font-size: 22px;
}


/* Upload text */

.drop-zone h3 {
  max-width: 780px;

  margin:
    9px
    auto
    0;

  font-size:
    clamp(
      44px,
      5.4vw,
      78px
    );

  line-height: 0.94;

  letter-spacing: -0.055em;
}


.drop-zone p {
  margin:
    12px
    0
    0;

  color: var(--muted);

  font-size: 12px;
}


.drop-zone .btn {
  position: relative;
  z-index: 2;

  margin-top: 30px;
}


.drop-limits {
  position: absolute;

  left: 42px;
  right: 42px;
  bottom: 39px;

  display: flex;
  justify-content: space-between;

  color: var(--muted-dark);

  font-family: var(--font-mono);
  font-size: 7px;

  letter-spacing: 0.08em;
}


/* ============================================================
   10. PROCESSING STATE
   ============================================================ */

.processing-card {
  display: grid;

  grid-template-columns:
    minmax(310px, 0.80fr)
    minmax(0, 1.20fr);

  min-height: 590px;

  overflow: hidden;

  border:
    1px solid
    var(--line-strong);

  border-radius:
    var(--radius-large);

  background: #181818;
}


/* Preview side */

.processing-image {
  position: relative;

  min-height: 590px;

  display: grid;
  place-items: center;

  overflow: hidden;
}


.processing-image img {
  width: 72%;
  max-height: 440px;

  object-fit: contain;

  filter:
    saturate(0.75)
    contrast(0.98);

  box-shadow:
    0
    30px
    70px
    rgba(0, 0, 0, 0.20);
}


/* Scanning line */

.scan-line {
  position: absolute;

  left: 8%;
  right: 8%;

  height: 2px;

  background:
    var(--orange);

  box-shadow:
    0
    0
    16px
    var(--orange);

  animation:
    scan-line-move
    2.10s
    linear
    infinite;
}


@keyframes scan-line-move {
  0% {
    top: 8%;
  }

  100% {
    top: 92%;
  }
}


/* Status / progress side */

.processing-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;

  padding:
    clamp(
      34px,
      5vw,
      76px
    );

  border-left:
    1px solid
    var(--line);
}


.processing-copy h3 {
  margin:
    12px
    0
    0;

  font-size:
    clamp(
      45px,
      5vw,
      76px
    );

  line-height: 0.94;

  letter-spacing: -0.06em;
}


.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;

  margin-top: 55px;

  color: var(--muted);

  font-size: 10px;
}


.progress-row strong {
  color: var(--text);

  font-family: var(--font-mono);
  font-size: 9px;
}


.progress {
  height: 3px;

  margin-top: 11px;

  overflow: hidden;

  background:
    var(--line);
}


.progress i {
  display: block;

  width: 0;
  height: 100%;

  background:
    var(--orange);

  transition:
    width
    0.35s
    var(--ease-out);
}


.processing-steps {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 8px;

  margin-top: 36px;
}


.processing-steps span {
  padding-top: 10px;

  border-top:
    1px solid
    var(--line);

  color: var(--muted-dark);

  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.4;
}


.processing-steps span.active {
  border-color:
    var(--orange);

  color:
    var(--orange);
}


/* ============================================================
   11. RESULT TOOLBAR
   ============================================================ */

.result-workspace {
  max-width: 1460px;
  margin: 0 auto;
}


.result-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;

  margin-bottom: 12px;

  padding:
    16px
    18px;

  border:
    1px solid
    var(--line);

  border-radius: 13px;

  background:
    var(--surface);
}


.result-topbar > div:first-child {
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 4px;
}


.result-topbar strong {
  overflow: hidden;

  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 12px;
}


.result-topbar > div:last-child {
  display: flex;
  gap: 8px;
}


/* ============================================================
   12. RESULT GRID
   ============================================================ */

.result-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(285px, 350px);

  gap: 12px;
}


.compare-card,
.output-panel {
  border:
    1px solid
    var(--line);

  border-radius:
    var(--radius-medium);

  background:
    var(--surface);
}


.compare-card {
  min-width: 0;

  padding: 20px;
}


/* Shared small card header */

.card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 17px;
}


.card-head h3 {
  margin:
    6px
    0
    0;

  font-size:
    clamp(
      25px,
      2.4vw,
      37px
    );

  line-height: 1;

  letter-spacing: -0.045em;
}


.card-head > span {
  color:
    var(--muted);

  font-family:
    var(--font-mono);

  font-size: 7px;
}


/* ============================================================
   13. BEFORE / AFTER COMPARISON
   ============================================================ */

.comparison {
  position: relative;

  min-height:
    min(
      66svh,
      720px
    );

  overflow: hidden;

  border-radius: 12px;

  background: #090909;

  touch-action: none;
  user-select: none;
}


.compare-layer {
  position: absolute;

  inset: 0;

  overflow: hidden;
}


.compare-layer img {
  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: center;
}


/* Original image is clipped to the slider position */

.compare-layer--original {
  clip-path:
    inset(
      0
      calc(100% - var(--split))
      0
      0
    );
}


/* Vertical split line */

.divider {
  position: absolute;
  z-index: 5;

  top: 0;
  bottom: 0;
  left: var(--split);

  width: 1px;

  background:
    var(--cream);

  transform:
    translateX(-50%);

  box-shadow:
    0
    0
    18px
    rgba(255, 255, 255, 0.22);
}


/* Circular comparison handle */

.handle {
  position: absolute;
  z-index: 6;

  top: 50%;
  left: var(--split);

  width: 58px;
  height: 58px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;

  border:
    1px solid
    var(--line-strong);

  border-radius: 50%;

  background:
    var(--cream);

  color: #111111;

  transform:
    translate(-50%, -50%);

  pointer-events: none;

  font-family:
    var(--font-mono);

  font-size: 10px;

  box-shadow:
    0
    9px
    28px
    rgba(0, 0, 0, 0.25);
}


/* Invisible range input receives mouse/touch interaction */

#comparison-range {
  position: absolute;
  z-index: 8;

  inset: 0;

  width: 100%;
  height: 100%;

  appearance: none;
  -webkit-appearance: none;

  opacity: 0;

  cursor: ew-resize;
}


/* Original / cutout labels */

.compare-label {
  position: absolute;
  z-index: 7;

  top: 14px;

  padding:
    7px
    9px;

  background:
    rgba(17, 17, 17, 0.72);

  color: #ffffff;

  font-family:
    var(--font-mono);

  font-size: 7px;

  letter-spacing: 0.10em;

  pointer-events: none;

  backdrop-filter:
    blur(8px);

  -webkit-backdrop-filter:
    blur(8px);
}


.compare-label.before {
  left: 14px;
}


.compare-label.after {
  right: 14px;

  background:
    var(--orange);

  color: #111111;
}


/* ============================================================
   14. OUTPUT PANEL
   ============================================================ */

.output-panel {
  align-self: start;

  padding: 22px;
}


.control-block {
  padding:
    22px
    0;

  border-top:
    1px solid
    var(--line);
}


.control-label {
  display: block;

  margin-bottom: 12px;

  color:
    var(--muted);

  font-family:
    var(--font-mono);

  font-size: 7px;

  text-transform: uppercase;
  letter-spacing: 0.10em;
}


/* Background choices */

.background-options {
  display: grid;

  grid-template-columns:
    1fr
    1fr;

  gap: 7px;
}


.bg-option {
  min-height: 72px;

  display: grid;

  grid-template-columns:
    28px
    1fr;

  align-items: center;

  gap: 9px;

  padding: 10px;

  border:
    1px solid
    var(--line);

  border-radius: 10px;

  background: #141414;
  color: var(--muted);

  text-align: left;

  transition:
    border-color 0.20s ease,
    background 0.20s ease,
    color 0.20s ease;
}


.bg-option:hover {
  border-color:
    rgba(255, 255, 255, 0.20);
}


.bg-option i {
  width: 28px;
  height: 28px;

  display: block;

  overflow: hidden;

  border:
    1px solid
    var(--line-strong);

  border-radius: 7px;
}


.bg-option span {
  font-size: 8px;
  font-weight: 600;
}


.bg-option.active {
  border-color:
    rgba(255, 90, 54, 0.55);

  background:
    rgba(255, 90, 54, 0.08);

  color: var(--text);
}


/* Custom color row */

.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-top: 10px;

  padding:
    10px
    12px;

  border:
    1px solid
    var(--line);

  border-radius: 9px;

  color:
    var(--muted);

  font-size: 8px;
}


.color-row input {
  width: 35px;
  height: 28px;

  padding: 0;

  border: 0;

  background:
    transparent;
}


/* File information grid */

.file-details {
  display: grid;

  grid-template-columns:
    1fr
    1fr;

  gap: 1px;

  overflow: hidden;

  border:
    1px solid
    var(--line);

  border-radius: 10px;

  background:
    var(--line);
}


.file-details div {
  padding: 11px;

  background: #141414;
}


.file-details span {
  display: block;

  color:
    var(--muted);

  font-size: 7px;
}


.file-details strong {
  display: block;

  margin-top: 4px;

  font-family:
    var(--font-mono);

  font-size: 8px;
  font-weight: 500;
}


.output-panel .btn--download {
  margin-top: 22px;
}


/* ============================================================
   15. THREE-STEP PROCESS
   ============================================================ */

.process-section {
  border-top:
    1px solid
    var(--line);
}


.process-grid {
  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  border-top:
    1px solid
    var(--line);

  border-left:
    1px solid
    var(--line);
}


.process-grid article {
  min-height: 390px;

  display: flex;
  flex-direction: column;

  padding:
    clamp(
      24px,
      3vw,
      42px
    );

  border-right:
    1px solid
    var(--line);

  border-bottom:
    1px solid
    var(--line);

  background:
    #131313;
}


.process-grid article > span {
  color:
    var(--muted);

  font-family:
    var(--font-mono);

  font-size: 8px;
}


.process-icon {
  width: 112px;
  height: 112px;

  display: grid;
  place-items: center;

  margin:
    auto
    0;

  border:
    1px solid
    var(--line);

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      var(--orange) 0 24%,
      transparent 25%
    );

  color: #111111;

  font-family:
    var(--font-mono);

  font-size: 14px;
}


.process-icon.cut {
  background:
    radial-gradient(
      circle,
      var(--yellow) 0 24%,
      transparent 25%
    );
}


.process-grid h3 {
  margin: 0;

  font-size:
    clamp(
      34px,
      3vw,
      50px
    );

  line-height: 0.95;

  letter-spacing: -0.05em;
}


.process-grid p {
  max-width: 360px;

  margin:
    13px
    0
    0;

  color:
    var(--muted);

  font-size: 11px;
  line-height: 1.6;
}


/* ============================================================
   16. FOOTER
   ============================================================ */

.footer {
  min-height: 170px;

  display: grid;

  grid-template-columns:
    1fr
    auto
    auto;

  align-items: end;

  gap: 40px;

  padding:
    45px
    var(--page-padding)
    28px;

  border-top:
    1px solid
    var(--line);

  background:
    #0d0d0d;
}


.footer > div {
  display: flex;
  flex-wrap: wrap;

  gap:
    10px
    20px;

  color:
    var(--muted);

  font-family:
    var(--font-mono);

  font-size: 7px;
}


.footer > div:first-child {
  flex-direction: column;
  gap: 4px;
}


.footer strong {
  color:
    var(--text);

  font-family:
    var(--font-sans);

  font-size: 12px;
}


.footer a {
  color:
    var(--orange);

  font-family:
    var(--font-mono);

  font-size: 8px;
}


/* ============================================================
   17. TOAST
   ============================================================ */

.toast {
  position: fixed;
  z-index: 300;

  right: 18px;
  bottom: 18px;

  max-width:
    min(
      360px,
      calc(100vw - 36px)
    );

  padding:
    12px
    14px;

  border:
    1px solid
    var(--line-strong);

  border-radius: 10px;

  background:
    var(--cream);

  color: #111111;

  font-size: 10px;
  font-weight: 600;

  opacity: 0;

  transform:
    translateY(10px);

  pointer-events: none;

  box-shadow:
    0
    20px
    48px
    rgba(0, 0, 0, 0.25);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}


.toast.visible {
  opacity: 1;

  transform:
    translateY(0);
}


/* ============================================================
   18. TABLET
   ============================================================ */

@media (max-width: 980px) {

  .topbar {
    grid-template-columns:
      1fr
      auto;
  }


  .topbar__status {
    display: none;
  }


  .hero__grid {
    grid-template-columns:
      1fr;
  }


  .hero__visual {
    justify-self: center;

    width:
      min(
        78vw,
        560px
      );
  }


  .section-heading {
    grid-template-columns:
      1fr;
  }


  .section-heading > p {
    max-width:
      620px;
  }


  .processing-card {
    grid-template-columns:
      1fr;
  }


  .processing-image {
    min-height:
      450px;
  }


  .processing-copy {
    border-top:
      1px solid
      var(--line);

    border-left: 0;
  }


  .result-grid {
    grid-template-columns:
      1fr;
  }


  .output-panel {
    width: 100%;

    display: grid;

    grid-template-columns:
      1fr
      1fr;

    gap:
      0
      24px;
  }


  .output-panel .card-head {
    grid-column:
      1 / -1;
  }


  .output-panel .btn--download {
    align-self: end;
  }

}


/* ============================================================
   19. MOBILE
   ============================================================ */

@media (max-width: 700px) {

  :root {
    --topbar-height: 64px;
    --page-padding: 14px;
  }


  html {
    scroll-padding-top:
      calc(
        var(--topbar-height) +
        env(safe-area-inset-top) +
        12px
      );
  }


  body {
    min-height: 100svh;

    background:
      #111111;
  }


  /* ----------------------------------------------------------
     Mobile topbar
     ---------------------------------------------------------- */

  .topbar {
    height:
      calc(
        var(--topbar-height) +
        env(safe-area-inset-top)
      );

    padding:
      env(safe-area-inset-top)
      13px
      0;

    background:
      rgba(17, 17, 17, 0.96);
  }


  .brand {
    min-width: 0;
  }


  .brand img {
    width: 34px;
    height: 34px;
  }


  .brand strong {
    font-size: 12px;
  }


  .brand small {
    display: none;
  }


  .topbar__jump {
    gap: 7px;

    white-space: nowrap;

    font-size: 7px;
  }


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

  .hero {
    min-height: auto;

    padding:
      calc(
        var(--topbar-height) +
        env(safe-area-inset-top) +
        25px
      )
      14px
      24px;
  }


  .hero__meta {
    font-size: 6px;
  }


  .hero__grid {
    gap: 35px;

    padding:
      52px
      0
      40px;
  }


  .hero__copy,
  .hero__visual {
    min-width: 0;
  }


  .hero__copy h1 {
    font-size:
      clamp(
        53px,
        18.5vw,
        82px
      );

    line-height: 0.81;
  }


  .hero__lede {
    margin-top: 23px;

    font-size: 13px;
    line-height: 1.6;
  }


  .hero__cta {
    margin-top: 23px;

    font-size: 8px;
  }


  .hero__visual {
    justify-self: center;

    width:
      min(
        92vw,
        430px
      );
  }


  .hero__footer {
    flex-wrap: wrap;

    gap:
      13px
      24px;

    font-size: 6px;
  }


  .hero__footer span {
    white-space: nowrap;
  }


  /* ----------------------------------------------------------
     Mobile section spacing
     ---------------------------------------------------------- */

  .studio,
  .process-section {
    padding:
      76px
      14px;
  }


  .section-heading {
    gap: 23px;

    margin-bottom: 38px;
  }


  .section-heading h2 {
    font-size:
      clamp(
        48px,
        15vw,
        68px
      );
  }


  .section-heading > p {
    font-size: 11px;
  }


  /* ----------------------------------------------------------
     Mobile upload
     ---------------------------------------------------------- */

  .drop-zone {
    width: 100%;
    min-height: 490px;

    padding:
      28px
      18px
      78px;

    border-radius: 18px;
  }


  .drop-zone::before {
    inset: 11px;

    border-radius: 13px;
  }


  .corner {
    width: 17px;
    height: 17px;
  }


  .tl,
  .tr {
    top: 10px;
  }


  .bl,
  .br {
    bottom: 10px;
  }


  .tl,
  .bl {
    left: 10px;
  }


  .tr,
  .br {
    right: 10px;
  }


  .drop-icon {
    width: 72px;
    height: 72px;

    margin-bottom: 23px;
  }


  .drop-icon span {
    width: 104px;
  }


  .drop-zone h3 {
    overflow-wrap: anywhere;

    font-size:
      clamp(
        39px,
        12.5vw,
        54px
      );
  }


  .drop-zone p {
    font-size: 11px;
  }


  .drop-zone .btn {
    width: 100%;
    min-height: 52px;
  }


  .drop-limits {
    left: 24px;
    right: 24px;
    bottom: 29px;

    font-size: 6px;
  }


  /* ----------------------------------------------------------
     Mobile processing
     ---------------------------------------------------------- */

  .processing-card {
    min-height: 0;

    border-radius: 18px;
  }


  .processing-image {
    min-height: 0;

    aspect-ratio: 1 / 1;
  }


  .processing-image img {
    width: auto;
    max-width: 82%;
    max-height: 82%;
  }


  .processing-copy {
    padding:
      27px
      20px
      30px;
  }


  .processing-copy h3 {
    font-size:
      clamp(
        37px,
        11vw,
        52px
      );
  }


  .progress-row {
    margin-top: 34px;
  }


  .processing-steps {
    grid-template-columns:
      1fr
      1fr;

    gap:
      15px
      8px;

    margin-top: 28px;
  }


  /* ----------------------------------------------------------
     Mobile result topbar
     ---------------------------------------------------------- */

  .result-workspace,
  .compare-card,
  .output-panel {
    min-width: 0;
  }


  .result-topbar {
    align-items: flex-start;
    flex-direction: column;

    padding: 14px;
  }


  .result-topbar strong {
    max-width:
      calc(
        100vw - 56px
      );
  }


  .result-topbar > div:last-child {
    width: 100%;

    display: grid;

    grid-template-columns:
      1fr
      1fr;
  }


  .result-topbar .btn {
    min-height: 44px;

    padding:
      0
      10px;

    font-size: 8px;
  }


  /* ----------------------------------------------------------
     Mobile comparison
     ---------------------------------------------------------- */

  .result-grid {
    gap: 8px;
  }


  .compare-card,
  .output-panel {
    border-radius: 15px;
  }


  .compare-card {
    padding: 12px;
  }


  .card-head {
    align-items: flex-start;
    flex-direction: column;

    gap: 7px;

    margin-bottom: 12px;
  }


  .comparison {
    min-height:
      clamp(
        390px,
        62svh,
        600px
      );

    max-height: 630px;

    border-radius: 10px;
  }


  .handle {
    width: 50px;
    height: 50px;

    font-size: 9px;

    box-shadow:
      0
      9px
      28px
      rgba(0, 0, 0, 0.28),

      0
      0
      0
      5px
      rgba(242, 238, 228, 0.08);
  }


  .compare-label {
    top: 9px;

    padding:
      6px
      7px;

    font-size: 6px;
  }


  .compare-label.before {
    left: 9px;
  }


  .compare-label.after {
    right: 9px;
  }


  /* ----------------------------------------------------------
     Mobile output controls
     ---------------------------------------------------------- */

  .output-panel {
    display: block;

    padding: 18px;
  }


  .background-options {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 6px;
  }


  .bg-option {
    width: 100%;
    min-height: 66px;
  }


  .btn--download {
    min-height: 54px;
  }


  .output-panel .btn--download {
    position: sticky;
    z-index: 12;

    bottom:
      max(
        10px,
        env(safe-area-inset-bottom)
      );

    box-shadow:
      0
      14px
      34px
      rgba(0, 0, 0, 0.28);
  }


  /* ----------------------------------------------------------
     Mobile process section
     ---------------------------------------------------------- */

  .process-grid {
    grid-template-columns: 1fr;
  }


  .process-grid article {
    min-height: 290px;

    padding: 24px;
  }


  .process-icon {
    margin:
      42px
      0;
  }


  .process-grid h3 {
    font-size: 40px;
  }


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

  .footer {
    grid-template-columns: 1fr;

    align-items: start;

    gap: 25px;

    padding:
      38px
      14px
      max(
        28px,
        env(safe-area-inset-bottom)
      );
  }


  /* ----------------------------------------------------------
     Mobile toast
     ---------------------------------------------------------- */

  .toast {
    left: 12px;
    right: 12px;

    bottom:
      max(
        12px,
        env(safe-area-inset-bottom)
      );

    max-width: none;
  }

}


/* ============================================================
   20. NARROW PHONES
   ============================================================ */

@media (max-width: 430px) {

  .hero__meta span:last-child {
    text-align: right;
  }


  .hero__footer {
    display: grid;

    grid-template-columns:
      repeat(
        2,
        max-content
      );

    justify-content: space-between;
  }


  .result-topbar > div:last-child {
    grid-template-columns: 1fr;
  }


  .result-topbar .btn {
    width: 100%;
  }


  .comparison {
    min-height:
      clamp(
        360px,
        58svh,
        520px
      );
  }


  .card-head h3 {
    font-size: 27px;
  }

}


/* ============================================================
   21. VERY SMALL PHONES
   ============================================================ */

@media (max-width: 360px) {

  .topbar__jump span {
    display: none;
  }


  .hero__copy h1 {
    font-size: 47px;
  }


  .hero__footer {
    grid-template-columns:
      1fr
      1fr;
  }


  .drop-zone {
    min-height: 455px;
  }


  .drop-limits {
    left: 18px;
    right: 18px;
  }


  .background-options {
    grid-template-columns: 1fr;
  }


  .file-details {
    grid-template-columns: 1fr;
  }

}


/* ============================================================
   22. TOUCH DEVICES
   ============================================================ */

@media (hover: none) and (pointer: coarse) {

  .btn:hover {
    transform: none;
  }


  .btn,
  .bg-option,
  .topbar__jump,
  .hero__cta {
    touch-action: manipulation;
  }


  #comparison-range {
    cursor: default;
  }

}


/* ============================================================
   23. REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

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

    scroll-behavior: auto !important;
  }

}


/* ============================================================
   24. API / PROCESSING FAILURE POLISH
   ============================================================ */

.drop-zone.has-error {
  border-color:
    rgba(255, 105, 105, 0.56);

  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(255, 105, 105, 0.10),
      transparent 38%
    ),
    #191919;
}


.drop-zone.has-error .mono {
  color:
    var(--danger);
}


@media (max-width: 700px) {

  .drop-zone.has-error {
    border-color:
      rgba(255, 105, 105, 0.62);
  }

}
