@font-face {
  font-family: 'Huninn';
  src: url('/fonts/huninn-subset.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #080808;
  --surface: #101010;
  --fg: #f5f5f7;
  --muted: rgba(235, 235, 245, 0.6);
  --faint: rgba(235, 235, 245, 0.32);
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-edge: rgba(255, 255, 255, 0.13);
  --red: #ff453a;
  --font: 'Huninn', ui-rounded, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

header,
main {
  width: min(100% - 32px, 920px);
  margin-inline: auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

nav a:hover {
  color: var(--fg);
}

.download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  background: var(--fg);
  color: #000;
}

nav .download:hover {
  color: #000;
  background: #fff;
}

.download .sf {
  --s: 0.6;
}

header img {
  display: block;
  height: 26px;
  width: auto;
}

main {
  padding: 36px 0 24px;
}

h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(36px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(19px, 2.4vw, 21px);
}

/* Demos */

.demos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 40px;
  margin-top: 32px;
}

figure {
  margin: 0;
  min-width: 0;
}

figcaption {
  margin-top: 14px;
  color: var(--muted);
}

.screen {
  position: relative;
  /* Leaves room for the heading and captions so the page fits one desktop viewport. */
  height: clamp(340px, 100svh - 354px, 440px);
  container-type: size;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* SF Symbols rendered at 25 pt by scripts/render-symbols.swift; --s scales them like the app. */
.sf {
  --s: 0.88;
  display: block;
  width: calc(var(--w) * var(--s));
  height: calc(var(--h) * var(--s));
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
}
[data-symbol='calendar'] {
  --icon: url('/icons/calendar.png');
  --w: 31px;
  --h: 27px;
}
[data-symbol='gearshape'] {
  --icon: url('/icons/gearshape.png');
  --w: 31px;
  --h: 31px;
}
[data-symbol='mic'] {
  --icon: url('/icons/mic.png');
  --w: 25px;
  --h: 31px;
}
[data-symbol='keyboard'] {
  --icon: url('/icons/keyboard.png');
  --w: 37px;
  --h: 24px;
}
[data-symbol='clock.arrow.circlepath'] {
  --icon: url('/icons/clock-arrow-circlepath.png');
  --w: 30px;
  --h: 29px;
}
[data-symbol='stop.fill'] {
  --icon: url('/icons/stop-fill.png');
  --w: 26px;
  --h: 24px;
  --s: 0.42;
}
[data-symbol='magnifyingglass'] {
  --icon: url('/icons/magnifyingglass.png');
  --w: 30px;
  --h: 29px;
}
[data-symbol='chart.bar'] {
  --icon: url('/icons/chart-bar.png');
  --w: 38px;
  --h: 27px;
}
[data-symbol='plus.circle'] {
  --icon: url('/icons/plus-circle.png');
  --w: 29px;
  --h: 29px;
}
[data-symbol='xmark'] {
  --icon: url('/icons/xmark.png');
  --w: 26px;
  --h: 24px;
}
[data-symbol='arrow.down'] {
  --icon: url('/icons/arrow-down.png');
  --w: 25px;
  --h: 28px;
}
[data-symbol='arrow.up'] {
  --icon: url('/icons/arrow-up.png');
  --w: 25px;
  --h: 28px;
}
.round .sf {
  --s: 0.6;
}

.glass {
  display: inline-grid;
  place-items: center;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  color: var(--fg);
}

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

.date {
  flex: 1;
  color: var(--muted);
}

.round {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.total,
.pair > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.total {
  margin-top: 3cqh;
}

.value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.total .value {
  font-size: clamp(64px, 19cqh, 84px);
  line-height: 1;
}

.label {
  color: var(--muted);
  margin-top: 4px;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: 14px;
  margin-top: 4cqh;
}

.pair .value {
  font-size: 30px;
  line-height: 1.1;
}

.rule {
  height: 40px;
  background: var(--line);
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.button {
  position: relative;
  height: 58px;
  border-radius: 24px;
  transition:
    background-color 0.25s,
    color 0.25s,
    border-color 0.25s;
}

.button > * {
  grid-area: 1 / 1;
}

.recording,
.spinner {
  display: none;
}

.recording {
  align-items: center;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.level {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 22px;
}

.wave i {
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  animation: wave 0.9s ease-in-out infinite alternate;
}

.wave i:nth-child(2) {
  animation-delay: -0.3s;
}
.wave i:nth-child(3) {
  animation-delay: -0.6s;
}
.wave i:nth-child(4) {
  animation-delay: -0.15s;
}
.wave i:nth-child(5) {
  animation-delay: -0.45s;
}

@keyframes wave {
  to {
    height: 22px;
  }
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--faint);
  border-top-color: var(--fg);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

[data-state='recording'] .mic {
  color: var(--red);
  background: rgba(255, 69, 58, 0.14);
  border-color: rgba(255, 69, 58, 0.3);
}

[data-state='recording'] .mic .recording {
  display: flex;
}

[data-state='transcribing'] .mic .spinner,
[data-state='analyzing'] .keys .spinner {
  display: block;
}

[data-state='recording'] .mic .idle-icon,
[data-state='transcribing'] .mic .idle-icon,
[data-state='analyzing'] .keys .idle-icon {
  display: none;
}

.heard {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 2px;
}

.heard p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  color: var(--muted);
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.4s,
    transform 0.4s;
}

/* Container heights exclude the screen padding; each step frees one line of space. */
@container (height < 392px) {
  .heard p {
    -webkit-line-clamp: 4;
  }
}

@container (height < 368px) {
  .heard p {
    -webkit-line-clamp: 3;
  }
}

@container (height < 345px) {
  .heard p {
    -webkit-line-clamp: 2;
  }
}

.heard.shown p {
  opacity: 1;
  transform: none;
}

/* Text input sheet, as in TextInputView */

.sheet {
  position: absolute;
  inset: auto 0 0;
  height: 84%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 18px 18px;
  border-top: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  background: #151515;
  transform: translateY(102%);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-sheet='open'] .sheet,
[data-sheet='sending'] .sheet {
  transform: none;
}

.grabber {
  align-self: center;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--faint);
}

.sheet-bar {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  text-align: center;
}

.round [data-symbol='xmark'] {
  --s: 0.55;
}

.field {
  min-height: calc(4 * 1.4em + 28px);
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  background: var(--glass);
  font-size: 15px;
  line-height: 1.4;
}

.typed:empty::before {
  content: 'Log food...';
  color: var(--faint);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: #0a84ff;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 22px;
  background: var(--fg);
  color: #000;
  opacity: 0.4;
  transition: opacity 0.25s;
}

.send.ready,
[data-sheet='sending'] .send {
  opacity: 1;
}

.send .sf {
  --s: 0.6;
}

.send .spinner {
  width: 16px;
  height: 16px;
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: #000;
}

[data-sheet='sending'] .send .spinner {
  display: block;
}

[data-sheet='sending'] :is(.send .sf, .caret) {
  display: none;
}

/* Chat */

.chat {
  gap: 12px;
  justify-content: flex-end;
  padding-inline: 18px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.4;
}

.chat [data-at] {
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}

.chat .shown {
  opacity: 1;
  transform: none;
}

.message {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 20px;
}

.mine {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.1);
  border-bottom-right-radius: 8px;
}

.reply {
  align-self: flex-start;
  padding-inline: 0;
}

.calls {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}

.calls li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.calls .sf {
  --s: 0.54;
  flex: none;
  margin: 1px calc((20px - var(--w) * var(--s)) / 2) 0;
}

.tool {
  color: var(--fg);
}

.calls .active .tool {
  animation: thinking 1.2s ease-in-out infinite alternate;
}

.link {
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
}

@keyframes thinking {
  to {
    opacity: 0.35;
  }
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg);
  font:
    15px/1.3 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}

button {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--glass-edge);
  border-radius: 12px;
  background: var(--glass);
  color: var(--fg);
  font: 15px var(--font);
  cursor: pointer;
}

