/* Food & Fit — foodandfit.app
   Dark-first "Aurora" system, mirrored from the app's single source of
   brand color (app/FoodFit/Theme/Colors.swift). Only the four locked
   brand hexes + their documented derived tints are used below — never
   invent a new hue here. */

:root {
  /* Locked brand palette */
  --plum: #3b164f;
  --purple: #7f4aa4;
  --gold: #f4d84e;
  --gold-bright: #fbee0f;

  /* Derived tints (from Colors.swift — not new brand hues) */
  --amber: #e8a33d;
  --teal: #4fa3c7;
  --violet: #6b3e8e;

  /* Aurora dark neutrals */
  --ground: #000000;
  --surface: #141518;
  --surface-elevated: #24262b;
  --separator: #2e3036;

  /* Text on dark */
  --text: #ffffff;
  --text-secondary: #b7b9c0;
  --text-tertiary: #80828a;

  /* Type */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Radius scale — concentric: outer = inner + padding */
  --radius-full: 999px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --wrap: 1120px;
}

@property --p {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 0.5em;
}

p {
  text-wrap: pretty;
  color: var(--text-secondary);
}

a {
  color: var(--gold);
  text-underline-offset: 0.2em;
}

a:not(.btn):not(.wordmark) {
  text-decoration-color: rgba(244, 216, 78, 0.4);
}

a:not(.btn):not(.wordmark):hover {
  text-decoration-color: currentColor;
}

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

::selection {
  background: rgba(127, 74, 164, 0.45);
  color: #fff;
}

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

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

/* ---------- Skip link ---------- */

.skip-link-wrap {
  position: relative;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--gold);
  color: #1a1300;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition-property: top;
  transition-duration: 0.2s;
  z-index: 100;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.wordmark__mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    conic-gradient(from -90deg, var(--gold) 0deg 260deg, transparent 260deg 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  flex-shrink: 0;
}

.wordmark__amp {
  color: var(--purple);
}

.site-nav {
  display: flex;
  gap: clamp(16px, 3vw, 28px);
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition-property: color;
  transition-duration: 0.15s;
}

.site-nav a:hover {
  color: var(--text);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition-property: transform, box-shadow, background-color, border-color;
  transition-duration: 0.15s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a1300;
  box-shadow: 0 8px 24px -8px rgba(244, 216, 78, 0.55);
}

.btn--primary:hover {
  box-shadow: 0 10px 28px -8px rgba(244, 216, 78, 0.7);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 10vw, 108px) 0 clamp(48px, 8vw, 96px);
  background:
    radial-gradient(ellipse 140% 90% at 50% -10%, rgba(127, 74, 164, 0.35), transparent 60%),
    radial-gradient(ellipse 120% 80% at 88% 8%, rgba(244, 216, 78, 0.12), transparent 55%),
    radial-gradient(ellipse 100% 70% at 8% 100%, rgba(59, 22, 79, 0.6), transparent 60%),
    var(--ground);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 24%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 68% 16%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 84% 52%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 38% 78%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 55% 40%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 9% 62%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 93% 82%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 30% 12%, rgba(255, 255, 255, 0.45), transparent);
}

.hero__row {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.hero__chips span {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 13px;
  border-radius: var(--radius-full);
}

.hero__title {
  font-size: clamp(34px, 5.4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.hero__lede {
  font-size: clamp(16px, 2vw, 18.5px);
  max-width: 46ch;
  margin-bottom: 32px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}

.hero__note {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ---------- Ring cluster (signature visual) ---------- */

.ring-cluster {
  position: relative;
  width: min(320px, 74vw);
  aspect-ratio: 1;
  margin-inline: auto;
}

.ring-cluster__glow {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 216, 78, 0.22), rgba(127, 74, 164, 0.16) 45%, transparent 70%);
  filter: blur(22px);
}

.ring-cluster__disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.01) 55%),
    var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 30px 60px -22px rgba(0, 0, 0, 0.75);
}

.ring {
  position: absolute;
  border-radius: 50%;
}

.ring--calorie {
  inset: 6%;
}

.ring--protein {
  inset: 22%;
}

.ring__track,
.ring__fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.ring--calorie .ring__track,
.ring--calorie .ring__fill {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 14px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 14px));
}

.ring--protein .ring__track,
.ring--protein .ring__fill {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 12px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 12px));
}

.ring__track {
  background: rgba(255, 255, 255, 0.08);
}

