:root {
  color-scheme: light;
  --ink: #1f211f;
  --shell: #151817;
  --muted: #6d6254;
  --paper: #fff7e8;
  --panel: #fffaf0;
  --line: rgba(225, 212, 191, 0.72);
  --copper: #b96f3b;
  --olive: #596947;
  --gold: #d5ad69;
  --tomato: var(--copper);
  --leaf: var(--olive);
  --blue: var(--gold);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
  --paper-glow: rgba(255, 247, 232, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(21, 24, 23, 0.96), rgba(21, 24, 23, 0.86), rgba(82, 55, 35, 0.58)),
    url("https://images.unsplash.com/photo-1414235077428-338989a2e8c0?auto=format&fit=crop&w=1800&q=80")
      center / cover fixed;
  color: var(--paper);
  font-family:
    "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 44px;
}

.home-view {
  width: 100vw;
  min-height: 100vh;
  margin-left: calc((100% - 100vw) / 2);
  margin-top: -30px;
  margin-bottom: -44px;
  display: grid;
  grid-template-rows: auto minmax(400px, 62vh) auto;
}

.home-nav {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 0;
}

.home-brand {
  color: var(--paper);
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1;
}

.home-hero {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  display: grid;
  align-items: center;
}

.home-hero-inner {
  max-width: 620px;
  padding: 34px 0 44px;
}

.home-hero h1 {
  max-width: 620px;
  margin: 0 0 14px;
  font-size: clamp(3.7rem, 11vw, 8.2rem);
  line-height: 0.86;
}

.home-hero p:not(.eyebrow) {
  max-width: 430px;
  margin: 0 0 24px;
  color: rgba(255, 247, 232, 0.82);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  line-height: 1.42;
}

.home-start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 184px;
  min-height: 58px;
  border: 0;
  border-radius: 6px;
  background: var(--copper);
  color: var(--paper);
  box-shadow: 0 16px 34px rgba(185, 111, 59, 0.28);
  font-size: 1.05rem;
  font-weight: 900;
}

.home-about {
  border-top: 1px solid rgba(225, 212, 191, 0.55);
  background: var(--paper);
  color: var(--ink);
}

.home-about-inner {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 36px;
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 30px;
  align-items: start;
}

.home-about-copy h2 {
  max-width: 440px;
  margin-bottom: 10px;
  font-size: clamp(1.65rem, 3vw, 2.65rem);
  line-height: 1;
}

.home-about-copy p:not(.eyebrow),
.home-about-card p {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

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

.home-about-card {
  min-height: 132px;
  border: 1px solid rgba(225, 212, 191, 0.58);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.7);
  padding: 14px;
}

.home-about-card span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(89, 105, 71, 0.14);
  color: var(--olive);
  font-size: 0.78rem;
  font-weight: 900;
}

.home-about-card h3 {
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.home-ai {
  border-top: 1px solid rgba(225, 212, 191, 0.55);
  background: rgba(21, 24, 23, 0.94);
  color: var(--paper);
}

.home-ai-inner {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 40px;
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 30px;
  align-items: start;
}

.home-ai-copy h2 {
  max-width: 440px;
  margin-bottom: 10px;
  color: var(--paper);
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1;
}

.home-ai-copy p:not(.eyebrow),
.home-ai-card p {
  color: rgba(255, 247, 232, 0.74);
  font-weight: 700;
  line-height: 1.45;
}

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

.home-ai-card {
  min-height: 136px;
  border: 1px solid rgba(225, 212, 191, 0.16);
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.055);
  padding: 14px;
}

.home-ai-card span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(213, 173, 105, 0.18);
  color: #f1d596;
  font-size: 0.78rem;
  font-weight: 900;
}

.home-ai-card h3 {
  margin-bottom: 6px;
  color: var(--paper);
  font-size: 0.96rem;
}

.home-ai-disclaimer {
  grid-column: 2;
  border: 0;
  background: transparent;
  padding: 4px 0 0;
}

