:root {
  --bg: #050505;
  --surface: #0b0b0b;
  --surface-2: #101010;
  --surface-3: #151515;

  --white: #ffffff;
  --text: #f5f5f5;
  --muted: #8d8d8d;
  --muted-2: #5e5e5e;

  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);

  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.08);

  --success: #b9ffcb;

  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;

  --shadow:
    0 30px 100px rgba(0, 0, 0, 0.55);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}


/* =========================
   RESET
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);

  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  overflow-x: hidden;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}


/* =========================
   BACKGROUND
========================= */

body::before {
  content: "";
  position: fixed;
  inset: 0;

  background:
    linear-gradient(
      rgba(255,255,255,0.018) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255,255,255,0.018) 1px,
      transparent 1px
    );

  background-size: 70px 70px;

  mask-image:
    linear-gradient(
      to bottom,
      black,
      transparent 75%
    );

  pointer-events: none;
}

.ambient {
  position: fixed;
  width: 500px;
  height: 500px;

  border-radius: 50%;

  filter: blur(100px);

  opacity: 0.06;

  pointer-events: none;
}

.ambient-one {
  top: -280px;
  left: -200px;

  background: white;
}

.ambient-two {
  right: -250px;
  bottom: -300px;

  background: #777;
}

.noise {
  position: fixed;
  inset: 0;

  pointer-events: none;

  opacity: 0.025;

  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}


/* =========================
   APP
========================= */

.app {
  width: min(100%, 900px);
  margin: 0 auto;

  position: relative;
  z-index: 2;
}


/* =========================
   TOP BAR
========================= */

.topbar {
  min-height: 76px;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  gap: 20px;

  padding: 18px 24px;

  border-bottom: 1px solid var(--border);

  background:
    rgba(5, 5, 5, 0.78);

  backdrop-filter: blur(20px);

  position: sticky;
  top: 0;

  z-index: 20;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  width: fit-content;

  color: #aaa;

  text-decoration: none;

  font-size: 12px;
  font-weight: 600;

  transition:
    color 0.25s ease,
    transform 0.25s var(--ease);
}

.back-link:hover {
  color: white;
  transform: translateX(-3px);
}

.back-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.nav-logo {
  width: 34px;
  height: 34px;

  object-fit: contain;

  border-radius: 9px;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-brand-text strong {
  font-size: 11px;
  letter-spacing: 0.09em;
}

.nav-brand-text span {
  color: #6d6d6d;

  font-size: 8px;

  letter-spacing: 0.08em;

  text-transform: uppercase;
}

.status {
  justify-self: end;

  display: flex;
  align-items: center;
  gap: 7px;

  color: #777;

  font-size: 10px;

  text-transform: uppercase;

  letter-spacing: 0.08em;
}

.status-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: white;

  box-shadow:
    0 0 0 4px rgba(255,255,255,0.04),
    0 0 12px rgba(255,255,255,0.4);

  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.55;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}


/* =========================
   MAIN
========================= */

.main {
  padding: 65px 24px 70px;
}


/* =========================
   HERO
========================= */

.hero {
  text-align: center;

  max-width: 700px;

  margin: 0 auto 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  color: #707070;

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 0.16em;

  text-transform: uppercase;
}

.eyebrow-line {
  width: 20px;
  height: 1px;

  background: #444;
}

.hero-logo-wrap {
  margin: 26px auto 20px;

  width: 70px;
  height: 70px;

  display: grid;
  place-items: center;

  border-radius: 20px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.12),
      rgba(255,255,255,0.025)
    );

  border: 1px solid var(--border-strong);

  box-shadow:
    0 15px 50px rgba(0,0,0,0.4);

  overflow: hidden;
}

.hero-logo {
  width: 58px;
  height: 58px;

  object-fit: contain;

  transition:
    transform 0.7s var(--ease);
}

.hero-logo-wrap:hover .hero-logo {
  transform: scale(1.08) rotate(-2deg);
}

.hero h1 {
  font-size: clamp(42px, 7vw, 70px);

  line-height: 0.98;

  letter-spacing: -0.065em;

  font-weight: 800;
}

.hero h1 span {
  color: #666;
}

.hero p {
  max-width: 480px;

  margin: 22px auto 0;

  color: #858585;

  font-size: 14px;

  line-height: 1.7;
}

.hero p strong {
  color: #d0d0d0;
}

.motto {
  margin-top: 15px;

  color: #666;

  font-size: 10px;

  text-transform: uppercase;

  letter-spacing: 0.18em;
}


