:root {
  --bg-deep: #071016;
  --bg-mid: #0c1a22;
  --ink: #e8f0f4;
  --ink-muted: #8fa3ae;
  --accent: #e8a04a;
  --accent-2: #2ec4b6;
  --accent-glow: rgba(232, 160, 74, 0.35);
  --line: rgba(232, 240, 244, 0.12);
  --panel: rgba(12, 28, 36, 0.72);
  --danger: #ff6b6b;
  --radius: 18px;
  --font-brand: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-deep);
  line-height: 1.5;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #16354a 0%, transparent 55%),
    linear-gradient(165deg, #071016 0%, #0a1820 45%, #061018 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 18s var(--ease) infinite alternate;
}

.orb-a {
  width: min(55vw, 520px);
  height: min(55vw, 520px);
  top: -8%;
  right: -8%;
  background: radial-gradient(circle, rgba(46, 196, 182, 0.45), transparent 70%);
}

.orb-b {
  width: min(50vw, 460px);
  height: min(50vw, 460px);
  bottom: 5%;
  left: -12%;
  background: radial-gradient(circle, rgba(232, 160, 74, 0.28), transparent 70%);
  animation-delay: -6s;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-24px, 30px, 0) scale(1.08); }
}

.stage {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 100vh;
}

.brand-block {
  text-align: center;
  animation: rise 0.9s var(--ease) both;
}

.eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 600;
}

.brand {
  margin: 0;
  font-family: var(--font-brand);
  font-size: clamp(3.4rem, 12vw, 5.6rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 0.95;
  background: linear-gradient(120deg, #f4f7f8 20%, var(--accent) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandShine 8s ease-in-out infinite;
}

@keyframes brandShine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.tagline {
  margin: 1rem auto 0;
  max-width: 28ch;
  font-size: clamp(1.05rem, 2.6vw, 1.2rem);
  color: var(--ink-muted);
  font-weight: 500;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: rise 1s var(--ease) 0.12s both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropzone {
  margin: 0;
  padding: 1.35rem;
  border: 1px dashed var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}

.dropzone.is-drag {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(46, 196, 182, 0.15), 0 20px 50px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.dropzone.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

.drop-inner {
  position: relative;
  text-align: center;
  padding: 2.2rem 1rem 1.6rem;
}

.pulse-ring {
  position: absolute;
  left: 50%;
  top: 28%;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  border: 1px solid rgba(46, 196, 182, 0.35);
  animation: pulse 2.8s var(--ease) infinite;
}

@keyframes pulse {
  0% { transform: scale(0.85); opacity: 0.8; }
  70% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

.icon-media {
  width: 64px;
  height: 64px;
  color: var(--accent);
  margin-bottom: 0.85rem;
  position: relative;
  z-index: 1;
}

.drop-title {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.drop-sub {
  margin: 0.4rem 0 0;
  color: var(--ink-muted);
}

.linkish {
  appearance: none;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.drop-meta {
  margin: 1.1rem 0 0;
  font-size: 0.82rem;
  color: rgba(143, 163, 174, 0.85);
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.4rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.file-chip-icon {
  flex: 0 0 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(232, 160, 74, 0.25), rgba(46, 196, 182, 0.18));
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
}

.file-chip-body {
  min-width: 0;
  flex: 1;
}

.file-name {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.chip-clear {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 8px;
}

.chip-clear:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.presets {
  border: 0;
  margin: 0 0 1.1rem;
  padding: 0;
}

.presets legend {
  padding: 0;
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.preset {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0.55rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

.preset input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.preset-pct {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.preset-label {
  font-size: 0.82rem;
  font-weight: 650;
}

.preset-hint {
  font-size: 0.68rem;
  color: var(--ink-muted);
  line-height: 1.25;
}

.preset:hover {
  border-color: rgba(46, 196, 182, 0.45);
  transform: translateY(-1px);
}

.preset.is-active {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(232, 160, 74, 0.16), rgba(232, 160, 74, 0.04));
  box-shadow: 0 8px 24px var(--accent-glow);
}

.cta {
  appearance: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 0;
  border-radius: 999px;
  padding: 1rem 1.4rem;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: #0a1218;
  background: linear-gradient(120deg, var(--accent) 0%, #f0c27a 45%, var(--accent-2) 120%);
  background-size: 160% 100%;
  cursor: pointer;
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease), background-position 0.5s var(--ease), opacity 0.25s;
  text-decoration: none;
}

.cta:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
  background-position: 100% 0;
}

.cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cta-arrow {
  transition: transform 0.3s var(--ease);
}

.cta:hover:not(:disabled) .cta-arrow {
  transform: translateX(4px);
}

.cta.download {
  flex: 1;
}

.ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.95rem 1.2rem;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}

.ghost:hover {
  border-color: var(--accent-2);
  background: rgba(46, 196, 182, 0.08);
}

.panel {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  animation: rise 0.55s var(--ease) both;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.panel-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 650;
}

.panel-pct {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.35s var(--ease);
  box-shadow: 0 0 18px rgba(46, 196, 182, 0.45);
}

.panel-msg {
  margin: 0.75rem 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.result-title {
  margin: 0.35rem 0 1.1rem;
  font-family: var(--font-brand);
  font-size: 1.8rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.compare-col {
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  text-align: center;
}

.compare-col.accent {
  border-color: rgba(232, 160, 74, 0.45);
  background: rgba(232, 160, 74, 0.08);
}

.compare-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.compare-col strong {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 750;
}

.compare-arrow {
  color: var(--ink-muted);
  font-size: 1.2rem;
}

.result-note {
  margin: 0 0 0.45rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.result-expire {
  margin: 0 0 1.15rem;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.error-toast {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffc9c9;
  font-size: 0.92rem;
  animation: rise 0.4s var(--ease) both;
}

.foot {
  margin-top: auto;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.88rem;
  animation: rise 1.1s var(--ease) 0.2s both;
}

.foot strong {
  color: var(--ink);
  font-weight: 650;
}

.foot .credit {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.foot .credit strong {
  color: var(--accent);
  font-family: var(--font-brand);
  font-weight: 750;
  letter-spacing: 0.08em;
}

.stats {
  padding: 1.2rem 0 0.2rem;
  text-align: center;
  animation: rise 1.05s var(--ease) 0.18s both;
}

.stats-kicker {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 650;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.stat {
  padding: 0.85rem 0.5rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.stat.accent {
  border-color: rgba(232, 160, 74, 0.4);
  background: rgba(232, 160, 74, 0.08);
}

.stat strong {
  display: block;
  font-family: var(--font-brand);
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.stat span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.stats-sub {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

@media (max-width: 640px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .preset-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-actions {
    flex-direction: column;
  }

  .cta.download,
  .ghost {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
