/* =====================================================================
   Academic Research Corner — Stylesheet
   Design tokens:
     Ink Navy   #16243E  (primary / headings / nav)
     Paper      #FAF8F4  (background)
     Brass      #B08D57  (accent — seals, links, CTAs secondary)
     Slate      #5B6472  (secondary text)
     Success    #2F7D5C
     Danger     #C0392B
     Border     #E4DFD3
   Type:
     Display/Heading: 'Poppins' (rounded geometric sans — friendly, modern)
     Body/UI: 'Poppins' (same family, lighter weights for legibility)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --ink: #16243E;
    --ink-soft: #2A3B5C;
    --paper: #FAF8F4;
    --paper-alt: #F1ECE1;
    --brass: #B08D57;
    --brass-dark: #8C6D3F;
    --slate: #5B6472;
    --success: #2F7D5C;
    --danger: #C0392B;
    --border: #E4DFD3;
    --white: #FFFFFF;

    --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 4px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 3px rgba(22, 36, 62, 0.08);
    --shadow-md: 0 4px 16px rgba(22, 36, 62, 0.12);
    --max-width: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1.25;
    margin: 0 0 0.5em;
}

p { margin: 0 0 1em; color: var(--slate); }

a { color: var(--brass-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Focus visibility — accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--brass-dark);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Seal / signature motif — used sparingly near trust-related content
   --------------------------------------------------------------------- */
.seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--brass);
    border-radius: 50%;
    color: var(--brass-dark);
    flex-shrink: 0;
    background: var(--paper);
}
.seal svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------------
   Header / Navigation
   --------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
}
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: var(--max-width);
    margin: 0 auto;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--ink);
}
.brand .seal { width: 36px; height: 36px; }
.brand .seal svg { width: 16px; height: 16px; }

.nav-actions { display: flex; gap: 10px; align-items: center; }
.nav-actions .user-pill {
    font-size: 0.85rem;
    color: var(--slate);
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--ink-soft); text-decoration: none; }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); text-decoration: none; }

.btn-brass { background: var(--brass); color: var(--white); }
.btn-brass:hover { background: var(--brass-dark); text-decoration: none; }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
    padding: 88px 24px 72px;
    border-bottom: 1px solid var(--border);
}
.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
}
.hero-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brass-dark);
    font-weight: 600;
    margin-bottom: 14px;
}
.hero h1 {
    font-size: clamp(2.1rem, 4vw, 3.1rem);
    margin-bottom: 18px;
}
.hero p.lead {
    font-size: 1.08rem;
    color: var(--slate);
    max-width: 540px;
    margin-bottom: 28px;
}
.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.hero-meta {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--slate);
}
.hero-meta strong { color: var(--ink); font-family: var(--font-display); font-size: 1.1rem; display: block; }

.hero-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.hero-panel h3 { font-size: 1.05rem; margin-bottom: 16px; }
.hero-panel ul { list-style: none; padding: 0; margin: 0; }
.hero-panel li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
    color: var(--ink-soft);
}
.hero-panel li:last-child { border-bottom: none; }
.hero-panel li .seal { width: 30px; height: 30px; }
.hero-panel li .seal svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------------
   Generic section
   --------------------------------------------------------------------- */
.section { padding: 72px 0; }
.section-alt { background: var(--paper-alt); }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head .hero-eyebrow { justify-content: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-head p { font-size: 1rem; }

/* ---------------------------------------------------------------------
   About
   --------------------------------------------------------------------- */
.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.about-item {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--white);
}
.about-item .seal { margin-bottom: 14px; }
.about-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.about-item p { font-size: 0.92rem; margin-bottom: 0; }

