


:root {
    --ground: #e8dfd0;
    --ground-rgb: 232, 223, 208;
    --surface: #d8caba;
    --surface-rgb: 216, 202, 186;
    --surface-card: #f4eee5;
    --surface-card-rgb: 244, 238, 229;
    --surface-muted: #e0d5c5;
    --surface-dark: #1e1916;
    --surface-dark-rgb: 30, 25, 22;


    /* Typography & Ink */
    --ink: #221c18;
    --ink-rgb: 34, 28, 24;
    --ink-light: #f4eee5;
    --ink-muted: #5c5249;
    --steel: #52463e;
    --steel-light: #52463e;


    --accent: #953314;
    --accent-rgb: 149, 51, 20;
    --accent-hover: #7b2a10;
    --accent-soft: rgba(149, 51, 20, 0.12);
    --accent-surface: #ead0c7;


    /* Editorial & Structural Lines */
    --line: #221c18;
    --line-subtle: rgba(34, 28, 24, 0.22);
    --line-faint: rgba(34, 28, 24, 0.12);
    --line-strong: #221c18;
    --line-light: rgba(244, 238, 229, 0.22);


    /* Functional Status */
    --success: #2e6930;
    --warning: #b36800;
    --error: #b52b20;
    --info: #3e5a70;


    --beki-f2b: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --beki-1d6: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --beki-391: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;


    --text-xs: clamp(0.72rem, 0.7rem + 0.15vw, 0.8rem);
    --text-sm: clamp(0.82rem, 0.8rem + 0.2vw, 0.92rem);
    --text-base: clamp(0.95rem, 0.92rem + 0.25vw, 1.05rem);
    --text-md: clamp(1.1rem, 1.05rem + 0.35vw, 1.25rem);
    --text-lg: clamp(1.28rem, 1.2rem + 0.6vw, 1.55rem);
    --text-xl: clamp(1.5rem, 1.35rem + 1vw, 2rem);
    --text-2xl: clamp(1.85rem, 1.6rem + 1.6vw, 2.7rem);
    --text-3xl: clamp(2.2rem, 1.85rem + 2.4vw, 3.6rem);
    --text-display: clamp(2.5rem, 2.1rem + 3.2vw, 4.6rem);


    /* Leading & Tracking */
    --leading-tight: 1.12;
    --leading-snug: 1.25;
    --leading-normal: 1.55;
    --leading-loose: 1.7;
    --tracking-tight: -0.03em;
    --tracking-snug: -0.015em;
    --tracking-normal: 0em;
    --tracking-wide: 0.05em;
    --tracking-wider: 0.1em;


    /* Spacing Rhythm */
    --space-2xs: clamp(0.2rem, 0.18rem + 0.1vw, 0.35rem);
    --space-xs: clamp(0.45rem, 0.4rem + 0.2vw, 0.65rem);
    --space-sm: clamp(0.75rem, 0.68rem + 0.35vw, 1rem);
    --space-md: clamp(1.2rem, 1.05rem + 0.6vw, 1.65rem);
    --space-lg: clamp(1.8rem, 1.5rem + 1.1vw, 2.6rem);
    --space-xl: clamp(2.5rem, 2rem + 1.8vw, 4rem);
    --space-2xl: clamp(3.5rem, 2.8rem + 2.8vw, 6rem);
    --space-3xl: clamp(4.5rem, 3.5rem + 4.2vw, 8rem);


    --radius-none: 0px;
    --radius-xs: 2px;
    --radius-sm: 3px;
    --radius-md: 4px;
    --radius-pill: 9999px;


    --border-hairline: 1px solid var(--line-subtle);
    --border-thin: 1px solid var(--line);
    --border-thick: 2px solid var(--line);
    --border-heavy: 3px solid var(--line);


    /* Elevation: Clean, Tactile Depth from Borders and Contrast */
    --shadow-flat: 2px 2px 0 var(--line);
    --shadow-lift: 4px 4px 0 var(--line);
    --shadow-heavy: 6px 6px 0 var(--line);
    --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.12);


    --site-max-width: 1360px;
    --content-max-width: 1040px;
    --prose-max-width: 72ch;
    --page-gutter: clamp(1rem, 0.8rem + 2vw, 2.75rem);


    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --dur-fast: 140ms;
    --dur-normal: 220ms;
    --dur-settle: 380ms;
    --dur-spring: 520ms;


    --focus-ring: 2px solid var(--accent);
    --focus-offset: 3px;
}



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


html {
    font-size: 16px;
    line-height: var(--leading-normal);
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    background-color: var(--ground);
    color: var(--ink);
    scroll-behavior: smooth;
}


