/* ==========================================================================
 * style.css — Editorial dark theme for an academic knowledge base.
 * Palette is warm-dark (#0f1115) with a single muted scholarly blue accent.
 * Headings use a serif for editorial feel; body uses a clean sans.
 * ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Design tokens ------------------------------------------------------- */
:root {
    --bg:            #000000;
    --surface:       #0a0a0a;
    --surface-2:     #141414;
    --border:        #1f1f1f;
    --border-strong: #2e2e2e;

    --text:          #e6e6e6;
    --text-muted:    #a0a6b0;
    --text-subtle:   #6b7180;

    --accent:        #7aa7ff;
    --accent-hover:  #a5c4ff;
    --accent-quiet:  #3f5a8a;

    --warn:          #d4a85a;
    --success:       #7db68a;

    --code-bg:       #0b0d11;
    --code-fg:       #e6e6e6;

    --content-width: 960px;

    --font-serif: 'Newsreader', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
    --font-sans:  'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
}

/* --- Base ---------------------------------------------------------------- */
* { box-sizing: border-box; }

html { background: var(--bg); }

body {
    max-width: none;
    margin: 0;
    padding: 0 50px 60px;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 720px) {
    body { padding: 0 20px 48px; }
}

/* --- Typography ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 1.8em 0 0.6em;
}

h1 { font-size: 2.2rem; font-weight: 600; margin-top: 0.4em; }
h2 { font-size: 1.55rem; font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 0.35em; }
h3 { font-size: 1.2rem; font-weight: 600; color: var(--text); }
h4 { font-size: 1.02rem; font-weight: 600; color: var(--text-muted); text-transform: none; }

p {
    color: var(--text);
    margin: 0 0 1.1em;
}

ul, ol {
    color: var(--text);
    margin: 0 0 1.2em 0;
    padding-left: 1.4em;
}

li {
    margin-bottom: 0.45em;
    color: var(--text);
}

strong {
    color: var(--text);
    font-weight: 600;
}

em { color: var(--text-muted); font-style: italic; }

blockquote {
    margin: 1.5em 0;
    padding: 0.6em 1.2em;
    border-left: 3px solid var(--accent-quiet);
    background: var(--surface);
    color: var(--text-muted);
    font-style: italic;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}

/* --- Links --------------------------------------------------------------- */
a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
    background: transparent;
}

/* --- Code ---------------------------------------------------------------- */
code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--code-bg);
    color: var(--code-fg);
    padding: 0.12em 0.4em;
    border-radius: 3px;
    border: 1px solid var(--border);
}

pre {
    background: var(--code-bg);
    color: var(--code-fg);
    padding: 1em 1.2em;
    border-radius: 6px;
    border: 1px solid var(--border);
    overflow-x: auto;
    line-height: 1.55;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    margin: 1.2em 0;
}

pre code {
    background: transparent;
    border: 0;
    padding: 0;
}