/* =========================
   WORKSPACE
========================= */

.workspace {
  position: relative;

  padding: 28px;

  border-radius: var(--radius-xl);

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.055),
      rgba(255,255,255,0.015)
    );

  border: 1px solid var(--border);

  box-shadow: var(--shadow);

  backdrop-filter: blur(30px);
}

.workspace::before {
  content: "";

  position: absolute;

  inset: 1px;

  border-radius: calc(var(--radius-xl) - 1px);

  pointer-events: none;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255,255,255,0.05),
      transparent 40%
    );
}


/* =========================
   WORKSPACE HEADER
========================= */

.workspace-top {
  display: flex;

  justify-content: space-between;

  align-items: flex-start;

  gap: 20px;

  margin-bottom: 25px;
}

.product-label {
  margin-bottom: 7px;

  color: #777;

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 0.16em;

  text-transform: uppercase;
}

.workspace-top h2 {
  font-size: 23px;

  letter-spacing: -0.04em;
}

.workspace-top p {
  margin-top: 5px;

  color: #666;

  font-size: 11px;
}

.pro-badge {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 8px 11px;

  border: 1px solid var(--border-strong);

  border-radius: 999px;

  color: #aaa;

  font-size: 9px;
  font-weight: 700;
}

.pro-badge span {
  color: #fff;

  letter-spacing: 0.12em;
}


/* =========================
   MODE SWITCHER
========================= */

.mode-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 8px;

  margin-bottom: 18px;

  padding: 5px;

  background: #070707;

  border: 1px solid var(--border);

  border-radius: 17px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 13px;

  text-align: left;

  color: #777;

  background: transparent;

  border-radius: 12px;

  transition:
    color 0.25s ease,
    background 0.3s var(--ease),
    transform 0.25s var(--ease);
}

.mode-btn:hover {
  color: #bbb;
}

.mode-btn.active {
  color: #fff;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.11),
      rgba(255,255,255,0.045)
    );

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.07);
}

.mode-number {
  font-family: "DM Mono", monospace;

  color: #555;

  font-size: 9px;
}

.mode-btn.active .mode-number {
  color: #aaa;
}

.mode-btn strong {
  display: block;

  font-size: 11px;
}

.mode-btn small {
  display: block;

  margin-top: 2px;

  color: #555;

  font-size: 9px;
}

.mode-btn.active small {
  color: #777;
}


/* =========================
   TOOL PANEL
========================= */

.tool-panel {
  animation: panelIn 0.45s var(--ease);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.input-header,
.result-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 9px;

  color: #666;

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 0.13em;
}

.input-header > div,
.result-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-index {
  color: #aaa;

  font-family: "DM Mono", monospace;

  font-size: 8px;
}


/* =========================
   TEXTAREA
========================= */

.textarea-wrap {
  position: relative;
}

textarea {
  display: block;

  width: 100%;

  min-height: 190px;

  padding: 19px;

  resize: vertical;

  color: #eaeaea;

  background:
    linear-gradient(
      145deg,
      #080808,
      #050505
    );

  border: 1px solid var(--border);

  border-radius: 18px;

  outline: none;

  font-family:
    "DM Mono",
    monospace;

  font-size: 12px;

  line-height: 1.8;

  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

textarea::placeholder {
  color: #414141;
}

textarea:focus {
  border-color: rgba(255,255,255,0.22);

  box-shadow:
    0 0 0 4px rgba(255,255,255,0.025);

  background: #080808;
}

.textarea-corner {
  position: absolute;

  right: 13px;
  bottom: 12px;

  color: #333;

  font-family: "DM Mono", monospace;

  font-size: 8px;

  pointer-events: none;
}


/* =========================
   BUTTONS
========================= */

.primary-btn {
  width: 100%;

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-top: 10px;

  padding: 15px 17px;

  border-radius: 14px;

  color: #050505;

  background: #f3f3f3;

  font-size: 11px;
  font-weight: 800;

  transition:
    transform 0.25s var(--ease),
    background 0.25s ease,
    box-shadow 0.3s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);

  background: #fff;

  box-shadow:
    0 12px 35px rgba(255,255,255,0.08);
}

.primary-btn:active {
  transform: translateY(0) scale(0.99);
}

.button-arrow {
  font-size: 17px;

  transition:
    transform 0.3s var(--ease);
}

.primary-btn:hover .button-arrow {
  transform: translate(2px, -2px);
}


/* =========================
   RESULT
========================= */

