/* TrueCost landing — Foodnoms-style light system.
   Flat (no shadows), white canvas + Fog alt sections, uniform 26px radius,
   two-tone headlines, Nunito Sans standing in for Aquawax Pro. */

:root {
  /* Colors (Foodnoms tokens, roles preserved) */
  --ember-orange: #ff5406; /* brand mark + CTA */
  --verdant-green: #00b33f; /* win / positive */
  --signal-red-orange: #ff3400; /* Option B emphasis */
  --sky-blue: #00a9dd; /* Option A in mockups */
  --electric-blue: #0099f9; /* feature heading accent */
  --iris: #5856de; /* feature heading accent */
  --graphite: #2f2f2f; /* primary text + App Store badge */
  --charcoal: #000000;
  --fog: #f5f5f5; /* alt surface */
  --paper: #ffffff;
  --hairline: #e7e7e7;
  --muted: #6b6b6b;

  /* Type */
  --font: "Nunito Sans", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Shape + layout */
  --radius: 26px;
  --page-max: 1200px;
  --section-gap: 96px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

/* Two-tone headline accents */
.win {
  color: var(--verdant-green);
}
.accent {
  color: var(--ember-orange);
}

.shell {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}
.btn--orange {
  background: var(--ember-orange);
  color: var(--paper);
  padding: 13px 22px;
}
.btn .arrow {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* App Store badge (Graphite, ~56px) */
.appstore {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--graphite);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 0 26px;
  height: 56px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.appstore:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}
.appstore svg {
  width: 24px;
  height: 24px;
  fill: var(--paper);
  flex: none;
}
.appstore .as-top {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
  line-height: 1.1;
}
.appstore .as-main {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
}

/* ---------- Brand lockup ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  object-fit: cover;
  flex: none;
}
.brand__name {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--graphite);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--paper);
}
.site-header .shell {
  max-width: none;
  display: flex;
  align-items: center;
  gap: 44px;
  padding: 48px clamp(32px, 5vw, 60px) 26px;
}
.site-header .btn--orange {
  margin-left: auto;
}
.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav a {
  font-weight: 700;
  font-size: 16px;
  color: #6e6e73;
}
.nav a:hover {
  color: var(--ember-orange);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: clamp(56px, 9vw, 104px) 0 var(--section-gap);
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(38px, 7vw, 60px);
  max-width: 18ch;
  margin: 0 auto;
}
.hero__sub {
  max-width: 640px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.6;
}
.hero__cta {
  margin: 36px 0 0;
  display: flex;
  justify-content: center;
}
.hero__note {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Phone mockup row — full-bleed, upright, clipped at the viewport edges */
.mockups {
  margin-top: clamp(40px, 6vw, 72px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  padding: 0;
}
/* ---------- iPhone device frame (real PNG mockup) ---------- */
.phone {
  width: clamp(290px, 21vw, 330px);
  flex: none;
  aspect-ratio: 450 / 920;
  position: relative;
  will-change: transform;
  /* drop-shadow follows the frame's rounded silhouette */
  filter: drop-shadow(0 12px 20px rgba(15, 15, 20, 0.12))
    drop-shadow(0 4px 8px rgba(15, 15, 20, 0.08));
}
/* The screenshot sits behind the frame and shows through the transparent screen */
.phone__screen {
  position: absolute;
  z-index: 0;
  top: 2.5%;
  bottom: 2.5%;
  left: 5.33%;
  right: 5.33%;
  border-radius: 18px;
  background: #000;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
}
/* The iPhone frame (bezel, side buttons, Dynamic Island) overlays on top */
.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url("img/iphone.png") center / 100% 100% no-repeat;
  pointer-events: none;
}
.phone__screen span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
  padding: 20px;
}
.phone__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Features — 2×2 card grid (text left, phone bleeds off right) ---------- */
.features {
  padding: var(--section-gap) 0 0;
}
.features__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  /* break out wider than the 1200px shell so cards get more width */
  width: min(100vw - 2 * clamp(20px, 5vw, 40px), 1400px);
  margin-left: 50%;
  transform: translateX(-50%);
}
.feature {
  position: relative;
  overflow: hidden;
  background: var(--fog);
  border-radius: var(--radius);
  height: clamp(380px, 33vw, 440px);
}
.feature__text {
  position: relative;
  z-index: 1;
  max-width: 58%;
  padding: 44px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature h2 {
  font-size: clamp(25px, 2.4vw, 31px);
  line-height: 1.15;
  text-align: left;
}
.feature--blue h2 {
  color: var(--electric-blue);
}
.feature--orange h2 {
  color: var(--ember-orange);
}
.feature--iris h2 {
  color: var(--iris);
}
.feature--green h2 {
  color: var(--verdant-green);
}
.feature__body {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  text-align: left;
}

/* Preset chips (rounded tags, 26px radius) */
.feature__pills {
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feature__pill {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 7px 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--graphite);
}

/* Phone bleeds off the bottom-right of the card */
.feature__media {
  position: absolute;
  right: 28px;
  top: 64px;
}
.feature__media .phone {
  width: 224px;
  aspect-ratio: 450 / 920;
}
.feature__media .phone__screen {
  border-radius: 14px;
}

/* ---------- Download CTA card (floats over the grid bottom) ---------- */
/* ---------- Trust / values strip (3 centered columns) ---------- */
.values {
  padding: var(--section-gap) 0 0;
}
.values__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 5vw, 64px);
}
.value {
  max-width: 340px;
  margin: 0 auto;
  text-align: center;
}
.value__icon {
  display: inline-flex;
  margin-bottom: 18px;
}
.value__icon svg {
  width: 42px;
  height: 42px;
  stroke-width: 2.5;
}
.value__icon--blue {
  color: var(--sky-blue);
}
.value__icon--iris {
  color: var(--iris);
}
.value__icon--green {
  color: var(--verdant-green);
}
.value h3 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 800;
  color: var(--graphite);
}
.value p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- Closing CTA ---------- */
.closing {
  padding: var(--section-gap) 0;
  text-align: center;
}
.closing h2 {
  margin: 0 auto;
  font-size: clamp(26px, 3.4vw, 34px);
  max-width: 18ch;
}
.closing__sub {
  margin: 20px auto 0;
  max-width: 600px;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.6;
}
.closing__devices {
  margin: 40px 0 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  color: var(--graphite);
}
.closing__devices svg {
  width: 36px;
  height: 36px;
}
.closing__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--fog);
  color: var(--ember-orange);
  font-weight: 700;
  font-size: 18px;
  padding: 16px 28px;
  border-radius: var(--radius);
  transition: transform 0.15s ease, background 0.15s ease;
}
.closing__cta:hover {
  transform: translateY(-1px);
  background: #efefef;
}