.home-ai-disclaimer strong {
  display: block;
  margin-bottom: 4px;
  color: rgba(241, 213, 150, 0.76);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-ai-disclaimer p {
  margin-bottom: 0;
  color: rgba(255, 247, 232, 0.64);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}

.topbar,
.deck-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar-actions {
  position: relative;
  z-index: 30;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-slot:empty {
  display: none;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 0;
  font-size: clamp(2.2rem, 6vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
  color: var(--paper);
}

h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

.status-pill,
.tagline,
.card-facts span,
.taste-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 247, 232, 0.9);
  color: #5e4f3a;
  padding: 8px 12px;
  white-space: nowrap;
  font-weight: 800;
}

.panel,
.food-card,
.decision-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.setup-view,
.account-view {
  padding: 24px;
}

.setup-view {
  width: fit-content;
  max-width: 100%;
  box-shadow: none;
  color: var(--paper);
}

.account-view {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: center;
}

.account-copy h2 {
  max-width: 430px;
  font-size: 2.2rem;
  line-height: 1.02;
  color: var(--ink);
}

.account-copy p {
  max-width: 430px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.55;
}

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

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

.field-error {
  display: block;
  min-height: 20px;
  margin-top: 6px;
  color: var(--tomato);
  font-size: 0.82rem;
  font-weight: 800;
}

.profile-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  color: rgba(255, 247, 232, 0.82);
}

.profile-strip span {
  border-radius: 999px;
  background: rgba(213, 173, 105, 0.18);
  color: #f1d596;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.profile-strip strong {
  color: var(--paper);
}

.food-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 12, 0.72);
  backdrop-filter: blur(4px);
  padding: 18px;
}

.food-modal-card {
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 24px;
}

.food-modal-card h2 {
  margin-bottom: 0;
  font-size: 2rem;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.location-modal-card {
  width: min(560px, 100%);
}

.guest-notice-card {
  width: min(520px, 100%);
}

.guest-notice-copy {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.location-choice-button {
  width: 100%;
  margin-top: 12px;
}

.radius-field {
  display: block;
  margin-top: 18px;
}

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

.choice-column {
  display: grid;
  gap: 10px;
}

.choice-column h3 {
  margin: 0 0 2px;
  color: #7c6644;
  font-size: 0.86rem;
  font-weight: 900;
}

.choice-custom-center {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(260px, 100%);
}

.choice-custom-center .choice-button {
  width: 100%;
  text-align: center;
}

.choice-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffaf0;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 850;
  text-align: left;
}

.choice-button.selected,
.choice-button[aria-pressed="true"] {
  border-color: rgba(89, 105, 71, 0.68);
  background: rgba(89, 105, 71, 0.13);
  color: var(--olive);
}

.custom-food-field {
  display: block;
  margin-top: 14px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--copper);
  margin-top: 14px;
  padding: 4px 0;
  font-weight: 900;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}

.arrow-button span {
  display: inline-block;
  margin-left: 6px;
}

.account-settings-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 247, 232, 0.92);
  color: var(--copper);
  min-height: 34px;
  padding: 0 12px;
  font-weight: 900;
}

.account-settings-card {
  width: min(520px, 100%);
}

#accountSettingsModal {
  z-index: 40;
}

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

.icon-button {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 900;
}

.icon-button:hover {
  color: var(--copper);
  background: rgba(185, 111, 59, 0.08);
}

.settings-profile {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  padding: 14px;
}

.settings-profile span {
  color: var(--ink);
  font-weight: 900;
}

.settings-profile small,
.password-status {
  color: var(--muted);
  font-weight: 700;
}

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

.password-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.password-form .primary-button {
  justify-self: end;
}

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

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffaf0;
  color: var(--ink);
  padding: 0 14px;
}

