


@property --mesh-pos-x1 {
    syntax: '<percentage>';

    inherits: false;
    initial-value: 15%;
}


@property --mesh-pos-y1 {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 25%;
}


@property --mesh-pos-x2 {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 85%;
}


@property --mesh-pos-y2 {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 75%;
}


@property --mesh-pos-x3 {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 50%;
}


@property --mesh-pos-y3 {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 50%;
}


@property --mesh-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 38deg;
}


:root {
    /* Color Story: Oxblood & Cream with Aged Gold Accent */
    --bg-ground: #4A1F22;
    --bg-ground-deep: #361417;
    --bg-ground-darkest: #230B0D;
    --bg-surface: #582528;
    --bg-surface-elevated: #662B2F;
    --bg-surface-hover: #743136;
    --bg-surface-active: #3C1618;
    --bg-subtle-tint: rgba(246, 239, 230, 0.04);


    /* Typography Colors */
    --text-cream: #F6EFE6;
    --text-cream-bright: #FFFFFF;
    --text-muted: #D8C3B5;
    --text-dim: #AA9485;
    --text-inverse: #230B0D;


    --accent-gold: #D4A359;
    --accent-gold-hover: #E3B46E;
    --accent-gold-active: #B5843A;
    --accent-gold-subtle: rgba(212, 163, 89, 0.14);
    --accent-gold-border: rgba(212, 163, 89, 0.45);


    --line-grid: rgba(246, 239, 230, 0.16);
    --line-grid-strong: rgba(246, 239, 230, 0.32);
    --line-grid-subtle: rgba(246, 239, 230, 0.09);
    --line-gold: rgba(212, 163, 89, 0.38);


    /* Functional Alert Colors */
    --error-red: #E0635C;
    --error-bg: rgba(224, 99, 92, 0.14);
    --error-border: rgba(224, 99, 92, 0.42);
    --success-green: #68B684;
    --success-bg: rgba(104, 182, 132, 0.14);


    /* Typography Families */
    --mizi-9d5: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mizi-239: 'Crimson Pro', Georgia, 'Times New Roman', serif;
    --mizi-f36: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;


    /* Fluid Type Scale (Modular ratio calibrated for small screen fit at 320px) */
    --step--2: clamp(0.70rem, 0.68rem + 0.10vw, 0.78rem);
    --step--1: clamp(0.82rem, 0.79rem + 0.18vw, 0.94rem);
    --mizi-090:  clamp(1.00rem, 0.94rem + 0.30vw, 1.15rem);
    --mizi-cb0:  clamp(1.18rem, 1.09rem + 0.45vw, 1.38rem);
    --mizi-0e9:  clamp(1.40rem, 1.26rem + 0.70vw, 1.72rem);
    --mizi-6d1:  clamp(1.68rem, 1.46rem + 1.10vw, 2.15rem);
    --mizi-554:  clamp(2.02rem, 1.70rem + 1.60vw, 2.70rem);
    --mizi-32b:  clamp(2.42rem, 1.98rem + 2.20vw, 3.40rem);
    --mizi-37c:  clamp(2.88rem, 2.30rem + 2.90vw, 4.30rem);


    /* Line Heights */
    --lh-tight: 1.12;
    --lh-heading: 1.24;
    --lh-body: 1.65;
    --lh-relaxed: 1.80;


    /* Letter Spacing */
    --tracking-tight: -0.02em;
    --tracking-normal: 0em;

    --tracking-wide: 0.04em;
    --tracking-mono: -0.01em;


    --space-3xs: 0.25rem;
    --space-2xs: 0.5rem;
    --space-xs:  0.75rem;
    --space-s:   1.0rem;
    --space-m:   1.5rem;
    --space-l:   2.0rem;
    --space-xl:  3.0rem;
    --space-2xl: 4.5rem;
    --space-3xl: 6.5rem;


    /* Layout Dimensions */
    --sidebar-width: 290px;
    --sidebar-width-wide: 320px;
    --header-mobile-height: 64px;
    --content-max-width: 1360px;
    --prose-measure: 66ch;


    /* Typography Contrast Safe Colors */
    --text-dim-contrast: #E6D5C8;
    --accent-gold-contrast: #F0C47F;


    /* Geometry & Shape: Strict Zero Radius for Swiss Grid */
    --radius-none: 0px;
    --radius-subtle: 0px;


    /* Shadows (Tonal Oxblood Falloff) */
    --shadow-sm: 0 2px 6px rgba(35, 11, 13, 0.45);
    --shadow-md: 0 8px 24px rgba(35, 11, 13, 0.55);
    --shadow-lg: 0 16px 48px rgba(35, 11, 13, 0.70);


    /* Motion Tokens (Durations & Easing) */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
    --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-base: 240ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}


