/*
 * nomi website. It borrows the app's own look (apps/mobile/src/theme):
 *   - the colour tokens, light and dark;
 *   - Poppins titles that end in an olive full stop, with DM Sans body text;
 *   - "sticker" surfaces with a 1.5px ink outline;
 *   - chips and tags that sit on a card's top edge, like the Plan tab's day chips and price tags;
 *   - index-card tabs for the nav, like the recipe page's Ingredients / Instructions tabs.
 *
 * The fonts are self-hosted latin subsets (SIL OFL, licences in fonts/), so no
 * page sends visitors' IP addresses to a font CDN.
 */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/poppins-500-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/poppins-600-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/poppins-700-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;
  /* apps/mobile/src/theme/colors.ts, light */
  --bg: #f7f3e9;
  --surface: #fffdf8;
  --muted: #eeefe3;
  --selected: #eef3da;
  --primary: #46572c;
  --on-primary: #fffdf8;
  --accent: #d3ec9e;
  --on-accent: #2b3a12;
  --text: #1f2019;
  --text-2: #6b6a5e;
  --text-3: #9a988b;
  --ink: #26381a;
  --border: #e7e3d6;
  --divider: #eeeae0;
  /* meal-card.tsx's price tag */
  --tag-paper: #e9d5ae;
  --tag-ink: #26381a;
  /* lightTagColors: the vibe chips */
  --lavender-bg: #e7e1f3;
  --lavender: #50407f;
  --sky-bg: #dbe8ef;
  --sky: #2e5a70;
  --butter-bg: #f4e7bd;
  --butter: #6f5810;
  --pistachio-bg: #e2edc6;
  --pistachio: #45562a;
  --apricot-bg: #f7dcc5;
  --apricot: #8a4718;
  --mint-bg: #d4ebe2;
  --mint: #2c6553;
  --rose-bg: #f5d8d2;
  --rose: #8e3a2b;
  --berry-bg: #f4dae8;
  --berry: #7d2e5e;

  --device: #1f2019;
  --line: 1.5px;
  --display: 'Poppins', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --radius: 24px;
  --gutter: 20px;
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141510;
    --surface: #1e1f19;
    --muted: #282a21;
    --selected: #213a0e;
    --primary: #9bd938;
    --on-primary: #18200c;
    --accent: #294e05;
    --on-accent: #c4ee7b;
    --text: #eeebe0;
    --text-2: #adab9c;
    --text-3: #7f7e71;
    --ink: #5f7a4e;
    --border: #33352b;
    --divider: #2a2c23;
    --tag-paper: #3f3627;
    --tag-ink: #e9d5ae;
    --lavender-bg: #2e2940;
    --lavender: #cbbff0;
    --sky-bg: #1e2f38;
    --sky: #a6cde2;
    --butter-bg: #3a3218;
    --butter: #edd58c;
    --pistachio-bg: #2a3419;
    --pistachio: #c9e09a;
    --apricot-bg: #422a1a;
    --apricot: #f3bd92;
    --mint-bg: #1a3129;
    --mint: #a1d9c3;
    --rose-bg: #43241f;
    --rose: #f1b2a5;
    --berry-bg: #3f2334;
    --berry: #f2b6d8;
    --device: #34362c;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--primary);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 8px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0;
}

h2 {
  text-wrap: balance;
}

h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* The app ends its screen titles in an olive full stop ("Grocery list.") */
.dot {
  color: var(--primary);
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 14px;
}

.eyebrow {
  font: 600 13px/1.4 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 8px;
}

/* Stickers: small outlined chips, often tilted or sitting on a card's top edge */

.sticker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 14px/1.3 var(--display);
  white-space: nowrap;
}

.sticker.tag {
  background: var(--tag-paper);
  color: var(--tag-ink);
  border-radius: 10px;
}

.sticker.tag::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: var(--line) solid currentColor;
}

.sticker.paper {
  background: var(--surface);
  color: var(--text);
}

.sticker.olive {
  background: var(--primary);
  color: var(--on-primary);
}

.tilt-l {
  transform: rotate(-5deg);
}

.tilt-r {
  transform: rotate(4deg);
}

.edge {
  position: absolute;
  top: 0;
  left: 22px;
  translate: 0 -55%;
}

.edge.right {
  left: auto;
  right: 22px;
}

