/* DinnerSorted marketing site. Tokens mirror ios-app/src/lib/theme.ts */

:root {
  --primary: #af540d;
  --primary-dark: #8a4209;
  --primary-tint: #f6e6d8;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6560;
  --background: #f7f3ee;
  --surface: #ffffff;
  --success: #27ae60;
  --border: #e5dfd6;
  --separator: #ede7df;
  --primary-foreground: #ffffff;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(26, 17, 9, 0.06);
  --shadow-lg: 0 12px 32px rgba(26, 17, 9, 0.12);
  --max-width: 1080px;
  --prose-width: 680px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #f39c12;
    --primary-dark: #d98505;
    --primary-tint: #2e2217;
    --text-primary: #f4efe9;
    --text-secondary: #a89e94;
    --background: #14110f;
    --surface: #1e1a17;
    --border: #3a322b;
    --separator: #2a2420;
    --primary-foreground: #1a1109;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  clip: auto;
  z-index: 10;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- nav */

.nav {
  padding: 18px 0;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--primary-dark);
}

/* ---------------------------------------------------------------- hero */

.hero {
  padding: 40px 0 72px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  margin: 0 0 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.hero .accent {
  color: var(--primary);
}

.hero p.lede {
  font-size: 19px;
  color: var(--text-secondary);
  margin: 0 0 28px;
  max-width: 46ch;
}

.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-media::before {
  content: "";
  position: absolute;
  width: min(360px, 78vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--primary-tint);
}

.hero-media img {
  position: relative;
  width: min(300px, 64vw);
  filter: drop-shadow(0 24px 40px rgba(26, 17, 9, 0.18));
}

.sources-line {
  margin: 28px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.sources-line strong {
  color: var(--text-primary);
  font-weight: 600;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.btn .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.25;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--background);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
}

.trust-line {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------------------------------------------------------------- sections */

section {
  padding: 72px 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 10px;
}

h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.015em;
}

.section-lede {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 60ch;
  margin: 0 0 40px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0 24px;
  flex-wrap: wrap;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 40px;
}

.text-link .icon {
  width: 18px;
  height: 18px;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* problem */

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--separator);
}

.problem {
  padding: 28px 28px 0 0;
}

.problem + .problem {
  padding-left: 28px;
  border-left: 1px solid var(--separator);
}

.problem .icon {
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.problem h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.problem p {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0;
}

/* how it works */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.step p {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0;
}

/* features */

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature .icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--background);
  border: 1px solid var(--separator);
  color: var(--text-primary);
  margin-bottom: 14px;
}

.feature h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.feature p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

/* screenshots */

.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.shots img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* guides teaser + hub */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.section-alt .guide-card {
  background: var(--background);
}

.guide-card:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .guide-card {
    transition: none;
  }

  .guide-card:hover {
    transform: none;
  }
}

.guide-card .guide-cluster {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.guide-card h3 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 10px;
}

.guide-card p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 18px;
}

.guide-card .guide-meta {
  margin-top: auto;
  margin-bottom: 0;
  font-size: 13px;
}

.hub {
  padding-top: 24px;
}

.hub-cluster + .hub-cluster {
  margin-top: 56px;
}

.hub-cluster .section-lede {
  margin-bottom: 20px;
}

.hub-cluster h2 {
  font-size: 22px;
  margin-bottom: 20px;
}

/* email capture */

.capture {
  background: var(--text-primary);
  color: var(--background);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .capture {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
  }
}

.capture h2 {
  color: inherit;
}

.capture .section-lede {
  color: rgba(247, 243, 238, 0.78);
  margin-left: auto;
  margin-right: auto;
}

@media (prefers-color-scheme: dark) {
  .capture .section-lede {
    color: var(--text-secondary);
  }
}

.capture-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qr-code {
  width: 132px;
  height: 132px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-lg);
}

.qr-code svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-caption {
  margin: 0;
  font-size: 13px;
  color: rgba(247, 243, 238, 0.75);
}

@media (prefers-color-scheme: dark) {
  .qr-caption {
    color: var(--text-secondary);
  }
}

.capture-divider {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(247, 243, 238, 0.6);
}

@media (prefers-color-scheme: dark) {
  .capture-divider {
    color: var(--text-secondary);
  }
}

.signup-form {
  display: flex;
  gap: 10px;
  width: 420px;
  max-width: 100%;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.signup-form input[type="email"] {
  flex: 1 1 200px;
  min-width: 0;
  padding: 14px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: 16px;
  font-family: var(--font);
}

.signup-form button {
  flex: none;
  white-space: nowrap;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  padding: 14px 22px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  font-family: var(--font);
}

.signup-form button:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-status {
  margin-top: 14px;
  font-size: 14px;
  min-height: 20px;
}

.form-status[data-state="success"] {
  color: #6fd68f;
}

.form-status[data-state="error"] {
  color: #ec7063;
}

.form-note {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(247, 243, 238, 0.65);
}

@media (prefers-color-scheme: dark) {
  .form-note {
    color: var(--text-secondary);
  }
}

/* faq (homepage and articles) */

.faq-list {
  max-width: 760px;
}

.faq-item {
  border-bottom: 1px solid var(--separator);
  padding: 20px 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  color: var(--text-secondary);
  margin: 12px 0 0;
  font-size: 16px;
  max-width: 65ch;
}

/* ---------------------------------------------------------------- articles */

.page-head {
  padding: 32px 0 8px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--border);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text-primary);
}