@keyframes meshDrift {
    0% {
        --mesh-pos-x1: 15%;
        --mesh-pos-y1: 25%;
        --mesh-pos-x2: 85%;
        --mesh-pos-y2: 75%;
        --mesh-pos-x3: 50%;
        --mesh-pos-y3: 50%;
        --mesh-angle: 38deg;
    }
    25% {
        --mesh-pos-x1: 28%;
        --mesh-pos-y1: 18%;
        --mesh-pos-x2: 72%;
        --mesh-pos-y2: 82%;
        --mesh-pos-x3: 45%;
        --mesh-pos-y3: 58%;
        --mesh-angle: 85deg;
    }
    50% {
        --mesh-pos-x1: 22%;
        --mesh-pos-y1: 36%;
        --mesh-pos-x2: 78%;
        --mesh-pos-y2: 64%;
        --mesh-pos-x3: 55%;
        --mesh-pos-y3: 42%;
        --mesh-angle: 155deg;
    }
    75% {
        --mesh-pos-x1: 12%;
        --mesh-pos-y1: 30%;
        --mesh-pos-x2: 88%;
        --mesh-pos-y2: 70%;
        --mesh-pos-x3: 48%;
        --mesh-pos-y3: 52%;
        --mesh-angle: 230deg;
    }
    100% {
        --mesh-pos-x1: 15%;
        --mesh-pos-y1: 25%;
        --mesh-pos-x2: 85%;
        --mesh-pos-y2: 75%;
        --mesh-pos-x3: 50%;
        --mesh-pos-y3: 50%;
        --mesh-angle: 398deg;
    }
}


*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border-radius: 0; /* Swiss international grid: strictly zero radius */
}


html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-mobile-height) + 16px);
    background-color: var(--bg-ground);
    color: var(--text-cream);
    min-height: 100%;
}


body {
    min-height: 100vh;
    background-color: var(--bg-ground);
    color: var(--text-cream);
    font-family: var(--mizi-239);
    font-size: var(--mizi-090);
    line-height: var(--lh-body);
    letter-spacing: var(--tracking-normal);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}


input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
    border-radius: 0;
}


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


svg {
    flex-shrink: 0;
}


h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--mizi-9d5);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-cream-bright);
    text-wrap: balance;
    overflow-wrap: break-word;
    hyphens: manual;
}


h1 {

    font-size: var(--mizi-32b);
    margin-bottom: var(--space-s);
}


h2 {
    font-size: var(--mizi-554);
    margin-bottom: var(--space-s);
}


h3 {
    font-size: var(--mizi-6d1);
    margin-bottom: var(--space-xs);
}


h4 {
    font-size: var(--mizi-0e9);
    margin-bottom: var(--space-xs);
}


h5 {
    font-size: var(--mizi-cb0);
    margin-bottom: var(--space-2xs);
}


h6 {
    font-size: var(--mizi-090);
    font-weight: 500;
    margin-bottom: var(--space-2xs);
}


p {
    font-family: var(--mizi-239);
    font-size: var(--mizi-090);
    line-height: var(--lh-body);
    color: var(--text-cream);
    max-width: var(--prose-measure);
    margin-bottom: var(--space-m);
}


p.lead {
    font-size: var(--mizi-cb0);
    line-height: var(--lh-relaxed);
    color: var(--text-cream-bright);
}


p.meta,
.meta-text {
    font-family: var(--mizi-f36);
    font-size: var(--step--1);
    line-height: var(--lh-tight);
    color: var(--text-muted);
    letter-spacing: var(--tracking-mono);
}


a {
    color: var(--text-cream);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}


