/* ==========================================================================
   GB Hub — front end stylesheet
   Version 2.0.0

   Token mirrors of theme.json live in :root so the front end and the block
   editor describe the same system. Change a colour or a type step in both
   places, or not at all.

   Contents
     1. Tokens
     2. Reset and base elements
     3. Accessibility utilities
     4. Layout
     5. Header and navigation
     6. Hero and stat strip
     7. Sections, panels, lists
     8. Cards and grids
     9. CTA band
    10. Long form content
    11. Galleries and embeds
    12. Forms
    13. Pagination
    14. Footer
    15. Motion and prefers-reduced-motion
    16. TikTok facade
   ========================================================================== */

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces */
  --color-base: #14100f;
  --color-base-deep: #0b0809;
  --color-surface: #1c1716;
  --color-surface-raised: #241d1b;
  --color-border: #322a26;

  /* Text */
  --color-ink: #f6ece1;
  --color-ink-soft: #c9bcae;
  --color-ink-muted: #a89b8d;

  /* Accents */
  --color-ember: #c25a2b;
  --color-ember-text: #e8843c;
  --color-ember-button: #9e4522;
  --color-ember-button-hover: #b35428;
  --color-link: #7cc7f0;
  --color-cream: #f5e6d0;

  --focus-ring: var(--color-ember-text);

  /* Type */
  --font-body: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Syne", var(--font-body);

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-2: clamp(1.25rem, 1.16rem + 0.45vw, 1.5rem);
  --step-3: clamp(1.5rem, 1.34rem + 0.8vw, 2rem);
  --step-4: clamp(1.85rem, 1.55rem + 1.5vw, 2.7rem);
  --step-5: clamp(2.25rem, 1.75rem + 2.5vw, 3.75rem);

  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;

  /* Structure */
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --container: 72rem;
  --measure: 42rem;
  --header-height: 4.5rem;
}

/* ==========================================================================
   2. Reset and base elements
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--color-ink);
  background-color: var(--color-base);
  background-image: radial-gradient(120% 70% at 50% -10%, rgba(194, 90, 43, 0.1), transparent 60%);
  background-repeat: no-repeat;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--color-ember);
  color: var(--color-cream);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-3); }
h4 { font-size: var(--step-2); }

p {
  margin: 0 0 var(--space-3);
  color: var(--color-ink-soft);
}

a {
  color: var(--color-link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-ink);
}

ul,
ol {
  margin: 0 0 var(--space-3);
  padding-left: 1.25rem;
  color: var(--color-ink-soft);
}

li + li {
  margin-top: var(--space-1);
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
  border: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-4) 0;
}

code,
kbd,
pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

code {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
  color: var(--color-ink);
}

pre {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  overflow-x: auto;
  color: var(--color-ink-soft);
}

blockquote {
  margin: var(--space-4) 0;
  padding-left: var(--space-3);
  border-left: 3px solid var(--color-ember);
  color: var(--color-ink);
}

blockquote p:last-child {
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-3);
}

th,
td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

th {
  color: var(--color-ink);
  font-weight: 700;
}

figcaption {
  font-size: var(--step--1);
  color: var(--color-ink-muted);
  margin-top: var(--space-1);
}

/* ==========================================================================
   3. Accessibility utilities
   ========================================================================== */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -4rem;
  z-index: 120;
  background: var(--color-cream);
  color: var(--color-base);
  font-weight: 700;
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: var(--space-3);
  color: var(--color-base);
}

.visually-hidden,
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   4. Layout
   ========================================================================== */

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.section {
  padding-block: clamp(3rem, 6vw, 5.5rem);
}

.section--tight {
  padding-block: clamp(2rem, 4vw, 3rem);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}

.section-head__title {
  margin: 0;
}

.section-head__link {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.section-head__link:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 var(--space-2);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-ember-text);
}

.eyebrow::before {
  content: "";
  width: 1.25rem;
  height: 2px;
  background: var(--color-ember);
  border-radius: 2px;
}

.lede {
  font-size: var(--step-1);
  color: var(--color-ink-soft);
  max-width: 48ch;
}

