@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #0f172a;
  --bg-2: #111827;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --primary-2: #22d3ee;
  --accent: #f97316;
  --card: rgba(15, 23, 42, 0.82);
  --border: rgba(148, 163, 184, 0.16);
  --shadow: 0 30px 80px rgba(2, 6, 23, 0.45);
  --ring: rgba(56, 189, 248, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.18), transparent 45%),
    linear-gradient(145deg, var(--bg), var(--bg-2));
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
      90deg,
      rgba(148, 163, 184, 0.06) 0px,
      rgba(148, 163, 184, 0.06) 1px,
      transparent 1px,
      transparent 90px
    ),
    repeating-linear-gradient(
      180deg,
      rgba(148, 163, 184, 0.04) 0px,
      rgba(148, 163, 184, 0.04) 1px,
      transparent 1px,
      transparent 90px
    );
  opacity: 0.7;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 28px 96px;
  display: grid;
  gap: 32px;
  animation: fadeUp 0.9s ease both;
}

.hero {
  display: grid;
  gap: 16px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.home-link {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.4);
}

.status-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.15);
  color: #67e8f9;
  font-weight: 600;
  font-size: 0.9rem;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--primary);
  font-size: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 4.5vw, 4rem);
  font-weight: 700;
  background: linear-gradient(120deg, #38bdf8, #f97316 70%, #38bdf8);
  -webkit-background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  display: grid;
  gap: 18px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.9s ease both;
}

#decoder-card {
  animation-delay: 0.12s;
}

#hash-card {
  grid-column: 1 / -1;
  animation-delay: 0.24s;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(56, 189, 248, 0.2), transparent 45%, rgba(249, 115, 22, 0.2));
  opacity: 0.6;
  pointer-events: none;
}

.card-head {
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.card-head h2 {
  margin: 0;
  font-size: 1.6rem;
}

.card-head p {
  margin: 0;
  color: var(--muted);
}

.dropzone {
  position: relative;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 18px;
  padding: 26px;
  background: rgba(2, 6, 23, 0.35);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  z-index: 1;
}

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

.dropzone.is-dragover {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

.drop-content {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.drop-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.drop-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.file-meta,
.decode-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.file-meta div,
.decode-meta div {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.field {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.field span {
  font-weight: 600;
}

input[type="text"],
input[type="url"],
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 12px 14px;
  background: rgba(2, 6, 23, 0.65);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 4px var(--ring);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.url-fetch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  position: relative;
  z-index: 1;
}

.primary {
  background: linear-gradient(120deg, #38bdf8, #22d3ee);
  color: #0f172a;
  border: none;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(56, 189, 248, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(56, 189, 248, 0.3);
}

.primary:disabled,
.ghost-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.helper[data-state="error"] {
  color: #fb923c;
}

.helper[data-state="success"] {
  color: #22d3ee;
}

#decode-status[data-state="error"] {
  color: #fb923c;
  font-weight: 600;
}

#decode-status[data-state="success"] {
  color: #67e8f9;
  font-weight: 600;
}

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

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .file-meta,
  .decode-meta,
  .split,
  .url-fetch {
    grid-template-columns: 1fr;
  }
}

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