@import url('https://fonts.googleapis.com/css2?family=Familjen+Grotesk:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;0,9..144,900;1,9..144,300;1,9..144,700&display=swap');

/* DESIGN TOKENS */
:root {
  --black: #0A0C0A;
  --deep: #111612;
  --surface: #161B16;
  --surface2: #1E261E;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);

  --green: #3DBA6C;
  --green-bright: #52E088;
  --green-pale: rgba(61,186,108,0.12);
  --green-glow: rgba(61,186,108,0.3);

  --acid: #C8F23C;
  --acid-dim: rgba(200,242,60,0.15);

  --amber: #F0A830;
  --amber-pale: rgba(240,168,48,0.15);

  --red: #E8504A;
  --red-pale: rgba(232,80,74,0.15);

  --white: #F4F7F0;
  --gray: #8A9488;
  --gray-mid: #6A7268;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Familjen Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-green: 0 0 40px rgba(61,186,108,0.15);
  --shadow-card: 0 4px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

/* animated gradient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(61,186,108,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(200,242,60,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* NAVIGATION */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: rgba(10,12,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  cursor: pointer;
}

.nav-logo-mark {
  width: 32px; height: 32px;
  background: var(--green);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  letter-spacing: -0.02em;
}

.nav-logo-text span { color: var(--green); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
}

.nav-links a {
  display: block;
  text-decoration: none;
  color: var(--gray);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 100px;
  transition: all 0.2s;
  letter-spacing: 0.01em;
}

.nav-links a:hover { color: var(--white); background: var(--surface); }
.nav-links a.active { color: var(--green); background: var(--green-pale); }

.nav-cta {
  background: var(--green) !important;
  color: var(--black) !important;
  font-weight: 700 !important;
  padding: 0.4rem 1rem !important;
}
.nav-cta:hover { background: var(--green-bright) !important; transform: translateY(-1px); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.nav-hamburger span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s;
}

/* PAGE SYSTEM */
.page { display: none; position: relative; z-index: 1; }
.page.active { display: block; }

/* HOME - HERO */
.hero {
  min-height: 100vh;
  padding-top: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  padding-left: 5%;
  padding-right: 5%;
  position: relative;
  overflow: hidden;
}

/* decorative circle */
.hero::before {
  content: '';
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: 55vw; height: 55vw;
  max-width: 700px; max-height: 700px;
  border-radius: 50%;
  border: 1px solid var(--border);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--acid-dim);
  border: 1px solid rgba(200,242,60,0.3);
  color: var(--acid);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  margin-bottom: 1.75rem;
}

.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--acid);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.5vw, 5.2rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--white);
  margin-bottom: 1.75rem;
}

.hero-title .accent {
  color: var(--green);
  font-style: italic;
  display: block;
}

.hero-title .outline {
  -webkit-text-stroke: 1px rgba(255,255,255,0.3);
  color: transparent;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--gray);
  line-height: 1.75;
  max-width: 460px;
  margin-bottom: 2.5rem;
}

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

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green);
  color: var(--black);
  box-shadow: 0 0 0 0 var(--green-glow);
}
.btn-primary:hover {
  background: var(--green-bright);
  box-shadow: 0 0 24px var(--green-glow);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border-hover);
}
.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-pale);
}

.btn-acid {
  background: var(--acid);
  color: var(--black);
}
.btn-acid:hover {
  background: #d8ff42;
  transform: translateY(-2px);
}

/* hero visual - fridge card */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.fridge-card {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--r-xl);
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-green), var(--shadow-card);
  animation: heroFloat 7s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(0.5deg); }
  50% { transform: translateY(-14px) rotate(-0.5deg); }
}

.fridge-top {
  background: linear-gradient(135deg, var(--green) 0%, #2a9a56 100%);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fridge-top-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--black);
}

.fridge-top-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(0,0,0,0.65);
  font-family: var(--font-mono);
}

.fridge-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fridge-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--r-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  animation: fadeSlide 0.4s ease both;
}

.fridge-row:nth-child(1) { animation-delay: 0.1s; }
.fridge-row:nth-child(2) { animation-delay: 0.2s; }
.fridge-row:nth-child(3) { animation-delay: 0.3s; }
.fridge-row:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.fridge-row-name { font-weight: 500; color: var(--white); }
.fridge-row-days { font-size: 0.75rem; color: var(--gray); font-family: var(--font-mono); }

