/* Tokens mirror smakbook/src/theme (colors.ts, typography.ts, spacing.ts). */
:root {
  --primary: #a06540;
  --primary-strong: #905b3a;
  --primary-pressed: #805133;
  --primary-soft: #f3eae4;

  --secondary: #7a8b6f;
  --secondary-strong: #626f59;
  --secondary-soft: #ebeee9;

  --accent: #d47a60;
  --accent-pressed: #945543;
  --accent-soft: #f9ebe7;

  --background: #f9f5f0;
  --surface: #ffffff;
  --border: #e8dfd7;

  --text: #332922;
  --text-muted: #776e69;
  --text-on-color: #ffffff;

  --font-regular: "Comfortaa", system-ui, sans-serif;
  --font-script: "Great Vibes", cursive;

  --radius-lg: 16px;
  --radius-full: 999px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-regular);
  font-size: 16px;
  line-height: 1.5;
}

/* Food-doodle background under a 90% cream veil — same as the app's auth screens. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(249, 245, 240, 0.9), rgba(249, 245, 240, 0.9)),
    url("/assets/doodles-bg.webp") center / cover no-repeat;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: max(32px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.logo {
  width: auto;
  height: 110px;
  animation: rise 0.6s ease-out both;
}

.card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(51, 41, 34, 0.08);
  animation: rise 0.6s 0.1s ease-out both;
}

.card[hidden] {
  display: none;
}

.badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--secondary-soft);
  color: var(--secondary-strong);
  animation: pop 0.5s 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.badge--accent {
  background: var(--accent-soft);
  color: var(--accent-pressed);
}

/* Great Vibes overhangs its box (swashes), hence the padding. */
.title {
  margin: 0;
  padding: 4px 8px;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 48px;
  line-height: 1.2;
  color: var(--primary);
}

.lead {
  margin: 0;
  font-weight: 700;
  font-size: 18px;
}

.body {
  margin: 0;
  color: var(--text);
}

.chef {
  width: 100%;
  max-width: 240px;
  height: auto;
  margin: 4px 0;
}

.hint {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-regular);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition:
    background-color 0.15s,
    transform 0.15s;
}

.button--primary {
  background: var(--primary-strong);
  color: var(--text-on-color);
  box-shadow: 0 4px 12px rgba(144, 91, 58, 0.28);
}

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

.button:active {
  transform: scale(0.97);
}

.button:focus-visible {
  outline: 3px solid var(--primary-soft);
  outline-offset: 2px;
}

/* The smakbook:// deep link only works where the app is installed. */
.only-mobile {
  display: none;
}

.is-mobile .only-mobile {
  display: inline-flex;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
}

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

@media (max-width: 380px) {
  .logo {
    height: 88px;
  }

  .title {
    font-size: 40px;
  }
}

/* ---------- Long-form documents (privacy policy) ---------- */

.page--doc {
  justify-content: flex-start;
}

.card.doc {
  max-width: 720px;
  align-items: stretch;
  gap: 0;
  padding: 32px 24px;
  text-align: left;
}

.doc .title {
  text-align: center;
  font-size: 44px;
}

.doc__meta {
  margin: 0 0 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.doc p,
.doc ul,
.doc ol {
  margin: 0 0 12px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li {
  margin-bottom: 6px;
}

.doc li::marker {
  color: var(--primary);
}

.doc h2 {
  margin: 28px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 20px;
  line-height: 1.3;
  scroll-margin-top: 16px;
}

.doc h3 {
  margin: 16px 0 8px;
  font-size: 16px;
  color: var(--primary-pressed);
}

.doc a {
  color: var(--primary-pressed);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.doc a:hover {
  color: var(--primary);
}

.doc__toc {
  margin-bottom: 8px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--primary-soft);
}

.doc__toc ol {
  margin: 0;
}

.doc__toc li {
  margin-bottom: 4px;
}

.doc__toc a {
  text-decoration: none;
}

.doc__toc a:hover {
  text-decoration: underline;
}

@media (min-width: 640px) {
  .card.doc {
    padding: 40px 48px;
  }
}

@media (max-width: 380px) {
  .doc .title {
    font-size: 36px;
  }
}

.lang-switch {
  display: flex;
  gap: 4px;
  margin-top: -8px;
  padding: 4px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  animation: rise 0.6s 0.05s ease-out both;
}

.lang-switch > * {
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.lang-switch [aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-pressed);
}

.lang-switch a {
  color: var(--text-muted);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--primary-pressed);
}

/* Shown when the smakbook:// link didn't open the app (not installed). */
.app-notice {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--accent-pressed);
  font-size: 14px;
}

.app-notice[hidden] {
  display: none;
}
