:root {
  color-scheme: light;
  --page: #f7f8fc;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --field: #f8f8fb;
  --text: #1a1920;
  --muted: #777582;
  --line: rgba(43, 38, 67, 0.09);
  --line-strong: rgba(43, 38, 67, 0.15);
  --accent: #6958e8;
  --accent-bright: #725fe8;
  --accent-soft: rgba(105, 88, 232, 0.12);
  --success: #27865a;
  --danger: #cf4059;
  --shadow: 0 28px 80px rgba(67, 57, 106, 0.13);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(139, 124, 255, 0.18), transparent 35rem),
    var(--page);
}

button,
textarea,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.page-glow {
  position: fixed;
  z-index: -1;
  top: -22rem;
  left: 50%;
  width: 46rem;
  height: 46rem;
  border-radius: 50%;
  background: rgba(121, 98, 244, 0.12);
  filter: blur(110px);
  transform: translateX(-50%);
  pointer-events: none;
}

.site-header,
main,
footer {
  width: min(100% - 40px, 940px);
  margin-inline: auto;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  align-content: center;
  gap: 3px;
  width: 34px;
  height: 34px;
  padding: 8px;
  border: 1px solid rgba(105, 88, 232, 0.16);
  border-radius: 11px;
  background: linear-gradient(145deg, #9d91ff, #6756ea);
  box-shadow: 0 8px 24px rgba(105, 85, 235, 0.34);
}

.brand-mark i {
  display: block;
  height: 2px;
  border-radius: 99px;
  background: #fff;
}

.brand-mark i:nth-child(2) {
  width: 72%;
}

.brand-mark i:nth-child(3) {
  width: 44%;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 24px rgba(63, 54, 101, 0.07);
}

.local-badge > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(39, 134, 90, 0.28);
}

.hero {
  padding: 76px 0 58px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  color: #17161d;
  font-size: clamp(58px, 9vw, 96px);
  font-weight: 720;
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(105deg, #17161d 0%, #5d4bd9 52%, #826ff1 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.intro {
  max-width: 600px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.tool {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px) saturate(130%);
  -webkit-backdrop-filter: blur(30px) saturate(130%);
}

.tool::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18%;
  width: 64%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(115, 96, 232, 0.55), transparent);
}

.tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  max-width: 300px;
  margin: 6px auto 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(91, 79, 139, 0.06);
}

.tab {
  min-height: 42px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: #fff;
  background: linear-gradient(140deg, rgba(154, 141, 255, 0.96), rgba(102, 83, 230, 0.96));
  box-shadow: 0 6px 20px rgba(91, 70, 220, 0.3);
}

.panel {
  padding: 32px;
  border: 1px solid rgba(43, 38, 67, 0.07);
  border-radius: 22px;
  background: rgba(250, 250, 253, 0.8);
}

form {
  display: grid;
  gap: 22px;
}

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

.carrier-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  margin: 0;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.carrier-switch legend {
  float: left;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.carrier-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 210px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(91, 79, 139, 0.055);
}

.carrier-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.carrier-option:hover {
  color: var(--text);
}

.carrier-option.is-active {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 3px 12px rgba(63, 54, 101, 0.11);
}

.carrier-option:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 1px;
}

.carrier-option svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field {
  display: grid;
  gap: 10px;
}

.field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.field-heading label {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.field-heading span {
  color: var(--muted);
  font-size: 12px;
}

.heading-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 0;
  border-radius: 8px;
  color: var(--accent);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.heading-action:hover {
  background: var(--accent-soft);
}

.heading-action:focus-visible {
  outline: 3px solid var(--accent-soft);
}

.heading-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-entry {
  display: grid;
  gap: 8px;
}

.image-picker {
  display: grid;
  gap: 10px;
}

.image-drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 132px;
  padding: 17px 20px;
  border: 1.5px dashed rgba(105, 88, 232, 0.34);
  border-radius: 17px;
  color: var(--muted);
  background: rgba(105, 88, 232, 0.035);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.image-drop:hover,
.image-drop.is-dragging {
  border-color: rgba(105, 88, 232, 0.75);
  background: rgba(105, 88, 232, 0.075);
}

.image-drop:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

.image-drop strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 670;
}

.image-drop > span:last-child {
  font-size: 12px;
}

.image-drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 1px;
  border: 1px solid rgba(105, 88, 232, 0.15);
  border-radius: 14px;
  color: var(--accent);
  background: #fff;
  box-shadow: 0 8px 24px rgba(67, 57, 106, 0.1);
}

.image-drop-icon svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.image-selection {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 94px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: #fff;
}

.image-selection img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--field);
}

.image-file-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.image-file-info strong,
.image-file-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-file-info strong {
  font-size: 13px;
  font-weight: 650;
}