.status-pip {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pip-green { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.pip-amber { background: var(--amber); box-shadow: 0 0 8px rgba(240,168,48,0.4); }
.pip-red { background: var(--red); box-shadow: 0 0 8px rgba(232,80,74,0.4); }

.fridge-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray);
}

.fridge-footer-stat { display: flex; align-items: center; gap: 0.4rem; }
.fridge-footer-num { font-family: var(--font-mono); color: var(--green); font-weight: 600; }

/* STATS STRIP */
.stats-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2rem 5%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.stat-item { text-align: center; }

.stat-num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--acid);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--gray);
  line-height: 1.4;
}

/* FEATURES SECTION */
.features-section {
  padding: 7rem 5%;
}

.section-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-kicker::before {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--green);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--gray);
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 3.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.feature-cell {
  background: var(--deep);
  padding: 2.25rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.feature-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--green-pale);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-cell:hover::after { opacity: 1; }
.feature-cell:hover { transform: scale(1.01); z-index: 1; }

.feature-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  color: rgba(255,255,255,0.04);
  line-height: 1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.06em;
}

.feature-icon-wrap {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.feature-cell h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}

.feature-cell p {
  font-size: 0.875rem;
  color: var(--gray);
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

/* HOW IT WORKS */
.how-section {
  padding: 7rem 5%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 3.5rem;
  position: relative;
}

.how-steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: calc(12.5%);
  right: calc(12.5%);
  height: 1px;
  background: linear-gradient(90deg, var(--green) 0%, rgba(61,186,108,0.2) 100%);
}

.how-step {
  padding: 0 1.5rem;
  text-align: center;
  position: relative;
}

.how-step-num {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--black);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--green);
  margin: 0 auto 1.5rem;
  position: relative;
  z-index: 1;
}

.how-step h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.how-step p {
  font-size: 0.825rem;
  color: var(--gray);
  line-height: 1.65;
}

/* SDG BANNER */
.sdg-section {
  padding: 5rem 5%;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4rem;
}

.sdg-block {
  flex-shrink: 0;
  width: 120px; height: 120px;
  background: linear-gradient(135deg, var(--green) 0%, #1f7a45 100%);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
}

.sdg-block .num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--black);
  line-height: 1;
  letter-spacing: -0.06em;
}

.sdg-block .label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(0,0,0,0.65);
  text-transform: uppercase;
}

.sdg-content h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.sdg-content p {
  font-size: 0.95rem;
  color: var(--gray);
  line-height: 1.8;
  max-width: 660px;
}

/* FOOTER */
footer {
  background: var(--deep);
  border-top: 1px solid var(--border);
  padding: 3rem 5%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.footer-sub {
  font-size: 0.8rem;
  color: var(--gray);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--gray);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--green); }

/* INNER PAGE LAYOUTS */
.inner-page {
  padding-top: 64px;
  min-height: 100vh;
}

.page-header {
  padding: 3.5rem 5% 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.page-header p {
  color: var(--gray);
  font-size: 0.875rem;
  margin-top: 0.35rem;
}

.page-content {
  padding: 2.5rem 5%;
  max-width: 1300px;
}

/* DASHBOARD */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: border-color 0.2s;
}

.kpi-card:hover { border-color: var(--border-hover); }

.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.kpi-icon.green { background: var(--green-pale); }
.kpi-icon.amber { background: var(--amber-pale); }
.kpi-icon.red { background: var(--red-pale); }

.kpi-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 0.15rem;
}

.dash-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.6rem 1.1rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder { color: var(--gray-mid); }
.search-input:focus { border-color: var(--green); }

.filter-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  color: var(--gray);
  font-family: var(--font-body);
}

.filter-tab.active {
  background: var(--green);
  color: var(--black);
}

