:root {
  --ink: #14201f;
  --mute: #4a5c59;
  --paper: #f3f6f1;
  --panel: rgba(255, 255, 255, 0.72);
  --line: rgba(20, 32, 31, 0.12);
  --teal: #0f6b61;
  --teal-deep: #0b3d3a;
  --lime: #c8f05f;
  --shadow: 0 16px 40px rgba(11, 61, 58, 0.1);
  --radius: 18px;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* CSSのdisplay指定がUAの [hidden] を上書きしないようにする */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 12% 8%, rgba(200, 240, 95, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 0%, rgba(15, 107, 97, 0.22), transparent 50%),
    linear-gradient(165deg, #eef5ec 0%, #dcebe6 42%, #c5ddd6 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  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)' opacity='0.45'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: multiply;
}

.shell {
  width: min(880px, calc(100% - 2rem));
  height: 100dvh;
  margin: 0 auto;
  padding: clamp(0.85rem, 2.2vh, 1.4rem) 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.brand {
  flex: 0 0 auto;
  margin-bottom: clamp(0.55rem, 1.4vh, 0.9rem);
  animation: rise 0.7s ease both;
}

.brand__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.5vh, 3.6rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--teal-deep);
  font-weight: 400;
}

.brand__sub {
  margin: 0.4rem 0 0;
  color: var(--mute);
  font-size: 0.9rem;
}

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0.45rem, 1.2vh, 0.75rem);
  animation: rise 0.85s ease 0.08s both;
}

.step--drop {
  flex: 0 1 auto;
  min-height: 0;
}

.step--controls {
  flex: 0 0 auto;
}

.step__label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}

.dropzone {
  position: relative;
  height: clamp(148px, 24vh, 210px);
  border: 1.5px dashed rgba(15, 107, 97, 0.45);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: border-color 0.2s ease, transform 0.25s ease, background 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  outline: none;
  border-color: var(--teal);
  transform: translateY(-1px);
}

.dropzone.is-dragover {
  border-color: var(--teal-deep);
  background: rgba(200, 240, 95, 0.28);
}

.dropzone.has-file {
  border-style: solid;
  border-color: rgba(15, 107, 97, 0.35);
}

.dropzone__visual {
  position: absolute;
  right: -6%;
  bottom: -38%;
  width: min(360px, 52%);
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(15, 107, 97, 0.85), rgba(11, 61, 58, 0.95)),
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 10px,
      rgba(200, 240, 95, 0.08) 10px,
      rgba(200, 240, 95, 0.08) 12px
    );
  transform: rotate(-8deg);
  opacity: 0.9;
  pointer-events: none;
  animation: drift 8s ease-in-out infinite alternate;
}

.dropzone__copy {
  position: relative;
  z-index: 1;
  padding: 0 1.4rem;
  max-width: 28rem;
}

.dropzone__title {
  margin: 0;
  font-size: clamp(1.05rem, 2.4vh, 1.25rem);
  font-weight: 700;
}

.dropzone__hint {
  margin: 0.3rem 0 0;
  color: var(--mute);
  font-size: 0.86rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.field {
  display: grid;
}

.field__input-wrap {
  display: flex;
  align-items: center;
  width: 10.5rem;
  height: 2.65rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 0.8rem;
  box-shadow: var(--shadow);
}

.field__input {
  width: 100%;
  min-width: 0;
  height: 2.65rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  outline: none;
}

.field__suffix {
  color: var(--mute);
  font-weight: 600;
  white-space: nowrap;
}

.hint {
  margin: 0.4rem 0 0;
  color: var(--mute);
  font-size: 0.8rem;
}

.hint--inline {
  margin: 0;
}

.status {
  margin: 0.2rem 0 0;
  min-height: 1.3em;
  color: var(--mute);
  font-size: 0.85rem;
}

.cta {
  height: 2.65rem;
  padding: 0 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--teal-deep);
  color: var(--lime);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.cta:hover:not(:disabled) {
  background: var(--teal);
  transform: translateY(-1px);
}

.cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.progress-block {
  flex: 0 0 auto;
  display: grid;
  gap: 0.3rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 32, 31, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #1aa390 55%, var(--lime));
  transition: width 0.2s ease;
}

.result {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  animation: rise 0.5s ease both;
}

.result__video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(28vh, 240px);
  height: auto;
  border-radius: 12px;
  background: #0b3d3a;
}

.result__download {
  display: inline-flex;
  align-items: center;
  height: 2.4rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--lime);
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.result__download:hover {
  transform: translateY(-1px);
}

.foot {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 0.5rem;
  color: var(--mute);
  font-size: 0.75rem;
  animation: rise 1s ease 0.15s both;
}

.foot p {
  margin: 0;
}

/* When result is visible, keep dropzone compact */
.workspace:has(.result:not([hidden])) .dropzone {
  height: clamp(120px, 18vh, 160px);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: rotate(-8deg) translate(0, 0);
  }
  to {
    transform: rotate(-5deg) translate(-10px, -8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-height: 640px) {
  .brand__name {
    font-size: 2.1rem;
  }

  .dropzone__visual {
    width: min(260px, 48%);
  }

  .result__video {
    max-height: 22vh;
  }
}