.card {
  position: relative;
  background: var(--surface);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.chip {
  padding: 3px 12px;
  border-radius: 999px;
  font: 500 14px/1.5 var(--body);
}

.chip.lavender { background: var(--lavender-bg); color: var(--lavender); }
.chip.sky { background: var(--sky-bg); color: var(--sky); }
.chip.butter { background: var(--butter-bg); color: var(--butter); }
.chip.pistachio { background: var(--pistachio-bg); color: var(--pistachio); }
.chip.apricot { background: var(--apricot-bg); color: var(--apricot); }
.chip.mint { background: var(--mint-bg); color: var(--mint); }
.chip.rose { background: var(--rose-bg); color: var(--rose); }
.chip.berry { background: var(--berry-bg); color: var(--berry); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font: 600 17px/1 var(--display);
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.08);
}

.button.outline {
  background: transparent;
  color: var(--text);
  border: var(--line) solid var(--ink);
}

/*
 * Phones: a screenshot with a slim device bezel. The bezel is a box-shadow ring,
 * which follows the screen's corners and stays the same few pixels at any size
 * (percentage padding would scale with the parent's width instead). The radius
 * ratio keeps the corners round, since every screenshot has the same aspect.
 */

.phone {
  --bezel: 4px;
  position: relative;
}

.phone img {
  width: 100%;
  border-radius: 12.6% / 5.8%;
  box-shadow:
    0 0 0 var(--bezel) var(--device),
    0 30px 60px -28px rgba(31, 32, 25, 0.55);
}

/*
 * Header: the nav is a row of index-card tabs standing on a rule, like the
 * dividers in a recipe box (the app's recipe-tabs.tsx). The open tab is cut from
 * the page's own paper and runs into it; the others wait behind in their tints.
 */

.site-header {
  padding: 16px 0 0;
}

.site-header .wrap {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

/* The rule the tabs stand on, drawn over the ones waiting behind */
.site-header .wrap::after {
  content: '';
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  height: var(--line);
  background: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 56px;
  height: 56px;
  border-radius: 15px;
}

.brand .wordmark {
  height: 48px;
}

@media (max-width: 700px) {
  .brand {
    gap: 10px;
  }

  .brand img {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .brand .wordmark {
    height: 38px;
  }
}

.wordmark {
  display: block;
  height: 34px;
  width: auto;
  color: var(--text);
}

.wordmark .mi {
  fill: var(--primary);
}

.site-nav {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  font: 600 15px/1 var(--body);
}

.site-nav a {
  position: relative;
  z-index: 1;
  padding: 11px 18px 13px;
  border: var(--line) solid var(--ink);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--tab-bg);
  color: var(--tab-fg);
  text-decoration: none;
  transition: padding-top 0.18s ease;
}

.site-nav .pistachio { --tab-bg: var(--pistachio-bg); --tab-fg: var(--pistachio); }
.site-nav .sky { --tab-bg: var(--sky-bg); --tab-fg: var(--sky); }
.site-nav .butter { --tab-bg: var(--butter-bg); --tab-fg: var(--butter); }
.site-nav .lavender { --tab-bg: var(--lavender-bg); --tab-fg: var(--lavender); }

.site-nav a:hover {
  padding-top: 14px;
}

.site-nav a[aria-current='page'] {
  z-index: 3;
  padding-top: 16px;
  background: var(--bg);
  color: var(--text);
}

/* The seam: the open tab's paper covers the rule, so the tab runs into the page */
.site-nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--line) + 1px);
  background: var(--bg);
}

@media (max-width: 700px) {
  .site-nav .wide {
    display: none;
  }

  .site-nav a {
    padding: 10px 14px 12px;
  }

  .site-nav a:hover {
    padding-top: 12px;
  }

  .site-nav a[aria-current='page'] {
    padding-top: 14px;
  }
}

/* Home: hero */

.hero {
  padding: 32px 0 88px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 40px;
}

.hero h1 {
  font-size: clamp(42px, 5vw, 62px);
  margin: 6px 0 22px;
}

.hero .lead {
  font-size: 20px;
  color: var(--text-2);
  max-width: 30em;
  margin: 0 0 32px;
}

.hero .cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
}

.hero .soon {
  color: var(--text-2);
  font-size: 15px;
  margin: 18px 0 0;
}

