/*
 * smallcastle.com's static site (decisions 1652, 1657). The app's dark palette
 * (decisions 1495-1498), restated as plain CSS because this site has no
 * Tailwind: the values are globals.css's hex comments, so a palette change is
 * made there first and copied here.
 */
:root {
  --background: #1a1613;
  --card: #2b2824;
  --foreground: #fffcf8;
  --muted-foreground: #c9bbaa;
  --border: #857a6e;
  --primary: #f7941d;
  --primary-foreground: #000000;
  --link: #f7941d;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

body { margin: 0; min-height: 100vh; }

/* The photograph, as Backdrop.tsx draws it: shoreline at 55% over the page. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--background);
}
.backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  opacity: 0.55;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem;
}
header img { height: 1.5rem; width: auto; display: block; }
@media (min-width: 640px) { header img { height: 3rem; } }

main {
  max-width: 42rem;
  margin: 0.75rem auto 2.5rem;
  padding: 0 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
}
@media (min-width: 640px) { .card { padding: 2rem; } }
.card + .card { margin-top: 1rem; }

.badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.8125rem;
  font-weight: 600;
}

h1 { margin: 0 0 0.75rem; font-size: 1.75rem; line-height: 1.2; }
@media (min-width: 640px) { h1 { font-size: 2.25rem; } }
h2 { margin: 0 0 0.5rem; font-size: 1.125rem; }

p { margin: 0 0 0.75rem; line-height: 1.6; }
.lead { font-size: 1.0625rem; color: var(--muted-foreground); }

.audiences {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) { .audiences { grid-template-columns: 1fr 1fr; } }
.audiences p { margin: 0; color: var(--muted-foreground); font-size: 0.9375rem; }

a { color: var(--link); text-underline-offset: 2px; }

footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  gap: 0.5rem 1.25rem;
}
footer a { color: var(--muted-foreground); }

/* The generated Terms and Privacy: LegalDocument's frame, without its classes. */
.legal .effective { color: var(--muted-foreground); font-size: 0.875rem; margin-bottom: 1.5rem; }
.legal section { margin-bottom: 1.5rem; font-size: 0.875rem; line-height: 1.6; }
.legal ul { padding-left: 1.25rem; }
.legal li { margin-bottom: 0.25rem; }

/* The SMS opt-in proof, /sms/ (decision 1674). Screenshots come in phone-width
   pairs, before and after: stacked on a phone, where side by side they are too
   small to read, and side by side from 640px. */
.facts { padding-left: 1.25rem; margin: 0 0 1rem; line-height: 1.6; }
.facts li { margin-bottom: 0.5rem; }
.pair { display: grid; gap: 1.25rem; margin-top: 1rem; }
@media (min-width: 640px) { .pair { grid-template-columns: 1fr 1fr; gap: 1rem; } }
.pair figure { margin: 0; }
.pair img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 0.5rem; }
.pair figcaption { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--muted-foreground); }

/* /help (decisions 1673, 1676): the FAQ as disclosures, and the contact form. */
/* Each group (Text messages, Signing in…) collapses too, so the page opens as
   four headings rather than fourteen questions. */
.faq .group { border-top: 1px solid var(--border); }
.faq .group:last-of-type { border-bottom: 1px solid var(--border); }
/* The browser's ▶ markers give way to one chevron, in the brand color, that
   turns down when its disclosure opens. */
.faq summary { list-style: none; display: flex; align-items: baseline; gap: 0.625rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "";
  flex: none;
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: translateY(-0.1em) rotate(-45deg);
  transition: transform 150ms ease;
}
.faq details[open] > summary::before { transform: translateY(-0.25em) rotate(45deg); }
.faq summary:hover { color: var(--primary); }
.faq .group > summary { cursor: pointer; padding: 1rem 0; }
.faq .group > summary h2 { margin: 0; }
.faq .group[open] > summary { padding-bottom: 0.5rem; }
.faq .group details { border-top: 1px solid var(--border); padding: 0.75rem 0 0.75rem 1rem; }
.faq .group details:last-of-type { margin-bottom: 0.75rem; }
.faq .group details summary { cursor: pointer; font-weight: 600; line-height: 1.5; }
.faq .group details p { margin: 0.5rem 0 0; color: var(--muted-foreground); }
.help-form { display: grid; gap: 0.375rem; margin-top: 1rem; }
.help-form label { font-size: 0.875rem; font-weight: 600; margin-top: 0.625rem; }
.help-form .req { color: var(--primary); }
.help-form input, .help-form select, .help-form textarea {
  font: inherit;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  width: 100%;
  transition: border-color 150ms ease;
}
.help-form input:hover, .help-form select:hover, .help-form textarea:hover { border-color: var(--muted-foreground); }
/* The browser's own arrow gives way to a chevron in the muted text color. */
.help-form select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23c9bbaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  cursor: pointer;
}
.help-form textarea { resize: vertical; }
.help-form :focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.help-form .hint { margin: 0; font-size: 0.8125rem; color: var(--muted-foreground); }
.help-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Hidden unless Cloudflare asks for interaction (data-appearance): it keeps no
   height while hidden, and its iframe sits in a shadow root this CSS cannot
   reach, so a small margin on the container serves both states. */
.help-form .cf-turnstile { margin-top: 0.5rem; justify-self: center; }
.help-form .status { margin: 0.25rem 0 0; text-align: center; }
.help-form .status:empty { display: none; }
.help-form button {
  justify-self: center;
  font: inherit;
  font-weight: 600;
  color: var(--primary-foreground);
  background: var(--primary);
  border: 0;
  border-radius: 0.5rem;
  padding: 0.625rem 1.25rem;
  margin-top: 0.25rem;
  cursor: pointer;
  transition: background-color 150ms ease, transform 50ms ease;
}
/* The app's Button: hover:bg-primary/90. */
.help-form button:hover:not(:disabled) { background: rgb(247 148 29 / 0.9); }
.help-form button:active:not(:disabled) { transform: translateY(1px); }
.help-form button:disabled { opacity: 0.6; cursor: default; }