/* Ground color must stay authoritative across viewport */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--ground);
    color: var(--ink);
    font-family: var(--beki-1d6);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--leading-normal);
    letter-spacing: var(--tracking-normal);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}


/* Form controls only: inherit font cleanly without polluting body */
button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
    color: inherit;
}


main {
    display: block;
    flex: 1 0 auto;
    width: 100%;
}


img,
picture,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}


img {
    border-style: none;
    font-style: italic;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-size: cover;
    shape-margin: 0.75rem;
}


/* Icons via sprite */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    flex-shrink: 0;
}



h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: var(--space-sm);
    color: var(--ink);
    font-family: var(--beki-f2b);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: manual;
}


h1 {

    font-size: var(--text-display);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    line-height: 1.08;
}


h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: var(--tracking-tight);
}


h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.22;
}


h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: 1.28;
}


h5 {
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.35;
}


h6 {
    font-size: var(--text-base);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}


p {
    margin-top: 0;
    margin-bottom: var(--space-md);
    max-width: var(--prose-max-width);
}


p:last-child { margin-bottom: 0; }


.lead-p {
    font-size: var(--text-md);
    line-height: var(--leading-snug);
    color: var(--ink);
    font-weight: 500;
}


.caption {
    font-size: var(--text-xs);
    line-height: 1.4;
    color: var(--steel);
    font-family: var(--beki-391);
    letter-spacing: var(--tracking-wide);
}


.numeral,
.rate,
.spec-code,
.mono {
    font-family: var(--beki-391);
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-tight);
}


.currency {
    font-family: var(--beki-391);
    font-weight: 700;
    color: var(--accent);
}


/* Links */
a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;

    text-underline-offset: 3px;
    transition: color var(--dur-fast) ease, text-decoration-color var(--dur-fast) ease;
}


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


a:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    border-radius: var(--radius-xs);
}


/* Lists */
ul,
ol {
    margin-top: 0;
    margin-bottom: var(--space-md);

    padding-left: 1.4rem;
}


li { margin-bottom: var(--space-2xs); }


li::marker { color: var(--accent); }


hr {
    border: none;
    border-top: var(--border-thin);
    margin: var(--space-lg) 0;
    height: 0;
}


hr.thick { border-top: var(--border-thick); }


blockquote {
    margin: var(--space-lg) 0;
    padding: var(--space-md) var(--space-lg);
    border-left: 4px solid var(--accent);
    background-color: var(--surface-card);
    font-style: italic;
    font-size: var(--text-md);
    line-height: var(--leading-snug);
    color: var(--ink);
}


code,
kbd,
samp,
pre {
    font-family: var(--beki-391);
    font-size: 0.9em;
}


code {
    background-color: var(--surface);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line-subtle);
}



.page-container {
    width: 100%;
    max-width: var(--site-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
}


.page-container--narrow { max-width: var(--content-max-width); }


.page-container--prose { max-width: var(--prose-max-width); }


.page-container--full {
    max-width: 100%;
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
}


/* Modular Grid */
.grid-modular {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-md);
    width: 100%;
}


.grid-col-12 { grid-column: span 12; }
.grid-col-8 { grid-column: span 8; }
.grid-col-6 { grid-column: span 6; }
.grid-col-4 { grid-column: span 4; }
.grid-col-3 { grid-column: span 3; }


@media (max-width: 1024px) {
    .grid-col-8 { grid-column: span 12; }
    .grid-col-4 { grid-column: span 12; }
    .grid-col-6 { grid-column: span 12; }
    .grid-col-3 { grid-column: span 6; }
}


@media (max-width: 640px) {
    .grid-col-3 { grid-column: span 12; }
}


/* Flex utilities */
.flex-row {
    display: flex;
    flex-direction: row;
    align-items: center;
}


.flex-between {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}


.flex-col {
    display: flex;
    flex-direction: column;
}


/* Section Wrapper */
.site-section {
    position: relative;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: var(--border-thin);
}


.site-section--dense {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
}


.site-section--spacious {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
}


.site-section--dark {
    background-color: var(--surface-dark);
    color: var(--ink-light);
    border-color: rgba(244, 238, 229, 0.15);
}


.site-section--dark h1,
.site-section--dark h2,
.site-section--dark h3,
.site-section--dark h4 { color: var(--ink-light); }


.site-section--dark p { color: rgba(244, 238, 229, 0.86); }


/* Visual utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}


.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 9999;
    background-color: var(--accent);
    color: #fff;
    padding: 0.75rem 1.25rem;
    font-family: var(--beki-391);
    font-size: var(--text-sm);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-lift);
    transition: top var(--dur-fast) ease-out;
}


.skip-link:focus {
    top: 1rem;
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}



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


    [data-depth] { transform: none !important; }
}
