/* NutriByte marketing site, in the brand of the NutriByte logo: plum ink on cream, lila and
   berry accents, the pixels that break off the mark. Static, no build step, no JavaScript.

   Layout: the product leads. Screenshots are shown large, on lila panels; text sections are
   set as editorial lists with hairlines, not as boxes. Headings sit in a left column beside
   their content (.split) so every section reads the same way. */

:root {
  /* From the logo */
  --plum: #362435; /* ink on light, dark sections */
  --plum-2: #47304a; /* hover on plum */
  --berry: #8b5e83; /* accents, decorative */
  --berry-ink: #7a4f72; /* the accent in text on light (6:1 on cream) */
  --lila: #d5bdcd; /* the circle and the pixels; text on dark (8:1) */
  --lila-pale: #f1e8ee; /* panels behind screenshots, pale sections */
  --cream: #f8f4f1; /* the page */
  --white: #ffffff;

  --on-dark: #f8f4f1;
  --on-dark-soft: #d5bdcd;
  --on-light-soft: #5e4a5c;
  --line: rgb(54 36 53 / 0.14);
  --line-dark: rgb(213 189 205 / 0.22);

  --font-display: 'Outfit', 'Avenir Next', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', 'Avenir Next', system-ui, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4.5rem, 10vw, 8rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--plum);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
}

::selection {
  background: var(--lila);
  color: var(--plum);
}

:focus-visible {
  outline: 3px solid var(--berry);
  outline-offset: 3px;
  border-radius: 6px;
}

.dark :focus-visible,
.cta :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--lila);
}

/* The symbols the page uses (logo, icons); never shown itself */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--plum);
  color: var(--cream);
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.wrap-wide {
  width: min(100% - 2 * var(--gutter), 1320px);
}

/* Sections */

.section {
  padding-block: var(--section);
}

.section + .section:not(.mist, .dark) {
  border-top: 1px solid var(--line);
}

.dark {
  background: var(--plum);
  color: var(--on-dark);
}

.mist {
  background: var(--lila-pale);
}

.section h2,
.cta h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.25rem);
}

.section-title {
  max-width: 18ch;
}

.intro {
  font-size: 1.15rem;
  color: var(--on-light-soft);
}

.dark .intro {
  color: var(--on-dark-soft);
}

/* A heading in the left column, its content in the right; the heading stays in view while
   the content scrolls past it */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2.5rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.split > h2 {
  position: sticky;
  top: 6.5rem;
  max-width: 14ch;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split > h2 {
    position: static;
  }
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(248 244 241 / 0.88);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--plum);
  text-decoration: none;
}

.logo {
  display: block;
  height: 1.95rem;
  width: auto;
  aspect-ratio: 4658 / 1065;
}

.nav {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
  font-size: 0.97rem;
}

.nav a,
.lang {
  position: relative;
  text-decoration: none;
  font-weight: 500;
  color: var(--on-light-soft);
  transition: color 0.15s;
}

/* An underline that draws from the left on hover */
.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.3rem;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease);
}

.nav a:hover::after {
  transform: scaleX(1);
}

.nav a:hover,
.lang:hover {
  color: var(--plum);
}

.lang {
  font-size: 0.92rem;
}

/* Legal pages have no nav: the language link goes right */
.site-header .brand + .lang {
  margin-left: auto;
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }
  .lang {
    margin-left: auto;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition:
    background-color 0.15s,
    color 0.15s,
    transform 0.15s var(--ease),
    box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--plum);
  color: var(--cream);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.12) inset;
}

.btn-primary:hover {
  background: var(--plum-2);
}

