/*
 * rhz-web, an own surface: brand fonts, OS theme through tokens.css, motion only when the user
 * has not asked for less (reduced motion gets the static layout, which is also the default).
 * CSP is style-src 'self', so no inline style anywhere; every url() is a local /assets/ path.
 */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px / 1.6 "Hanken Grotesk", system-ui, sans-serif;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img {
  max-width: 100%;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Type */

h1,
h2,
h3 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  color: var(--text);
}

h1 {
  font-size: clamp(30px, 7vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 32px 0 12px;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 32px 0 8px;
}

h3 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 28px 0 8px;
}

/* The English mirror's title: one h1 per page, so it is an h2 sized like a heading. */
.mirror-title {
  font-size: clamp(24px, 6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p,
ul {
  margin: 0 0 12px;
}

.lead {
  font-size: 18px;
  color: var(--text2);
}

.meta,
.hint,
.caption {
  font-size: 14px;
  color: var(--text2);
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--brandInk);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

/* Header and footer */

.site-header {
  padding: 20px 0 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font: 700 24px / 1 "Bricolage Grotesque", system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.brand img {
  display: block;
}

.site-footer {
  margin-top: 56px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--text2);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer a {
  color: var(--text2);
}

/* Icons: brand SVGs as masks, so they take the text colour in both themes. */

.ic {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.ic-age {
  --icon: url("/assets/svg/ic-age.a59b3679ad.svg");
}

.ic-history {
  --icon: url("/assets/svg/ic-history.20c1d32ad1.svg");
}

.ic-save {
  --icon: url("/assets/svg/ic-save.ec073232d2.svg");
}

.ic-down {
  --icon: url("/assets/svg/ic-down.01536eff62.svg");
}

.ic-equal {
  --icon: url("/assets/svg/ic-equal.704066887c.svg");
}

.ic-up {
  --icon: url("/assets/svg/ic-up.0f8c37a252.svg");
}

/* Home */

.facts {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

.facts li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.facts .ic {
  margin-top: 3px;
  color: var(--brand);
}

.links {
  padding-left: 20px;
}

/* Welcome */

.panel {
  margin: 16px 0;
  padding: 24px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(36, 20, 32, 0.06), 0 12px 32px -8px rgba(36, 20, 32, 0.18);
}

.panel > :first-child {
  margin-top: 0;
}

.panel > :last-child {
  margin-bottom: 0;
}

.privacy-line {
  font-weight: 600;
}

/* The pill as it sits on a listing (X13): outline, verdict colour, mark plus direction icon. */
.demo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 20px 0 8px;
  padding: 18px 16px;
  border-radius: 8px;
  background: var(--bg);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px 0 4px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--surface);
  font: 700 13px / 1 "Hanken Grotesk", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill picture,
.pill .mark {
  display: block;
  width: 20px;
  height: 20px;
}

.pill .ic {
  width: 12px;
  height: 12px;
}

.pill.below {
  color: var(--below);
}

.pill.in-line {
  color: var(--fair);
}

.pill.above {
  color: var(--above);
}

/* Privacy and Limited Use */

.prose ul {
  padding-left: 20px;
}

.prose li {
  margin-bottom: 8px;
}

.prose section {
  scroll-margin-top: 16px;
}

.prose article + article {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.callout {
  padding: 12px 16px;
  border-left: 3px solid var(--brand);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}

blockquote {
  margin: 16px 0 24px;
  padding: 12px 16px;
  border-left: 3px solid var(--brand);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}

blockquote p {
  margin: 0;
}

/* 404 */

.empty {
  padding: 40px 0 8px;
  text-align: center;
}

.empty .hauzic {
  display: block;
  margin: 0 auto 8px;
}

/* Motion: the badge demo loops on this own surface (spec §9), Hauzić peeks once. */

@media (prefers-reduced-motion: no-preference) {
  .demo {
    display: grid;
    justify-items: start;
  }

  .demo .pill {
    grid-area: 1 / 1;
    animation: rhz-cycle 7.5s linear infinite both;
  }

  .demo .pill:nth-child(2) {
    animation-delay: 2.5s;
  }

  .demo .pill:nth-child(3) {
    animation-delay: 5s;
  }

  .empty .hauzic {
    animation: rhz-peek 450ms cubic-bezier(0.34, 1.36, 0.64, 1) both;
  }
}

@keyframes rhz-cycle {
  0% {
    opacity: 0;
    transform: scale(0.92);
    animation-timing-function: cubic-bezier(0.34, 1.36, 0.64, 1);
  }
  3%,
  30% {
    opacity: 1;
    transform: scale(1);
  }
  33.4%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes rhz-peek {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
