/*
 * Quark 2 — User Customizations
 * Architecture: Clean, deterministic cascade (Zero !important dependency)
 */

/* ==========================================
   1. Base & Global Typography
   ========================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111111;
    background-color: #ffffff;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    line-height: 1.6;
}

/* Scope standard h1 transforms strictly to body markdown content, excluding structured components */
#body-wrapper h1:not(.brand-title),
h1:not(.brand-title),
.h1:not(.brand-title) {
    font-weight: 400;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-stretch: condensed;
    letter-spacing: -0.01em;
    line-height: 1.15;
    transform: scaleY(0.92);
    transform-origin: left center;
    -webkit-font-smoothing: antialiased;
}

h3 {
    color: #555555;
    font-weight: 400;
    margin-top: 0;
}

hr {
    border: 0;
    border-top: 1px solid #e5e5e5;
    margin: 2rem 0;
}

ul {
    padding-left: 1.2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ==========================================
   2. Header & Navigation Component
   ========================================== */
.meta-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    font-family: var(--font-mono, monospace);
    color: #666666;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 0.5rem;
}

.meta-nav a {
    color: #111111;
    text-decoration: none;
    font-weight: 600;
}

.navbar {
    min-height: 4.5rem;
    align-items: center;
}

/* Target icons inside the top-left navbar brand link */
.navbar-brand i,
.navbar-brand svg,
.navbar-brand .fa,
.navbar-brand .fa-brands,
.navbar-brand .fa-solid {
  font-size: 1.5rem !important; /* Adjust size as needed (default is usually ~1rem) */
  vertical-align: middle;
  margin-right: 0.35rem;
}

.navbar-brand img {
    max-height: 3.3rem !important;
    height: auto;
    width: auto;
}

.navbar-section.desktop-menu {
    align-items: center;
}

.navbar-section.desktop-menu .dropmenu a,
.navbar-section .navigation a {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    font-weight: 500;
}

/* ==========================================
   3. Hero Frame Component
   ========================================== */
.hero-frame {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.75rem 1.5rem;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.hero-frame .brand-identity {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.hero-frame .site-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
}

.hero-frame .brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-frame .brand-title {
    margin: 0;
    padding: 0;
    font-family: var(--font-mono, monospace);
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.0;
    color: #111111;
    transform: none;
}

.hero-frame .brand-tagline {
    margin: 0.35rem 0 0 0;
    padding: 0;
    font-family: var(--font-mono, monospace);
    font-size: 1.05rem;
    color: #4a5568;
    letter-spacing: 0.01em;
}

.hero-frame .terminal-prompt {
    color: #2f855a;
    font-weight: 700;
}

.hero-frame .cursor {
    display: inline-block;
    margin-left: 2px;
    color: #2f855a;
    font-weight: 700;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-frame .hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: 0.25rem;
}

.hero-frame .badge {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    background-color: #edf2f7;
    color: #2d3748;
    border: 1px solid #cbd5e0;
}

.hero-frame .badge-accent {
    border-color: #9ae6b4;
    color: #22543d;
    background-color: #f0fff4;
}

/* ==========================================
   4. Tables & Data Layouts
   ========================================== */
table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
    font-size: 0.85rem;
    margin: 1.5rem 0;
}

table th,
table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border-color, #e1e1e1);
    text-align: left;
    vertical-align: middle;
}

table th {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-color, #222);
}

/* Prevent text wrapping on initial structural columns */
table td:nth-child(1),
table td:nth-child(2),
table td:nth-child(3) {
    white-space: nowrap;
}

/* Relative column proportions */
table th:nth-child(1), table td:nth-child(1) { width: 18%; }
table th:nth-child(2), table td:nth-child(2) { width: 22%; }
table th:nth-child(3), table td:nth-child(3) { width: 22%; }
table th:nth-child(4), table td:nth-child(4) { width: 38%; }

table td a,
table td a:link,
table td a:visited,
table td a:hover,
table td a:active {
    color: #0066ff;
}

/* ==========================================
   5. System & Layout Structure Overrides
   ========================================== */
#page-wrapper,
#body-wrapper {
    display: block;
    min-height: 0;
    height: auto;
}

.section.bg-gray,
#header-meta,
.hero {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.section,
#body-wrapper .section {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

#body-wrapper .container {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

#body-wrapper .section,
.section.main-content,
.main-content {
    padding-bottom: 0;
    margin-bottom: 0;
}

.main-content > *:last-child,
#body-wrapper .container > *:last-child,
#body-wrapper p:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
}

.sys-provenance {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    color: #888888;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 0.4rem;
}

.sys-provenance code {
    background: transparent;
    color: #aaaaaa;
    padding: 0;
}

.about-footer-note {
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
    font-size: 0.85rem;
    color: #777777;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e1e1e1);
}

/* ==========================================
   6. Footer Component
   ========================================== */
.site-footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eeeeee;
    font-size: 0.85rem;
    color: #666666;
    font-family: var(--font-mono, monospace);
}

#footer,
footer.section,
.section#footer {
    margin-top: 0;
    padding-top: 1rem;
    padding-bottom: 1.5rem;
    clear: both;
}

#footer p,
.footer-status p {
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
}

/* ==========================================
   7. Responsive Adaptations
   ========================================== */
@media (max-width: 640px) {
    .hero-frame .brand-identity {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
