/* Sim Recipes — shared site styles (global on purpose: components and pages
   all use these primitives). Relies on the design tokens on :root in
   src/layouts/Base.astro. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text1);
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

::selection {
  background: var(--selection);
}

input::placeholder {
  color: var(--text4);
}

button {
  font-family: inherit;
}

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

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

/* ---- Layout ---------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
@media (min-width: 768px) {
  .container {
    padding-left: 32px;
    padding-right: 32px;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn svg {
  flex: 0 0 auto;
}
.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13.5px;
}
.btn-primary {
  background: var(--accent-strong);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}
.btn-ink {
  background: var(--ink);
  color: var(--on-ink);
}
.btn-ink:hover {
  background: var(--ink-hover);
  color: var(--on-ink);
}
.btn-quiet {
  background: var(--card);
  color: var(--text1);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-quiet:hover {
  border-color: var(--text5);
  color: var(--text1);
}
.btn-ghost {
  background: transparent;
  color: var(--text2);
}
.btn-ghost:hover {
  background: var(--chipbg3);
  color: var(--text1);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.6;
  cursor: default;
}

/* ---- Chips ----------------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--chipbg1);
  color: var(--text3);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

/* ---- Text pages (privacy, support) ----------------------------------- */

.privacy-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 96px;
}
.privacy-heading {
  margin: 0;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.12;
  font-weight: 760;
  letter-spacing: -0.028em;
  color: var(--text1);
}
.privacy-updated {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--text4);
}
.privacy-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.privacy-section h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text1);
}
.privacy-section p {
  margin: 0 0 12px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text3);
}
.privacy-section p:last-child {
  margin-bottom: 0;
}
.privacy-section ul {
  margin: 0 0 12px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.privacy-section li {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text3);
}
.privacy-section li::marker {
  color: var(--accent);
}
.privacy-section strong {
  color: var(--text2);
}
.privacy-section a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
.privacy-section code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--chipbg1);
  font-size: 0.9em;
}
@media (min-width: 768px) {
  .privacy-shell {
    padding-top: 64px;
  }
}

/* ---- Sign-in buttons (SignInButtons.astro, public/js/signin.js) ------- */

.signin-slot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
/* Sign in with Apple: the ink button (black on light, light on dark) with
   the Apple mark, as Apple's guidelines allow. Same 40px height and 240px
   width as Google's rendered button next to it. */
.btn-apple {
  width: 240px;
  max-width: 100%;
  gap: 10px;
  font-size: 15px;
}
.signin-gis {
  display: flex;
  justify-content: center;
  min-height: 40px;
  max-width: 100%;
  /* GIS paints a white button: keep its rounded corners from showing a square
     backdrop on the dark theme. */
  color-scheme: light;
}
.signin-status {
  margin: 12px 0 0;
  max-width: 44ch;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text3);
  text-align: center;
}
.signin-status[data-tone='error'] {
  color: #b3261e;
}
@media (prefers-color-scheme: dark) {
  .signin-status[data-tone='error'] {
    color: #ff9a8f;
  }
}

/* ---- Toast (public/js/toast.js) --------------------------------------- */

.sr-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: min(92vw, 420px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}
.sr-toast[data-visible='true'] {
  opacity: 1;
  transform: translate(-50%, 0);
}
