/*
 * Shared styles for FroggyHub app legal and support pages.
 *
 * Same pond palette and type stack as froggyhub.com, tuned for long-form
 * reading: a narrow measure, generous line height, and no marketing furniture.
 * Hand-authored — the page generator writes HTML, never CSS.
 */

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

:root {
  color-scheme: light;

  --pond-mist: #f4f1e8;
  --pond-cream: #ede9de;
  --pond-shore: #d4cfc2;
  --pond-sage: #8b9a87;
  --pond-moss: #3d7a52;
  --pond-deep: #2d5a3d;
  --pond-dark: #1a3a28;
  --pond-ink: #1c2b21;

  --ink-70: rgba(28, 43, 33, 0.72);
  --ink-55: rgba(28, 43, 33, 0.55);
  --ink-40: rgba(28, 43, 33, 0.42);
  --rule: rgba(212, 207, 194, 0.6);

  --measure: 40rem;
}

html {
  scroll-behavior: smooth;
  /* Anchor links land below the sticky top bar. */
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family:
    'DM Sans',
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--pond-mist);
  color: var(--pond-ink);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(45, 90, 61, 0.2);
}

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

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  padding: 0.7rem 1.1rem;
  background: var(--pond-deep);
  color: var(--pond-mist);
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
}
.skip:focus {
  left: 0;
}

/* ── Top bar ─────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(244, 241, 232, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 207, 194, 0.45);
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 0.95rem;
  color: var(--pond-dark);
  text-decoration: none;
}
.topbar__brand svg {
  width: 1.25rem;
  height: 1.25rem;
}

.topbar__back {
  font-size: 0.8rem;
  color: var(--ink-55);
  text-decoration: none;
  transition: color 0.2s;
}
.topbar__back:hover {
  color: var(--pond-deep);
}

/* ── App header ──────────────────────────────────────────── */

.apphead {
  padding: 3.5rem 0 1.75rem;
}

.apphead__eyebrow {
  font-family: 'Caveat', cursive;
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 0.55rem;
}
.apphead__eyebrow a {
  color: var(--pond-moss);
  text-decoration: none;
}
.apphead__eyebrow a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.apphead h1 {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--pond-dark);
}

.apphead__date {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: var(--ink-40);
}

.apphead__intro {
  margin-top: 1rem;
  font-size: 1.05rem;
  color: var(--ink-70);
}

.apphead__attrib {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--pond-sage);
}
.apphead__attrib a {
  color: var(--pond-sage);
  text-decoration: underline;
  text-decoration-color: rgba(139, 154, 135, 0.45);
  text-underline-offset: 2px;
}
.apphead__attrib a:hover {
  color: var(--pond-moss);
}

/* ── Page switcher ───────────────────────────────────────── */

.appnav {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.appnav__link {
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.86rem;
  color: var(--ink-55);
  text-decoration: none;
  transition:
    color 0.2s,
    background 0.2s;
}
.appnav__link:hover {
  color: var(--pond-deep);
  background: rgba(212, 207, 194, 0.35);
}
.appnav__link.is-current {
  background: var(--pond-deep);
  color: var(--pond-mist);
}

/* ── Table of contents ───────────────────────────────────── */

.toc {
  margin-bottom: 2.5rem;
  padding: 1.15rem 1.35rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--rule);
  border-radius: 0.85rem;
}

.toc__heading {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--pond-sage);
  margin-bottom: 0.7rem;
}

.toc__list {
  columns: 2;
  column-gap: 1.75rem;
  list-style: none;
  counter-reset: toc;
  font-size: 0.86rem;
}
@media (max-width: 34rem) {
  .toc__list {
    columns: 1;
  }
}

.toc__list li {
  counter-increment: toc;
  margin-bottom: 0.3rem;
  break-inside: avoid;
}
.toc__list li::before {
  content: counter(toc) '.';
  margin-right: 0.4rem;
  color: var(--ink-40);
  font-variant-numeric: tabular-nums;
}

/* Support pages have unnumbered sections, so the contents list drops the
   numbers too rather than inventing an ordering the page does not show. */