.result-section {
  margin-top: 25px;
}

.result-status {
  color: #555;

  font-family: "DM Mono", monospace;

  font-size: 8px;

  letter-spacing: 0;

  text-transform: none;
}

.result-status.ready {
  color: #aaa;
}

.result-status.success {
  color: var(--success);
}

.result-box {
  min-height: 150px;

  padding: 18px;

  border-radius: 17px;

  background: #060606;

  border: 1px solid var(--border);

  overflow: auto;

  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}

.result-box.has-result {
  border-color: rgba(255,255,255,0.15);

  background:
    linear-gradient(
      145deg,
      #0b0b0b,
      #060606
    );
}

.result-empty {
  min-height: 112px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  text-align: center;

  gap: 7px;
}

.empty-mark {
  width: 32px;
  height: 32px;

  display: grid;
  place-items: center;

  margin-bottom: 4px;

  border: 1px solid var(--border);

  border-radius: 10px;

  color: #555;

  font-weight: 800;
}

.result-empty strong {
  color: #777;

  font-size: 10px;
}

.result-empty span {
  color: #414141;

  font-size: 9px;
}

.result-output {
  display: none;

  color: #e6e6e6;

  font-family: "DM Mono", monospace;

  font-size: 11px;

  line-height: 1.8;

  white-space: pre-wrap;

  word-break: break-word;
}

.result-box.has-result .result-empty {
  display: none;
}

.result-box.has-result .result-output {
  display: block;
}

.result-actions {
  display: grid;

  grid-template-columns: 1fr auto;

  gap: 8px;

  margin-top: 9px;
}

.secondary-btn,
.ghost-btn {
  min-height: 43px;

  border-radius: 12px;

  font-size: 10px;
  font-weight: 700;

  transition:
    transform 0.2s var(--ease),
    border-color 0.2s ease,
    background 0.2s ease;
}

.secondary-btn {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 8px;

  color: #ddd;

  background: #101010;

  border: 1px solid var(--border);
}

.secondary-btn:hover:not(:disabled) {
  background: #161616;

  border-color: var(--border-strong);

  transform: translateY(-1px);
}

.secondary-btn:disabled {
  cursor: not-allowed;

  color: #444;
}

.copy-icon {
  font-size: 13px;
}

.ghost-btn {
  padding: 0 16px;

  color: #666;

  background: transparent;

  border: 1px solid var(--border);
}

.ghost-btn:hover {
  color: #aaa;

  border-color: var(--border-strong);
}


/* =========================
   PRO CARD
========================= */

.pro-card {
  position: relative;

  margin-top: 25px;

  overflow: hidden;

  border-radius: 20px;

  border: 1px solid rgba(255,255,255,0.12);

  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(255,255,255,0.08),
      transparent 42%
    ),
    #0a0a0a;
}

.pro-glow {
  position: absolute;

  width: 180px;
  height: 180px;

  right: -100px;
  top: -100px;

  border-radius: 50%;

  background: white;

  opacity: 0.045;

  filter: blur(40px);
}

.pro-content {
  position: relative;

  padding: 22px;
}

.pro-top {
  display: flex;

  justify-content: space-between;

  align-items: center;
}

.pro-kicker {
  color: #888;

  font-size: 8px;
  font-weight: 800;

  letter-spacing: 0.15em;
}

.pro-price {
  color: white;

  font-family: "DM Mono", monospace;

  font-size: 11px;
}

.pro-card h3 {
  max-width: 450px;

  margin-top: 13px;

  font-size: 20px;

  letter-spacing: -0.04em;
}

.pro-card p {
  max-width: 470px;

  margin-top: 7px;

  color: #6e6e6e;

  font-size: 11px;

  line-height: 1.6;
}

.pro-features {
  display: flex;

  flex-wrap: wrap;

  gap: 15px;

  margin-top: 16px;
}

.pro-features span {
  display: flex;

  align-items: center;

  gap: 6px;

  color: #777;

  font-size: 9px;
}

.pro-features i {
  font-style: normal;

  color: #ccc;
}

.unlock-btn {
  width: 100%;

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-top: 19px;

  padding: 14px 16px;

  border-radius: 13px;

  color: #050505;

  background: #f1f1f1;

  font-size: 10px;
  font-weight: 800;

  transition:
    transform 0.25s var(--ease),
    box-shadow 0.3s ease;
}

.unlock-btn:hover {
  transform: translateY(-2px);

  box-shadow:
    0 15px 35px rgba(255,255,255,0.08);
}