.meta {
  font-size: var(--step--1);
  color: var(--color-ink-muted);
  margin-bottom: var(--space-1);
}

.notice,
.empty-state {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  color: var(--color-ink-muted);
  font-size: var(--step--1);
  background: rgba(255, 255, 255, 0.015);
}

.notice > *:last-child,
.empty-state > *:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   5. Header and navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 8, 9, 0.86);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-ink);
}

.brand:hover {
  color: var(--color-ink);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-ember-text);
  overflow: hidden;
}

.brand__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--color-ink);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.menu-toggle:hover {
  border-color: var(--color-ember);
}

.menu-toggle__bars {
  position: relative;
  display: block;
  width: 0.9rem;
  height: 2px;
  background: currentColor;
  transition: background-color 0.18s ease;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.18s ease;
}

.menu-toggle__bars::before {
  top: -5px;
}

.menu-toggle__bars::after {
  top: 5px;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before {
  transform: translateY(5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after {
  transform: translateY(-5px) rotate(-45deg);
}

.menu-list,
.footer-menu,
.menu-list ul,
.footer-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-list,
.menu-list > ul,
.footer-menu,
.footer-menu > ul {
  display: flex;
  gap: var(--space-4);
}

/* Footer links sit tighter than primary navigation links. */
.footer-menu,
.footer-menu > ul {
  gap: var(--space-1);
}

/* Mobile first: stacked, and visible even with JavaScript disabled. */
.menu-list,
.menu-list > ul,
.footer-menu,
.footer-menu > ul {
  flex-direction: column;
}

.menu-list li + li,
.footer-menu li + li {
  margin-top: 0;
}

.menu-list a,
.footer-menu a {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--color-ink-soft);
}

.menu-list a:hover,
.menu-list a:focus-visible,
.footer-menu a:hover,
.footer-menu a:focus-visible {
  color: var(--color-ink);
}

.menu-list .current-menu-item > a,
.menu-list .current_page_item > a,
.menu-list .current-menu-parent > a {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-ember);
  text-underline-offset: 0.4em;
}

.primary-nav {
  display: block;
}

/* With JS present the panel collapses behind the toggle on small screens.
   The offset comes from the header itself, never a hardcoded pixel value. */
@media (max-width: 47.999rem) {
  .js .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: var(--space-3) max(1rem, (100% - var(--container)) / 2) var(--space-4);
    background: rgba(11, 8, 9, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
  }

  .js .primary-nav.is-open {
    display: block;
  }

  .js .menu-list a,
  .js .menu-list > ul a {
    font-size: 1.0625rem;
    padding-block: 0.25rem;
  }
}

@media (min-width: 48rem) {
  .menu-toggle {
    display: none;
  }

  .primary-nav {
    position: static;
  }

  /* Only the primary navigation goes horizontal. The footer menu is a
     stacked list at every width. */
  .menu-list,
  .menu-list > ul {
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
  }

  .menu-list a,
  .footer-menu a {
    font-size: var(--step--1);
  }
}

/* ==========================================================================
   6. Hero and stat strip
   ========================================================================== */

.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3.5rem);
}

.hero__inner {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}

.hero__title {
  margin-bottom: var(--space-3);
  max-width: 22ch;
}

.hero__lede {
  margin-bottom: 0;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.hero__media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--color-surface-raised), var(--color-base-deep));
}

.hero__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hero__media--empty {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: var(--space-4);
}

.hero__mark {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: rgba(232, 132, 60, 0.22);
  line-height: 1;
}

.hero__aside {
  margin-top: var(--space-4);
}

@media (min-width: 62rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: var(--space-6);
    align-items: center;
  }

  .hero__media .hero__image,
  .hero__media--empty {
    aspect-ratio: 5 / 4;
  }
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.stat__value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-ink);
}

.stat__label {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}

/* ==========================================================================
   7. Sections, panels, lists
   ========================================================================== */

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.panel--raised {
  background: var(--color-surface-raised);
}

.panel__title {
  margin-bottom: var(--space-2);
  font-size: var(--step-2);
}

