@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Inter:wght@400;600;700;800&display=swap');

:root {
  --bg: #F8F5EF;
  --bg-soft: #EFE7DA;
  --text: #1E1B18;
  --muted: #6F6256;
  --gold: #C8A45D;
  --gold-light: #E4C978;
  --bronze: #9C7248;
  --black: #111111;
  --white: #FFFDF8;
  --green: #2F6F5E;
  --green-soft: #DDEBE5;
  --line: rgba(30, 27, 24, 0.12);
  --shadow: 0 24px 80px rgba(30, 27, 24, 0.16);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(228, 201, 120, 0.22), transparent 36%),
    radial-gradient(circle at bottom right, rgba(47, 111, 94, 0.16), transparent 38%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button, input { font: inherit; }

button { cursor: pointer; }

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px 18px 44px;
}

.hero {
  padding: 18px 0 8px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(17, 17, 17, 0.98), rgba(47, 111, 94, 0.82)),
    var(--black);
  color: var(--gold-light);
  font-family: "Cormorant Garamond", serif;
  font-size: 34px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 253, 248, 0.14), 0 18px 40px rgba(17, 17, 17, 0.22);
}

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

h1, h2, h3 { margin: 0; }

h1, h2 {
  font-family: "Cormorant Garamond", serif;
  line-height: 0.92;
  letter-spacing: -0.04em;
}

h1 { font-size: clamp(3.1rem, 14vw, 5.8rem); }

h2 { font-size: clamp(2.2rem, 10vw, 4rem); }

h3 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.hero-text {
  margin: 0 0 22px;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 700;
}

.search-card, .value-panel, .section-block, .detail-panel {
  background: rgba(255, 253, 248, 0.74);
  border: 1px solid rgba(200, 164, 93, 0.22);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-card {
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 5;
  border-radius: var(--radius-xl);
  padding: 12px;
}

.search-card label {
  display: block;
  margin: 0 0 8px 14px;
  color: var(--bronze);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 800;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 8px 10px 8px 14px;
}

.search-box span {
  color: var(--gold);
  font-size: 1.5rem;
  line-height: 1;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  font-size: 1rem;
  min-height: 42px;
}

.search-box input::placeholder { color: rgba(111, 98, 86, 0.7); }

.ghost-button {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 800;
}

.value-panel {
  margin: 20px 0;
  border-radius: var(--radius-lg);
  padding: 20px;
}

.value-panel p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  font-weight: 700;
}

.section-block {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius-xl);
}

.section-heading { margin-bottom: 16px; }

.inline-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.result-count {
  min-width: 42px;
  min-height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--black);
  color: var(--white);
  font-weight: 900;
}

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

.category-card {
  text-align: left;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, var(--white), var(--bg-soft));
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text);
}

.category-card span {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.92;
}

.category-card small {
  color: var(--muted);
  font-weight: 800;
}

.category-card.active {
  background: linear-gradient(145deg, var(--black), #26352F);
  color: var(--white);
  border-color: rgba(228, 201, 120, 0.44);
}

.category-card.active small { color: var(--gold-light); }

.prompt-list {
  display: grid;
  gap: 14px;
}

.prompt-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 28px;
  overflow: hidden;
  background: var(--white);
  color: var(--text);
  box-shadow: 0 18px 46px rgba(30, 27, 24, 0.12);
}

.prompt-card-inner {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.prompt-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.prompt-card h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.4rem;
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
}

.prompt-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 700;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.card-footer strong { font-size: 0.92rem; }

.arrow-round {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 0;
  background: var(--black);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 1.55rem;
}

.empty-state {
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.detail-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(17, 17, 17, 0.42);
  backdrop-filter: blur(12px);
  display: none;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.detail-view.open {
  display: block;
}

.detail-panel {
  width: min(100%, 760px);
  margin: 0 auto;
  border-radius: 34px;
  padding: 18px;
}

.back-button {
  border: 0;
  background: var(--black);
  color: var(--white);
  border-radius: 18px;
  padding: 13px 16px;
  font-weight: 900;
  margin-bottom: 18px;
}

.detail-header {
  padding: 10px 2px 18px;
}

.detail-header h2 {
  margin-bottom: 14px;
}

.detail-header p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.detail-tags, .pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.detail-tags span, .pill-list span {
  border-radius: 999px;
  padding: 9px 12px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 900;
  font-size: 0.82rem;
}

.price-card {
  border-radius: 26px;
  padding: 16px;
  background: linear-gradient(145deg, var(--black), #26352F);
  color: var(--white);
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.price-card .eyebrow { color: var(--gold-light); }

.primary-button, .secondary-button {
  border: 0;
  min-height: 52px;
  border-radius: 18px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-button {
  background: var(--gold);
  color: var(--black);
}

.secondary-button {
  background: var(--black);
  color: var(--white);
  margin-top: 14px;
}

.article-section {
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 18px;
  margin-top: 14px;
  background: rgba(255, 253, 248, 0.72);
}

.article-section h3 { margin-bottom: 12px; }

.article-section ul {
  padding-left: 18px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.prompt-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
}

.prompt-box p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  font-weight: 700;
}

.prompt-box pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  line-height: 1.55;
  font-weight: 650;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(22px);
  opacity: 0;
  pointer-events: none;
  background: var(--black);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 900;
  z-index: 40;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 720px) {
  .app-shell { padding-top: 34px; }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .price-card { grid-template-columns: 1fr auto; align-items: center; }
}