/* ---------------------------------------------------------------------
   Services
   --------------------------------------------------------------------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.service-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.service-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.service-card .seal { margin-bottom: 14px; }
.service-card h3 { font-size: 0.98rem; margin-bottom: 6px; }
.service-card p { font-size: 0.86rem; margin-bottom: 14px; }
.service-card .service-link { font-size: 0.84rem; font-weight: 600; color: var(--brass-dark); }

/* ---------------------------------------------------------------------
   Contact
   --------------------------------------------------------------------- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.contact-item {
    text-align: center;
    padding: 20px;
}
.contact-item .seal { margin: 0 auto 14px; }
.contact-item h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate); margin-bottom: 6px; font-family: var(--font-body); font-weight: 600; }
.contact-item p { font-size: 0.95rem; color: var(--ink); margin-bottom: 0; }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer {
    background: var(--ink);
    color: #C9D0DE;
    padding: 40px 0 24px;
    font-size: 0.85rem;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; align-items: center; }
.site-footer a { color: #C9D0DE; }
.footer-brand { font-family: var(--font-display); color: var(--white); font-size: 1.05rem; }

/* ---------------------------------------------------------------------
   Modals
   --------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 36, 62, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}
.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--white);
    border-radius: var(--radius-md);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-md);
}
.modal-box.modal-wide { max-width: 720px; }

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--slate);
    cursor: pointer;
    padding: 4px;
}
.modal-close:hover { color: var(--ink); }

.modal-box h2 { font-size: 1.4rem; margin-bottom: 4px; }
.modal-sub { font-size: 0.88rem; color: var(--slate); margin-bottom: 24px; }

/* Contact modal — icon + label/value rows */
.modal-contact-box { max-width: 480px; }
.modal-contact-header { margin-bottom: 22px; }
.modal-contact-header .hero-eyebrow { justify-content: flex-start; margin-bottom: 6px; }
.modal-contact-header .modal-sub { margin-bottom: 0; }

.contact-modal-list { display: flex; flex-direction: column; gap: 10px; }

.contact-modal-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--paper);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}
a.contact-modal-row:hover {
    background: var(--paper-alt);
    border-color: var(--brass);
    text-decoration: none;
}
.contact-modal-row-static { align-items: flex-start; }

.contact-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid var(--brass);
    background: var(--white);
    color: var(--brass-dark);
}
.contact-modal-icon svg { width: 18px; height: 18px; }
.contact-modal-row-static .contact-modal-icon { margin-top: 1px; }

.contact-modal-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.contact-modal-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate);
    font-weight: 600;
}
.contact-modal-value {
    font-size: 0.94rem;
    color: var(--ink);
    font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
}
.contact-modal-row-static .contact-modal-value { font-weight: 500; color: var(--ink-soft); }

.contact-modal-arrow {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--brass);
    font-size: 1rem;
    opacity: 0;
    transform: translateX(-2px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
a.contact-modal-row:hover .contact-modal-arrow { opacity: 1; transform: translateX(0); }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="date"], input[type="file"], select, textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.94rem;
    color: var(--ink);
    background: var(--white);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--brass);
    outline: none;
}
textarea { resize: vertical; min-height: 90px; }
small.help-text { display: block; font-size: 0.78rem; color: var(--slate); margin-top: 4px; }
.field-hint { display: block; font-size: 0.78rem; color: var(--slate); margin-top: 4px; }
.field-error { display: block; font-size: 0.8rem; color: var(--danger); margin-top: 4px; }
.input-error { border-color: var(--danger) !important; }

/* ---------------------------------------------------------------------
   Manual UPI/QR Payment modal
   --------------------------------------------------------------------- */
.payment-summary {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--paper-alt);
    padding: 14px 16px;
    margin-bottom: 18px;
}
.payment-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.9rem;
}
.payment-summary-row + .payment-summary-row { border-top: 1px solid var(--border); }
.payment-summary-row span { color: var(--slate); }
.payment-summary-row strong { color: var(--ink); text-align: right; }
.payment-summary-amount strong { font-size: 1.2rem; color: var(--brass-dark); }

