/*
  AIStill.ai — Nutritional Intelligence Hub
  Tier 2: AI Results Interpretation
  v1.0 | Built for Cloudflare Pages + Workers
  Auth integration point: search "AUTH STUB" for drop-in hooks
*/

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

html {
  color-scheme: light;
  font-family: var(--font-sans);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.72), rgba(247, 248, 250, 0) 360px),
    var(--color-bg);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary,
a {
  touch-action: manipulation;
}

a {
  color: var(--color-accent);
  text-underline-offset: 3px;
}

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

p,
h1,
h2,
h3,
ul,
ol,
figure {
  margin-top: 0;
}

p:last-child,
ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.34);
  outline-offset: 3px;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header,
.site-footer {
  background: rgba(255, 255, 255, 0.86);
  border-color: var(--color-border);
  backdrop-filter: blur(16px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--color-border);
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand-link {
  color: var(--color-text-primary);
  font-weight: var(--font-bold);
  text-decoration: none;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.nav-link {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-decoration: none;
}

.main-content {
  flex: 1;
}

.site-footer {
  margin-top: var(--space-16);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1120px);
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: var(--space-3) 0;
  }
}