/* Floating banner: hidden over the hero, fades in through the features,
   hides again once the footer is reached (toggled by JS, see index.html). */
.cta {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  width: min(720px, calc(100vw - 40px));
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.cta.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.cta__card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.14);
}
.cta__text {
  text-align: left;
}
.cta__card h2 {
  font-size: 19px;
  margin: 0;
}
.cta__card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.cta__card .btn {
  flex: none;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 48px 0;
}
.site-footer .shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer__links {
  display: flex;
  gap: 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.footer__links a:hover {
  color: var(--ember-orange);
}
.footer__disclaimer {
  max-width: 560px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.footer__copy {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Focus ---------- */
a:focus-visible,
.btn:focus-visible,
.appstore:focus-visible {
  outline: 2px solid var(--ember-orange);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav {
    display: none;
  }
  .features__grid {
    grid-template-columns: 1fr;
  }
  .values__grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .feature {
    height: auto;
    display: flex;
    flex-direction: column;
  }
  .feature__text {
    max-width: 100%;
    height: auto;
    padding: 36px 36px 0;
  }
  .feature__media {
    position: static;
    margin: 26px auto 0;
    display: flex;
    justify-content: center;
  }

  /* Hero phone row: scroll horizontally instead of clipping at the edges */
  .mockups {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 16px;
    /* leading/trailing padding so the first and last phone can sit centred */
    padding: 0 max(20px, calc((100vw - 72vw) / 2));
    scrollbar-width: none;
  }
  .mockups::-webkit-scrollbar {
    display: none;
  }
  .mockups .phone {
    width: 72vw;
    max-width: 320px;
    scroll-snap-align: center;
  }
  .cta {
    bottom: 12px;
    width: calc(100vw - 24px);
  }
  .cta__card {
    padding: 14px 16px;
    gap: 12px;
  }
  .cta__card h2 {
    font-size: 16px;
  }
  .cta__card p {
    display: none;
  }
}

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