.payment-qr-box {
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 22px;
    background: var(--white);
}
.payment-qr-img { width: 200px; height: 200px; object-fit: contain; margin: 0 auto 12px; display: block; }
.payment-qr-fallback { font-size: 0.85rem; color: var(--danger); margin-bottom: 10px; }
.payment-upi-id { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.payment-upi-id strong { color: var(--ink); letter-spacing: 0.02em; }

.form-message {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 18px;
}
.form-message.success { background: #E8F3EE; color: var(--success); }
.form-message.error { background: #FBEAE8; color: var(--danger); }

.form-switch {
    text-align: center;
    font-size: 0.88rem;
    color: var(--slate);
    margin-top: 16px;
}
.form-switch a { font-weight: 600; }

.password-rules {
    font-size: 0.78rem;
    color: var(--slate);
    margin-top: 6px;
    line-height: 1.5;
}

/* ---------------------------------------------------------------------
   Status pages (verify email / reset password)
   --------------------------------------------------------------------- */
.status-page-body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--paper-alt);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.status-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-md);
}
.status-card h1 { font-size: 1.4rem; margin-bottom: 12px; }
.status-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 18px;
}
.status-success { background: #E8F3EE; color: var(--success); }
.status-error { background: #FBEAE8; color: var(--danger); }
.reset-form { text-align: left; margin-top: 20px; }
.reset-form label { margin-top: 14px; }

/* ---------------------------------------------------------------------
   Loading spinner for async submits
   --------------------------------------------------------------------- */
.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: repeat(2, 1fr); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .hero { padding: 56px 20px 48px; }
    .nav-bar { flex-wrap: wrap; gap: 12px; }
    .nav-actions { width: 100%; justify-content: center; flex-wrap: wrap; }
    .about-grid { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .modal-box { padding: 22px; }
    .contact-modal-row { padding: 12px; gap: 12px; }
    .contact-modal-icon { width: 36px; height: 36px; }
    .contact-modal-icon svg { width: 16px; height: 16px; }
    .hero-meta { gap: 18px; }
}


.site-footer a {
    color: #00bfff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}
/* =====================================================================
   Branding — Logo, Nav Links, Mobile Toggle
   ===================================================================== */
.brand { display: flex; align-items: center; }
.brand-logo { height: 42px; width: auto; display: block; }
.footer-brand-wrap { display: flex; align-items: center; }
.footer-logo { height: 34px; width: auto; filter: brightness(0) invert(1); opacity: 0.92; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 0.9rem;
    font-weight: 600;
}
.nav-links a { color: var(--ink); }
.nav-links a:hover { color: var(--brass-dark); text-decoration: none; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px; height: 32px;
    background: none; border: none; cursor: pointer;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .nav-bar.nav-open .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--white);
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        gap: 14px;
        z-index: 40;
    }
    .nav-bar { position: relative; }
}

/* =====================================================================
   Featured Sample Projects + Projects Library — Cards
   ===================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.project-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.project-card:hover { border-color: var(--brass); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.project-icon { font-size: 1.8rem; line-height: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 100px;
    background: var(--paper-alt);
    color: var(--slate);
    white-space: nowrap;
}
.tag-category { background: #EAF1FB; color: #2A5FA5; }
.tag-level { background: #FBEFE0; color: var(--brass-dark); }

.project-title { font-family: var(--font-display); font-size: 1.08rem; margin-bottom: 6px; line-height: 1.35; }
.project-branch { font-size: 0.82rem; color: var(--slate); margin-bottom: 8px; }
.project-desc { font-size: 0.88rem; color: var(--slate); margin-bottom: 10px; flex-grow: 1; }
.project-aim { font-size: 0.85rem; margin-bottom: 10px; }
.project-aim strong { color: var(--ink); }
.project-tech { font-size: 0.8rem; color: var(--slate); margin-bottom: 14px; }
.project-view-btn, .project-card-actions { margin-top: auto; }
.project-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.section-cta { text-align: center; margin-top: 36px; }

/* =====================================================================
   Projects Library page — filters, pagination
   ===================================================================== */
.library-hero { padding-top: 40px; }
.library-filters {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr auto auto;
    gap: 10px;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}
.library-filters input,
.library-filters select {
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.86rem;
    background: var(--paper);
}
.library-result-meta { font-size: 0.85rem; color: var(--slate); margin-bottom: 18px; }
.library-grid.loading { opacity: 0.5; pointer-events: none; }
.library-empty { grid-column: 1 / -1; text-align: center; color: var(--slate); padding: 40px 0; }

.library-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 0.85rem; font-weight: 600;
}
.page-link:hover { border-color: var(--brass); text-decoration: none; }
.page-link.active { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* =====================================================================
   Sample Project Structure — free downloadable resource
   ===================================================================== */
.resource-download-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 24px;
}
.resource-download-box-compact { padding: 14px 18px; margin-bottom: 20px; background: var(--paper-alt); }
.resource-download-info { display: flex; align-items: center; gap: 14px; }
.resource-icon { font-size: 1.8rem; line-height: 1; }
.resource-download-info h3 { font-size: 1rem; margin: 0 0 4px; }
.resource-download-info p { font-size: 0.85rem; color: var(--slate); margin: 0; }

