/* skin (SkinEngine) */
:root {
  /* type scale */
  --t-step--1: 0.875rem;
  --t-step-0: 1rem;
  --t-step-1: clamp(1.075rem, calc(1.0167rem + 0.2917vw), 1.25rem);
  --t-step-2: clamp(1.3438rem, calc(1.2708rem + 0.3646vw), 1.5625rem);
  --t-step-3: clamp(1.6797rem, calc(1.5885rem + 0.4557vw), 1.9531rem);
  --t-step-4: clamp(2.0996rem, calc(1.9857rem + 0.5697vw), 2.4414rem);
  --t-step-5: clamp(2.6245rem, calc(2.4821rem + 0.7121vw), 3.0518rem);
  --t-line-tight: 1.1;
  --t-line-normal: 1.5;
  --t-line-relaxed: 1.7;
  /* spacing */
  --t-space-3xs: 0.3125rem;
  --t-space-2xs: 0.625rem;
  --t-space-xs: 0.9375rem;
  --t-space-sm: 1.25rem;
  --t-space-md: 1.875rem;
  --t-space-lg: 2.5rem;
  --t-space-xl: 3.75rem;
  --t-space-2xl: 5rem;
  --t-space-3xl: 7.5rem;
  --t-space-section: 10rem;
  /* radius */
  --t-radius-xs: 8px;
  --t-radius-sm: 12px;
  --t-radius-md: 16px;
  --t-radius-lg: 24px;
  --t-radius-pill: 9999px;
  --t-radius-button: 16px;
  /* elevation */
  --t-shadow-xs: 0 1px 2px var(--t-shadow);
  --t-shadow-sm: 0 2px 6px var(--t-shadow);
  --t-shadow-md: 0 8px 24px var(--t-shadow);
  --t-shadow-lg: 0 22px 55px var(--t-shadow-hover);
  /* motion */
  --t-motion-fast: 150ms;
  --t-motion-base: 260ms;
  --t-motion-slow: 460ms;
  --t-motion-distance: 28px;
  --t-motion-stagger: 90ms;
  --t-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* texture */
  --t-texture-bg: radial-gradient(120% 80% at 50% -10%, var(--t-surface-alt), transparent 60%);
  --t-texture-opacity: 1;
  --t-texture-size: cover;
  --t-texture-repeat: no-repeat;
  --t-texture-position: center top;
  /* imagery */
  --t-image-filter: saturate(1.06) sepia(0.08);
  /* fonts */
  --t-font-heading: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --t-font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --t-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* fixed */
  --t-focus-ring: var(--t-primary);
  --t-focus-width: 3px;
  --t-container-pad: clamp(1rem, 4vw, 2rem);
}
:root {
  --t-on-primary: #ffffff;
  --t-on-secondary: #ffffff;
  --t-on-accent: #ffffff;
  --t-accent-text: #18181b;
  /* text/scrim over media (constant; scrim guarantees AA) */
  --t-on-media: #ffffff;
  --t-on-media-dim: rgba(255, 255, 255, 0.82);
  --t-scrim: rgba(16, 18, 24, 0.55);
  --t-scrim-strong: rgba(16, 18, 24, 0.72);
}
[data-theme="dark"] {
  --t-on-primary: #ffffff;
  --t-on-secondary: #ffffff;
  --t-on-accent: #ffffff;
  --t-accent-text: #7c7c7d;
}

/* base-core */
/* ===========================================================================
   base-core.css — the FIXED reset + global primitives every compiled theme
   ships. The compiler prepends the resolved skin variables (SkinEngine) ABOVE
   this file, so everything here consumes --t-* tokens only. Hand-made once.
   =========================================================================== */

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

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    tab-size: 4;
}

body {
    min-block-size: 100vh;
    font-family: var(--t-font-body);
    font-size: var(--t-step-0);
    line-height: var(--t-line-normal);
    color: var(--t-text);
    background: var(--t-surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
}

/* Discreet page texture (personality) — never over content, never affects
   contrast. Uses --t-texture-* which default to none/0. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--t-texture-bg, none);
    opacity: var(--t-texture-opacity, 0);
    background-size: var(--t-texture-size, 140px 140px);
    background-repeat: var(--t-texture-repeat, repeat);
    background-position: var(--t-texture-position, 0 0);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--t-font-heading);
    line-height: var(--t-line-tight);
    font-weight: 600;
    text-wrap: balance;
}

p, li {
    text-wrap: pretty;
}

a {
    color: inherit;
    text-decoration: none;
}

img, picture, video, canvas, svg {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
}

ul[role="list"], ol[role="list"] {
    list-style: none;
    padding: 0;
}

:where(h1, h2, h3, h4, h5, h6) {
    overflow-wrap: break-word;
}

::selection {
    background: var(--t-primary);
    color: var(--t-on-primary);
}

/* Global focus ring — the single source of :focus-visible for every theme.
   Sections rely on this; they never restyle focus except deliberate overrides. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: var(--t-focus-width) solid var(--t-focus-ring);
    outline-offset: 2px;
    border-radius: var(--t-radius-xs);
}

/* Layout container */
.container {
    inline-size: 100%;
    max-inline-size: var(--t-max-width, 1200px);
    margin-inline: auto;
    padding-inline: var(--t-container-pad, clamp(1rem, 4vw, 2rem));
}

.container--narrow {
    max-inline-size: var(--t-content-width, 720px);
}

.container--wide {
    max-inline-size: var(--t-wide-width, 1024px);
}

/* Accessibility helpers */
.visually-hidden {
    position: absolute !important;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    inset-block-start: -100%;
    inset-inline-start: var(--t-space-sm, 1rem);
    z-index: 100;
    padding: var(--t-space-2xs, 0.5rem) var(--t-space-sm, 1rem);
    color: var(--t-on-primary);
    background: var(--t-primary);
    border-radius: var(--t-radius-sm, 6px);
    box-shadow: var(--t-shadow-md);
}

.skip-link:focus {
    inset-block-start: var(--t-space-sm, 1rem);
}

.site-main {
    display: block;
}

/* Signature layer scope (TC.4 / D3): the optional AI signature.css scopes every
   rule under .t-signature (a class on <body>). This inert anchor keeps the class
   DEFINED even when no signature ships, so it is never an orphan and always safe;
   the custom property has zero visual effect. */
.t-signature {
    --t-signature-scope: 1;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