.setup-actions,
.swipe-actions,
.decision-panel div {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.round-button {
  border: 0;
  border-radius: 6px;
  min-height: 44px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  background: var(--copper);
  color: #fffaf0;
  box-shadow: 0 10px 22px rgba(185, 111, 59, 0.22);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fffaf0;
  color: var(--ink);
}

.compact {
  min-height: 38px;
}

.hidden {
  display: none !important;
}

.swipe-view {
  max-width: 620px;
  margin: 0 auto;
}

.food-card {
  overflow: hidden;
  position: relative;
  transform: translateX(var(--swipe-x, 0)) rotate(var(--swipe-rotate, 0deg));
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  touch-action: pan-y;
  user-select: none;
  will-change: transform;
}

.food-card.is-dragging {
  cursor: grabbing;
  transition: none;
}

.food-card.is-committing {
  opacity: 0;
  pointer-events: none;
}

.swipe-label {
  position: absolute;
  top: 22px;
  z-index: 5;
  border: 3px solid currentColor;
  border-radius: 6px;
  background: rgba(255, 247, 232, 0.9);
  padding: 8px 12px;
  opacity: 0;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  text-transform: uppercase;
  transition: opacity 120ms ease;
}

.swipe-label-no {
  right: 22px;
  color: #2a302f;
  transform: rotate(10deg);
}

.swipe-label-yes {
  left: 22px;
  color: var(--olive);
  transform: rotate(-10deg);
}

.food-card.swiping-no .swipe-label-no,
.food-card.commit-no .swipe-label-no,
.food-card.swiping-yes .swipe-label-yes,
.food-card.commit-yes .swipe-label-yes {
  opacity: var(--swipe-progress, 1);
}

.card-image {
  position: relative;
  min-height: 430px;
  background: #372b20 center / cover;
}

.card-content {
  padding: 22px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.tagline {
  display: inline-flex;
  margin-bottom: 8px;
  color: #6a5225;
  font-size: 0.84rem;
  font-weight: 800;
}

.card-content h3 {
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1.05;
}

.rating {
  min-width: 78px;
  color: var(--gold);
  font-weight: 900;
  text-align: right;
}

.address {
  color: var(--muted);
}

.card-facts,
.taste-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.discovery-reason {
  margin: 14px 0 0;
  border-left: 3px solid var(--olive);
  color: var(--muted);
  background: rgba(89, 105, 71, 0.1);
  padding: 10px 12px;
  font-size: 0.93rem;
  font-weight: 750;
  line-height: 1.45;
}

.result-body .discovery-reason {
  margin: 8px 0 10px;
  font-size: 0.86rem;
}

.swipe-actions {
  justify-content: center;
}

.round-button {
  width: 116px;
  height: 58px;
  border-radius: 999px;
  color: #fff;
}

.round-button.no {
  background: #2a302f;
}

.round-button.yes {
  background: var(--copper);
  box-shadow: 0 14px 28px rgba(185, 111, 59, 0.26);
}

.decision-panel {
  margin-top: 18px;
  padding: 16px;
}

.decision-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.results-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.result-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
}

.result-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #3b3026 center / cover;
}

.image-label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 2px;
  width: fit-content;
  max-width: calc(100% - 24px);
  border: 1px solid rgba(255, 247, 232, 0.55);
  border-radius: 6px;
  background: rgba(21, 24, 23, 0.82);
  color: var(--paper);
  padding: 8px 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.image-label strong {
  font-size: 0.78rem;
  line-height: 1.1;
}

.image-label span {
  color: rgba(255, 247, 232, 0.82);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.2;
}

.result-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.result-body h3 {
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.result-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.match-score {
  color: var(--olive);
  font-weight: 900;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  padding-top: 12px;
}

.result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgba(185, 111, 59, 0.2);
  border-radius: 6px;
  background: rgba(185, 111, 59, 0.07);
  color: var(--copper);
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.result-link:hover,
.result-link:focus-visible {
  border-color: rgba(185, 111, 59, 0.38);
  background: rgba(185, 111, 59, 0.13);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .food-card,
  .swipe-label {
    transition-duration: 1ms;
  }
}

@media (max-width: 800px) {
  .app-shell {
    width: min(100vw - 20px, 640px);
    padding-top: 18px;
  }

  .home-view {
    margin-top: -18px;
    grid-template-rows: auto minmax(420px, auto) auto;
  }

  .home-nav,
  .home-hero,
  .home-about-inner,
  .home-ai-inner {
    width: min(100vw - 20px, 640px);
  }

  .home-hero h1 {
    font-size: clamp(3rem, 17vw, 5rem);
  }

  .home-about-inner,
  .home-about-grid,
  .home-ai-inner,
  .home-ai-grid {
    grid-template-columns: 1fr;
  }

  .home-ai-disclaimer {
    grid-column: auto;
  }

  .topbar,
  .deck-meta,
  .card-row {
    display: block;
  }

  .topbar-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .status-pill {
    display: inline-flex;
  }

  .form-grid,
  .account-view,
  .results-list {
    grid-template-columns: 1fr;
  }

  .account-copy h2 {
    font-size: 1.75rem;
  }

  .food-modal-card h2 {
    font-size: 1.55rem;
  }

  .card-image {
    min-height: 310px;
  }

  .rating {
    text-align: left;
  }
}