.unlock-btn:active {
  transform: scale(0.99);
}

.secure-note {
  display: block;

  margin-top: 9px;

  color: #3e3e3e;

  text-align: center;

  font-size: 8px;
}


/* =========================
   TOAST
========================= */

.toast {
  position: fixed;

  left: 50%;

  bottom: 25px;

  z-index: 100;

  display: flex;

  align-items: center;

  gap: 11px;

  min-width: 240px;

  padding: 12px 15px;

  border-radius: 14px;

  border: 1px solid rgba(255,255,255,0.12);

  background:
    rgba(15,15,15,0.92);

  box-shadow:
    0 20px 60px rgba(0,0,0,0.45);

  backdrop-filter: blur(20px);

  opacity: 0;

  pointer-events: none;

  transform:
    translate(-50%, 15px);

  transition:
    opacity 0.3s ease,
    transform 0.4s var(--ease);
}

.toast.show {
  opacity: 1;

  transform:
    translate(-50%, 0);
}

.toast-check {
  width: 27px;
  height: 27px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  color: #050505;

  background: white;

  font-size: 12px;
  font-weight: 900;
}

.toast div {
  display: flex;

  flex-direction: column;

  gap: 2px;
}

.toast strong {
  font-size: 10px;
}

.toast span:not(.toast-check) {
  color: #777;

  font-size: 9px;
}


/* =========================
   FOOTER
========================= */

.product-footer {
  padding: 40px 5px 0;

  text-align: center;
}

.footer-brand {
  display: inline-flex;

  align-items: center;

  gap: 9px;

  text-align: left;
}

.footer-brand img {
  width: 32px;
  height: 32px;

  object-fit: contain;
}

.footer-brand div {
  display: flex;

  flex-direction: column;

  gap: 2px;
}

.footer-brand strong {
  font-size: 9px;

  letter-spacing: 0.08em;
}

.footer-brand span {
  color: #4d4d4d;

  font-size: 7px;

  letter-spacing: 0.12em;

  text-transform: uppercase;
}

.product-footer > p {
  max-width: 400px;

  margin: 16px auto;

  color: #4b4b4b;

  font-size: 9px;

  line-height: 1.6;
}

.footer-meta {
  display: flex;

  justify-content: center;

  gap: 15px;

  color: #363636;

  font-family: "DM Mono", monospace;

  font-size: 7px;
}


/* =========================
   UNLOCKED STATE
========================= */

.workspace.unlocked .pro-card {
  border-color: rgba(255,255,255,0.06);

  opacity: 0.5;
}

.workspace.unlocked .pro-card .unlock-btn {
  background: #151515;

  color: #777;

  pointer-events: none;
}

.workspace.unlocked .pro-card .unlock-btn::after {
  content: "UNLOCKED";
}

.workspace.unlocked .pro-card .unlock-btn span:first-child {
  display: none;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 700px) {

  .topbar {
    grid-template-columns: auto 1fr auto;

    padding: 15px 17px;
  }

  .nav-brand {
    justify-self: center;
  }

  .nav-brand-text {
    display: none;
  }

  .main {
    padding: 50px 15px 55px;
  }

  .hero {
    margin-bottom: 35px;
  }

  .hero h1 {
    font-size: clamp(38px, 11vw, 58px);
  }

  .hero p {
    font-size: 12px;

    max-width: 330px;
  }

  .workspace {
    padding: 17px;

    border-radius: 23px;
  }

  .workspace-top h2 {
    font-size: 20px;
  }

  .mode-btn {
    padding: 12px 10px;
  }

  .mode-number {
    display: none;
  }

  textarea {
    min-height: 180px;

    padding: 16px;

    font-size: 11px;
  }

  .pro-content {
    padding: 18px;
  }

  .pro-features {
    gap: 9px 13px;
  }

  .product-footer {
    padding-top: 32px;
  }
}


@media (max-width: 430px) {

  .status {
    font-size: 8px;
  }

  .back-link span:last-child {
    display: none;
  }

  .hero-logo-wrap {
    width: 62px;
    height: 62px;
  }

  .hero-logo {
    width: 51px;
    height: 51px;
  }

  .workspace-top {
    margin-bottom: 20px;
  }

  .pro-badge {
    font-size: 8px;
  }

  .mode-btn strong {
    font-size: 10px;
  }

  .mode-btn small {
    font-size: 8px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .ghost-btn {
    width: 100%;
  }

  .footer-meta {
    flex-direction: column;

    gap: 5px;
  }
}


/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }
}