.resource-preview-frame {
    background: var(--paper-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 80vh;
    margin-bottom: 24px;
}
.resource-pdf-frame { width: 100%; height: 100%; border: 0; }

/* =====================================================================
   Secure Document Viewer
   ===================================================================== */
.viewer-meta { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 6px; }
.viewer-meta h1 { font-size: 1.5rem; margin-bottom: 8px; }
.viewer-notice {
    background: #FBEFE0;
    color: var(--brass-dark);
    border: 1px solid #EBD9BB;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.86rem;
    font-weight: 600;
    margin: 18px 0;
}

.viewer-frame {
    position: relative;
    background: var(--paper-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 70vh;
    overflow-y: auto;
    user-select: none;
    -webkit-user-select: none;
}
.viewer-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(22, 36, 62, 0.08);
    transform: rotate(-22deg);
    pointer-events: none;
    z-index: 5;
    line-height: 2.4;
    letter-spacing: 1px;
}
.viewer-document { position: relative; padding: 40px 48px; z-index: 2; }
.viewer-page {
    background: var(--white);
    max-width: 760px;
    margin: 0 auto;
    padding: 48px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-display);
}
.viewer-page h2 { font-size: 1.3rem; margin-bottom: 14px; }
.viewer-page h3 { font-size: 1.02rem; margin-top: 24px; margin-bottom: 8px; color: var(--brass-dark); }
.viewer-page p { font-family: var(--font-body); font-size: 0.92rem; line-height: 1.7; color: var(--ink-soft); }
.viewer-keywords { font-style: italic; color: var(--slate); }
.viewer-truncated-note {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px dashed var(--border);
    font-size: 0.82rem !important;
    color: var(--slate) !important;
    text-align: center;
}
.viewer-protect-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    background: transparent;
}
.viewer-cta { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

/* Block printing of the preview entirely */
@media print {
    .viewer-frame, .viewer-document, .viewer-page { display: none !important; }
    body.viewer-body::before {
        content: "Printing is disabled for secure previews.";
        display: block;
        text-align: center;
        padding: 100px 20px;
        font-family: sans-serif;
        font-size: 1.2rem;
    }
}

/* =====================================================================
   New Responsive Rules
   ===================================================================== */
@media (max-width: 900px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .library-filters { grid-template-columns: 1fr 1fr; }
    .viewer-document { padding: 24px 16px; }
    .viewer-page { padding: 28px 20px; }
}
@media (max-width: 600px) {
    .projects-grid { grid-template-columns: 1fr; }
    .library-filters { grid-template-columns: 1fr; }
    .brand-logo { height: 34px; }
}

/* =====================================================================
   PROJECT CARDS — v2 polish (append-only override, safe to paste last)
   ===================================================================== */
.projects-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 26px !important;
    margin-top: 10px;
}

.project-card {
    display: flex !important;
    flex-direction: column !important;
    background: #FFFFFF !important;
    border: 1px solid #E4DFD3 !important;
    border-radius: 14px !important;
    padding: 26px !important;
    box-shadow: 0 2px 10px rgba(22, 36, 62, 0.06) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(22, 36, 62, 0.14) !important;
    border-color: #B08D57 !important;
}