button:hover {
  background: rgba(255, 255, 255, 0.12);
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .screen {
    height: 440px;
  }
  .chat {
    height: 340px;
  }
}

@media (max-width: 420px) {
  nav {
    gap: 14px;
  }
  .wide {
    display: none;
  }
  .download {
    padding: 0 14px;
  }
  .screen {
    padding: 18px 16px;
    border-radius: 30px;
  }
}

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

/* Two complementary demos within the shared landing shell. */
.site-page.nutrition-page {
  max-width: 1120px;
}

.nutrition-page .demos {
  grid-template-columns: repeat(2, minmax(0, 390px));
  align-self: center;
  width: 100%;
  max-width: 804px;
  gap: 24px;
  margin-top: 0;
}

.nutrition-page figure {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.nutrition-page .screen {
  flex: 1;
  height: auto;
  min-height: 400px;
  background: var(--bg);
}

.nutrition-page .chat {
  background: var(--surface);
}

.nutrition-page figcaption {
  min-height: 86px;
  margin-top: 14px;
  color: var(--site-muted);
  font: 13px/1.5 var(--site-font);
}

.nutrition-page .endpoint {
  margin-top: 8px;
  border-radius: 14px;
}

.nutrition-page code {
  font-size: 13px;
}

.nutrition-page [data-copy] {
  min-height: 30px;
  border-radius: 999px;
  font: 500 12px var(--site-font);
}

@media (max-width: 720px) {
  .nutrition-page .demos {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .nutrition-page .screen {
    flex: none;
    height: 440px;
  }

  .nutrition-page .chat {
    height: 340px;
    min-height: 0;
  }

  .nutrition-page figcaption {
    min-height: 0;
  }
}

/* Shared landing shell. Keep this file identical across the five projects.
   Product demos retain their own typography, controls and visual identity. */
:root {
  --site-bg: #111214;
  --site-surface: #1b1c1f;
  --site-text: #f4f4f5;
  --site-muted: #a1a1aa;
  --site-line: #343539;
  --site-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --site-radius: 20px;
  --site-shadow: 0 16px 48px rgb(0 0 0 / 24%);
}

html:has(.site-body),
.site-body {
  background: var(--site-bg);
}

.site-body {
  margin: 0;
  overflow-x: clip;
  overflow-y: auto;
  color: var(--site-text);
  -webkit-font-smoothing: antialiased;
}

.site-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1440px;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  margin: 0 auto;
  padding: 28px 32px 22px;
}

.site-header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  width: 100%;
  margin: 0;
  padding: 0;
  font: 14px/1.5 var(--site-font);
  letter-spacing: normal;
}

