:root {
  --blue: #1e6eaa;
  --glass-blue: #288cc8;
  --slate: #5a6e8c;
  --deep: #0a1e32;
  --lake: #1e3246;
  --gold: #d4a017;
  --orange: #e07a3d;
  --white: #fafafa;
  --frost: rgba(255, 255, 255, 0.7);
  --ink-on-glass: #fafafa;
  --shadow: 0 22px 50px rgba(10, 30, 50, 0.32);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100vh;
  font-family: Outfit, "Segoe UI", sans-serif;
  color: var(--ink-on-glass);
  background: var(--deep);
}

.scene {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 30, 50, 0.12), rgba(10, 30, 50, 0.02) 28%, rgba(10, 30, 50, 0.2)),
    url("/landscape.jpg") center / cover no-repeat;
}

.topbar,
.dock {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 5;
}

.topbar {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 22px;
  background: var(--white);
  color: var(--deep);
  box-shadow: 0 8px 24px rgba(10, 30, 50, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  width: 46px;
  height: 46px;
  flex: none;
}

.eyebrow {
  margin: 0 0 1px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--deep);
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.pill {
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(30, 110, 170, 0.22);
  background: rgba(40, 140, 200, 0.12);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill[data-phase="uploading"],
.pill[data-phase="peeling"] {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.pill[data-phase="done"] {
  background: rgba(30, 110, 170, 0.14);
  color: var(--blue);
}

.pill[data-phase="error"] {
  background: rgba(224, 122, 61, 0.14);
  border-color: rgba(224, 122, 61, 0.35);
  color: var(--orange);
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 96px 18px 112px;
}

.glass {
  width: min(680px, 100%);
  align-self: center;
  padding: 26px 24px 20px;
  border-radius: 30px;
  color: var(--ink-on-glass);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.22) 42%, rgba(40, 140, 200, 0.2)),
    rgba(30, 50, 70, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.82), inset 0 -1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
}

.lede {
  max-width: 36ch;
  margin-bottom: 18px;
  color: rgba(250, 250, 250, 0.92);
  font-size: 1.08rem;
  line-height: 1.45;
  text-shadow: 0 1px 1px rgba(10, 30, 50, 0.18);
}

.drop,
.file-row,
.result {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
}

.drop {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 18px 22px;
  text-align: center;
  cursor: pointer;
  border-style: dashed;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop:hover,
.drop:focus-visible,
.drop.is-hot {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}

.drop.is-hot {
  border-color: var(--gold);
}

.drop-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 6px;
  color: var(--gold);
}

.drop-icon svg,
.dock-item svg {
  width: 100%;
  height: 100%;
}

.drop-title,
.file-name,
h2 {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.drop-title {
  font-size: 1.16rem;
}

.drop-sub,
.drop-hint,
.file-meta,
.fine,
.progress-label {
  color: rgba(250, 250, 250, 0.8);
}

.drop-sub {
  font-size: 0.95rem;
}

.drop-hint,
.file-meta,
.fine,
.progress-label {
  font-size: 0.84rem;
}

.drop-hint {
  margin-top: 8px;
}

.file-row,
.result,
.progress-wrap {
  margin-top: 14px;
}

.file-row,
.result-actions,
.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-row,
.result {
  padding: 14px;
}

.file-copy,
.result-head {
  min-width: 0;
  flex: 1;
}

.result-head {
  margin-bottom: 12px;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  margin-top: 3px;
}

h2 {
  font-size: 1.12rem;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--glass-blue), var(--gold));
  transition: width 140ms ease;
}

.progress-bar.is-busy {
  width: 100% !important;
  background: linear-gradient(90deg, transparent, var(--gold), var(--glass-blue), transparent);
  background-size: 220% 100%;
  animation: sweep 1.1s linear infinite;
}

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

.wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.wave span {
  width: 3px;
  height: 6px;
  border-radius: 99px;
  background: var(--gold);
  animation: bounce 0.9s ease-in-out infinite;
}

.wave span:nth-child(2) { animation-delay: 0.1s; }
.wave span:nth-child(3) { animation-delay: 0.2s; }
.wave span:nth-child(4) { animation-delay: 0.3s; }
.wave span:nth-child(5) { animation-delay: 0.4s; }

.message {
  min-height: 1.3em;
  margin: 14px 2px 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.message[data-tone="error"] {
  color: #ffe1d2;
}

.message[data-tone="ok"] {
  color: #e7f6ff;
}

.primary,
.ghost,
.dock-peel,
.dock-item {
  appearance: none;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.primary,
.ghost {
  border: 0;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--blue);
  color: var(--white);
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 10px 22px rgba(10, 30, 50, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.primary:hover {
  background: #288cc8;
}

.ghost {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
}

.download {
  flex: 1;
}

.result-actions {
  margin-top: 14px;
}

audio {
  width: 100%;
  height: 40px;
}

.fine {
  margin-top: 16px;
  line-height: 1.45;
}

.dock {
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 -12px 30px rgba(10, 30, 50, 0.28);
}

.dock-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 72px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
}

.dock-item svg {
  width: 22px;
  height: 22px;
}

.dock-item:first-child {
  justify-self: start;
}

.dock-item:last-child {
  justify-self: end;
}

.dock-peel {
  min-width: 168px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--blue);
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 18px rgba(10, 30, 50, 0.24);
}

.dock-peel:hover:not(:disabled) {
  background: #ffffff;
}

.dock-peel:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.noscript {
  position: fixed;
  z-index: 6;
  left: 16px;
  right: 16px;
  bottom: 96px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--deep);
  background: rgba(250, 250, 250, 0.94);
}

button:focus-visible,
a:focus-visible,
label:focus-visible,
.drop:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 14px;
    min-height: 64px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .stage {
    padding: 80px 12px 108px;
  }

  .glass {
    padding: 20px 14px 16px;
    border-radius: 24px;
  }

  .result-actions,
  .file-row {
    align-items: stretch;
    flex-direction: column;
  }

  .download,
  .ghost,
  .dock-peel {
    width: 100%;
  }

  .dock {
    grid-template-columns: 72px 1fr 72px;
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wave span,
  .progress-bar.is-busy,
  .drop {
    animation: none;
    transition: none;
  }
}

@keyframes bounce {
  0%,
  100% { height: 5px; }
  50% { height: 16px; }
}

@keyframes sweep {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
