/* =============================================================================
   FoodMatch website design system
   Warm Mediterranean, premium, food-first. Hand-authored (no CDN framework)
   so the public site is fast, self-contained, and consistent with the app.
   ========================================================================== */

:root {
  /* Brand palette (shared with the app + foodmatch.es) */
  --paper: #f7efe1;        /* warm cream page bg */
  --surface: #fbf6ec;      /* lifted warm surface (cards) */
  --creamy: #f1e8d6;       /* deeper warm */
  --tinta: #1f1814;        /* primary text */
  --tinta-70: rgba(31, 24, 20, 0.7);
  --tinta-55: rgba(31, 24, 20, 0.55);
  --tinta-40: rgba(31, 24, 20, 0.4);
  --line: rgba(31, 24, 20, 0.10);
  --line-soft: rgba(31, 24, 20, 0.07);
  --tomate: #e63946;       /* primary accent */
  --tomate-deep: #b72c39;
  --mostaza: #f2a93b;      /* amber */
  --fresco: #3fae6b;       /* green */
  --azulejo: #1f4e5f;      /* deep teal */
  --ceramica: #d9694d;     /* terracotta */

  --shadow-sm: 0 1px 2px rgba(31, 24, 20, 0.04), 0 1px 3px rgba(31, 24, 20, 0.05);
  --shadow-md: 0 6px 20px -6px rgba(31, 24, 20, 0.12), 0 2px 6px -2px rgba(31, 24, 20, 0.06);
  --shadow-lg: 0 24px 60px -20px rgba(31, 24, 20, 0.22), 0 8px 24px -12px rgba(31, 24, 20, 0.10);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 56px);

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--tinta);
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* subtle warm dot texture, very faint */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(31, 24, 20, 0.018) 1px, transparent 1px);
  background-size: 26px 26px;
}
body > * { position: relative; z-index: 1; }

/* ---------- typography ---------- */
.serif { font-family: var(--serif); font-optical-sizing: auto; }
.it { font-style: italic; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.02em; line-height: 1.02; margin: 0; }

.display-xl { font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 0.98; letter-spacing: -0.03em; }
.display-lg { font-size: clamp(2rem, 5vw, 3.2rem); }
.display-md { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.eyebrow {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--tomate); margin: 0 0 0.6rem;
}
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--tinta-70); line-height: 1.6; }
.muted { color: var(--tinta-55); }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 9vw, 120px); }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.grid { display: grid; gap: clamp(16px, 2.5vw, 28px); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  padding: 0.9rem 1.5rem; border-radius: var(--r-pill); border: 0;
  cursor: pointer; transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--tomate); color: #fff; box-shadow: 0 12px 28px -12px rgba(230, 57, 70, 0.55); }
.btn-primary:hover { background: var(--tomate-deep); box-shadow: 0 16px 34px -12px rgba(230, 57, 70, 0.55); }
.btn-dark { background: var(--tinta); color: var(--paper); }
.btn-dark:hover { background: #000; }
.btn-ghost { background: var(--surface); color: var(--tinta); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--creamy); box-shadow: var(--shadow-md); }
.btn-lg { padding: 1.05rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- cards & surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: clamp(20px, 3vw, 32px); }
.card-hover { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line); }

.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.35rem 0.7rem; border-radius: var(--r-pill);
}
.badge-tomate { background: rgba(230, 57, 70, 0.10); color: var(--tomate-deep); }
.badge-fresco { background: rgba(63, 174, 107, 0.14); color: #2e7d4f; }
.badge-mostaza { background: rgba(242, 169, 59, 0.18); color: #92590a; }
.badge-line { background: var(--surface); color: var(--tinta-70); border: 1px solid var(--line); }

.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; font-weight: 500; padding: 0.45rem 0.85rem;
  border-radius: var(--r-pill); background: var(--surface);
  border: 1px solid var(--line); color: var(--tinta);
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-fresco { background: var(--fresco); }
.dot-tomate { background: var(--tomate); }
.dot-muted { background: var(--tinta-40); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 239, 225, 0.85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: 0.85rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--serif); font-weight: 700; font-size: 1.35rem; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--tomate); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.02em;
  font-family: var(--serif); font-weight: 700; font-size: 0.95rem; line-height: 1;
  white-space: nowrap; letter-spacing: -0.02em;
}
.brand-mark .it { margin-left: 0.02em; }
.nav-links { display: none; align-items: center; gap: 1.5rem; font-size: 0.95rem; }
.nav-links a { color: var(--tinta-70); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--tinta); }
@media (min-width: 880px) { .nav-links { display: flex; } }
.lang-switch { display: inline-flex; gap: 0.15rem; font-size: 0.8rem; font-weight: 600; }
.lang-switch a { padding: 0.25rem 0.5rem; border-radius: 8px; color: var(--tinta-40); }
.lang-switch a.active { color: var(--tinta); background: var(--creamy); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(40px, 7vw, 80px); }
.hero-grid { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; } }