.btn-sm {
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

.btn-light {
  background: var(--lila);
  color: var(--plum);
}

.btn-light:hover {
  background: #e4d3de;
}

/* A text link with an arrow that steps right on hover */
.btn-link {
  padding-inline: 0.25rem;
  color: var(--plum);
}

.btn-link span {
  transition: transform 0.2s var(--ease);
}

.btn-link:hover {
  transform: none;
}

.btn-link:hover span {
  transform: translateX(3px);
}

@media (max-width: 480px) {
  .site-header .btn {
    display: none;
  }
}

/* Hero: the headline left, the lead and actions right, the plan editor below on a lila panel */

.hero {
  padding-top: clamp(3.5rem, 8vw, 6.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  align-items: end;
}

.hero h1 {
  font-size: clamp(3rem, 7.4vw, 6.1rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  /* The page's one moment on load: the headline comes into focus. Never transparent, so it is
     painted (and counted) at once; off under prefers-reduced-motion (above) */
  animation: focus-in 0.8s var(--ease) both;
}

/* The English headline is longer: smaller, so each half stays on one line */
html[lang='en'] .hero h1 {
  font-size: clamp(2.75rem, 6vw, 5rem);
}

@keyframes focus-in {
  from {
    filter: blur(6px);
    opacity: 0.6;
  }
  to {
    filter: blur(0);
    opacity: 1;
  }
}

/* The logo mark: the lila circle with its pixels breaking off, and the B, above the lead */
.hero-mark {
  display: block;
  width: clamp(6rem, 11vw, 9.5rem);
  height: auto;
  aspect-ratio: 216 / 200;
  margin: 0 0 clamp(1.25rem, 2.5vw, 2rem) auto;
}

@media (max-width: 860px) {
  .hero-mark {
    display: none;
  }
}

.hero .lead {
  font-size: 1.2rem;
  color: var(--on-light-soft);
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.75rem;
}

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

/* The lila panel the screenshot rises out of; the logo's three pixels break off its corner */
.stage {
  position: relative;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding: clamp(1rem, 5vw, 4.5rem) clamp(1rem, 5vw, 4.5rem) 0;
  border-radius: 24px 24px 0 0;
  background: var(--lila);
  overflow: hidden;
}

.stage::before {
  content: '';
  position: absolute;
  top: clamp(0.75rem, 1.6vw, 1.5rem);
  right: clamp(3rem, 5vw, 5rem);
  width: 0.75rem;
  height: 0.75rem;
  background: var(--cream);
  box-shadow:
    1.05rem -0.75rem 0 var(--cream),
    2.1rem -1.5rem 0 var(--cream);
  transform: translateY(1.5rem);
}

.stage-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px 12px 0 0;
  background: var(--white);
  box-shadow:
    0 0 0 1px rgb(54 36 53 / 0.1),
    0 -12px 40px -20px rgb(54 36 53 / 0.35);
  animation: rise 0.9s 0.1s var(--ease) both;
}

@keyframes rise {
  from {
    transform: translateY(2rem);
  }
  to {
    transform: none;
  }
}

/* Where the time goes: a numbered list with hairlines */

.problems {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.problems li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 1rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--line);
}

.problems .num {
  grid-row: span 2;
  padding-top: 0.2rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--berry-ink);
}

.problems h3 {
  font-size: 1.35rem;
}

.problems p {
  margin-top: 0.4rem;
  max-width: 38rem;
  color: var(--on-light-soft);
}

/* What the software does: three large screenshots beside their text, alternating sides */

#program,
#software {
  background: var(--white);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin-top: clamp(3rem, 7vw, 5.5rem);
}

.feature-flip {
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
}

.feature-flip .feature-text {
  order: 2;
}

.feature-text h3 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
}

.feature-text p {
  margin-top: 0.85rem;
  font-size: 1.1rem;
  color: var(--on-light-soft);
}

.feature-shot {
  padding: clamp(0.75rem, 3vw, 2.25rem);
  border-radius: 20px;
  background: var(--lila-pale);
  overflow: hidden;
}

.feature-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--white);
  box-shadow:
    0 0 0 1px rgb(54 36 53 / 0.08),
    0 24px 48px -28px rgb(54 36 53 / 0.45);
  transition: transform 0.4s var(--ease);
}

.feature-shot:hover img {
  transform: scale(1.02);
}

@media (max-width: 860px) {
  .feature,
  .feature-flip {
    grid-template-columns: 1fr;
  }
  .feature-flip .feature-text {
    order: 0;
  }
}

/* The smaller features: four columns under a hairline, no boxes */
.minor {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin: clamp(4rem, 8vw, 6rem) 0 0;
  padding: 0;
  list-style: none;
}

.minor li {
  padding-top: 1.25rem;
  border-top: 2px solid var(--plum);
}

.minor h3 {
  font-size: 1.2rem;
}

.minor p {
  margin-top: 0.5rem;
  font-size: 0.98rem;
  color: var(--on-light-soft);
}

@media (max-width: 960px) {
  .minor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* The client app: three phones on plum, the middle one raised */

.split-head {
  align-items: end;
}

.split-head > h2 {
  position: static;
}

.phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 4vw, 3.5rem);
  margin-top: clamp(3rem, 7vw, 5rem);
  align-items: start;
}

.phones figure {
  margin: 0;
}

.phones figure:nth-child(odd) {
  margin-top: 3rem;
}