.site-header > .site-icon {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 11px;
  object-fit: contain;
}

.site-title {
  flex: 1;
  min-width: 0;
}

.site-title h1 {
  margin: 0;
  color: var(--site-text);
  font: 600 19px/1.3 var(--site-font);
  letter-spacing: -0.025em;
}

.site-title p {
  max-width: 80ch;
  margin: 3px 0 0;
  color: var(--site-muted);
  font: 400 14px/1.5 var(--site-font);
  letter-spacing: normal;
}

.site-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: auto;
}

.site-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  background: var(--site-surface);
  color: var(--site-text);
  font: 500 14px/1 var(--site-font);
  letter-spacing: normal;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 150ms,
    border-color 150ms;
}

.site-button:hover {
  border-color: #55565c;
  background: #27282c;
  color: var(--site-text);
}

.site-button.primary {
  border-color: transparent;
  background: var(--site-text);
  color: var(--site-bg);
}

.site-button.primary:hover {
  background: #fff;
  color: var(--site-bg);
}

.site-button[aria-disabled='true'] {
  opacity: 0.55;
  cursor: default;
}

.site-actions .req {
  margin: 0;
  color: var(--site-muted);
  font: 12px/1.5 var(--site-font);
}

.site-body a:focus-visible,
.site-body button:focus-visible {
  outline: 2px solid var(--site-text);
  outline-offset: 4px;
}

.site-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.site-demo {
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  box-shadow: var(--site-shadow);
}

.site-footer {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  color: var(--site-muted);
  font: 400 12px/1.5 var(--site-font);
  letter-spacing: normal;
}

.site-footer a {
  color: inherit;
  text-decoration-color: #64656c;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--site-text);
  text-decoration-color: currentColor;
}

.site-footer .avx {
  display: block;
  flex: none;
  opacity: 1;
}

.site-footer .avx:hover {
  opacity: 1;
}

.site-footer .avx :is(img, svg) {
  display: block;
  width: auto;
  height: 13px;
}

@media (max-width: 1100px) {
  .site-header {
    flex-wrap: wrap;
  }

  .site-title {
    flex-basis: calc(100% - 58px);
  }

  .site-actions {
    margin-left: 58px;
  }
}

@media (max-width: 820px) {
  .site-page {
    gap: 20px;
    height: auto;
    min-height: 100svh;
    padding: 20px;
  }

  .site-stage {
    flex: none;
  }

  .site-actions {
    width: 100%;
    margin-left: 0;
  }

  .site-footer {
    margin-top: auto;
  }
}

@media (max-width: 420px) {
  .site-page {
    padding: 16px;
  }

  .site-button {
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-button {
    transition: none;
  }
}