.ring--calorie .ring__fill {
  --p: 0%;
  background: conic-gradient(var(--gold-bright), var(--gold) var(--p), transparent var(--p));
  animation: fill-calorie 1.6s cubic-bezier(0.2, 0, 0, 1) 0.2s forwards;
}

.ring--protein .ring__fill {
  --p: 0%;
  background: conic-gradient(var(--violet), var(--purple) var(--p), transparent var(--p));
  animation: fill-protein 1.6s cubic-bezier(0.2, 0, 0, 1) 0.4s forwards;
}

@keyframes fill-calorie {
  to {
    --p: 78%;
  }
}

@keyframes fill-protein {
  to {
    --p: 58%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring--calorie .ring__fill {
    animation: none;
    --p: 78%;
  }

  .ring--protein .ring__fill {
    animation: none;
    --p: 58%;
  }
}

.ring-cluster__core {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.ring-cluster__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 4vw, 27px);
  font-variant-numeric: tabular-nums;
}

.ring-cluster__label {
  font-size: 11.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 860px) {
  .hero__row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__chips {
    justify-content: center;
  }

  .hero__lede {
    margin-inline: auto;
  }

  .hero__cta {
    justify-content: center;
  }

  .ring-cluster {
    order: -1;
    margin-bottom: 8px;
  }
}

/* ---------- Feature strip ---------- */

.features {
  padding: clamp(56px, 8vw, 96px) 0;
}

.features__head {
  max-width: 56ch;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.features__head h2 {
  font-size: clamp(26px, 3.6vw, 34px);
}

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

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

.feature-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 28px;
}

.feature-card__chip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 18px;
}

.feature-card:nth-child(1) .feature-card__chip {
  background: radial-gradient(circle at 32% 28%, var(--gold-bright), var(--gold));
}

.feature-card:nth-child(2) .feature-card__chip {
  background: radial-gradient(circle at 32% 28%, var(--purple), var(--violet));
}

.feature-card:nth-child(3) .feature-card__chip {
  background: radial-gradient(circle at 32% 28%, var(--teal), #2f6f8c);
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14.5px;
  margin: 0;
}

/* ---------- Trust band ---------- */

.trust {
  padding-bottom: clamp(56px, 8vw, 96px);
}

.trust__panel {
  background: linear-gradient(135deg, rgba(59, 22, 79, 0.55), rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 44px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

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

.trust__item h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.trust__item p {
  font-size: 14.5px;
  margin: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 28px 0;
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-footer__meta {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.site-footer__links {
  display: flex;
  gap: 20px;
}

.site-footer__links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.site-footer__links a:hover {
  color: var(--text);
}

/* ---------- Long-form doc pages (privacy / support) ---------- */

.doc {
  padding: clamp(40px, 7vw, 72px) 0 clamp(64px, 8vw, 100px);
}

.doc__header {
  max-width: 68ch;
  margin-bottom: 12px;
}

.doc__header h1 {
  font-size: clamp(28px, 4vw, 38px);
}

.doc__updated {
  font-size: 13.5px;
  color: var(--text-tertiary);
  margin-bottom: clamp(32px, 5vw, 48px);
}

.doc__body {
  max-width: 68ch;
}

.doc__body h2 {
  font-size: 21px;
  margin-top: 2.4em;
  padding-top: 1.4em;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.doc__body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.doc__body h3 {
  font-size: 16.5px;
  margin-top: 1.6em;
}

.doc__body p,
.doc__body li {
  font-size: 15.5px;
  line-height: 1.75;
}

.doc__body ul,
.doc__body ol {
  color: var(--text-secondary);
  padding-left: 1.3em;
}

.doc__body li {
  margin-bottom: 0.5em;
}

.doc__body blockquote {
  margin: 1.6em 0;
  padding: 16px 20px;
  background: var(--surface);
  border-left: 3px solid var(--purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 14.5px;
}

.doc__body blockquote p {
  margin: 0;
  font-size: inherit;
}

.doc__body blockquote p + p {
  margin-top: 0.8em;
}

.doc__body code {
  background: var(--surface-elevated);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
}

.doc__body strong {
  color: var(--text);
}

.doc__body hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 2.4em 0;
}

/* ---------- Support page extras ---------- */

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 1.6em 0 2.4em;
}

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

.support-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 22px;
}

.support-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.support-card p {
  font-size: 14.5px;
  margin: 0;
}

.faq {
  margin-top: 0.5em;
}

.faq details {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  font-size: 15.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 20px;
  color: var(--gold);
  transition-property: transform;
  transition-duration: 0.2s;
  flex-shrink: 0;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq p {
  margin: 12px 0 0;
  font-size: 14.5px;
}
