:root {
  --ink: #14231f;
  --ink-soft: #3d524b;
  --paper: #f3efe6;
  --paper-2: #e8e2d4;
  --foam: #faf8f3;
  --accent: #0f7a5f;
  --accent-deep: #0a5543;
  --accent-soft: #d7efe6;
  --warn: #9b3d1f;
  --line: rgba(20, 35, 31, 0.12);
  --shadow: 0 18px 40px rgba(20, 35, 31, 0.08);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d9f0e6 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f0e2c8 0%, transparent 50%),
    linear-gradient(165deg, #f7f4ec 0%, #ebe4d6 48%, #e2ddd0 100%);
  line-height: 1.55;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(20, 35, 31, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 35, 31, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 85%);
}

.bg-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  right: -80px;
  top: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 122, 95, 0.18), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-40px, 30px); }
}

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

@keyframes pulse-bar {
  0% { width: 12%; }
  50% { width: 78%; }
  100% { width: 92%; }
}

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

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
  animation: rise 0.6s ease both;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link.is-active {
  background: var(--accent);
  color: #f7fffb;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.topbar-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-align: right;
}

main {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.hero {
  padding: 2.5rem 0 2.75rem;
  animation: rise 0.7s 0.08s ease both;
}

.hero-compact {
  padding-bottom: 1.75rem;
}

.hero-compact .hero-brand {
  font-size: clamp(2.4rem, 7vw, 4rem);
}

.hero-brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 5.4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.hero-line {
  margin: 0 0 0.75rem;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
}

.hero-sub {
  margin: 0 0 1.75rem;
  max-width: 38rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #f7fffb;
  box-shadow: 0 10px 24px rgba(15, 122, 95, 0.28);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
}

.btn-block {
  width: 100%;
}

.panel {
  background: color-mix(in srgb, var(--foam) 88%, white);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  animation: rise 0.7s 0.16s ease both;
}

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.panel-sub {
  margin: 0.35rem 0 1.35rem;
  color: var(--ink-soft);
}

.presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}

.presets-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.15rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field-input {
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  color: var(--ink);
}

.field-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.preset {
  position: relative;
  cursor: pointer;
}

.preset input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.preset-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 100%;
  padding: 0.9rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.preset input:focus-visible + .preset-body {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.preset input:checked + .preset-body {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(15, 122, 95, 0.25);
}

.preset.is-featured .preset-label::after {
  content: "rekomendasi";
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #f7fffb;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  text-transform: uppercase;
}

.preset-label {
  font-weight: 700;
  font-size: 0.95rem;
}

.preset-hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-deep);
}

.preset-desc {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.dropzone {
  margin-bottom: 1rem;
  border: 1.5px dashed rgba(15, 122, 95, 0.45);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(243, 239, 230, 0.5));
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(215, 239, 230, 0.55);
  transform: translateY(-1px);
}

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

.dropzone-inner {
  padding: 2rem 1.25rem;
  text-align: center;
}

.drop-icon {
  display: inline-flex;
  color: var(--accent-deep);
  margin-bottom: 0.65rem;
}

.drop-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.drop-sub {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.linkish {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-chip {
  display: inline-block;
  margin: 1rem 0 0;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--foam);
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list-wrap {
  margin: 0 0 1rem;
}

.file-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.text-btn {
  border: 0;
  background: none;
  color: var(--accent-deep);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.file-index {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

.file-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.file-actions {
  display: inline-flex;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--accent-soft);
  border-color: rgba(15, 122, 95, 0.35);
}

.icon-btn-danger:hover {
  background: #f8e6df;
  border-color: rgba(155, 61, 31, 0.3);
  color: var(--warn);
}

.howto a {
  color: var(--accent-deep);
  font-weight: 600;
}

.progress {
  margin-top: 1.25rem;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 35, 31, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 12%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2aa37f);
  animation: pulse-bar 1.8s ease-in-out infinite;
}

.progress-label {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.result {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  animation: rise 0.45s ease both;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

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

.stat-accent {
  background: var(--accent-soft);
  border-color: rgba(15, 122, 95, 0.28);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.result-note {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.result .btn + .btn {
  margin-top: 0.6rem;
}

.error {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #f8e6df;
  color: var(--warn);
  border: 1px solid rgba(155, 61, 31, 0.2);
  font-size: 0.92rem;
}

.howto {
  margin-top: 2.5rem;
  animation: rise 0.7s 0.24s ease both;
}

.howto h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.howto ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.howto li + li {
  margin-top: 0.45rem;
}

.howto-note {
  margin: 1rem 0 0;
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.footer-credit {
  letter-spacing: 0.01em;
}

.footer-credit strong {
  color: var(--accent-deep);
  font-weight: 700;
}

@media (max-width: 820px) {
  .presets,
  .presets-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-note {
    display: none;
  }

  .topbar-left {
    gap: 0.75rem;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 1.5rem;
  }

  .panel {
    padding: 1.15rem;
  }

  .presets,
  .presets-3,
  .split-fields {
    grid-template-columns: 1fr;
  }

  .nav {
    max-width: 100%;
    overflow-x: auto;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}