.hero-phones {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1.06;
  justify-self: center;
}

.hero-phones::before {
  content: '';
  position: absolute;
  inset: 8% 0 4% 6%;
  border-radius: 50%;
  background: var(--selected);
}

.hero-phones .phone {
  position: absolute;
}

.hero-phones .front {
  width: 50%;
  right: 6%;
  top: 0;
  z-index: 2;
}

.hero-phones .back {
  width: 43%;
  left: 4%;
  top: 11%;
  rotate: -7deg;
}

.hero-phones .sticker {
  position: absolute;
  z-index: 3;
  font-size: 15px;
  padding: 7px 16px;
}

.hero-phones .s1 {
  left: 0;
  top: 4%;
}

.hero-phones .s2 {
  right: 0;
  bottom: 12%;
}

@media (max-width: 860px) {
  .hero {
    padding: 12px 0 64px;
  }

  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-phones {
    max-width: 420px;
  }
}

/* Home: sections */

.section {
  padding: 88px 0;
}

.section.tinted {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section h2 {
  font-size: clamp(32px, 4.4vw, 48px);
}

.section-head p:not(.eyebrow) {
  color: var(--text-2);
  font-size: 18px;
  margin: 16px 0 0;
}

/* How it works: each step is a sticker card with its screen rising out of the bottom */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.step {
  display: flex;
  flex-direction: column;
  padding: 36px 26px 0;
  background: var(--bg);
}

.step h3 {
  font-size: 23px;
  margin-bottom: 8px;
}

.step p {
  margin: 0;
  color: var(--text-2);
}

.step .peek {
  margin: 28px -26px 0;
  height: 330px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  border-radius: 0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px);
  background: var(--selected);
  padding-top: 26px;
  flex: 1 0 auto;
}

.step .peek .phone {
  width: 210px;
  flex: none;
  align-self: flex-start;
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
  }
}

/* A peek inside: a grid of screens, gently staggered */

.gallery {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px 48px;
}

.gallery li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gallery .phone {
  width: min(250px, 100%);
}

.gallery h3 {
  font-size: 20px;
  margin: 24px 0 6px;
}

.gallery p {
  margin: 0;
  color: var(--text-2);
  max-width: 26ch;
}

@media (min-width: 901px) {
  .gallery li:nth-child(3n + 2) {
    translate: 0 56px;
  }

  .gallery {
    padding-bottom: 56px;
  }
}

/* On phones the gallery becomes a swipeable strip */
@media (max-width: 900px) {
  .gallery {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * var(--gutter));
    padding: 8px var(--gutter) 16px;
    scrollbar-width: none;
  }

  .gallery::-webkit-scrollbar {
    display: none;
  }

  .gallery li {
    flex: 0 0 min(230px, 64vw);
    scroll-snap-align: center;
  }

  .swipe-hint {
    display: block;
  }
}

.swipe-hint {
  display: none;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  margin: 8px 0 0;
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 28px;
}

.feature {
  padding: 34px 28px 28px;
}

.feature .icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  border: var(--line) solid var(--ink);
  margin-bottom: 18px;
}

.feature h3 {
  font-size: 22px;
  margin-bottom: 6px;
}

.feature > p {
  margin: 0;
  color: var(--text-2);
}

.feature ul:not(.chips) {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text-2);
}

.feature li + li {
  margin-top: 4px;
}

@media (max-width: 820px) {
  .features {
    grid-template-columns: 1fr;
  }
}

/* Dark mode showcase: always dark, like the app at night */

.night {
  background: #141510;
  color: #eeebe0;
  border-block: 1px solid #33352b;
  overflow: hidden;
}

.night .wrap {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
}

.night .eyebrow,
.night .dot {
  color: #9bd938;
}

.night p:not(.eyebrow) {
  color: #adab9c;
  font-size: 18px;
}

.night .modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.night .modes li {
  padding: 8px 16px;
  border-radius: 999px;
  border: var(--line) solid #5f7a4e;
  font: 600 15px/1.3 var(--display);
}

.night .modes li:nth-child(2) {
  background: #294e05;
  color: #c4ee7b;
}

