/* LIBDYN Base Styles (Physics & Truth) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');

:root {
    /* Color Tokens */
    --bg-core: #0b0d10;
    --bg-nav: var(--bg-core);
    --text-primary: #F6F7F9;
    --text-secondary: rgba(246, 247, 249, 0.90);
    --text-muted: rgba(246, 247, 249, 0.30);
    --accent: #00E5C8;

    /* Typography Tokens */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    /* Semantic Rhythm (Mobile First) */
    --rhythm: 0.75rem;

    /* L-LINE (Mobile First) */
    --l-line: 20px;
    --grid-l: var(--l-line);

    /* Headline System (Context + Assertion) */
    --headline-context-size: 0.85rem;
    --headline-context-color: rgba(255, 255, 255, 0.45);
    --headline-assertion-size: clamp(2.8rem, 4vw, 3.6rem);
    --headline-assertion-weight: 400;
    --headline-assertion-color: #ffffff;

    /* Semantic Scale (LOCKED) */
    --h1: clamp(2.2rem, 6vw, 3.2rem);
    --h2: clamp(1.4rem, 4.5vw, 1.9rem);
    --h3: clamp(1.1rem, 3.5vw, 1.3rem);
    --body: clamp(0.95rem, 3.2vw, 1.05rem);
    --small: 0.85rem;

    --lh-tight: 1.15;
    --lh-normal: 1.45;
    --lh-loose: 1.65;

    /* Layout Tokens */
    --max-width: 1200px;
    --page-padding: 32px;
    --spacing-unit: 8px;
    --spacing-section: 120px;
    --nav-h: 72px;

    /* Z-Index Tokens */
    --z-nav: 1000;
    --z-overlay: 900;
}

/* Desktop Enhancements (Layer 2 & 3) */
@media (min-width: 768px) {
    :root {
        --rhythm: 0.9rem;
        --l-line: clamp(32px, 6vw, 96px);
    }
}

/* === RESET & NORMALIZATION === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === TYPOGRAPHY & PHYSICS OWNERSHIP === */
html {
    font-size: 16px;
    /* Base Assumption */
    background-color: var(--bg-core);
    color: var(--text-primary);
    font-family: var(--font-family);
    height: 100%;
    -webkit-font-smoothing: antialiased;
}

/* CLS Guard (Font Loading) */
html {
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size-adjust: 0.52;
    /* CLS Guard: Stabilize fallback font x-height */
}

html.fonts-loaded {
    opacity: 1;
}

body {
    min-height: 100%;
    line-height: 1.6;
    padding: 0;
    background-color: var(--bg-core);
    color: var(--text-primary);
    overflow-x: hidden;
    width: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    backface-visibility: hidden;
    /* Anti-Blink Rule 3 */
}

main {
    will-change: opacity;
    /* Anti-Blink Rule 3 */
}

/* Heading Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: normal;
    margin: 0;
    color: var(--text-primary);
}

h1 {
    font-size: var(--h1);
    line-height: var(--lh-tight);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--h2);
    line-height: var(--lh-tight);
    font-weight: 500;
    opacity: 0.78;
}

h3 {
    font-size: var(--h3);
    letter-spacing: normal;
    text-transform: none;
    font-weight: 400;
    opacity: 0.5;
}

p {
    font-size: var(--body);
    line-height: var(--lh-normal);
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: calc(var(--rhythm) * 1.5);
}

p+p {
    margin-top: calc(var(--rhythm) * 0.5);
}

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

/* === PAGE TITLE SYSTEM (Two-Line Structure) === */
.page-title .context {
    display: block;
    font-size: var(--headline-context-size);
    color: var(--headline-context-color);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.page-title .assertion {
    display: block;
    font-size: var(--headline-assertion-size);
    font-weight: var(--headline-assertion-weight);
    color: var(--headline-assertion-color);
    line-height: 1.05;
}

/* === INHERITANCE LOCKS === */
/* Structural wrappers must inherit physics, not define them */
section,
header,
footer,
main,
nav,
.hero,
.hero-content {
    font-family: inherit;
    color: inherit;
    background: transparent;
}

/* === FORM PHYSICS (Color & Typography) === */
form label {
    color: var(--text-secondary);
    opacity: 1;
    /* Defeat parent opacity inheritance */
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Inputs & Textareas (Physics) */
/* Inputs & Textareas (Physics) */
.field input,
.field textarea {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-size: 16px;
    /* iOS No-Zoom */
    min-height: 44px;
    /* Touch Target */
    outline: none;
    font-family: inherit;
    /* Safe Local Inheritance */
    border-radius: 0;
}

.field input:focus,
.field textarea:focus {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.02);
}

/* === FORM BUTTON PHYSICS (Formal Spec) === */
form button,
.form-action {
    /* Visibility Lock */
    color: var(--text-primary);
    /* #f2f2f2 */
    opacity: 1;
    /* Defeat parent opacity */
}

/* Base Button Styling (Visuals Only) */
form button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    /* Visible Border */

    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;

    cursor: pointer;
    /* Interaction */

    transition:
        background-color 220ms ease-out,
        color 220ms ease-out,
        opacity 180ms ease-out;
    will-change: opacity;
}

