:root {
  /* Core Brand Colors */
  --ff-primary: #0066FF;
  --ff-primary-dark: #0052CC;
  --ff-accent: #4ADE80;
  --ff-accent-glow: rgba(74, 222, 128, 0.5);
  --ff-secondary: #FF6B6B;

  /* Neutral Colors */
  --ff-background: #FAFAFA;
  --ff-surface: #FFFFFF;
  --ff-text: #0A0A0A;
  --ff-text-secondary: #525252;
  --ff-text-tertiary: #A3A3A3;
  --ff-border: rgba(0, 0, 0, 0.06);
  --ff-border-hover: rgba(0, 0, 0, 0.12);

  /* Nutrition Colors */
  --ff-protein: #F97316;
  --ff-carbs: #10B981;
  --ff-fat: #3B82F6;
  --ff-success: #10B981;
  --ff-danger: #EF4444;

  /* Glass Morphism */
  --ff-glass-surface: rgba(255, 255, 255, 0.7);
  --ff-glass-border: rgba(255, 255, 255, 0.5);
  --ff-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  --ff-blur: blur(20px);

  /* Spacing & Layout */
  --ff-radius-sm: 12px;
  --ff-radius-md: 20px;
  --ff-radius-lg: 32px;
  --ff-radius-full: 9999px;
  --ff-container-width: 1200px;
  --ff-nav-height: 80px;

  /* Gradients */
  --ff-gradient-primary: linear-gradient(135deg, #0066FF 0%, #3B82F6 100%);
  --ff-gradient-accent: linear-gradient(135deg, #4ADE80 0%, #22C55E 100%);
  --ff-gradient-glow: radial-gradient(circle at 50% 50%, rgba(74, 222, 128, 0.15) 0%, transparent 60%);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--ff-background);
  color: var(--ff-text);
  line-height: 1.5;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

button {
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

/* Typography */
h1,
h2,
h3,
h4 {
  letter-spacing: -0.02em;
  font-weight: 700;
}

.text-gradient {
  background: var(--ff-gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-accent {
  color: var(--ff-accent);
}

/* Layout Utilities */
.container {
  max-width: var(--ff-container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  position: relative;
}

/* Components: Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: var(--ff-radius-full);
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--ff-text);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: #222;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--ff-gradient-accent);
  color: #003300;
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.btn-accent:hover {
  box-shadow: 0 6px 16px rgba(74, 222, 128, 0.4);
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  border-color: var(--ff-text);
  background: rgba(0, 0, 0, 0.02);
}

/* Animated Background Mesh */
.mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 50%, rgba(74, 222, 128, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 102, 255, 0.06), transparent 25%);
  pointer-events: none;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--ff-nav-height);
  z-index: 100;
  transition: background 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav.scrolled {
  background: rgba(250, 250, 250, 0.85);
  border-bottom: 1px solid var(--ff-border);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--ff-accent-glow));
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-weight: 500;
  color: var(--ff-text-secondary);
}

.nav-link:hover {
  color: var(--ff-text);
}

/* Hero Section */
.hero {
  padding-top: 160px;
  padding-bottom: 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-content h1 {
  font-size: 4.5rem;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--ff-text-secondary);
  margin-bottom: 40px;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}

.stats-row {
  display: flex;
  gap: 32px;
  border-top: 1px solid var(--ff-border);
  padding-top: 24px;
}

.stat-item h4 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.stat-item p {
  color: var(--ff-text-secondary);
  font-size: 0.9rem;
}

/* Phone Preview (Interactive) - REFACTORED V2 */
.phone-frame {
  position: relative;
  width: 375px;
  /* iPhone standard width */
  height: 812px;
  background: #FAFAFA;
  /* Matches app background */
  border-radius: 48px;
  border: 12px solid #1a1a1a;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  margin: 0 auto;
  transform: rotateY(-5deg) rotateX(5deg);
  transition: transform 0.5s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.phone-frame:hover {
  transform: rotateY(0) rotateX(0) scale(1.02);
}

.bezel-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 34px;
  background: #1a1a1a;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  z-index: 20;
}

/* App Header */
.app-header {
  padding: 50px 24px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-logo-text {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: #000;
}

.streak-badge {
  background: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* App Content Area */
.app-scroll {
  padding: 0 24px;
  height: 100%;
  overflow: hidden;
  /* Simulated scroll */
}

/* Card Common Styles */
.app-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Streak Calendar Component */
.calendar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2px;
  gap: 8px;
}

.cal-fire-icon {
  font-size: 40px;
}

.cal-streak-num {
  font-size: 32px;
  font-weight: 600;
}

.cal-label {
  text-align: center;
  color: #525252;
  font-size: 13px;
  margin-bottom: 16px;
}

.week-row {
  display: flex;
  justify-content: space-between;
}

.day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.day-char {
  font-size: 13px;
  font-weight: 500;
  color: #525252;
}

.day-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}

.day-circle.complete {
  background: var(--ff-success);
  /* Green from tokens */
  color: white;
  font-weight: bold;
}

.day-circle.today-incomplete {
  border-color: var(--ff-danger);
  /* Red from tokens */
  border-width: 2px;
}

.day-circle.future {
  background: #FAFAFA;
  border: 1px solid #E5E5E5;
}

.day-num {
  font-size: 11px;
  color: #A3A3A3;
}

/* Main Calorie Circle */
.calorie-card {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

.cal-progress-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
}

.cal-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.cal-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.06);
  stroke-width: 12;
}