/* product grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  transition: all 0.25s;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}

.product-card.fresh::before { background: var(--green); }
.product-card.soon::before { background: var(--amber); }
.product-card.expired::before { background: var(--red); }

.product-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-card); }

.product-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.product-emoji { font-size: 1.75rem; line-height: 1; }

.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-badge.fresh { background: var(--green-pale); color: var(--green-bright); }
.product-badge.soon { background: var(--amber-pale); color: var(--amber); }
.product-badge.expired { background: var(--red-pale); color: var(--red); }

.product-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.product-qty {
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 0.75rem;
}

.product-progress-wrap {
  height: 3px;
  background: var(--surface2);
  border-radius: 3px;
  margin-bottom: 0.4rem;
}

.product-progress {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}
.product-progress.fresh { background: var(--green); }
.product-progress.soon { background: var(--amber); }
.product-progress.expired { background: var(--red); }

.product-expiry {
  font-size: 0.72rem;
  color: var(--gray-mid);
  font-family: var(--font-mono);
  margin-bottom: 0.75rem;
}

.product-note {
  background: rgba(200,242,60,0.08);
  border: 1px solid rgba(200,242,60,0.2);
  border-radius: var(--r-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.77rem;
  color: rgba(200,242,60,0.8);
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}

.product-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-xs {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  font-weight: 600;
}
.btn-xs:hover { border-color: var(--green); color: var(--green); background: var(--green-pale); }
.btn-xs.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-pale); }

.add-card {
  border: 1.5px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.25s;
  min-height: 180px;
  color: var(--gray);
  background: transparent;
  font-family: var(--font-body);
}
.add-card:hover { border-color: var(--green); color: var(--green); background: var(--green-pale); }
.add-card-icon { font-size: 1.75rem; }
.add-card-text { font-size: 0.85rem; font-weight: 600; }

/* SCAN PAGE */
.scan-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px;
  margin-bottom: 2rem;
  width: fit-content;
  gap: 2px;
}

.scan-tab {
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  color: var(--gray);
  font-family: var(--font-body);
}

.scan-tab.active { background: var(--green); color: var(--black); }

.upload-zone {
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--r-xl);
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--surface);
  margin-bottom: 2rem;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--green);
  background: var(--green-pale);
}

.upload-icon-big { font-size: 3rem; margin-bottom: 1rem; display: block; }
.upload-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.upload-sub { font-size: 0.875rem; color: var(--gray); margin-bottom: 1.5rem; }

.upload-preview {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.result-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-box h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}

.detected-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--r-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}
.detected-name { flex: 1; font-weight: 500; }
.detected-exp { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gray); }

.additive-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
  background: var(--amber-pale);
  border: 1px solid rgba(240,168,48,0.2);
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.additive-row.danger {
  background: var(--red-pale);
  border-color: rgba(232,80,74,0.2);
}

.additive-code { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; min-width: 50px; }
.additive-name { font-weight: 600; font-size: 0.85rem; }
.additive-desc { font-size: 0.77rem; color: var(--gray); }

.ingredient-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-top: 2rem;
}

.textarea-field {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  resize: vertical;
  min-height: 90px;
  transition: border-color 0.2s;
  margin-bottom: 0.75rem;
}
.textarea-field:focus { border-color: var(--green); }
.textarea-field::placeholder { color: var(--gray-mid); }

/* AI CHAT */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  padding: 1.5rem 5%;
  max-width: 860px;
}

.chat-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.chat-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.chat-header p { font-size: 0.8rem; color: var(--gray); margin-top: 0.2rem; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 4px; }

.chat-msg {
  display: flex;
  gap: 0.75rem;
  max-width: 88%;
  animation: msgPop 0.25s ease;
}

@keyframes msgPop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-av {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.msg-av.bot { background: var(--green); color: var(--black); font-weight: 700; }
.msg-av.user { background: var(--surface2); color: var(--white); font-size: 0.75rem; font-weight: 700; }

.msg-bubble {
  padding: 0.8rem 1rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.65;
}

.chat-msg.bot .msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--white);
}

.chat-msg.user .msg-bubble {
  background: var(--green);
  color: var(--black);
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gray);
  animation: typeBounce 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typeBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.chat-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.chat-chip {
  padding: 0.3rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  font-weight: 500;
}
.chat-chip:hover { border-color: var(--green); color: var(--green); background: var(--green-pale); }

.chat-input-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.85rem 0.85rem 0.85rem 1.1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  transition: border-color 0.2s;
}

.chat-input-bar:focus-within { border-color: var(--green); }

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  resize: none;
  min-height: 36px;
  max-height: 120px;
}
.chat-input::placeholder { color: var(--gray-mid); }

