/* Royal Capital Solutions, design system v2: base
   CONTENTS
   1. Reset and document
   2. Type roles
   3. Layout: wrap, bento, stack
   4. Precision details: hairline grid, registration marks
   5. Accessibility
   ============================================================ */

/* 1. RESET AND DOCUMENT ======================================= */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-padding-top: 6rem;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: var(--lh-body);
    letter-spacing: var(--tr-ui);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a, button, label, summary { touch-action: manipulation; }

/* 2. TYPE ROLES ===============================================
   Weight carries hierarchy; size steps are few and far apart.  */
.t-hero {
    font-size: var(--fs-hero);
    font-weight: 500;
    line-height: var(--lh-hero);
    letter-spacing: var(--tr-hero);
    text-wrap: balance;
}
/* Two-tone headline: the second phrase steps back in grey (Metto) */
.t-hero .t-dim, .t-h1 .t-dim { color: var(--text-3); }
.t-h1 {
    font-size: var(--fs-3xl);
    font-weight: 500;
    line-height: var(--lh-tight);
    letter-spacing: var(--tr-head);
    text-wrap: balance;
}
.t-h2 {
    font-size: var(--fs-2xl);
    font-weight: 500;
    line-height: var(--lh-tight);
    letter-spacing: var(--tr-head);
    text-wrap: balance;
}
.t-h3 {
    font-size: var(--fs-xl);
    font-weight: 500;
    line-height: var(--lh-head);
    letter-spacing: -0.025em;
    text-wrap: balance;
}
.t-h4 { font-size: var(--fs-base); font-weight: 600; line-height: 1.35; }
.t-lead { font-size: var(--fs-lg); line-height: 1.5; color: var(--text-2); max-width: 40ch; text-wrap: pretty; }
.t-body { max-width: 64ch; color: var(--text-2); text-wrap: pretty; }
.t-small { font-size: var(--fs-sm); line-height: 1.5; }
.t-xs { font-size: var(--fs-xs); line-height: 1.45; }
.t-2 { color: var(--text-2); }
.t-3 { color: var(--text-3); }

/* Mono: figures and data labels only, never sentences */
.t-mono {
    font-family: var(--font-mono);
    font-size: var(--fs-micro);
    font-weight: 500;
    letter-spacing: var(--tr-mono);
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}
.t-figure {
    font-size: var(--fs-figure);
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: -0.06em;
    font-variant-numeric: tabular-nums;
}

/* 3. LAYOUT ================================================== */
.wrap {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--row, var(--s-3)); }

.bento { display: grid; gap: var(--bento-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) {
    .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 72rem) {
    .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

/* 4. PRECISION DETAILS =======================================
   Hairline grid paper and corner registration marks: the
   "measured" feeling, used on two or three surfaces per page.   */
.grid-paper {
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 2rem 2rem;
    background-position: -1px -1px;
}
.marks { position: relative; }
.marks::before, .marks::after {
    content: "";
    position: absolute;
    width: 0.875rem;
    height: 0.875rem;
    pointer-events: none;
    background:
        linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat,
        linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
    color: var(--line-strong);
}
.marks::before { top: 1rem; inset-inline-start: 1rem; }
.marks::after { bottom: 1rem; inset-inline-end: 1rem; }

/* 5. ACCESSIBILITY =========================================== */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip {
    position: absolute; top: var(--s-3); inset-inline-start: var(--s-3); z-index: 100;
    padding: var(--s-3) var(--s-5); border-radius: var(--r-pill);
    background: var(--action); color: var(--on-action); font-weight: 600;
    transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }
.sr {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
