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

:root {
  color-scheme: light;
  --bg: #f4efe8;
  --ink: #151218;
  --muted: #6d6672;
  --accent: #ff6a3d;
  --accent-deep: #e8451d;
  --paper: #fff7ef;
  --card: #ffffff;
  --line: #e1d6ca;
  --shadow: 0 18px 40px rgba(20, 12, 30, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at top, #fdf7f0, #efe6dc 55%, #e7ddcf);
  color: var(--ink);
  min-height: 100vh;
  padding: 48px clamp(20px, 5vw, 72px) 80px;
  position: relative;
}

.bg-veil {
  position: fixed;
  inset: 0;
  background: linear-gradient(130deg, rgba(255, 106, 61, 0.2), transparent 60%),
    radial-gradient(circle at 20% 30%, rgba(21, 18, 24, 0.08), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(255, 106, 61, 0.18), transparent 35%);
  z-index: -1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: stretch;
  margin-bottom: 64px;
}

.hero-content {
  padding-top: 24px;
  animation: fadeUp 0.7s ease both;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 16px;
}

h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 0 0 20px;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 34ch;
}

.hero-card {
  background: var(--card);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  animation: fadeUp 0.85s ease both;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

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

.chip {
  background: var(--paper);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

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

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--paper);
  padding: 8px 12px;
  border-radius: 999px;
}

.primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 106, 61, 0.35);
}

.helper {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.helper button {
  background: transparent;
  border: none;
  color: var(--accent-deep);
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
}

.results {
  background: var(--card);
  border-radius: 24px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: fadeUp 1s ease both;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.results-head h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.meta {
  display: flex;
  gap: 12px;
}

.meta span {
  background: var(--paper);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

th {
  background: var(--paper);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

tbody tr:hover {
  background: #fff4ea;
}

.empty,
.error {
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

.error {
  color: #b4311a;
  background: #ffe5dc;
  border-radius: 12px;
}

.hidden {
  display: none;
}

.footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.85rem;
}

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

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

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

  .results-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