form button[disabled] {
    opacity: 0.82;
    cursor: wait;
}

form button:focus-visible {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7);
}

/* Link Active Underscore (Base Color) */
.site-nav a::after {
    background: currentColor;
}

/* Branding Vectors */
.libdyn-mark g,
.libdyn-mark path,
.libdyn-symbol path {
    vector-effect: non-scaling-stroke;
}

.libdyn-symbol {
    height: 32px;
    width: auto;
    margin-right: 16px;
    display: block;
}

/* === EXIT TEXT TERMINAL STATE === */
#exit-reflection,
.exit-text {
    border: none;
}

#exit-reflection::before,
#exit-reflection::after,
.exit-text::before,
.exit-text::after {
    content: none !important;
}

/* === EXIT TEXT SAFETY NET === */
/* Absolutely forbidden outside home */
body:not(.page-home) #exit-reflection,
body:not(.page-home) .exit-text {
    display: none !important;
}

/* === SIGNAL SYSTEM (Decoupled) === */
.signal-text {
    opacity: 0.7;
    max-width: 48ch;
}

.signal-text--static {
    pointer-events: none;
    /* Pure Layout */
    margin-bottom: 2rem;
    /* Spacing for static flow */
}

/* Note: .signal-text--trigger logic is handled in JS/Motion */

/* === VALIDATION UX (Intent-Gated) === */
color: #d1a1a1;
font-size: 0.85rem;
margin-top: 6px;
transition: none;
}

/* 1. Default: Neutral (Suppress browser red) */
input:invalid,
textarea:invalid {
    box-shadow: none;
    outline: none;
    border-color: rgba(255, 255, 255, 0.15);
    /* Match base border */
}

/* 2. Intent: Controlled Red (Only after submit attempt) */
.contact-form.submitted input:invalid,
.contact-form.submitted textarea:invalid {
    border-color: #b84a4a;
    /* Controlled Red */
}

/* === CONTENT BLINK (CSS Only) === */
body> :not(.site-header) {
    animation: contentBlink 90ms steps(1, end) 1;
}

@keyframes contentBlink {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
    body> :not(.site-header) {
        animation: none !important;
        opacity: 1;
    }
}

/* === REDUCED MOTION === */
@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;

        transition: none !important;
        animation: none !important;
    }
}

/* === COOKIE CONSENT BANNER === */
.cookie-consent {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    max-width: 420px;
    width: calc(100% - 32px);
}

.cookie-consent-inner {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 18px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.cookie-title {
    font-weight: 500;
    margin-bottom: 6px;
}

.cookie-text {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 12px;
}

.cookie-actions {
    display: flex;
    gap: 12px;
}

.cookie-actions button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);

    /* Allow width to grow for witty messages */
    width: auto;
    min-width: 140px;
    white-space: normal;
    /* Allow wrapping if absolutely needed */
}

.cookie-actions button:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

/* === SITE FOOTER === */
.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 48px 24px 32px;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle seperation */
    margin-top: 64px;
    /* Separation from content */
}

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
    opacity: 0.55;
}

.footer-legal a {
    text-decoration: none;
    color: inherit;
}

.footer-legal a:hover {
    opacity: 0.85;
}

.footer-service-index {
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
    opacity: 0.25;
    /* Very subtle */
    max-width: 640px;
    color: var(--text-secondary);
    pointer-events: none;
    /* Purely semantic/visual, unless links added later */
}

/* =========================
   Change Context (Quiet Reset)
   ========================= */
.change-context {
    background: none;
    border: none;
    font-size: 12px;
    opacity: 0.5;
    cursor: pointer;
    margin-top: 24px;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.change-context:hover {
    opacity: 0.8;
}