/* Outfit, served from here rather than from google fonts: a request to them
   carries the visitor's address to a third party, which needs a reason and a
   line in the privacy policy. The files are the ones the dashboard bundles,
   @fontsource-variable/outfit 5.3.0, under the SIL Open Font License. One
   variable file covers every weight the page uses. */
@font-face {
  font-family: 'Outfit Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/outfit-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Outfit Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/outfit-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* The palette of the app, light on :root and dark either from the system
   setting or from an explicit data-theme, so a choice here and a choice in the
   dashboard mean the same thing. Kept in sync with dashboard/src/index.css. */
:root {
  --bg: #faf7f4;
  --surface: #ffffff;
  --track: #f1ebe5;
  --line: rgb(23 19 16 / 0.07);
  --line-2: rgb(23 19 16 / 0.12);
  --ink: #171310;
  --ink-2: #6b615a;
  --ink-3: #7e7168;
  --accent: #e5533d;
  --accent-hover: #c43f2b;
  --protein: #2e6f5e;
  --carbs: #d98324;
  --fat: #6b5bd2;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #15110f;
    --surface: #1e1918;
    --track: #322b29;
    --line: rgb(255 255 255 / 0.09);
    --line-2: rgb(255 255 255 / 0.17);
    --ink: #f7f2ed;
    --ink-2: #c5bab1;
    --ink-3: #a79c93;
    --accent: #f2664f;
    --accent-hover: #ff8168;
    --protein: #7fcbb0;
    --carbs: #e9a24a;
    --fat: #9a8cf0;
  }
}

:root[data-theme='dark'] {
  --bg: #15110f;
  --surface: #1e1918;
  --track: #322b29;
  --line: rgb(255 255 255 / 0.09);
  --line-2: rgb(255 255 255 / 0.17);
  --ink: #f7f2ed;
  --ink-2: #c5bab1;
  --ink-3: #a79c93;
  --accent: #f2664f;
  --accent-hover: #ff8168;
  --protein: #7fcbb0;
  --carbs: #e9a24a;
  --fat: #9a8cf0;
}

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

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Outfit Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* Header and footer share the frame the content sits in. Wrapping rather
   than squeezing: on a narrow phone the name would otherwise break in two. */
.bar {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wordmark img {
  border-radius: 9px;
}

.wordmark span {
  white-space: nowrap;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--accent);
}

/* The button shows what a click would do, so the moon belongs to the light
   page and the sun to the dark one. */
.icon-button .when-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon-button .when-light {
    display: none;
  }

  :root:not([data-theme='light']) .icon-button .when-dark {
    display: block;
  }
}

:root[data-theme='dark'] .icon-button .when-light {
  display: none;
}

:root[data-theme='dark'] .icon-button .when-dark {
  display: block;
}

:root[data-theme='light'] .icon-button .when-light {
  display: block;
}

:root[data-theme='light'] .icon-button .when-dark {
  display: none;
}

.button {
  height: 52px;
  padding: 0 24px;
  border-radius: 15px;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-hover);
}

.button.ghost {
  padding: 0 22px;
  background: none;
  border: 1px solid var(--line-2);
  color: var(--ink);
}

.button.ghost:hover {
  border-color: var(--accent);
  background: none;
}

.button.small {
  height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 14.5px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

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

.hero {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 24px 88px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
  align-items: center;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: pretty;
}

.lead {
  margin: 18px 0 0;
  max-width: 30em;
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.points {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.points li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.points svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--accent);
}

.preview {
  display: flex;
  justify-content: center;
}

.card {
  width: 100%;
  max-width: 340px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
}

.card-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card-body {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}

.ring {
  position: relative;
  width: 116px;
  height: 116px;
  flex-shrink: 0;
}

.ring svg {
  transform: rotate(-90deg);
}

.ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-number {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ring-caption {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.macros {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.macro-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
}

.macro-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.macro-value {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.macro-track {
  height: 6px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}

.macro-track div {
  height: 100%;
  border-radius: 99px;
}

.closing {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 88px;
  text-align: center;
}

.closing img {
  border-radius: 16px;
}

.closing-frame {
  border: 1px solid var(--line-2);
  border-radius: 30px;
  padding: clamp(30px, 4.5vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.closing h2 {
  margin: 22px 0 0;
  max-width: 20em;
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.12;
  text-wrap: pretty;
}

.closing p {
  margin: 12px 0 0;
  max-width: 30em;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13.5px;
  color: var(--ink-3);
}