.night-phones {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.night-phones .phone {
  --device: #34362c;
  width: min(240px, 46%);
}

.night-phones .phone:last-child {
  translate: 0 48px;
}

@media (max-width: 860px) {
  .night .wrap {
    grid-template-columns: 1fr;
  }

  .night-phones {
    padding-bottom: 48px;
  }
}

/* Trial: the Plan tab's olive cost card */

.trial {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--primary);
  color: var(--on-primary);
  padding: 56px 48px 48px;
  border-radius: 32px;
}

.trial .edge {
  left: 40px;
}

.trial h2 {
  font-size: clamp(32px, 4.4vw, 46px);
}

.trial .eyebrow {
  color: inherit;
  opacity: 0.8;
}

.trial p {
  margin: 14px 0 0;
  opacity: 0.88;
  font-size: 18px;
}

.trial ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.trial li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 253, 248, 0.1);
  border: 1px solid rgba(255, 253, 248, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
}

.trial li svg {
  flex: none;
  margin-top: 3px;
}

@media (prefers-color-scheme: dark) {
  .trial li {
    background: rgba(24, 32, 12, 0.08);
    border-color: rgba(24, 32, 12, 0.2);
  }
}

@media (max-width: 820px) {
  .trial {
    grid-template-columns: 1fr;
    padding: 48px 24px 28px;
  }

  .trial .edge {
    left: 24px;
  }
}

/* Good to know */

.notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 24px;
}

.notes .card {
  padding: 32px 24px 24px;
}

.notes h3 {
  font-size: 19px;
  margin-bottom: 6px;
}

.notes p {
  margin: 0;
  color: var(--text-2);
  font-size: 16px;
}

@media (max-width: 820px) {
  .notes {
    grid-template-columns: 1fr;
  }
}

/* Documents: terms, privacy, support, deletion */

.doc {
  max-width: 780px;
  padding-top: 24px;
  padding-bottom: 88px;
}

.doc h1 {
  font-size: clamp(38px, 5.4vw, 52px);
  margin: 4px 0 8px;
}

.doc .updated {
  color: var(--text-3);
  font-size: 15px;
  margin: 0 0 36px;
}

.doc h2 {
  font-size: 25px;
  margin: 52px 0 12px;
  scroll-margin-top: 16px;
}

.doc h3 {
  font-size: 18px;
  margin: 28px 0 8px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li + li {
  margin-top: 6px;
}

.summary {
  position: relative;
  background: var(--accent);
  color: var(--on-accent);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  padding: 36px 28px 24px;
  margin: 12px 0 36px;
}

.summary h2 {
  margin: 0;
}

/* Headings dressed as stickers keep the sticker's size. */
.doc .sticker {
  font-size: 15px;
  letter-spacing: 0;
}

.summary ul {
  margin: 0;
}

.toc {
  position: relative;
  background: var(--surface);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  padding: 32px 28px 22px;
  margin: 0 0 16px;
}

.toc ol {
  margin: 0;
  columns: 2;
  column-gap: 32px;
}

.toc li {
  break-inside: avoid;
}

@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
}

.table-scroll {
  overflow-x: auto;
  margin: 16px 0;
  border: var(--line) solid var(--ink);
  border-radius: 18px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 520px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  font-weight: 600;
  background: var(--selected);
}

.callout {
  background: var(--selected);
  border-radius: 16px;
  padding: 16px 20px;
  margin: 20px 0;
}

.callout p {
  margin: 0;
}

.callout.warn {
  background: var(--tag-paper);
  color: var(--tag-ink);
  border: var(--line) solid var(--ink);
}

.faq details {
  background: var(--surface);
  border: var(--line) solid var(--ink);
  border-radius: 18px;
  padding: 2px 20px;
}

.faq details + details {
  margin-top: 12px;
}

.faq summary {
  cursor: pointer;
  font: 600 17px/1.4 var(--display);
  padding: 14px 0;
}

.faq details[open] summary {
  border-bottom: 1px solid var(--divider);
  margin-bottom: 4px;
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 36px 28px 26px;
  margin: 28px 0 8px;
}

.contact-card p {
  margin: 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 56px;
  color: var(--text-2);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  align-items: flex-end;
  justify-content: space-between;
}

.site-footer .sign-off {
  display: grid;
  gap: 10px;
}

.site-footer .wordmark {
  height: 40px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer a {
  color: var(--text-2);
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-nav a {
    transition: none;
  }
}
