/*
 * Element defaults, typography hierarchy, links, buttons, focus and the
 * motion layer (docs/02 §2, §4, §6).
 *
 * Hierarchy: h1/hero in Cormorant Garamond light; h2/h3 in Cormorant
 * regular; body, navigation, metadata, buttons and captions in Manrope.
 */

body.ru-site {
    background: var(--ru-color-bg);
    color: var(--ru-color-text);
    font-family: var(--ru-font-text);
    font-size: var(--ru-fs-200);
    font-weight: 400;
    line-height: var(--ru-lh-body);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

/* Headings */

h1,
h2,
h3,
h4,
.ru-display {
    font-family: var(--ru-font-display);
    font-weight: 400;
    line-height: var(--ru-lh-heading);
    letter-spacing: -0.01em;
    color: inherit;
    text-wrap: balance;
    overflow-wrap: break-word;
}

h1,
.ru-page-title {
    font-size: var(--ru-fs-700);
    font-weight: 300;
    line-height: var(--ru-lh-tight);
    letter-spacing: -0.02em;
}

h2,
.ru-section__title {
    font-size: var(--ru-fs-500);
}

h3 {
    font-size: var(--ru-fs-400);
}

.ru-page-title {
    margin-bottom: var(--ru-space-5);
}

.ru-subtitle {
    margin: var(--ru-space-7) 0 var(--ru-space-4);
    font-family: var(--ru-font-display);
    font-size: var(--ru-fs-400);
    font-weight: 400;
}

p {
    margin-bottom: var(--ru-space-4);
}

.ru-lead {
    font-size: var(--ru-fs-300);
    line-height: 1.65;
    color: var(--ru-color-text-secondary);
    text-wrap: pretty;
}

/* Small uppercase label above a title. The short ochre rule is decoration;
   the text itself stays muted taupe (5.70:1). */
.ru-eyebrow {
    display: flex;
    align-items: center;
    gap: var(--ru-space-3);
    margin-bottom: var(--ru-space-4);
    font-family: var(--ru-font-text);
    font-size: var(--ru-fs-50);
    font-weight: 600;
    letter-spacing: var(--ru-tracking-label);
    text-transform: uppercase;
    color: var(--ru-color-muted);
}

.ru-eyebrow::before {
    content: "";
    flex: none;
    width: 1.75rem;
    height: 1px;
    background: var(--ru-color-accent);
}

.ru-label {
    font-family: var(--ru-font-text);
    line-height: 1.6;
    font-size: var(--ru-fs-50);
    font-weight: 600;
    letter-spacing: var(--ru-tracking-label);
    text-transform: uppercase;
    color: var(--ru-color-muted);
}

.ru-measure {
    max-width: calc(var(--ru-measure) + 2 * var(--ru-gutter));
}

.ru-prose {
    color: var(--ru-color-text-secondary);
}

.ru-prose p {
    max-width: var(--ru-measure);
    text-wrap: pretty;
}

/* Links: ink text with an accent underline (the underline is decoration,
   so the text keeps body contrast). */
a {
    color: var(--ru-color-text);
    text-decoration-color: var(--ru-color-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25em;
    transition: color var(--ru-duration-ui) var(--ru-ease), text-decoration-color var(--ru-duration-ui) var(--ru-ease);
}

a:hover {
    color: var(--ru-black);
    text-decoration-thickness: 2px;
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: var(--ru-terracotta);
    color: var(--ru-black);
}

/* Layout container: one max width for the whole site, 16 px minimum
   gutter on phones. */
.ru-container {
    width: 100%;
    max-width: calc(var(--ru-container) + 2 * var(--ru-gutter));
    margin-inline: auto;
    padding-inline: var(--ru-gutter);
}

.ru-container--narrow {
    max-width: calc(var(--ru-container-narrow) + 2 * var(--ru-gutter));
}

.ru-container .row {
    --bs-gutter-x: var(--ru-gutter);
}

/* Visible focus on every interactive element (≥ 3:1, docs/02 §6). */
:focus-visible {
    outline: 2px solid var(--ru-color-focus);
    outline-offset: 3px;
}

.ru-main:focus {
    outline: none;
}

.ru-skip-link {
    position: absolute;
    top: var(--ru-space-2);
    left: var(--ru-space-2);
    z-index: 1100;
    padding: var(--ru-space-3) var(--ru-space-4);
    background: var(--ru-color-surface);
    color: var(--ru-black);
    font-size: var(--ru-fs-100);
    font-weight: 600;
}

/* Buttons: own identity over Bootstrap defaults; ≥ 44 px targets. */
.ru-button {
    --ru-button-bg: var(--ru-black);
    --ru-button-fg: var(--ru-neutral-100);
    --ru-button-border: var(--ru-black);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ru-space-3);
    min-height: 48px;
    padding: var(--ru-space-3) var(--ru-space-6);
    border: 1px solid var(--ru-button-border);
    background: var(--ru-button-bg);
    color: var(--ru-button-fg);
    font-family: var(--ru-font-text);
    font-size: var(--ru-fs-50);
    font-weight: 600;
    letter-spacing: var(--ru-tracking-label);
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color var(--ru-duration-ui) var(--ru-ease), border-color var(--ru-duration-ui) var(--ru-ease), color var(--ru-duration-ui) var(--ru-ease);
}

/* Hover: ochre fill with black text (6.23:1). */
.ru-button:hover {
    --ru-button-bg: var(--ru-ochre);
    --ru-button-border: var(--ru-ochre);
    --ru-button-fg: var(--ru-black);
    color: var(--ru-button-fg);
}

.ru-button--outline {
    --ru-button-bg: transparent;
    --ru-button-fg: var(--ru-color-text);
    --ru-button-border: var(--ru-color-border-strong);
}

.ru-button--outline:hover {
    --ru-button-bg: var(--ru-black);
    --ru-button-border: var(--ru-black);
    --ru-button-fg: var(--ru-neutral-100);
}

/* On dark grounds: ivory outline; hover fills ochre with black text. */
.ru-on-dark .ru-button {
    --ru-button-bg: var(--ru-ochre);
    --ru-button-border: var(--ru-ochre);
    --ru-button-fg: var(--ru-black);
}

.ru-on-dark .ru-button:hover {
    --ru-button-bg: var(--ru-terracotta);
    --ru-button-border: var(--ru-terracotta);
}

.ru-on-dark .ru-button--outline {
    --ru-button-bg: transparent;
    --ru-button-border: var(--ru-night-soft);
    --ru-button-fg: var(--ru-neutral-100);
}

.ru-on-dark .ru-button--outline:hover {
    --ru-button-bg: var(--ru-neutral-100);
    --ru-button-border: var(--ru-neutral-100);
    --ru-button-fg: var(--ru-black);
}

.ru-on-dark :focus-visible {
    outline-color: var(--ru-color-focus-on-dark);
}

/* Text link with a moving arrow, for "view all" style cues. */
.ru-arrow-link {
    display: inline-flex;
    align-items: center;
    gap: var(--ru-space-2);
    min-height: 44px;
    font-size: var(--ru-fs-50);
    font-weight: 600;
    letter-spacing: var(--ru-tracking-label);
    text-transform: uppercase;
    text-decoration: none;
}

.ru-arrow-link::after {
    content: "→";
    font-size: var(--ru-fs-200);
    letter-spacing: 0;
    transition: transform var(--ru-duration-ui) var(--ru-ease);
}

.ru-arrow-link:hover::after {
    transform: translateX(0.25rem);
}

/* Section reveal (animations.js). Content is only hidden once the script
   has started (html.ru-reveal-ready), so it is always visible without JS,
   when the script fails, and under reduced motion. */
.ru-reveal-ready [data-reveal]:not(.is-revealed):not(:focus-within) {
    opacity: 0;
    transform: translate3d(0, 1.5rem, 0);
}

.ru-reveal-ready [data-reveal] {
    transition: opacity var(--ru-duration-reveal) var(--ru-ease-out), transform var(--ru-duration-reveal) var(--ru-ease-out);
}

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

    .ru-reveal-ready [data-reveal]:not(.is-revealed):not(:focus-within) {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