.project-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}
.project-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    font-size: 1.5rem;
    background: #F1ECE1;
    border-radius: 50%;
    flex-shrink: 0;
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    max-width: 60%;
}
.tag {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 100px !important;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.tag-category { background: #EAF1FB !important; color: #2A5FA5 !important; }
.tag-level { background: #FBEFE0 !important; color: #8C6D3F !important; }

.project-title {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 1.12rem !important;
    font-weight: 700 !important;
    color: #16243E !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
}
.project-branch {
    font-size: 0.82rem !important;
    color: #5B6472 !important;
    margin-bottom: 10px !important;
}
.project-desc {
    font-size: 0.88rem !important;
    color: #5B6472 !important;
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
    flex-grow: 1;
}
.project-aim {
    font-size: 0.85rem !important;
    line-height: 1.55 !important;
    background: #FAF8F4;
    border-left: 3px solid #B08D57;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 14px !important;
}
.project-aim strong { color: #16243E !important; }
.project-tech {
    font-size: 0.8rem !important;
    color: #5B6472 !important;
    margin-bottom: 16px !important;
}

.project-card-actions {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    margin-top: auto !important;
    padding-top: 14px;
    border-top: 1px solid #EEE8DA;
}
.project-card-actions .btn {
    flex: 1 1 0;
    text-align: center;
    white-space: nowrap;
    padding-left: 6px !important;
    padding-right: 6px !important;
    font-size: 0.78rem !important;
}
.project-view-btn { margin-top: auto !important; }

/* -----------------------------------------------------------------
   Filters bar
   ----------------------------------------------------------------- */
.library-filters {
    background: #FFFFFF !important;
    border: 1px solid #E4DFD3 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 10px rgba(22, 36, 62, 0.05) !important;
}
.library-filters input,
.library-filters select {
    border-radius: 6px !important;
}
.library-filters input:focus,
.library-filters select:focus {
    outline: none;
    border-color: #B08D57 !important;
    box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.15);
}

/* -----------------------------------------------------------------
   Pagination — pill buttons
   ----------------------------------------------------------------- */
.library-pagination {
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 40px 0 10px !important;
}
.page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 10px;
    border: 1px solid #E4DFD3 !important;
    border-radius: 100px !important;
    color: #16243E !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    background: #FFFFFF;
    transition: all 0.15s ease;
}
.page-link:hover {
    border-color: #B08D57 !important;
    background: #FAF8F4;
    text-decoration: none !important;
}
.page-link.active {
    background: #16243E !important;
    color: #FFFFFF !important;
    border-color: #16243E !important;
}

/* -----------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------- */
@media (max-width: 960px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 620px) {
    .projects-grid { grid-template-columns: 1fr !important; }
    .project-tags { max-width: 100%; justify-content: flex-start; }
}

/* =====================================================================
   FIX: filter dropdown arrow overlap + bigger logo (v3 patch)
   ===================================================================== */
.library-filters select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6472' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 36px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    line-height: 1.3 !important;
}
.library-filters select::-ms-expand { display: none; }

/* Bigger, clearer logo */
.brand-logo {
    height: 64px !important;
    width: auto !important;
}
.footer-logo {
    height: 48px !important;
    width: auto !important;
}
@media (max-width: 600px) {
    .brand-logo { height: 48px !important; }
}

/* =====================================================================
   Real PDF embed in secure viewer + "Sample Available" badge (v4 patch)
   ===================================================================== */
.viewer-frame:has(.viewer-pdf-frame) {
    max-height: 85vh;
    height: 85vh;
}
.viewer-pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    position: relative;
    z-index: 2;
}
/* Overlay sits above the iframe to block right-click/drag; pointer-events
   pass through for scrolling but context menu + drag are still caught
   by listeners in viewer-protect.js on the parent .viewer-frame */
.viewer-frame .viewer-protect-overlay {
    pointer-events: none;
}

.badge-sample-available {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    padding: 3px 9px !important;
    border-radius: 100px !important;
    background: #E8F3EE !important;
    color: #2F7D5C !important;
    margin-left: 6px;
}


/* =====================================================================
   Spacing fix: gap between project cards grid and the download box (v5)
   ===================================================================== */
.resource-download-box-compact {
    margin-top: 40px !important;
}
@media (max-width: 600px) {
    .resource-download-box-compact { margin-top: 28px !important; }
}

/* =====================================================================
   Fix: excessive gap between "Browse Full Projects Library" and the
   Contact section below it (v6 patch)
   ===================================================================== */
#sample-projects {
    padding-bottom: 20px !important;
}
#sample-projects .section-cta {
    margin-top: 28px !important;
    margin-bottom: 0 !important;
}
#contact {
    padding-top: 20px !important;
}
/* =====================================================================
   PREMIUM MOBILE-FIRST UPGRADE PACK
   Append this entire file's contents to the bottom of assets/css/style.css
   Builds on existing design tokens (--ink, --brass, --paper, etc.) —
   does not redefine them, just extends.
   ===================================================================== */

/* -----------------------------------------------------------------
   0. Smooth scrolling + base motion
   ----------------------------------------------------------------- */
html { scroll-behavior: smooth; }
* { -webkit-tap-highlight-color: transparent; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}

/* -----------------------------------------------------------------
   1. Responsive fluid typography (clamp-based, mobile-first)
   ----------------------------------------------------------------- */