.image-file-info span {
  color: var(--muted);
  font-size: 11px;
}

.image-remove {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.image-remove:hover {
  color: var(--danger);
  background: rgba(207, 64, 89, 0.07);
}

.image-remove:focus-visible {
  outline: 3px solid rgba(207, 64, 89, 0.12);
}

.image-remove svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.text-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 68px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.text-action:hover {
  color: var(--accent);
  border-color: rgba(105, 88, 232, 0.35);
  background: rgba(105, 88, 232, 0.07);
}

.text-action:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 1px;
}

.text-action:active {
  transform: translateY(1px);
}

.text-action-clear:hover {
  color: var(--danger);
  border-color: rgba(207, 64, 89, 0.28);
  background: rgba(207, 64, 89, 0.06);
}

.text-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

textarea {
  width: 100%;
  min-height: 118px;
  padding: 16px 17px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  outline: none;
  color: var(--text);
  caret-color: var(--accent-bright);
  background: var(--field);
  font-size: 15px;
  line-height: 1.65;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea::placeholder {
  color: #a09eaa;
}

textarea:hover {
  border-color: rgba(61, 54, 90, 0.24);
}

textarea:focus {
  border-color: rgba(139, 124, 255, 0.9);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

textarea[readonly] {
  min-height: 110px;
  color: #443b7d;
  border-color: rgba(139, 124, 255, 0.24);
  background: rgba(105, 88, 232, 0.055);
}

.primary-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 680;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
  width: 100%;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #9688ff, #6854e8);
  box-shadow: 0 12px 30px rgba(95, 73, 225, 0.28);
}

.primary-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button:hover {
  box-shadow: 0 15px 34px rgba(95, 73, 225, 0.38);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.primary-button:active,
.copy-button:active {
  transform: translateY(1px);
}

.form-error {
  margin: -7px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 156, 170, 0.2);
  border-radius: 12px;
  color: var(--danger);
  background: rgba(255, 100, 125, 0.08);
  font-size: 13px;
  line-height: 1.55;
}

.result {
  display: grid;
  gap: 15px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  animation: result-in 320ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.result-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.result-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--success);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.result-heading h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 670;
  letter-spacing: -0.025em;
}

.result-stat {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.copy-button {
  width: max-content;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: #ffffff;
}

.copy-button:hover {
  border-color: rgba(139, 124, 255, 0.52);
  background: rgba(139, 124, 255, 0.1);
}

.copy-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.download-button {
  text-decoration: none;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stego-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 168px;
  height: 112px;
  min-height: 0;
  border: 1px solid rgba(139, 124, 255, 0.2);
  border-radius: 13px;
  background:
    linear-gradient(45deg, rgba(105, 88, 232, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(105, 88, 232, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(105, 88, 232, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(105, 88, 232, 0.035) 75%),
    #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.stego-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 64px 0 36px;
  color: #85838f;
  font-size: 12px;
}

footer a {
  text-underline-offset: 3px;
}

footer a:hover {
  color: var(--muted);
}

.toast {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--text);
  background: rgba(30, 30, 41, 0.96);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.34);
  font-size: 13px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.copy-helper {
  position: fixed;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 700px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 940px);
  }

  .site-header {
    min-height: 72px;
  }

  .hero {
    padding: 58px 4px 42px;
  }

  .hero h1 {
    font-size: clamp(54px, 19vw, 76px);
  }

  .intro {
    font-size: 14px;
    line-height: 1.75;
  }

  .tool {
    padding: 8px;
    border-radius: 24px;
  }

  .tabs {
    max-width: none;
    margin: 2px 0 7px;
  }

  .panel {
    padding: 22px 16px 18px;
    border-radius: 18px;
  }

  .field-heading {
    display: grid;
    gap: 4px;
  }

  .carrier-switch {
    display: grid;
    gap: 10px;
  }

  .carrier-switch legend {
    float: none;
  }

  .carrier-options {
    width: 100%;
  }

  .field-heading span {
    font-size: 11px;
  }

  textarea {
    min-height: 110px;
    font-size: 16px;
  }

  .text-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .text-action {
    min-width: 0;
    min-height: 42px;
    font-size: 13px;
  }

  .toast {
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    bottom: auto;
    left: 12px;
    max-width: none;
    text-align: center;
    transform: translateY(-12px);
  }

  .toast.is-visible {
    transform: translateY(0);
  }

  .result-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .copy-button {
    width: 100%;
  }

  .result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-drop {
    min-height: 126px;
  }

  .image-selection {
    grid-template-columns: 64px minmax(0, 1fr) auto;
  }

  .image-selection img {
    width: 64px;
    height: 64px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 50px;
  }
}

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

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