/* ===========================================
   CDTSC Theme - Base Styles
   IEEE C/DTSC — Professional / Academic
   Optimized v2 — Premium Design System
   =========================================== */

/* ---- Design Tokens ---- */
:root {
    /* Brand — Deep Blue */
    --color-primary: #0a4a8a;
    --color-primary-hover: #083b6e;
    --color-primary-light: #1068b8;
    --color-primary-dark: #06284a;
    --color-primary-50: rgba(10, 74, 138, 0.05);
    --color-primary-100: rgba(10, 74, 138, 0.10);
    --color-primary-200: rgba(10, 74, 138, 0.18);
    --color-primary-300: rgba(10, 74, 138, 0.35);

    /* Accent — Teal/Cyan */
    --color-accent: #0ea5e9;
    --color-accent-hover: #0284c7;
    --color-accent-50: rgba(14, 165, 233, 0.08);
    --color-accent-100: rgba(14, 165, 233, 0.15);

    /* Neutral */
    --color-white: #ffffff;
    --color-black: #0f172a;
    --color-gray-50: #f8fafc;
    --color-gray-75: #f3f6f9;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-400: #94a3b8;
    --color-gray-500: #64748b;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1e293b;
    --color-gray-900: #0f172a;

    /* Semantic */
    --color-success: #059669;
    --color-success-50: rgba(5, 150, 105, 0.08);
    --color-warning: #d97706;
    --color-warning-50: rgba(217, 119, 6, 0.08);
    --color-danger: #dc2626;
    --color-info: #2563eb;

    /* Stage badges — WCAG AA compliant on white bg */
    --badge-par: #4f46e5;
    --badge-wg: #7c3aed;
    --badge-draft: #b45309;
    --badge-comment: #1d4ed8;
    --badge-ballot: #b91c1c;
    --badge-published: #047857;
    --badge-suspended: #64748b;
    --badge-withdrawn: #475569;

    /* Typography */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;

    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    --text-5xl: 3rem;       /* 48px */

    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;

    /* Spacing (4px base scale) */
    --space-1: 0.25rem;   /*  4px */
    --space-2: 0.5rem;    /*  8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-14: 3.5rem;   /* 56px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-full: 9999px;

    /* Shadows — Refined elevation system */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 4px 14px rgba(10, 74, 138, 0.25);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Keyframes ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(10, 74, 138, 0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(10, 74, 138, 0); }
    100% { box-shadow: 0 0 0 0 rgba(10, 74, 138, 0); }
}

/* Scroll reveal (JS-driven) */
.cdtsc-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.cdtsc-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.cdtsc-reveal-delay-1 { transition-delay: 0.08s; }
.cdtsc-reveal-delay-2 { transition-delay: 0.16s; }
.cdtsc-reveal-delay-3 { transition-delay: 0.24s; }
.cdtsc-reveal-delay-4 { transition-delay: 0.32s; }

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-gray-800);
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-gray-900);
    font-weight: var(--fw-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { color: var(--color-gray-600); line-height: var(--leading-relaxed); margin-bottom: var(--space-4); }

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-primary-hover); }
a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

ul, ol { padding-left: var(--space-6); margin-bottom: var(--space-4); }
li { margin-bottom: var(--space-1); }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-6); }
th, td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--color-gray-200); }
th { font-weight: var(--fw-semibold); background: var(--color-gray-50); color: var(--color-gray-500); font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Forms ---- */
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="tel"], textarea, select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-gray-800);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-100);
}

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