.phones img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin-inline: auto;
  border: 8px solid #1e141d;
  border-radius: 38px;
  background: var(--white);
  box-shadow: 0 40px 70px -30px rgb(0 0 0 / 0.6);
  transition: transform 0.3s var(--ease);
}

.phones figure:hover img {
  transform: translateY(-4px);
}

.phones figcaption {
  max-width: 300px;
  margin: 1.25rem auto 0;
  font-size: 0.95rem;
  color: var(--on-dark-soft);
}

/* On phones: a row to swipe through, one phone at a time, the next one peeking in from the
   right so it is clear there is more. Plain CSS scroll snapping, no script */
@media (max-width: 720px) {
  .phones {
    display: flex;
    gap: 1.25rem;
    /* Full bleed: the row runs to the screen edges, the first phone lines up with the text */
    margin-inline: calc(var(--gutter) * -1);
    padding: 0.5rem var(--gutter) 1.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .phones::-webkit-scrollbar {
    display: none;
  }
  .phones figure {
    flex: 0 0 72%;
    max-width: 280px;
    scroll-snap-align: start;
  }
  .phones figure:nth-child(odd) {
    margin-top: 0;
  }
  .phones figure:hover img {
    transform: none;
  }
  .phones img,
  .phones figcaption {
    max-width: none;
  }
}

/* Your brand: a line under the phones, the same split as the headings */
.brand-note {
  margin-top: clamp(4rem, 8vw, 6rem);
  padding-top: 2.5rem;
  border-top: 1px solid var(--line-dark);
}

.brand-note h3 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  max-width: 14ch;
}

.brand-note p {
  font-size: 1.1rem;
  color: var(--on-dark-soft);
}

/* Getting started: three steps with large numerals */

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem clamp(1.5rem, 4vw, 3.5rem);
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: block;
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 6vw, 5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--berry);
}

.steps h3 {
  font-size: 1.35rem;
}

.steps p {
  margin-top: 0.5rem;
  color: var(--on-light-soft);
}

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

/* Where the data is: icon, title and text in two columns */

.safety {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.safety .icon {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.9rem;
  padding: 0.55rem;
  border-radius: 10px;
  background: var(--white);
  color: var(--berry-ink);
  box-shadow: 0 0 0 1px var(--line);
}

.safety h3 {
  font-size: 1.2rem;
}

.safety p {
  margin-top: 0.4rem;
  font-size: 0.98rem;
  color: var(--on-light-soft);
}

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

/* Call to action: a plum band, the pixels breaking off its corner */

.cta {
  position: relative;
  overflow: hidden;
  padding-block: clamp(5rem, 11vw, 8.5rem);
  background: var(--plum);
  color: var(--on-dark);
}

.cta .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.cta h2 {
  font-size: clamp(2.6rem, 6.4vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 12ch;
}

.cta p {
  font-size: 1.1rem;
  color: var(--on-dark-soft);
}

.cta .btn {
  margin-top: 1.75rem;
  min-height: 3.25rem;
  padding-inline: 1.75rem;
  font-size: 1.05rem;
}

.cta::before {
  content: '';
  position: absolute;
  top: clamp(2rem, 5vw, 3.5rem);
  right: clamp(3.5rem, 8vw, 7rem);
  width: 1rem;
  height: 1rem;
  background: var(--berry);
  box-shadow:
    1.4rem -1rem 0 var(--berry),
    2.8rem -2rem 0 var(--lila);
  transform: translateY(2rem);
}

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

/* Legal pages: privacy policy and the data processing agreement */

.legal {
  max-width: 46rem;
}

.legal h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
}

.legal-meta {
  margin-top: 0.75rem;
  color: var(--on-light-soft);
}

.legal h2 {
  max-width: none;
  margin: 2.5rem 0 0.75rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.legal p,
.legal ul,
.legal dl,
.legal .table-wrap {
  margin-top: 0.85rem;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li + li {
  margin-top: 0.4rem;
}

.legal a {
  color: var(--berry-ink);
}

.legal dt {
  margin-top: 0.9rem;
  font-weight: 600;
}

.legal dd {
  margin: 0.2rem 0 0;
  color: var(--on-light-soft);
}

.table-wrap {
  overflow-x: auto;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.legal th,
.legal td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal th {
  font-family: var(--font-display);
  font-weight: 600;
}

/* Footer: quiet, on the page colour, under the plum call to action */

.site-footer {
  padding-block: 2.25rem;
  border-top: 1px solid var(--line);
  color: var(--on-light-soft);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer .logo {
  height: 1.5rem;
}

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

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--plum);
  text-decoration: underline;
  text-underline-offset: 3px;
}