.article {
  padding: 0 0 72px;
}

.article-wrap {
  max-width: var(--prose-width);
  margin: 0 auto;
  padding: 0 24px;
}

.article h1,
.page-head h1 {
  font-size: clamp(32px, 4.5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 32px;
}

.byline strong {
  color: var(--text-primary);
  font-weight: 600;
}

.answer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 0 0 32px;
}

.answer-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin: 0 0 8px;
}

.answer p:last-child {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
}

.toc {
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
  padding: 20px 0;
  margin: 0 0 40px;
}

.toc-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
  font-size: 15px;
}

.toc li {
  margin: 0 0 6px;
  break-inside: avoid;
}

.toc a {
  color: var(--text-secondary);
  text-decoration: none;
}

.toc a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.prose {
  font-size: 18px;
  line-height: 1.7;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose > p,
.prose > ul,
.prose > ol {
  margin-bottom: 0;
}

.prose h2 {
  font-size: clamp(24px, 3vw, 30px);
  margin: 2.2em 0 0;
  scroll-margin-top: 24px;
}

.prose h3 {
  font-size: 20px;
  margin: 1.6em 0 0;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 0.6em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose a {
  color: var(--primary);
  text-underline-offset: 3px;
}

.prose strong {
  font-weight: 650;
}

.callout {
  background: var(--primary-tint);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.callout p {
  margin: 0;
  font-size: 16px;
}

.callout .callout-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.table-wrap th,
.table-wrap td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
  vertical-align: top;
}

.table-wrap th {
  font-weight: 700;
  background: var(--background);
}

.table-wrap tr:last-child td {
  border-bottom: none;
}

.article-section {
  margin-top: 56px;
  padding: 0;
}

.article-section h2 {
  font-size: 26px;
  margin: 0 0 8px;
}

.sources-list {
  font-size: 15px;
  color: var(--text-secondary);
  padding-left: 20px;
  margin: 12px 0 0;
}

.sources-list li + li {
  margin-top: 6px;
}

.sources-list a {
  color: var(--text-secondary);
  text-underline-offset: 3px;
  word-break: break-word;
}

.sources-list a:hover {
  color: var(--text-primary);
}

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--separator);
}

.author-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
}

.author-box p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.author-box .author-name {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 2px;
}

.cta-band {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 48px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.cta-band img {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.cta-band h2 {
  font-size: 20px;
  margin: 0 0 6px;
}

.cta-band p {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--text-secondary);
}

.cta-band .btn {
  padding: 12px 20px;
  font-size: 15px;
}

.related {
  padding: 56px 0 72px;
}

.related h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

/* ---------------------------------------------------------------- footer */

footer {
  padding: 48px 0 40px;
  border-top: 1px solid var(--separator);
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr 1fr;
  gap: 32px;
}

.footer-grid h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li + li {
  margin-top: 8px;
}

.footer-grid p {
  margin: 12px 0 0;
  max-width: 32ch;
}

footer a {
  text-decoration: none;
  color: var(--text-secondary);
}

footer a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
  font-size: 13px;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  section {
    padding: 56px 0;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding-top: 16px;
  }

  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-media {
    order: -1;
  }

  .hero-media::before {
    width: min(240px, 60vw);
  }

  .hero-media img {
    width: min(200px, 50vw);
  }

  .problem-grid,
  .steps,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .problem,
  .problem + .problem {
    padding: 24px 0;
    border-left: none;
  }

  .problem + .problem {
    border-top: 1px solid var(--separator);
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 20px;
  }

  /* Screenshots become a swipeable row instead of three tall stacked images. */
  .shots {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -24px;
    padding: 0 24px 24px;
    scrollbar-width: none;
  }

  .shots::-webkit-scrollbar {
    display: none;
  }

  .shots img {
    flex: 0 0 72%;
    max-width: 280px;
    scroll-snap-align: center;
  }

  .capture {
    padding: 32px 20px;
  }

  .capture-grid {
    flex-direction: column;
    gap: 20px;
  }

  .signup-form {
    width: 100%;
    max-width: 320px;
  }

  /* Stack the field and button so neither gets squeezed. */
  .signup-form input[type="email"],
  .signup-form button {
    flex: 1 1 100%;
    min-width: 0;
  }

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

  .toc ol {
    columns: 1;
  }

  .prose {
    font-size: 17px;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

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