/* food-tile collage placeholder (no external images needed) */
.collage { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tile {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-md); display: flex; align-items: flex-end; padding: 14px;
}
.tile:nth-child(1) { margin-top: 28px; }
.tile:nth-child(4) { margin-top: -28px; }
.tile .tile-label { font-family: var(--serif); font-weight: 700; color: #fff; font-size: 1.1rem; text-shadow: 0 1px 12px rgba(0,0,0,0.3); }
.tile .tile-mono {
  position: absolute; top: 10px; left: 14px; font-family: var(--serif); font-weight: 700;
  font-size: 2.4rem; color: rgba(255,255,255,0.92); text-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
/* photo tiles */
.tile-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(20,12,8,0.58), rgba(20,12,8,0.06) 46%, rgba(20,12,8,0) 72%);
}
.tile .tile-label, .tile .tile-mono { position: relative; z-index: 2; }
.tile { transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease; }
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.tile:hover .tile-img { transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) {
  .tile, .tile-img { transition: none; }
  .tile:hover { transform: none; }
  .tile:hover .tile-img { transform: none; }
}

/* ---------- split CTA cards (user vs restaurant) ---------- */
.split-card {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: clamp(24px, 3vw, 36px);
  display: flex; flex-direction: column; min-height: 280px; box-shadow: var(--shadow-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.split-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.split-card .split-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1rem; }
.split-card h3 { font-size: 1.6rem; }
.split-card p { color: var(--tinta-70); margin: 0.6rem 0 1.4rem; flex: 1; }

/* ---------- feature row ---------- */
.feature-num { font-family: var(--serif); font-style: italic; font-size: 1.4rem; }

/* ---------- restaurant grid cards ---------- */
.r-card { overflow: hidden; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); }
.r-cover { position: relative; aspect-ratio: 16 / 10; display: flex; align-items: flex-end; padding: 14px; overflow: hidden; }
.r-cover .r-mono { position: absolute; left: 14px; bottom: 10px; font-family: var(--serif); font-weight: 700; font-size: 2.6rem; color: rgba(255,255,255,0.92); text-shadow: 0 2px 14px rgba(0,0,0,0.28); }
.r-cover .r-tag { position: absolute; top: 12px; left: 12px; }
.r-body { padding: 16px 18px 18px; }
.r-name { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
.r-meta { font-size: 0.85rem; color: var(--tinta-55); margin-top: 2px; }
.r-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin-top: 0.8rem; font-size: 0.82rem; color: var(--tinta-70); }

/* ---------- info rows (detail page) ---------- */
.info-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line-soft); }
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--tinta-55); }
.info-row .v { text-align: right; font-weight: 500; }

/* ---------- footer ---------- */
.site-footer { background: var(--tinta); color: var(--paper); }
.site-footer a { color: rgba(248, 241, 229, 0.75); }
.site-footer a:hover { color: #fff; }
.site-footer .wrap { padding-block: clamp(40px, 6vw, 72px); }

/* ---------- forms ---------- */
.field {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--tinta);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 0.85rem 1rem; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field:focus { outline: none; border-color: rgba(230, 57, 70, 0.55); box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.14); }
.field::placeholder { color: var(--tinta-40); }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }

/* ---------- utilities ---------- */
.divider { height: 1px; background: var(--line); border: 0; }
.squiggle { height: 16px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 16' preserveAspectRatio='none'><path d='M0 8 Q10 1 20 8 T40 8 T60 8 T80 8' stroke='%23E63946' stroke-width='2' fill='none' stroke-linecap='round'/></svg>"); background-repeat: repeat-x; background-size: 80px 16px; opacity: 0.35; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--tinta); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 8px 0; z-index: 100; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--tomate); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