.hero h1, section h1 { font-size: clamp(1.7rem, 4.5vw + 0.5rem, 3rem) !important; line-height: 1.15 !important; }
.section-head h2, section h2 { font-size: clamp(1.35rem, 2.5vw + 0.6rem, 2.1rem) !important; }
.project-title, .service-card h3 { font-size: clamp(1rem, 1.2vw + 0.7rem, 1.15rem) !important; }
.lead { font-size: clamp(0.95rem, 1vw + 0.7rem, 1.15rem) !important; }

/* -----------------------------------------------------------------
   2. Hero — subtle gradient + soft motion
   ----------------------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--paper) 0%, #FFFDF9 45%, #F6EFE1 100%) !important;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -120px; right: -120px;
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(176,141,87,0.16) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.hero-panel {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 20px 44px rgba(22, 36, 62, 0.10) !important;
}
.hero-panel li { transition: transform 0.15s ease; }
.hero-panel li:hover { transform: translateX(4px); }

/* -----------------------------------------------------------------
   3. Buttons — gradient primary + smooth press feedback
   ----------------------------------------------------------------- */
.btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease !important;
    min-height: 44px; /* touch target */
}
.btn-primary {
    background: linear-gradient(135deg, var(--ink) 0%, #223256 60%, var(--brass-dark) 140%) !important;
    box-shadow: 0 6px 18px rgba(22, 36, 62, 0.22) !important;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22, 36, 62, 0.28) !important; }
.btn:active { transform: translateY(0) scale(0.98); }

/* -----------------------------------------------------------------
   4. Cards — glass/lift treatment site-wide (service, about, project)
   ----------------------------------------------------------------- */
.service-card, .about-item, .contact-item {
    transition: transform 0.2s cubic-bezier(.2,.8,.2,1), box-shadow 0.2s ease, border-color 0.2s ease !important;
    will-change: transform;
}
.service-card:hover, .about-item:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 18px 40px rgba(22, 36, 62, 0.14) !important;
    border-color: var(--brass) !important;
}

/* Scroll-reveal (paired with data-animate + main.js IntersectionObserver) */
[data-animate] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate].in-view {
    opacity: 1;
    transform: translateY(0);
}

/* -----------------------------------------------------------------
   5. Stat counters
   ----------------------------------------------------------------- */
.hero-meta { gap: 20px !important; }
.hero-meta div strong {
    background: linear-gradient(135deg, var(--brass-dark), var(--brass));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.4rem;
    display: block;
}

/* -----------------------------------------------------------------
   6. Mobile bottom nav (app-style) — hidden on tablet/desktop
   ----------------------------------------------------------------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-top: 1px solid rgba(22, 36, 62, 0.08);
    box-shadow: 0 -6px 24px rgba(22, 36, 62, 0.10);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-between;
}
.mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    color: var(--slate, #5B6472);
    font-size: 0.66rem;
    font-weight: 700;
    border-radius: 10px;
    transition: color 0.15s ease, background 0.15s ease;
}
.mbn-item .mbn-icon { font-size: 1.25rem; line-height: 1; }
.mbn-item:hover, .mbn-item.active { color: var(--brass-dark) !important; text-decoration: none !important; background: rgba(176, 141, 87, 0.1); }

/* -----------------------------------------------------------------
   7. Floating Action Button (mobile only) — Request Project
   ----------------------------------------------------------------- */
.fab-request {
    display: none;
    position: fixed;
    right: 18px;
    bottom: 78px;
    z-index: 101;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ink) 0%, var(--brass-dark) 130%);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 10px 26px rgba(22, 36, 62, 0.32);
    animation: fabPulse 2.6s ease-in-out infinite;
}
@keyframes fabPulse {
    0%, 100% { box-shadow: 0 10px 26px rgba(22, 36, 62, 0.32); }
    50% { box-shadow: 0 10px 30px rgba(176, 141, 87, 0.45); }
}

/* -----------------------------------------------------------------
   8. Mobile breakpoint activation
   ----------------------------------------------------------------- */
@media (max-width: 900px) {
    .mobile-bottom-nav { display: flex; }
    .fab-request { display: flex; }
    body { padding-bottom: 74px; } /* room for bottom nav */
    .site-footer { padding-bottom: calc(24px + 74px); }
}