.panel > *:last-child {
  margin-bottom: 0;
}

.split {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

@media (min-width: 62rem) {
  .split {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
  }
}

.feature-list,
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-list li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--color-ink-soft);
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-ember);
}

.link-list li {
  margin-bottom: var(--space-1);
}

.link-list li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   8. Cards and grids
   ========================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: var(--space-4);
}

.card {
  display: flex;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover,
.card:focus-within {
  border-color: rgba(232, 132, 60, 0.5);
  transform: translateY(-2px);
}

.card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card__link:hover {
  color: inherit;
}

.card__media {
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-3) var(--space-4);
}

.card__title {
  margin-bottom: 0;
  font-size: var(--step-2);
}

.card__text {
  margin-bottom: 0;
  font-size: var(--step-0);
}

/* ==========================================================================
   9. CTA band
   ========================================================================== */

.cta {
  display: grid;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(194, 90, 43, 0.14), transparent 55%),
    var(--color-surface);
}

.cta__title {
  margin-bottom: var(--space-2);
  max-width: 24ch;
}

.cta__text {
  margin-bottom: 0;
}

@media (min-width: 48rem) {
  .cta {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-5);
  }
}

/* ==========================================================================
   10. Long form content
   ========================================================================== */

.page-header {
  max-width: var(--measure);
  margin-bottom: var(--space-5);
}

.page-header__lede {
  font-size: var(--step-1);
  margin-bottom: 0;
}

.entry {
  max-width: var(--measure);
}

.entry__header {
  margin-bottom: var(--space-4);
}

.entry__title {
  margin-bottom: var(--space-2);
}

.entry__cover {
  margin-bottom: var(--space-4);
}

.entry__cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.entry__content > * + * {
  margin-top: var(--space-3);
}

.entry__content h2,
.entry__content h3 {
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

.entry__content a {
  text-decoration-thickness: 1px;
}

.entry__section {
  margin-top: var(--space-5);
}

.entry__section > *:last-child {
  margin-bottom: 0;
}

.entry__aside {
  margin-top: var(--space-4);
}

/* ==========================================================================
   11. Galleries and embeds
   ========================================================================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-3);
}

.gallery__item {
  margin: 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.embed-frame {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.embed-frame iframe {
  display: block;
  width: 100%;
}

/* Only force the aspect ratio when the provider actually gave us an iframe,
   so blockquote based embeds are not clipped. */
.embed-frame:has(iframe) {
  position: relative;
  aspect-ratio: 16 / 9;
}

.embed-frame:has(iframe) iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.link-external::after {
  content: " \2197\FE0E";
  font-size: 0.9em;
}

/* ==========================================================================
   12. Forms
   ========================================================================== */

.contact-layout {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 62rem) {
  .contact-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: start;
  }
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--color-ink-soft);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: var(--step-0);
  color: var(--color-ink);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

::placeholder {
  color: var(--color-ink-muted);
  opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-ember);
}

button,
input[type="submit"],
input[type="button"] {
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--color-cream);
  background: var(--color-ember-button);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.18s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: var(--color-ember-button-hover);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.search-form input[type="search"] {
  flex: 1 1 12rem;
  width: auto;
}

/* Buttons used as links in the page body. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.35rem;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn--primary {
  color: var(--color-cream);
  background: var(--color-ember-button);
  border-color: rgba(245, 230, 208, 0.14);
}

.btn--primary:hover {
  color: var(--color-cream);
  background: var(--color-ember-button-hover);
}

.btn--secondary {
  color: var(--color-ink);
  background: transparent;
  border-color: var(--color-border);
}

.btn--secondary:hover {
  color: var(--color-ink);
  border-color: var(--color-ember);
}

.btn--ghost {
  padding-inline: 0.25rem;
  color: var(--color-link);
  background: transparent;
}

.btn--ghost:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

/* ==========================================================================
   13. Pagination
   ========================================================================== */

