/* The public pages: the landing page in index.html and the guides (scripts/site.ts). They load without the app's
   styles, so they style themselves. public/boot.js adds the `app` class when the visit goes straight into the app. */
html.app #landing {
  display: none;
}

/* The page behind the app while it loads (the app's own --bg colours), so a dark device never flashes white. */
html {
  background: #f6f4f1;
}
@media (prefers-color-scheme: dark) {
  html {
    background: #14171b;
  }
}

.site {
  --l-bg: #f6f4f1;
  --l-surface: #ffffff;
  --l-ink: #1f2328;
  --l-muted: #5d6570;
  --l-line: #e4dfd7;
  --l-brand: #e8710a;
  --l-link: #a84f00;
  /* dark enough for white text (AA) */
  --l-button: #a84f00;
  min-height: 100vh;
  background: var(--l-bg);
  color: var(--l-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
  .site {
    --l-bg: #14171b;
    --l-surface: #1d2127;
    --l-ink: #eef0f2;
    --l-muted: #a3acb7;
    --l-line: #333a43;
    --l-brand: #ff9438;
    --l-link: #ffb067;
  }
}

body:has(> .site) {
  margin: 0;
}
.site * {
  box-sizing: border-box;
}
.site a {
  color: var(--l-link);
}
.site-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}
.site .site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}
.site-logo {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--l-brand);
  color: #fff;
  font-size: 1rem;
}
.site-main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}
.site-hero {
  padding: 2rem 0 1rem;
}
.site h1,
.site h2 {
  font-weight: 800;
}
.site h3 {
  font-weight: 700;
}
.site h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.15;
}
.site h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.4rem;
}
.site h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.site p {
  margin: 0;
}
.site-tagline {
  max-width: 40rem;
  color: var(--l-muted);
  font-size: 1.15rem;
}
.site .site-start {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 0.9rem;
  background: var(--l-button);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.site .site-start:hover {
  background: #8f4300;
}
.site a:focus-visible {
  outline: 3px solid var(--l-brand);
  outline-offset: 3px;
}
.site-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-card {
  padding: 1rem;
  border: 1px solid var(--l-line);
  border-radius: 1rem;
  background: var(--l-surface);
}
.site-card p,
.site-note {
  color: var(--l-muted);
}
.site-card-link {
  position: relative;
  transition: border-color 0.15s;
}
.site-card-link:hover {
  border-color: var(--l-brand);
}
.site-card-link a {
  text-decoration: none;
}
.site-card-link a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
}
.site-card-link:hover a {
  text-decoration: underline;
}
.site-faq details {
  border: 1px solid var(--l-line);
  border-radius: 1rem;
  background: var(--l-surface);
}
.site-faq details + details {
  margin-top: 0.5rem;
}
.site-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.site-faq summary::-webkit-details-marker {
  display: none;
}
/* A chevron that turns when the answer is open */
.site-faq summary::after {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--l-muted);
  border-bottom: 2px solid var(--l-muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.site-faq details[open] summary::after {
  transform: rotate(-135deg);
}
.site-faq summary:focus-visible {
  outline: 3px solid var(--l-brand);
  outline-offset: 2px;
}
.site-faq details p {
  padding: 0 1rem 1rem;
  color: var(--l-muted);
}
.site-main > .site-note {
  margin-top: 2.5rem;
  font-size: 0.9rem;
}

/* Guides */
.site-article > .site-note {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.site-article h2 {
  margin-top: 2rem;
}
.site-article p,
.site-article ul,
.site-article ol {
  margin: 0 0 1rem;
}
.site-article li {
  margin-bottom: 0.35rem;
}
.site-cta {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border: 1px solid var(--l-line);
  border-radius: 1rem;
  background: var(--l-surface);
}
.site-cta h2 {
  margin-top: 0;
}
.site nav p {
  margin-top: 1rem;
}
/* Keyboard focus outlines the whole guide card, not just its title */
.site-card-link:focus-within {
  outline: 3px solid var(--l-brand);
  outline-offset: 2px;
}
.site .site-card-link a:focus-visible {
  outline: none;
}
/* Guide cards hold more text: two columns on a wide screen, one on a phone */
.site-cards-wide {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
}

/* Guide cards: a tall picture on the left, the text next to it */
.site-card-guide {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 1rem;
  align-items: start;
}
.site-guide-icon {
  grid-row: span 2;
  display: block;
  width: 4.5rem;
  height: 6rem;
  transition: transform 0.2s;
  --i-tile: #fdf0e1;
  --i-main: #e8710a;
  --i-deep: #a84f00;
  --i-soft: #f6c596;
  --i-cut: #ffffff;
}
@media (prefers-color-scheme: dark) {
  .site-guide-icon {
    --i-tile: #3a2512;
    --i-main: #ff9438;
    --i-deep: #c45e05;
    --i-soft: #7a4518;
    --i-cut: #fff4e8;
  }
}
.site-guide-icon .i-tile {
  fill: var(--i-tile);
}
.site-guide-icon .i-main {
  fill: var(--i-main);
}
.site-guide-icon .i-deep {
  fill: var(--i-deep);
}
.site-guide-icon .i-soft {
  fill: var(--i-soft);
}
.site-guide-icon .i-cut {
  fill: var(--i-cut);
}
.site-guide-icon .i-ink,
.site-guide-icon .i-ink-deep {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-guide-icon .i-ink {
  stroke: var(--i-main);
}
.site-guide-icon .i-ink-deep {
  stroke: var(--i-deep);
}
.site-card-guide:hover .site-guide-icon {
  transform: translateY(-2px) rotate(-3deg);
}
@media (prefers-reduced-motion: reduce) {
  .site-guide-icon {
    transition: none;
  }
  .site-card-guide:hover .site-guide-icon {
    transform: none;
  }
}

/* Read by screen readers, not shown */
.site-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.site-section-note {
  margin: -0.5rem 0 1rem !important;
  color: var(--l-muted);
}

/* Language menu in the header (a native <details>) */
.site-lang {
  position: relative;
  flex: none;
}
.site-lang summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--l-line);
  border-radius: 999px;
  background: var(--l-surface);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.site-lang summary::-webkit-details-marker {
  display: none;
}
.site-lang summary svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--l-muted);
}
.site-lang summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin: 0 0.1rem 0.2rem 0.15rem;
  border-right: 2px solid var(--l-muted);
  border-bottom: 2px solid var(--l-muted);
  transform: rotate(45deg);
}
.site-lang[open] summary::after {
  margin-bottom: -0.2rem;
  transform: rotate(-135deg);
}
.site-lang summary:hover {
  border-color: var(--l-brand);
}
.site-lang summary:focus-visible {
  outline: 3px solid var(--l-brand);
  outline-offset: 2px;
}
.site-lang-code {
  display: none;
}
.site-lang ul {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 10;
  min-width: 11rem;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid var(--l-line);
  border-radius: 0.9rem;
  background: var(--l-surface);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.15);
  list-style: none;
}
.site .site-lang a {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  color: var(--l-ink);
  text-decoration: none;
}
.site .site-lang a:hover {
  background: var(--l-bg);
}
.site .site-lang a[aria-current="page"] {
  color: var(--l-link);
  font-weight: 700;
}
.site .site-lang a[aria-current="page"]::after {
  content: "✓";
}
/* A narrow phone: the brand and the menu share one line, so the menu shows the language code */
@media (max-width: 26rem) {
  .site-lang-name {
    display: none;
  }
  .site-lang-code {
    display: inline;
  }
  .site .site-brand {
    font-size: 1.05rem;
    white-space: nowrap;
  }
  .site-lang summary {
    padding: 0.4rem 0.6rem;
  }
  .site-top {
    gap: 0.5rem;
  }
}
/* The narrowest phones: the globe makes room for the name */
@media (max-width: 22.5rem) {
  .site-lang summary svg {
    display: none;
  }
}