/* Touch target safety across the board on small screens */
@media (max-width: 600px) {
    .btn, .nav-toggle, a.mbn-item, select, input[type="text"], input[type="email"] {
        min-height: 44px;
    }
    .hero-ctas { display: flex; flex-direction: column; gap: 10px !important; }
    .hero-ctas .btn { width: 100%; text-align: center; }
    .services-grid, .about-grid { grid-template-columns: 1fr !important; }
    .contact-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* =====================================================================
   Project Showcase page — hero, category filter chips
   ===================================================================== */
.showcase-hero { padding-bottom: 30px !important; }
.showcase-hero-inner { display: block !important; }
.showcase-hero .hero-ctas { margin-top: 22px; }

.showcase-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 100px;
    border: 1.5px solid var(--border, #E4DFD3);
    background: #FFFFFF;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 700;
    transition: all 0.15s ease;
}
.chip:hover { border-color: var(--brass); text-decoration: none; background: #FAF8F4; }
.chip.active {
    background: linear-gradient(135deg, var(--ink) 0%, var(--brass-dark) 130%);
    color: #fff;
    border-color: transparent;
}

.section-cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 600px) {
    .showcase-filter-bar { gap: 8px; }
    .chip { padding: 8px 12px; font-size: 0.78rem; }
}


/* =====================================================================
   Bigger header nav links (Home / About / Sample Projects / etc.)
   ===================================================================== */
.nav-links {
    gap: 28px !important;
    font-size: 1.08rem !important;
}
.brand-logo { height: 68px !important; } 


.nav-bar {
    align-items: center !important;
}
.nav-actions {
    align-items: center !important;
    margin-top: 4px;
}
.nav-actions .user-pill {
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.2 !important;
}
.nav-actions .btn {
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.2 !important;
}

/* =====================================================================
   Fix: uneven card alignment in Project Showcase / Project Catalog grids
   Different title lengths were pushing badges/descriptions/buttons to
   different heights per card. Reserve consistent space per section so
   every row lines up cleanly regardless of text length.
   ===================================================================== */
.project-title {
    min-height: 2.7em !important;   /* reserves space for ~2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.badge-sample-available {
    margin-left: 0 !important;
    margin-top: 4px;
    margin-bottom: 8px;
}
.project-branch {
    min-height: 1.3em;
}
.project-desc {
    min-height: 3.2em;   /* ~2 lines, keeps aim/tech/buttons aligned below */
}
.project-aim {
    min-height: 4.6em;   /* ~3 lines including the "Aim:" label line */
}
.project-tech {
    min-height: 1.2em;
}
/* Buttons already use margin-top: auto to pin to card bottom — this
   just makes sure everything above them lines up first. */
   
   /* ===========================================
   MOBILE FIX - STEP 1
   Prevent Horizontal Scrolling
=========================================== */

/*html,*/
/*body{*/
/*    width:100%;*/
/*    overflow-x:hidden;*/
/*}*/

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

/*img{*/
/*    max-width:100%;*/
/*    height:auto;*/
/*}*/

/*section,*/
/*.container,*/
/*.row,*/
/*.col{*/
/*    max-width:100%;*/
/*}*/

/* =========================================
   MOBILE HEADER - STICKY LOGO
   ========================================= */

/*@media (max-width:768px){*/

/*.site-header{*/
/*    position:fixed;*/
/*    top:0;*/
/*    left:0;*/
/*    width:100%;*/
/*    height:70px;*/
/*    background:#ffffff;*/
/*    z-index:9999;*/
/*    box-shadow:0 3px 15px rgba(0,0,0,.08);*/
/*    border-bottom:1px solid #f2f2f2;*/
/*}*/

/* Layout */

/*.nav-bar{*/
/*    height:70px;*/
/*    display:flex;*/
/*    align-items:center;*/
/*    justify-content:flex-start;*/
/*    padding:0 16px;*/
/*}*/

/* Logo */

/*.brand{*/
/*    display:flex;*/
/*    align-items:center;*/
/*}*/

/*.brand-logo{*/
/*    height:52px;*/
/*    width:auto;*/
/*    transition:.3s ease;*/
/*}*/

/* Hide desktop navigation */

/*.nav-links,*/
/*.nav-actions,*/
/*.nav-toggle{*/
/*    display:none !important;*/
/*}*/

/* Leave space below the fixed header */
/*body{*/
/*    padding-top:70px;*/
/*}*/

/*}*/
   
