/* ==========================================================================
   WebObfuscator
   --------------------------------------------------------------------------
   Shares the Animula palette so the two products read as one family: deep
   indigo surfaces, a royal-blue accent and a little of Furina's gold.

   A tool page has different needs from a marketing page, so the layout is
   built around the two editor panes rather than around a hero.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0b0f2a;
  --bg-soft: #10153a;
  --surface: #151b45;
  --surface-2: #1b2252;
  --surface-3: #232b61;

  --text: #eef3ff;
  --text-muted: #a8b6dc;
  --text-dim: #8b9bc7;
  --text-faint: #7484b0;

  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.17);

  --accent: #4c7ceb;
  --accent-soft: rgba(76, 124, 235, 0.16);
  --accent-line: rgba(76, 124, 235, 0.38);
  --accent-text: #9dc0f5;

  --gold: #f7daa9;
  --gold-soft: rgba(247, 218, 169, 0.14);

  --ok: #5ee0a0;
  --danger: #f98a95;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --fast: 140ms;
  --base: 220ms;

  --gutter: clamp(16px, 4vw, 32px);
  --shell: 1280px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
}

/* A single soft wash at the top; no grid, no noise. */
body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  background: radial-gradient(80% 40% at 50% -6%, rgba(76, 124, 235, 0.14), transparent 62%);
  pointer-events: none;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  color: #06101f;
  background: var(--accent);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  color: var(--bg);
  background: var(--text);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--fast) var(--ease);
}

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

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 42, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.topbar-inner {
  display: flex;
  width: min(100%, var(--shell));
  min-height: 60px;
  margin: 0 auto;
  align-items: center;
  gap: 18px;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand-text {
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  color: var(--accent-text);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 700;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.topnav a {
  border-radius: var(--r-sm);
  padding: 7px 11px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  transition: color var(--fast) ease, background-color var(--fast) ease;
}

.topnav a:hover {
  color: var(--text);
  background: var(--surface);
}

.badge {
  border: 1px solid var(--gold-soft);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, var(--shell));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) var(--gutter) 72px;
}

.hero {
  max-width: 62ch;
  margin-bottom: clamp(28px, 4vw, 40px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.08;
  text-wrap: balance;
}

h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 600;
}

.lead {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   Editor panes
   -------------------------------------------------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 40%),
    var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.pane-head {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
}

.pane-head label {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pane-actions {
  display: flex;
  gap: 6px;
}

.ghost {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  color: var(--text-dim);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--fast) ease, border-color var(--fast) ease, background-color var(--fast) ease;
}

.ghost:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-2);
}

.pane textarea {
  width: 100%;
  min-height: 46vh;
  flex: 1 1 auto;
  resize: vertical;
  border: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: 14px 16px;
  color: var(--text);
  background: transparent;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  tab-size: 4;
}

.pane textarea::placeholder {
  color: var(--text-faint);
}

.pane textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.pane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 8px 16px;
  color: var(--text-faint);
  font-size: 12px;
}

.detect {
  color: var(--accent-text);
  font-weight: 500;
}

.detect:empty {
  display: none;
}

/* --------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */

.controls {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 28px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 40%),
    var(--surface);
}

.controls-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

/* Language picker */
.language-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 15px;
  background: var(--bg-soft);
}

.language-row label {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.language-row select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.language-row select:focus {
  border-color: var(--accent);
  outline: none;
}

/* An option the current language does not support */
.option.is-unavailable {
  opacity: 0.42;
  cursor: not-allowed;
}

.option.is-unavailable:hover {
  border-color: var(--line);
  background: var(--bg-soft);
}

.option.is-unavailable input {
  cursor: not-allowed;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  padding: 0 22px;
  color: #06101f;
  background: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--fast) ease, transform var(--fast) var(--ease);
}

.button:hover {
  background: #6189f0;
}

.button:active {
  transform: translateY(1px);
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 15px;
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color var(--fast) ease, background-color var(--fast) ease;
}

.option:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.option input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.option-body {
  display: grid;
  gap: 2px;
}

.option-body strong {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.option-body em {
  color: var(--text-dim);
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.5;
}

.status {
  min-height: 1.4em;
  margin: 16px 0 0;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
}

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

.status.is-error {
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about {
  margin-top: 44px;
}

.about-lead {
  max-width: 68ch;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* Language cards */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.lang-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  background: var(--bg-soft);
}

.lang-card h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 0.95rem;
}

.lang-ext {
  margin: 0 0 6px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.lang-opt {
  margin: 0;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 500;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.about-grid article {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  background: var(--bg-soft);
}

.about-grid p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  display: flex;
  width: min(100%, var(--shell));
  margin: 0 auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 22px var(--gutter) 40px;
  color: var(--text-faint);
  font-size: 13px;
}

.dot {
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

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

  .pane textarea {
    min-height: 34vh;
  }
}

@media (max-width: 640px) {
  .topnav {
    display: none;
  }

  .badge {
    margin-left: auto;
  }

  .controls-head {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}

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

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