.pagination {
  margin-top: var(--space-5);
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding-inline: 0.6rem;
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  color: var(--color-ink-soft);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.page-numbers:hover {
  color: var(--color-ink);
  border-color: var(--color-ember);
}

.page-numbers.current {
  color: var(--color-ink);
  background: var(--color-surface-raised);
  border-color: var(--color-ember);
}

/* ==========================================================================
   14. Footer
   ========================================================================== */

.site-footer {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  background: var(--color-base-deep);
  border-top: 1px solid var(--color-border);
  color: var(--color-ink-soft);
}

.footer-grid {
  display: grid;
  gap: var(--space-5);
  padding-bottom: var(--space-5);
}

.footer-brand__title {
  font-size: var(--step-2);
  margin-bottom: var(--space-2);
}

.footer-brand p {
  color: var(--color-ink-muted);
  margin-bottom: 0;
}

.footer-heading {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-ink);
  margin-bottom: var(--space-2);
}

.footer-bottom {
  padding-block: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
}

.footer-bottom p {
  margin-bottom: 0;
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   15. Motion
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

/* The hidden state is behind .js, so content is visible by default and JS
   only ever adds the entrance. If site.js fails to load, nothing is lost. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   16. TikTok facade

   The panel reserves its height before anything is loaded, so swapping the
   placeholder for TikTok's feed cannot shift the page.
   ========================================================================== */

.tiktok {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid rgba(194, 90, 43, 0.3);
  border-radius: var(--radius);
  /* Warm walnut/ember, to sit with the page background rather than beside it.
     --color-surface is a desaturated grey-brown and read as a foreign block. */
  background:
    linear-gradient(135deg, rgba(194, 90, 43, 0.18), transparent 58%),
    linear-gradient(180deg, rgba(38, 24, 20, 0.97), rgba(16, 11, 11, 0.97));
}

@media (min-width: 62rem) {
  .tiktok {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: var(--space-5);
    align-items: center;
  }
}

.tiktok__title {
  max-width: 20ch;
}

.tiktok__copy {
  margin-bottom: 0;
}

.tiktok__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: var(--space-4) 0 0;
}

.tiktok__stat {
  display: flex;
  flex-direction: column;
}

.tiktok__stat-value {
  order: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-ink);
}

.tiktok__stat-label {
  order: 2;
  margin-top: var(--space-1);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}

.tiktok__frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 22rem;
  padding: var(--space-4);
  /* Solid, not dashed: the dashed treatment is reserved for editor-only
     notices, so using it here made a finished panel look like a placeholder. */
  border: 1px solid rgba(194, 90, 43, 0.24);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, rgba(74, 38, 22, 0.5), rgba(11, 8, 9, 0.92));
  box-shadow: inset 0 1px 0 rgba(245, 230, 208, 0.05);
  text-align: center;
}

/* Once the feed is loaded, stop framing a placeholder that is no longer there. */
.tiktok__frame:has(.tiktok__embed) {
  min-height: 0;
  padding: var(--space-1);
}

.tiktok__placeholder {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
}

.tiktok__mark {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: rgba(232, 132, 60, 0.6);
  text-shadow: 0 0 28px rgba(194, 90, 43, 0.4);
}

.tiktok__note {
  margin-bottom: 0;
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}

/* Only present after a click. */
.tiktok__embed {
  width: 100%;
  background: var(--color-base-deep);
  border: 1px solid rgba(194, 90, 43, 0.2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* TikTok renders its own embed inside a cross-origin iframe, in their light
   theme, and that cannot be restyled from here. Bounding it to a centred,
   max-width card makes it read as a deliberate inset screen against the walnut
   panel rather than an unbounded white slab. */
.tiktok__embed iframe {
  display: block;
  width: 100%;
  max-width: 32rem;
  margin-inline: auto;
  border: 0;
}

.tiktok__embed blockquote {
  margin-inline: auto;
}

/* Link mode, which is the default: with no embed there is no <template> in the
   frame, so it collapses to a compact dark panel instead of reserving height
   for a widget that will never load. */
.tiktok__frame:not(:has([data-tiktok-template])) {
  min-height: 0;
  padding: var(--space-5) var(--space-4);
}

.tiktok__frame:not(:has([data-tiktok-template])) .tiktok__mark {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}