.cal-progress {
  fill: none;
  stroke: #0A0A0A;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 565;
  /* 2 * pi * 90 */
  stroke-dashoffset: 565;
  /* Starts empty */
  transition: stroke-dashoffset 1.5s ease-out;
}

.cal-center-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.cal-center-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.cal-center-val {
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
}

.cal-center-label {
  font-size: 13px;
  text-transform: uppercase;
  color: #525252;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* Macro Rings Row */
.macros-row {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
}

.macro-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.macro-ring-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 8px;
}

.macro-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.macro-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.06);
  stroke-width: 6;
}

.macro-progress {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 232;
  /* 2 * pi * 37 */
  stroke-dashoffset: 232;
  transition: stroke-dashoffset 1.5s ease-out 0.2s;
}

.macro-emoji {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
}

.macro-val {
  font-size: 16px;
  font-weight: 600;
}

.macro-label {
  font-size: 12px;
  color: #525252;
}

.macro-status {
  font-size: 10px;
  color: #A3A3A3;
}

/* Recent Meal Card */
.meal-card-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.meal-img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: #eee;
  object-fit: cover;
}

.meal-details {
  flex: 1;
}

.meal-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.meal-time {
  font-size: 12px;
  color: #A3A3A3;
  margin-bottom: 8px;
}

.meal-tags {
  display: flex;
  gap: 8px;
}

.meal-tag {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 500;
}

.tag-pro {
  background: #FEF3C7;
  color: #92400E;
}

/* Orange-ish */
.tag-cal {
  background: #F3F4F6;
  color: #374151;
}

/* FAB Button */
.fab-scan {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: white;
  padding: 16px 32px;
  border-radius: 32px;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  width: 80%;
  justify-content: center;
  transition: transform 0.2s ease;
}

.fab-scan:active {
  transform: translateX(-50%) scale(0.96);
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 64px;
}

.feature-card {
  background: var(--ff-surface);
  border: 1px solid var(--ff-border);
  padding: 32px;
  border-radius: var(--ff-radius-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(74, 222, 128, 0.4);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  display: inline-block;
  padding: 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 16px;
}

/* Invite Section */
.invite-section {
  background: #000;
  color: #fff;
  border-radius: 48px;
  padding: 80px;
  position: relative;
  overflow: hidden;
  margin-bottom: 100px;
}

.invite-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.15), transparent 70%);
  z-index: 1;
}

.invite-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 48px;
}

.invite-text {
  flex: 1;
}

.invite-text h2 {
  font-size: 3rem;
  margin-bottom: 16px;
}

.invite-text p {
  color: #A3A3A3;
  font-size: 1.1rem;
  margin-bottom: 32px;
  max-width: 400px;
}

.invite-card-display {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 300px;
}

.code-box {
  background: #fff;
  color: #000;
  padding: 16px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 700;
}

.copy-btn {
  color: var(--ff-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 968px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 120px;
  }

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

  .stats-row {
    justify-content: center;
  }

  .invite-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 3rem;
  }

  .nav-links {
    display: none;
    /* simple mobile hide for now */
  }
}