/* Shares the look of capybaracode.eu, filenameninja.capybaracode.eu and tracksamurai.capybaracode.eu.
   Based on the Track Samurai stylesheet; WhatIEat-specific rules are at the end. */

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #0f1117;
  --color-bg-card: #1a1d27;
  --color-bg-card-hover: #222633;
  --color-surface: #252a3a;
  --color-primary: #e74c3c;
  --color-primary-dark: #c0392b;
  --color-accent: #f39c12;
  --color-accent-light: #f5b041;
  --color-text: #e8e8e8;
  --color-text-muted: #9ca3af;
  --color-text-heading: #ffffff;
  --color-border: #2d3348;
  --color-code-bg: #1e2233;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  --max-width: 1100px;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent-light);
  text-decoration: underline;
}

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

/* ===== Navigation ===== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text-heading);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--color-text-heading);
  text-decoration: none;
}

.nav-brand img {
  height: 36px;
  width: 36px;
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text-heading);
  text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  background: linear-gradient(180deg, #141722 0%, var(--color-bg) 100%);
}

.hero-logo {
  width: 180px;
  height: 180px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 8px 24px rgba(231, 76, 60, 0.25));
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-text-heading);
  margin-bottom: 0.5rem;
}

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

.hero .tagline {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  flex: 0 0 auto;
}

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

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text-heading);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ===== Sections ===== */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-heading);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* ===== Platform badges ===== */
.platforms {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  background: var(--color-surface);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.platform-badge svg,
.platform-badge img {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
}

.platform-badge svg {
  fill: currentColor;
}

/* ===== Feature grid ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  background: var(--color-bg-card-hover);
  border-color: #3d4460;
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text-heading);
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== Screenshots ===== */

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand img {
  height: 28px;
  opacity: 0.8;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .hero .tagline {
    font-size: 1.05rem;
  }

  .hero-logo {
    width: 130px;
    height: 130px;
  }

  .section {
    padding: 2.5rem 1rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 17, 23, 0.98);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

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

/* ===== WhatIEat additions ===== */

/* The app icon is a square image with a light background, so round it like a launcher icon. */
.app-icon-rounded {
  border-radius: 22%;
}

.nav-brand img.app-icon-rounded {
  border-radius: 8px;
}

.hero-logo.app-icon-rounded {
  filter: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* The company logo has black lettering on a transparent background,
   so it sits on a light plate to stay readable (same as on capybaracode.eu). */
.logo-plate {
  background: #f7f3ec;
  border-radius: 6px;
  padding: 2px 4px;
}

.footer-brand img.logo-plate {
  height: 36px;
  opacity: 0.9;
}

/* Phone screenshot gallery: a horizontal strip that scrolls on small screens */
.phone-gallery {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0.25rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.phone-shot {
  flex: 0 0 230px;
  scroll-snap-align: start;
  text-align: center;
}

.phone-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 1080 / 2340;
  object-fit: cover;
  border-radius: 22px;
  border: 6px solid #1f2330;
  box-shadow: var(--shadow);
  background: var(--color-bg-card);
  transition: transform 0.2s;
}

.phone-shot img:hover {
  transform: translateY(-3px);
}

.phone-shot figcaption {
  margin-top: 0.85rem;
}

.phone-shot figcaption h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-heading);
  margin-bottom: 0.2rem;
}

.phone-shot figcaption p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Health Score rating chips, matching the colours used in the app */
.rating-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.rating-chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chip-color);
}

.rating-chip.healthy { --chip-color: #4caf50; }
.rating-chip.so-so { --chip-color: #fbc02d; }
.rating-chip.unhealthy { --chip-color: #f44336; }

/* Privacy callout */
.privacy-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.privacy-card .feature-icon {
  margin-bottom: 0;
}

.privacy-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text-heading);
  margin-bottom: 0.5rem;
}

.privacy-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.privacy-card p:last-child {
  margin-bottom: 0;
}

/* Closing call to action */
.cta {
  text-align: center;
}

.cta .section-subtitle {
  margin-bottom: 1.75rem;
}

@media (max-width: 768px) {
  .phone-shot {
    flex-basis: 70%;
  }

  .privacy-card {
    flex-direction: column;
    gap: 0.75rem;
  }
}
