:root {
  --ink: #183c34;
  --muted: #6f817d;
  --green: #2f8f71;
  --green-dark: #24765d;
  --green-light: #e9f5f0;
  --cream: #fbfaf6;
  --line: #dce7e2;
  --white: #ffffff;
  --danger: #ad493d;
  --shadow: 0 22px 70px rgba(31, 76, 64, 0.11);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 9%, rgba(75, 161, 130, 0.1), transparent 25rem),
    radial-gradient(circle at 88% 35%, rgba(224, 184, 101, 0.08), transparent 22rem),
    var(--cream);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(47, 143, 113, 0.28);
  outline-offset: 3px;
}

.page-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--green);
  box-shadow: 0 8px 22px rgba(47, 143, 113, 0.25);
}

.brand-mark svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.brand-arrow {
  margin: 0 5px;
  color: #c4943c;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #53736a;
  background: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 600;
}

.privacy-pill svg,
.feature-icon svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hero {
  max-width: 720px;
  margin: 76px auto 44px;
  text-align: center;
}

.eyebrow {
  margin-bottom: 20px;
  color: var(--green);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.hero h1 {
  margin: 0;
  font-family: "Segoe UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: clamp(39px, 6vw, 64px);
  line-height: 1.15;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: var(--green);
}

.hero p {
  max-width: 600px;
  margin: 23px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.converter {
  max-width: 880px;
  margin: 0 auto;
}

.drop-zone {
  position: relative;
  display: flex;
  min-height: 380px;
  padding: 54px 32px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border: 1.5px dashed #9fc5b7;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.drop-zone::before,
.drop-zone::after {
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(47, 143, 113, 0.045);
  content: "";
}

.drop-zone::before {
  top: -120px;
  left: -80px;
}

.drop-zone::after {
  right: -90px;
  bottom: -125px;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--green);
  background: #f9fefc;
  transform: translateY(-2px);
}

.drop-zone.is-dragging {
  box-shadow: 0 22px 70px rgba(31, 76, 64, 0.16), inset 0 0 0 3px rgba(47, 143, 113, 0.08);
}

.drop-visual {
  display: grid;
  width: 74px;
  height: 74px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 22px;
  color: var(--green);
  background: var(--green-light);
}

.drop-visual svg {
  width: 38px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.drop-zone h2 {
  margin: 0 0 9px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.drop-zone p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.primary-button,
.secondary-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  min-width: 170px;
  padding: 13px 24px;
  color: white;
  background: var(--green);
  box-shadow: 0 9px 24px rgba(47, 143, 113, 0.24);
}

.primary-button:hover,
.secondary-button:hover,
.download-button:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.format-note {
  margin-top: 16px;
  color: #92a09c;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.settings-panel {
  display: grid;
  margin-top: 18px;
  padding: 19px 24px;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.67);
}

.setting-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.setting-group + .setting-group {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.setting-group.is-disabled {
  opacity: 0.62;
}

.settings-panel label {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 700;
}

.settings-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.quality-control {
  display: flex;
  min-width: 320px;
  align-items: center;
  gap: 14px;
}

.format-select {
  min-width: 132px;
  padding: 10px 38px 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font: 700 13px "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.format-select:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 156, 111, 0.13);
}

input[type="range"]:disabled {
  cursor: not-allowed;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  accent-color: var(--green);
  cursor: pointer;
}

.quality-control output {
  min-width: 44px;
  color: var(--green-dark);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.results {
  margin-top: 56px;
}

.results-heading {
  display: flex;
  margin-bottom: 18px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.results-heading h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.results-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.result-actions,
.file-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-button,
.remove-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.text-button {
  padding: 9px 10px;
  font-size: 12px;
}

.text-button:hover,
.remove-button:hover {
  color: var(--danger);
}

.secondary-button {
  padding: 10px 16px;
  color: white;
  background: var(--green);
  font-size: 12px;
}

.secondary-button svg,
.download-button svg,
.remove-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.secondary-button svg,
.download-button svg {
  margin-right: 7px;
}

.secondary-button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.file-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 10px;
  list-style: none;
}

.file-item {
  display: grid;
  min-width: 0;
  padding: 13px;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.thumbnail-wrap {
  position: relative;
  width: 72px;
  height: 58px;
  border-radius: 9px;
  background: #e9eeeb;
  overflow: hidden;
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-placeholder {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.thumbnail-placeholder span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9db5ad;
  animation: pulse 900ms infinite alternate;
}

.thumbnail-placeholder span:nth-child(2) { animation-delay: 180ms; }
.thumbnail-placeholder span:nth-child(3) { animation-delay: 360ms; }

@keyframes pulse {
  to { opacity: 0.25; transform: translateY(-3px); }
}

.file-details {
  min-width: 0;
}

.file-name-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.file-name {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: #4f7167;
  background: var(--green-light);
  font-size: 9px;
  font-weight: 700;
}

.file-item.is-complete .status-badge {
  color: var(--green-dark);
}

.file-item.is-error .status-badge {
  color: var(--danger);
  background: #f9eae7;
}

.file-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.progress-track {
  width: min(280px, 100%);
  height: 3px;
  margin-top: 9px;
  border-radius: 999px;
  background: #e9efec;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  animation: loading 1s ease-in-out infinite alternate;
}

@keyframes loading {
  from { transform: translateX(-100%); }
  to { transform: translateX(280%); }
}

.file-item.is-complete .progress-track,
.file-item.is-error .progress-track {
  display: none;
}

.download-button {
  padding: 9px 13px;
  color: white;
  background: var(--green);
  font-size: 11px;
}

.download-button:disabled {
  color: #9ba9a5;
  background: #edf1ef;
  cursor: wait;
}

.remove-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
}

.message {
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid #eccac4;
  border-radius: 12px;
  color: var(--danger);
  background: #fff5f3;
  font-size: 12px;
  line-height: 1.6;
}

.availability-notice {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid #e6c77d;
  border-radius: 14px;
  background: #fff9e9;
}

.availability-notice strong {
  display: block;
  margin-bottom: 5px;
  color: #765716;
  font-size: 13px;
}

.availability-notice p {
  margin: 0;
  color: #756a50;
  font-size: 11px;
  line-height: 1.6;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.trust-grid {
  display: grid;
  max-width: 880px;
  margin: 68px auto 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.trust-grid article {
  display: flex;
  padding: 20px 8px;
  align-items: flex-start;
  gap: 13px;
}

.feature-icon {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--green);
  background: var(--green-light);
}

.trust-grid h3 {
  margin: 0 0 5px;
  font-size: 12px;
}

.trust-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

footer {
  display: flex;
  margin-top: 74px;
  padding: 25px 0 34px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #91a09c;
  font-size: 9px;
}

footer p {
  margin: 0;
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 28px, 560px);
  }

  .site-header {
    height: 74px;
  }

  .privacy-pill {
    padding: 8px;
  }

  .privacy-pill svg {
    width: 18px;
  }

  .privacy-pill {
    font-size: 0;
  }

  .hero {
    margin: 52px auto 34px;
  }

  .hero h1 {
    font-size: clamp(36px, 12vw, 49px);
  }

  .hero h1 span {
    display: block;
  }

  .hero p {
    font-size: 13px;
  }

  .drop-zone {
    min-height: 330px;
    padding: 40px 18px;
    border-radius: 22px;
    text-align: center;
  }

  .drop-zone h2 {
    font-size: 18px;
  }

  .settings-panel {
    gap: 15px;
  }

  .setting-group {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .format-select {
    width: 100%;
  }

  .quality-control {
    min-width: 0;
  }

  .results {
    margin-top: 43px;
  }

  .results-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .result-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .file-item {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
  }

  .thumbnail-wrap {
    width: 58px;
    height: 50px;
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .download-button {
    flex: 1;
  }

  .trust-grid {
    margin-top: 48px;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .trust-grid article {
    padding: 15px 8px;
  }

  footer {
    align-items: center;
    flex-direction: column;
    gap: 7px;
    text-align: center;
  }
}

@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;
  }
}
