/* ==========================================================================
   Intracept — shared marketing + dashboard styles
   Owned by session A. Do not inline these tokens elsewhere; use vars.
   ========================================================================== */

/* ---------- @font-face (self-hosted, Latin subset) ---------- */
@font-face {
    font-family: 'TeX Gyre Heros';
    src: url('fonts/tex-gyre-heros-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'TeX Gyre Heros';
    src: url('fonts/tex-gyre-heros-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Chakra Petch';
    src: url('fonts/chakra-petch-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Chakra Petch';
    src: url('fonts/chakra-petch-medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Chakra Petch';
    src: url('fonts/chakra-petch-semibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Chakra Petch';
    src: url('fonts/chakra-petch-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
    /* Surfaces */
    --bg: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1e1e1e;

    /* Borders */
    --border: #252525;
    --border-strong: #333;

    /* Text */
    --text: #f0f0f0;
    --text-secondary: #a0a0a0;

    /* Brand + status */
    --accent: #E8451A;
    --accent-hover: #f5612e;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Layout */
    --gutter: clamp(16px, 4vw, 24px);
    --section-pad-y: clamp(48px, 10vw, 80px);

    /* Dashboard back-compat aliases (see dashboard.css) */
    --bg-primary: var(--bg);
    --text-primary: var(--text);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'TeX Gyre Heros', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Base typography ---------- */
h1, h2, h3, h4, .logo, .logo-text {
    font-family: 'TeX Gyre Heros', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}
h1 { letter-spacing: -0.05em; }
h2 { letter-spacing: -0.02em; }

p { margin: 0; }

a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
    font-family: 'Chakra Petch', sans-serif;
}
a:hover { font-style: italic; }

code, pre, .mono {
    font-family: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}
code { font-size: 0.9em; }
pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
    line-height: 1.5;
}
pre code { font-size: inherit; background: none; padding: 0; border: none; }

/* ---------- Container + layout helpers ---------- */
.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 var(--gutter);
    width: 100%;
}

/* ---------- Header + nav ---------- */
header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.05em;
}
.logo:hover { font-style: normal; }
.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-icon svg { width: 26px; height: 26px; stroke: #ffffff; }

nav {
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-link {
    color: var(--text-secondary);
    font-size: 14px;
    font-family: 'Chakra Petch', sans-serif;
}
.nav-link:hover { color: var(--text); font-style: normal; }

.btn-login {
    background: transparent;
    color: var(--text) !important;
    padding: 8px 16px;
    border: 1px solid var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    font-family: 'Chakra Petch', sans-serif;
    border-radius: 4px;
    transition: border-color 0.15s, color 0.15s;
}
.btn-login:hover { border-color: var(--text); font-style: normal; }

/* ---------- Buttons ---------- */
.btn {
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Chakra Petch', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
    text-decoration: none;
    line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; font-style: normal; }

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--border); color: var(--text); font-style: normal; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text); font-style: normal; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Main + footer ---------- */
main { flex: 1; }

footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
}
footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ---------- Accessibility globals ---------- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}
button:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline-offset: 3px;
}

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

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--accent);
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 9999;
    transition: top 0.2s;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus {
    top: 16px;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ---------- Utilities ---------- */
.eyebrow {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-wrap table { min-width: 520px; }

/* ---------- Global responsive helpers ---------- */
img, svg, video {
    max-width: 100%;
    height: auto;
}
.mono, code, pre {
    overflow-wrap: anywhere;
}
pre {
    -webkit-overflow-scrolling: touch;
}

/* ---------- Breakpoint: tablet/phone ---------- */
@media (max-width: 640px) {
    input, select, textarea { font-size: 16px; }
    nav { gap: clamp(12px, 3vw, 20px); }
    .nav-link { font-size: 13px; }
    .btn-login { padding: 8px 12px; font-size: 13px; }
    pre { font-size: 12px; padding: 14px; }
    footer .container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ---------- Breakpoint: small phone ---------- */
@media (max-width: 480px) {
    .nav-link.secondary { display: none; }
}

/* ---------- 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;
    }
}