.toc--plain .toc__list li::before {
  content: '';
  margin-right: 0;
}
.toc__list a {
  color: var(--ink-70);
  text-decoration: none;
}
.toc__list a:hover {
  color: var(--pond-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Prose ───────────────────────────────────────────────── */

.prose {
  padding-bottom: 1rem;
}

.sec {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
.sec:first-child {
  border-top: 0;
  padding-top: 0.5rem;
}

.sec h2 {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-bottom: 1rem;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--pond-dark);
  scroll-margin-top: 5rem;
}

.sec__num {
  flex: none;
  min-width: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pond-sage);
  font-variant-numeric: tabular-nums;
}

.sec h3 {
  margin: 1.5rem 0 0.55rem;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--pond-dark);
}

.sec p {
  margin-bottom: 0.9rem;
  color: var(--ink-70);
}
.sec p:last-child {
  margin-bottom: 0;
}

.sec ul,
.sec ol {
  margin: 0 0 1rem 1.1rem;
  color: var(--ink-70);
}
.sec li {
  margin-bottom: 0.35rem;
  padding-left: 0.25rem;
}
.sec li::marker {
  color: var(--pond-sage);
}

.sec dl {
  margin-bottom: 1rem;
}
.sec dt {
  font-weight: 500;
  color: var(--pond-dark);
  margin-top: 1rem;
}
.sec dt:first-child {
  margin-top: 0;
}
.sec dd {
  margin: 0.2rem 0 0;
  padding-left: 0.9rem;
  border-left: 2px solid rgba(139, 154, 135, 0.35);
  color: var(--ink-70);
}

.sec a {
  color: var(--pond-moss);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(61, 122, 82, 0.35);
  transition: text-decoration-color 0.2s;
}
.sec a:hover {
  text-decoration-color: var(--pond-moss);
}

.note {
  margin: 1.25rem 0;
  padding: 0.95rem 1.15rem;
  background: rgba(196, 146, 58, 0.07);
  border-left: 3px solid rgba(196, 146, 58, 0.5);
  border-radius: 0 0.5rem 0.5rem 0;
}
.note p {
  margin: 0;
  font-size: 0.92rem;
}

/* ── Hub cards (/apps/ and /apps/<slug>/) ────────────────── */

.hubgrid {
  display: grid;
  gap: 0.85rem;
  margin: 2rem 0 3rem;
}

.hubcard {
  display: block;
  padding: 1.25rem 1.4rem;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.25s,
    box-shadow 0.25s;
}
.hubcard:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 154, 135, 0.6);
  box-shadow: 0 12px 26px rgba(45, 90, 61, 0.07);
}

.hubcard__name {
  display: block;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--pond-dark);
}
.hubcard:hover .hubcard__name {
  color: var(--pond-moss);
}

.hubcard__desc {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: var(--ink-55);
}

.hubcard__links {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--pond-sage);
}

.hubcontact {
  margin-bottom: 3rem;
  font-size: 0.92rem;
  color: var(--ink-55);
}
.hubcontact a {
  color: var(--pond-moss);
  text-underline-offset: 2px;
}

/* ── Footer ──────────────────────────────────────────────── */

.pagefoot {
  margin-top: 2rem;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--rule);
}

.pagefoot__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
}

.pagefoot__heading {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--pond-sage);
  margin-bottom: 0.6rem;
}

.pagefoot__list {
  list-style: none;
}
.pagefoot__list li {
  margin-bottom: 0.3rem;
}
.pagefoot__list a {
  font-size: 0.86rem;
  color: var(--ink-55);
  text-decoration: none;
}
.pagefoot__list a:hover {
  color: var(--pond-deep);
}

.pagefoot__studio {
  margin-left: auto;
}

.pagefoot__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.pagefoot__brand svg {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}
.pagefoot__brand-name {
  display: block;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--pond-dark);
}
.pagefoot__brand-tag {
  display: block;
  font-family: 'Caveat', cursive;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--pond-sage);
}

.pagefoot__copy {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(212, 207, 194, 0.4);
  font-size: 0.75rem;
  color: var(--pond-sage);
}
.pagefoot__copy a {
  color: var(--pond-sage);
  text-underline-offset: 2px;
}

/* ── Print ───────────────────────────────────────────────── */

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .topbar,
  .appnav,
  .toc,
  .skip {
    display: none;
  }
  .wrap {
    max-width: none;
    padding: 0;
  }
  .sec a::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #555;
    word-break: break-all;
  }
  .hubcard,
  .note {
    border: 1px solid #ccc;
    background: none;
  }
}