a:hover {
    color: var(--accent-gold);
    text-decoration-color: var(--accent-gold);
}


a:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 3px;
}


/* Lists */
ul,
ol {
    margin-bottom: var(--space-m);
    padding-left: var(--space-l);
    max-width: var(--prose-measure);
}


li {
    font-family: var(--mizi-239);
    font-size: var(--mizi-090);
    line-height: var(--lh-body);
    margin-bottom: var(--space-2xs);
    color: var(--text-cream);
}


/* Blockquotes */
blockquote {
    margin: var(--space-l) 0;
    padding: var(--space-m) var(--space-l);
    border-left: 2px solid var(--accent-gold);
    background-color: var(--bg-surface);
    font-style: italic;
    color: var(--text-cream-bright);
}


blockquote cite {
    display: block;
    font-style: normal;
    font-family: var(--mizi-f36);
    font-size: var(--step--1);
    color: var(--accent-gold);
    margin-top: var(--space-xs);
}


/* Code & Preformatted */
code,
kbd,
pre {
    font-family: var(--mizi-f36);
    font-size: var(--step--1);
    color: var(--accent-gold);
}


pre {
    padding: var(--space-m);
    background-color: var(--bg-ground-deep);
    border: 1px solid var(--line-grid);
    overflow-x: auto;
    margin-bottom: var(--space-m);
}


/* Horizontal Rule */
hr {
    border: 0;
    height: 1px;
    background-color: var(--line-grid);
    margin: var(--space-xl) 0;
}


.site-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}


.main-column {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: var(--sidebar-width);
    background-color: var(--bg-ground);
    display: flex;
    flex-direction: column;
}


@media (min-width: 1440px) {
    :root {
        --sidebar-width: var(--sidebar-width-wide);
    }
}


@media (max-width: 1024px) {
    .site-wrapper {
        display: block;
    }


    .main-column {
        margin-left: 0;
        padding-top: var(--header-mobile-height);
    }


    .page-panel-hero {
        padding-top: calc(var(--header-mobile-height) + 1.5rem) !important;
    }
}


.swiss-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    border-top: 1px solid var(--line-grid);
    border-left: 1px solid var(--line-grid);
}


.swiss-cell {
    border-right: 1px solid var(--line-grid);
    border-bottom: 1px solid var(--line-grid);
    padding: var(--space-m);
    min-width: 0;
}


.swiss-cell-pad-l {
    padding: var(--space-xl);
}


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


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


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


    .swiss-cell {
        padding: var(--space-s);
    }
}


.gradient-mesh {
    position: relative;
    background-color: var(--bg-ground);
    background-image:
        radial-gradient(
            circle at var(--mesh-pos-x1) var(--mesh-pos-y1),
            rgba(98, 38, 43, 0.75) 0%,
            rgba(74, 31, 34, 0.35) 45%,
            transparent 70%
        ),
        radial-gradient(
            circle at var(--mesh-pos-x2) var(--mesh-pos-y2),
            rgba(112, 44, 50, 0.60) 0%,
            rgba(54, 20, 23, 0.40) 50%,
            transparent 75%
        ),
        conic-gradient(
            from var(--mesh-angle) at var(--mesh-pos-x3) var(--mesh-pos-y3),
            #4A1F22 0deg,
            #5A2226 90deg,
            #361417 180deg,
            #4A1F22 270deg,
            #5A2226 360deg
        );
    background-repeat: no-repeat;
    background-size: cover;
    animation: meshDrift 24s ease-in-out infinite alternate;
}


.gradient-mesh-subtle {
    position: relative;
    background-color: var(--bg-ground);
    background-image:
        radial-gradient(
            circle at var(--mesh-pos-x1) var(--mesh-pos-y1),
            rgba(88, 37, 40, 0.55) 0%,
            transparent 60%
        ),
        radial-gradient(
            circle at var(--mesh-pos-x2) var(--mesh-pos-y2),
            rgba(62, 24, 27, 0.70) 0%,
            transparent 65%
        );
    animation: meshDrift 30s ease-in-out infinite alternate;
}


.sr-only {
    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;
}


@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;
    }


    .gradient-mesh,
    .gradient-mesh-subtle {
        animation: none !important;
    }
}
