/* Design tokens: WCAG AA+ contrast verified on warm off-white */
:root {
  --bg-offwhite: #faf7f2;
  --bg-offwhite-accent: #f3ede3;
  --surface-card: #ffffff;
  --surface-item: #fdfbf8;
  --border-subtle: #e7ddd0;

  /* Deep Chick-fil-A-inspired crimson: ~6.2:1 contrast against #FAF7F2 */
  --brand-red: #ba0c2f;
  --brand-red-hover: #990a27;
  --brand-red-active: #7d0820;
  --focus-ring: #6e061b;

  --text-primary: #1f1a17;
  --text-secondary: #574c45;
  --text-on-red: #ffffff;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-lg: 1.25rem;
  --radius-md: 0.75rem;
  --shadow-card: 0 12px 32px rgba(45, 24, 16, 0.08), 0 2px 6px rgba(45, 24, 16, 0.04);
  --shadow-button: 0 6px 18px rgba(186, 12, 47, 0.28);
}

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

html {
  font-size: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-offwhite);
  background-image: radial-gradient(circle at top center, #fffdf9 0%, var(--bg-offwhite) 60%, var(--bg-offwhite-accent) 100%);
  display: flex;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem) 1.25rem;
}

/* Accessible skip link for keyboard and screen-reader users */
.skip-link {
  position: absolute;
  top: -3.5rem;
  left: 1rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  background-color: var(--brand-red);
  color: var(--text-on-red);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

.page-shell {
  width: 100%;
  max-width: 40rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

/* Header: Bold red title standing out against the off-white background */
.site-header {
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-red);
  margin-bottom: 0.35rem;
}

.page-title {
  color: var(--brand-red);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
}

.page-title::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 0.3rem;
  margin: 0.75rem auto 0;
  border-radius: 999px;
  background-color: var(--brand-red);
}

.subtitle {
  margin-top: 0.85rem;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  color: var(--text-secondary);
}

.main-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

/* Meal Card */
.meal-card {
  position: relative;
  width: 100%;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: clamp(1.75rem, 4vw, 2.35rem) clamp(1.25rem, 4vw, 2.25rem) clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: var(--shadow-card);
}

.meal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background-color: var(--brand-red);
}

.meal-heading {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1.35rem;
}

.meal-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.meal-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem 1rem;
  padding: 0.95rem 1.15rem;
  background-color: var(--surface-item);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.meal-label {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-red);
}

.meal-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  min-width: 0;
  overflow-wrap: break-word;
}

.meal-card.is-updated .meal-item {
  animation: subtle-reveal 0.25s ease;
}

@keyframes subtle-reveal {
  from {
    opacity: 0.65;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.noscript-notice {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background-color: #fff3f5;
  border: 1px solid var(--brand-red);
  color: var(--brand-red);
  font-size: 0.95rem;
  text-align: center;
}

/* Primary Action Button */
.action-area {
  width: 100%;
  display: flex;
  justify-content: center;
}

.generate-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  min-height: 3.25rem;
  padding: 0.95rem 2.25rem;
  background-color: var(--brand-red);
  color: var(--text-on-red);
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.generate-btn:hover {
  background-color: var(--brand-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(153, 10, 39, 0.34);
}

.generate-btn:active {
  background-color: var(--brand-red-active);
  transform: translateY(0);
}

.generate-btn:focus-visible,
.skip-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Footer */
.site-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 32rem;
}

@media (max-width: 540px) {
  .meal-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .meal-value {
    text-align: left;
  }

  .generate-btn {
    width: 100%;
  }
}

/* Respect user reduced-motion accessibility setting */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
