:root {
  --rb-brand: var(--wp--preset--color--brand, #17110b);
  --rb-brand-dark: var(--wp--preset--color--brand-dark, #0d0906);
  --rb-accent: var(--wp--preset--color--accent, #d49a2c);
  --rb-accent-text: var(--wp--preset--color--accent-text, #7a4c0e);
  --rb-accent-dark: var(--wp--preset--color--accent-dark, #a8701b);
  --rb-rust: var(--wp--preset--color--rust, #9d2f1d);
  --rb-silver: var(--wp--preset--color--silver, #cfcac2);
  --rb-ink: var(--wp--preset--color--ink, #1e150c);
  --rb-ink-soft: var(--wp--preset--color--ink-soft, #45351f);
  --rb-muted: var(--wp--preset--color--muted, #66553b);
  --rb-line: var(--wp--preset--color--line, #cdb98f);
  --rb-line-strong: #8a7046;
  --rb-surface: var(--wp--preset--color--surface, #efe2c2);
  --rb-surface-alt: var(--wp--preset--color--surface-alt, #e4d2a8);
  --rb-surface-deep: var(--wp--preset--color--surface-deep, #15100b);
  --rb-gold: linear-gradient(180deg, #ffe39a 0%, #f0bd55 38%, #d49a2c 62%, #a8701b 100%);
  --rb-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --rb-brick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='72'%3E%3Cg fill='none' stroke='%237a5a2a' stroke-opacity='0.13' stroke-width='2'%3E%3Cpath d='M0 1h180M0 37h180M1 1v36M91 1v36M46 37v35M136 37v35'/%3E%3C/g%3E%3C/svg%3E");
  --rb-mottle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.27 0 0 0 0 0.09 0 0 0 0.55 -0.12'/%3E%3C/filter%3E%3Crect width='420' height='420' filter='url(%23m)'/%3E%3C/svg%3E");
  --rb-woodgrain: url("/wp-content/plugins/rudys-blocks/assets/img/wood.webp");
  --rb-paper:
    radial-gradient(130% 90% at 50% 45%, transparent 55%, rgb(120 76 24 / 30%) 100%),
    var(--rb-mottle),
    var(--rb-brick);
  --rb-saloon:
    radial-gradient(90% 60% at 50% 0%, rgb(212 154 44 / 14%), transparent 60%),
    radial-gradient(120% 100% at 50% 50%, transparent 50%, rgb(0 0 0 / 55%) 100%),
    var(--rb-woodgrain);
  --rb-on-brand: #f4e8cc;
  --rb-on-accent: #1a1209;
  --rb-focus: var(--wp--preset--color--rust, #9d2f1d);

  --rb-font-heading: var(--wp--preset--font-family--heading, "Rye", Rockwell, Georgia, serif);
  --rb-font-body: var(--wp--preset--font-family--body, "Zilla Slab", Rockwell, Georgia, serif);
  --rb-font-script: var(--wp--preset--font-family--script, "Yellowtail", cursive);

  --rb-step--1: var(--wp--preset--font-size--x-small, clamp(0.88rem, 0.85rem + 0.14vw, 0.97rem));
  --rb-step-0: var(--wp--preset--font-size--small, clamp(1.05rem, 1rem + 0.2vw, 1.18rem));
  --rb-step-1: var(--wp--preset--font-size--medium, clamp(1.2rem, 1.12rem + 0.36vw, 1.44rem));
  --rb-step-2: var(--wp--preset--font-size--large, clamp(1.5rem, 1.32rem + 0.8vw, 2.05rem));
  --rb-step-3: var(--wp--preset--font-size--x-large, clamp(1.9rem, 1.6rem + 1.4vw, 2.8rem));
  --rb-step-4: var(--wp--preset--font-size--xx-large, clamp(2.3rem, 1.8rem + 2.4vw, 3.8rem));
  --rb-step-5: var(--wp--preset--font-size--display, clamp(2.9rem, 2rem + 4.4vw, 6rem));

  --rb-space-2xs: var(--wp--preset--spacing--20, clamp(0.5rem, 0.48rem + 0.14vw, 0.63rem));
  --rb-space-xs: var(--wp--preset--spacing--20, clamp(0.5rem, 0.48rem + 0.14vw, 0.63rem));
  --rb-space-sm: var(--wp--preset--spacing--30, clamp(0.75rem, 0.71rem + 0.21vw, 0.94rem));
  --rb-space-md: var(--wp--preset--spacing--40, clamp(1rem, 0.95rem + 0.28vw, 1.25rem));
  --rb-space-lg: var(--wp--preset--spacing--50, clamp(1.5rem, 1.43rem + 0.42vw, 1.88rem));
  --rb-space-xl: var(--wp--preset--spacing--60, clamp(2rem, 1.81rem + 0.85vw, 2.75rem));
  --rb-space-2xl: var(--wp--preset--spacing--70, clamp(3rem, 2.62rem + 1.7vw, 4.5rem));
  --rb-space-3xl: var(--wp--preset--spacing--80, clamp(4rem, 3.2rem + 3.6vw, 7.5rem));

  --rb-radius: 3px;
  --rb-radius-lg: 6px;
  --rb-shadow: 0 1px 2px rgb(13 9 6 / 14%), 0 10px 26px rgb(13 9 6 / 16%);
  --rb-shadow-lg: 0 2px 6px rgb(13 9 6 / 18%), 0 24px 60px rgb(13 9 6 / 26%);
  --rb-frame: 0 0 0 2px var(--rb-accent-dark), 0 0 0 5px var(--rb-surface), 0 0 0 6px var(--rb-accent-dark);

  --rb-measure: 62ch;
  --rb-container: var(--wp--style--global--wide-size, 1240px);
  --rb-container-wide: 1520px;

  --rb-ease: cubic-bezier(0.2, 0, 0, 1);
  --rb-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --rb-ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --rb-ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --rb-duration: 260ms;
}

body {
  background-image: var(--rb-mottle), var(--rb-brick);
  background-size: 420px 420px, 180px 72px;
}

.rb-section,
.rb-tone--paper {
  background-color: var(--rb-surface);
  background-image: var(--rb-paper);
  background-size: 100% 100%, 420px 420px, 180px 72px;
}

.rb-tone--deep {
  background-color: var(--rb-surface-deep);
  background-image: var(--rb-saloon);
  background-size: 100% 100%, 100% 100%, 900px 900px;
  color: var(--rb-ink);
  --rb-ink: #f4e8cc;
  --rb-ink-soft: rgb(244 232 204 / 80%);
  --rb-muted: rgb(244 232 204 / 60%);
  --rb-line: rgb(212 154 44 / 26%);
  --rb-line-strong: rgb(212 154 44 / 55%);
  --rb-surface: #211810;
  --rb-surface-alt: #1b140d;
  --rb-brand: #f4e8cc;
  --rb-on-brand: #15100b;
  --rb-accent-text: #f0bd55;
  --rb-focus: #f0bd55;
  --rb-shadow: 0 1px 2px rgb(0 0 0 / 34%), 0 10px 30px rgb(0 0 0 / 36%);
  --rb-shadow-lg: 0 2px 6px rgb(0 0 0 / 40%), 0 24px 60px rgb(0 0 0 / 50%);
  --rb-frame: 0 0 0 2px var(--rb-accent-dark), 0 0 0 5px #1b140d, 0 0 0 6px var(--rb-accent-dark);
}

.rb-section {
  padding-block: var(--rb-space-3xl);
  container-type: inline-size;
}

.rb-container {
  width: min(100% - (var(--rb-space-lg) * 2), var(--rb-container));
  margin-inline: auto;
}

.rb-container--wide {
  width: min(100% - (var(--rb-space-lg) * 2), var(--rb-container-wide));
}

.rb-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin: 0 0 var(--rb-space-sm);
  color: var(--rb-accent-text);
  font-family: var(--rb-font-body);
  font-size: var(--rb-step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rb-eyebrow::before,
.rb-eyebrow::after {
  content: '';
  inline-size: 0.8em;
  block-size: 0.8em;
  flex: none;
  background: currentcolor;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.rb-title {
  margin: 0;
  color: var(--rb-ink);
  font-family: var(--rb-font-heading);
  font-size: var(--rb-step-4);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-shadow: 0 2px 0 rgb(255 240 200 / 45%);
}

.rb-tone--deep .rb-title {
  text-shadow: 0 3px 0 rgb(0 0 0 / 60%);
}

.rb-title em,
.rb-title i,
.rb-title strong,
.rb-title b {
  font-style: normal;
  font-weight: 400;
  color: var(--rb-accent-dark);
}

.rb-tone--deep .rb-title :is(em, i, strong, b) {
  color: transparent;
  background: var(--rb-gold);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 rgb(0 0 0 / 60%));
}

.rb-title--sm {
  font-size: var(--rb-step-3);
}

.rb-as-heading {
  display: block;
}

.rb-lede {
  max-inline-size: var(--rb-measure);
  margin: var(--rb-space-md) 0 0;
  color: var(--rb-ink-soft);
  font-family: var(--rb-font-body);
  font-size: var(--rb-step-1);
  font-weight: 400;
  line-height: 1.5;
  text-wrap: pretty;
}

.rb-prose {
  max-inline-size: var(--rb-measure);
  color: var(--rb-ink-soft);
  font-size: var(--rb-step-0);
  line-height: 1.7;
}

.rb-prose > * + * {
  margin-block-start: var(--rb-space-md);
}

:is(.rb-prose, .rb-lede) a {
  color: var(--rb-accent-text);
  text-decoration-color: var(--rb-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

:is(.rb-prose, .rb-lede) a:hover {
  color: var(--rb-ink);
}

.rb-rule {
  display: flex;
  align-items: center;
  gap: var(--rb-space-sm);
  margin-block: var(--rb-space-md);
  color: var(--rb-accent-dark);
}

.rb-rule::before,
.rb-rule::after {
  content: '';
  flex: 1;
  block-size: 2px;
  background: linear-gradient(90deg, transparent, currentcolor 18%, currentcolor 82%, transparent);
}

.rb-rule__star {
  inline-size: 14px;
  block-size: 14px;
  background: currentcolor;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.rb-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-block-size: 52px;
  padding: 0 1.6rem;
  border: 2px solid currentcolor;
  border-radius: var(--rb-radius);
  font-family: var(--rb-font-body);
  font-size: var(--rb-step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition: background-color var(--rb-duration) var(--rb-ease),
    border-color var(--rb-duration) var(--rb-ease),
    color var(--rb-duration) var(--rb-ease),
    box-shadow calc(var(--rb-duration) * 1.4) var(--rb-ease),
    transform calc(var(--rb-duration) * 1.6) var(--rb-ease-out-expo);
}

.rb-btn__label {
  position: relative;
  z-index: 1;
}

.rb-btn__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-inline-end: -0.35rem;
  transition: transform calc(var(--rb-duration) * 1.8) var(--rb-ease-out-expo);
}

.rb-btn__svg { display: block; }

.rb-btn:hover .rb-btn__icon { transform: translate3d(4px, 0, 0); }

.rb-btn:focus-visible {
  outline: 3px solid var(--rb-focus);
  outline-offset: 3px;
}

.rb-btn:active {
  transform: scale3d(0.97, 0.97, 1);
  transition-duration: 80ms;
}

.rb-btn--primary {
  border-color: #7d5212;
  background-color: var(--rb-accent);
  background-image: var(--rb-gold);
  color: var(--rb-on-accent);
  text-shadow: 0 1px 0 rgb(255 236 180 / 55%);
  box-shadow: inset 0 0 0 2px rgb(255 228 150 / 55%), 0 3px 0 #5e3d0c, 0 10px 22px -10px rgb(0 0 0 / 60%);
}

.rb-btn--primary:hover {
  box-shadow: inset 0 0 0 2px rgb(255 228 150 / 75%), 0 5px 0 #5e3d0c, 0 16px 28px -12px rgb(0 0 0 / 60%);
  transform: translate3d(0, -2px, 0);
}

.rb-btn--secondary {
  background: transparent;
  color: var(--rb-ink);
  border-color: var(--rb-ink);
}

.rb-btn--secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--rb-ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform calc(var(--rb-duration) * 1.8) var(--rb-ease-out-expo);
}

.rb-btn--secondary:hover {
  color: var(--rb-surface);
}

.rb-btn--secondary:hover::before { transform: scaleX(1); }

.rb-btn--on-dark.rb-btn--secondary,
.rb-tone--deep .rb-btn--secondary {
  color: #f4e8cc;
  border-color: rgb(240 189 85 / 70%);
}

.rb-btn--on-dark.rb-btn--secondary::before,
.rb-tone--deep .rb-btn--secondary::before { background: #f0bd55; }

.rb-btn--on-dark.rb-btn--secondary:hover,
.rb-tone--deep .rb-btn--secondary:hover {
  color: #15100b;
  border-color: #f0bd55;
}

@media (prefers-reduced-motion: reduce) {
  .rb-btn, .rb-btn__icon, .rb-btn--secondary::before { transition: none; }
  .rb-btn:hover .rb-btn__icon { transform: none; }
}

.rb-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  color: inherit;
  font-family: var(--rb-font-body);
  font-size: var(--rb-step--1);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  background: linear-gradient(currentcolor, currentcolor) no-repeat 0 100% / 100% 2px;
  transition: background-size calc(var(--rb-duration) * 1.6) var(--rb-ease-out-expo);
}

.rb-link:hover {
  background-size: 0% 2px;
  background-position: 100% 100%;
}

[class^='rb-']:focus:not(:focus-visible),
[class*=' rb-']:focus:not(:focus-visible) {
  outline: none;
}

[class^='rb-']:focus-visible,
[class*=' rb-']:focus-visible {
  outline: 3px solid var(--rb-focus);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --rb-duration: 0.01ms;
  }

  html {
    scroll-behavior: auto;
  }
}

::selection {
  background: var(--rb-accent);
  color: var(--rb-on-accent);
}

@supports (scrollbar-color: red blue) {
  html {
    scrollbar-color: var(--rb-accent-dark) var(--rb-surface-deep);
    scrollbar-width: thin;
  }
}