/* SHOPPING */
.shop-add-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.text-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.65rem 1.1rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.text-input::placeholder { color: var(--gray-mid); }
.text-input:focus { border-color: var(--green); }

.shop-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.shop-item:hover { border-color: var(--border-hover); }
.shop-item.checked { opacity: 0.45; }
.shop-item.checked .shop-name { text-decoration: line-through; }

.shop-check {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border-hover);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--black);
  transition: all 0.2s;
  background: transparent;
}
.shop-check.checked { background: var(--green); border-color: var(--green); }

.shop-name { flex: 1; font-weight: 500; font-size: 0.875rem; }
.shop-qty { font-size: 0.8rem; color: var(--gray); }

.priority-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.priority-high { background: var(--red-pale); color: var(--red); }
.priority-med { background: var(--amber-pale); color: var(--amber); }
.priority-low { background: var(--green-pale); color: var(--green); }

/* FAMILY */
.member-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 0.6rem;
  transition: border-color 0.2s;
}

.member-row:hover { border-color: var(--border-hover); }

.member-av {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--black);
  flex-shrink: 0;
}

.member-name { font-weight: 600; font-size: 0.9rem; }
.member-role { font-size: 0.75rem; color: var(--gray); }
.member-activity { font-size: 0.8rem; color: var(--gray); margin-left: auto; }

.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  flex-shrink: 0;
}

.invite-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
  border-style: dashed;
}

.invite-panel h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.invite-panel p { font-size: 0.875rem; color: var(--gray); margin-bottom: 1.25rem; }

.invite-row {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}

.invite-code {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green-pale);
  border: 1px solid rgba(61,186,108,0.25);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--r-sm);
  letter-spacing: 0.1em;
  margin-top: 1rem;
}

/* ABOUT PAGE */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: all 0.3s;
  cursor: default;
}

.team-card:hover {
  border-color: var(--green);
  transform: translateY(-4px);
  box-shadow: 0 0 20px var(--green-glow);
}

.team-av {
  width: 64px; height: 64px;
  border-radius: 18px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--black);
}

.team-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.team-role { font-size: 0.78rem; color: var(--gray); }

.ethics-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem;
  margin-top: 2rem;
}

.ethics-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.ethics-list { list-style: none; }
.ethics-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--gray);
  line-height: 1.6;
}
.ethics-list li:last-child { border-bottom: none; }
.ethics-list li strong { color: var(--white); }
.ethics-list .emoji { flex-shrink: 0; font-size: 1rem; }

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 460px;
  padding: 2rem;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s;
}

.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-x {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--gray);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-x:hover { background: var(--surface2); color: var(--white); }

.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.9rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--green); }
.form-input::placeholder { color: var(--gray-mid); }

select.form-input option { background: var(--deep); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* TOAST */
.toast-wrap {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  color: var(--white);
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.3s ease;
  max-width: 300px;
  font-weight: 500;
}
.toast.success { border-color: var(--green); }
.toast.warning { border-color: var(--amber); }
.toast.error { border-color: var(--red); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* SPINNER */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav { padding: 0 1.25rem; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--deep);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    gap: 0.25rem;
  }
  .nav-links.open a { border-radius: var(--r-sm); }

  .hero { grid-template-columns: 1fr; padding: 2rem 5%; padding-top: 80px; min-height: auto; gap: 3rem; }
  .hero::before { display: none; }
  .fridge-card { max-width: 340px; margin: 0 auto; }
  .stats-strip { grid-template-columns: repeat(2,1fr); padding: 2rem 5%; }
  .features-grid { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr 1fr; }
  .how-steps::before { display: none; }
  .sdg-section { grid-template-columns: 1fr; gap: 2rem; }
  .sdg-block { width: 90px; height: 90px; }
  .sdg-block .num { font-size: 2.25rem; }
  footer { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; gap: 1rem; }
  .dash-kpis { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { justify-content: center; }
  .page-content { padding: 1.5rem 1.25rem; }
  .page-header { padding: 2.5rem 1.25rem 1.5rem; }
  .how-section { padding: 4rem 5%; }
  .features-section { padding: 4rem 5%; }
  .sdg-section { padding: 3.5rem 5%; }
  .chat-wrap { padding: 1.25rem; }
  .invite-row { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .how-steps { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
}