/* Prism token overrides tuned for editorial palette */
.keyword  { color: #c9a57b; }
.string   { color: #b2d29a; }
.function { color: #7aa7ff; }
.comment  { color: #6b7180; font-style: italic; }

/* --- Tables -------------------------------------------------------------- */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.4em 0;
    font-size: 0.95rem;
}

th, td {
    text-align: left;
    padding: 10px 14px;
    border: 1px solid var(--border);
    vertical-align: top;
}

th {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.01em;
}

td { background: var(--surface); color: var(--text); }

tr:hover td { background: var(--surface-2); }

/* Legacy class aliases used across content pages */
.table,
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    background: var(--surface);
}
.table th, .comparison-table th {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 14px;
}
.table td, .comparison-table td {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 14px;
}
.table tr:hover td,
.comparison-table tr:hover td { background: var(--surface-2); }

/* --- Profile / hero blocks (homepage) ------------------------------------ */
.profile-photo {
    border-radius: 4px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.hero {
    margin: 2.4em 0 2.2em;
    padding: 0;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 2.6rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 0 0 0.15em;
    color: var(--text);
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--text-muted);
    margin: 0 0 1.4em;
    font-weight: 400;
}

.hero-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 18px;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    padding: 0;
}

.hero-meta dt {
    font-weight: 600;
    color: var(--text);
    font-variant: small-caps;
    letter-spacing: 0.04em;
    font-size: 0.85rem;
    padding-top: 3px;
}

.hero-meta dd {
    margin: 0;
    color: var(--text);
}

/* --- Document Intelligence banner (homepage) -----------------------------
   Size and position (max-width, margin) are set inline in index.html so
   they can be tweaked without touching CSS or running cache-bust.
   ------------------------------------------------------------------------ */
.doc-intel-banner {
    display: block;
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.doc-intel-banner:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(122, 167, 255, 0.18);
    transform: translateY(-1px);
}

.doc-intel-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* --- Search input (kept functional, restyled) ---------------------------- */
.search-box { margin-bottom: 24px; }

input[type="text"] {
    width: 100%;
    max-width: 720px;
    height: 44px;
    padding: 8px 14px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(122, 167, 255, 0.15);
}

input[type="submit"] {
    height: 44px;
    padding: 0 22px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    font-weight: 500;
    background: var(--accent-quiet);
    color: var(--text);
    border: 1px solid var(--accent-quiet);
    border-radius: 4px;
    cursor: pointer;
    margin-left: 6px;
}

input[type="submit"]:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

/* --- Footer -------------------------------------------------------------- */
.footer {
    text-align: center;
    margin-top: 4em;
    padding: 1.4em 0 0.6em;
    border-top: 1px solid var(--border);
    color: var(--text-subtle);
    font-size: 0.82rem;
    background: transparent;
    font-weight: 400;
}

.footer p { margin: 3px 0; color: var(--text-subtle); }

/* --- Q&A blocks (used on some pages) ------------------------------------- */
.question { font-weight: 600; color: var(--accent); }
.answer   { margin-bottom: 1.2em; color: var(--text); }

/* --- Tagline / emphasis styles preserved from prior design --------------- */
.tagline {
    color: var(--warn);
    font-size: 1.15rem;
    font-family: var(--font-serif);
    font-style: italic;
}

.expertise-area {
    margin-bottom: 1.8em;
    padding: 1.1em 1.3em;
    background: var(--surface);
    border-left: 3px solid var(--accent-quiet);
    border-radius: 3px;
}

.expertise-area h3 { margin-top: 0; }
.expertise-area p  { margin-bottom: 0.8em; line-height: 1.7; }

.experience-block {
    margin-bottom: 1.5em;
    padding: 1.1em 1.3em;
    background: var(--surface);
    border-left: 3px solid var(--warn);
    border-radius: 3px;
}

.experience-block h3 { margin-top: 0; margin-bottom: 0.5em; }

.tech-category {
    margin-bottom: 1.2em;
    padding: 0.8em 1.1em;
    background: var(--surface);
    border-left: 3px solid var(--success);
    border-radius: 3px;
}

.tech-category h4 { margin-top: 0; margin-bottom: 0.45em; }
.tech-category p  { margin: 0; color: var(--text); }

.education-item {
    margin-bottom: 1.6em;
    padding: 1.1em 1.3em;
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: 3px;
}

.education-item h3 { margin-top: 0; margin-bottom: 0.3em; color: var(--text); }
.education-item p  { margin: 0.3em 0; line-height: 1.6; }
.education-item strong { color: var(--warn); font-weight: 600; }

/* --- Counter / video helpers kept intact --------------------------------- */
.counter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 240px;
    margin-top: 0;
    background: var(--bg);
    color: var(--text);
}

.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.video-item { display: flex; flex-direction: column; }

.video-item img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
    display: block;
}

.video-item a {
    text-decoration: none;
    color: var(--accent);
    font-weight: 500;
}

.video-item a:hover { border-bottom-color: var(--accent-hover); }

.video-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.video-media img,
.video-media iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

.video-description {
    margin: 1.2em 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Images -------------------------------------------------------------- */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

img.raw { border-radius: 0; }

/* --- Utility ------------------------------------------------------------- */
.green-text { color: var(--success); }
