/* Tailwind & Custom Theme Styles for Sivtech Engineering */
body {
    font-family: 'Inter', sans-serif;
    background-color: #0F172A;
    color: #F8FAFC;
    min-width: 320px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

:root {
    color-scheme: dark;
    scroll-padding-top: 6rem;
}

html {
    scroll-behavior: smooth;
}

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

a, button, input, textarea {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid #67e8f9;
    outline-offset: 3px;
}

body.modal-open {
    overflow: hidden;
}

.skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 100;
    transform: translateY(-160%);
    padding: .75rem 1rem;
    border-radius: .75rem;
    background: #06b6d4;
    color: #082f49;
    font-weight: 800;
}

.skip-link:focus {
    transform: translateY(0);
}

#navbar {
    padding-top: env(safe-area-inset-top);
}

#navbar > div:first-child {
    min-height: 5rem;
}

section {
    scroll-margin-top: 5.5rem;
}

/* Tech Grid Background Animation */
.tech-grid {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

.glow-effect {
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.25);
}

.glass-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.82));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 55px rgba(2, 6, 23, 0.16);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 22px 60px rgba(2, 6, 23, 0.28);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0F172A;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #06B6D4;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* Continuous Marquee Animation */
@keyframes marquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    display: flex;
    width: 200%;
    animation: marquee 25s linear infinite;
    will-change: transform;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

#home h1 {
    font-size: clamp(2.45rem, 5.3vw, 4.65rem);
    line-height: 1.06;
    letter-spacing: -.045em;
}

#home p {
    font-size: clamp(1rem, 1.25vw, 1.125rem);
}

#about, #services, #projects, #contact {
    padding-block: clamp(4rem, 7vw, 7rem);
}

#about h2, #services h2, #projects h2, #contact h2 {
    letter-spacing: -.035em;
    line-height: 1.12;
}

#services .glass-card, #projects .glass-card {
    min-width: 0;
}

#services img, #projects img, #about img {
    width: 100%;
    object-fit: cover;
}

#services .glass-card {
    min-height: 100%;
}

#projects .project-card {
    height: 100%;
}

#projects .project-card > div:first-child {
    height: clamp(12rem, 20vw, 15rem);
}

.project-btn {
    padding: .65rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    font-size: .78rem;
    font-weight: 700;
    transition: .2s ease;
}

.project-btn:hover {
    border-color: rgba(34, 211, 238, 0.6);
    color: #fff;
}

.project-btn.is-active {
    background: #0891b2;
    color: #fff;
    border-color: #22d3ee;
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.16);
}

#contact input:not([type="checkbox"]), #contact textarea {
    min-height: 3rem;
    width: 100%;
    max-width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#contact input:not([type="checkbox"]):focus, #contact textarea:focus {
    border-color: #22d3ee;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

#contact textarea {
    resize: vertical;
}

#service-modal, #confirm-modal {
    overflow-y: auto;
    overscroll-behavior: contain;
}

#service-modal > div, #confirm-modal > div {
    max-height: min(88dvh, 48rem);
    overflow-y: auto;
}

#service-modal li {
    align-items: flex-start;
    line-height: 1.55;
}

footer a {
    transition: color 0.2s ease;
}

/* Fix POPIA checkbox sizing & alignment across Chrome, Safari, and iOS */
input[type="checkbox"].popia-checkbox {
    -webkit-appearance: checkbox;
    appearance: checkbox;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    min-height: 16px !important;
    padding: 0 !important;
    margin-top: 0.2rem;
    flex: 0 0 16px;
    accent-color: #0284c7;
}

/* ==========================================================================
   BRIGHT / LIGHT THEME OVERRIDES (Activated via <body class="light-theme">)
   ========================================================================== */

body.light-theme {
    color-scheme: light;
    background-color: #ffffff;
    color: #0f172a;
}

body.light-theme::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body.light-theme::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

body.light-theme::-webkit-scrollbar-thumb:hover {
    background: #0284c7;
}

body.light-theme .tech-grid {
    background-color: #ffffff;
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(14, 165, 233, 0.07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(14, 165, 233, 0.07) 1px, transparent 1px);
}

body.light-theme .glass-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 28px -8px rgba(15, 23, 42, 0.08);
}

body.light-theme .glass-card:hover {
    border-color: #0284c7;
    box-shadow: 0 16px 36px -10px rgba(2, 132, 199, 0.16);
}

body.light-theme .project-btn {
    background-color: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

body.light-theme .project-btn:hover {
    border-color: #0284c7;
    color: #0284c7;
}

body.light-theme .project-btn.is-active {
    background: linear-gradient(to right, #06b6d4, #2563eb);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.22);
}

body.light-theme #modal-service-content,
body.light-theme #modal-service-content h2,
body.light-theme #modal-service-content h3,
body.light-theme #modal-service-content h4 {
    color: #0f172a !important;
}

body.light-theme #modal-service-content p,
body.light-theme #modal-service-content li,
body.light-theme #modal-service-content span {
    color: #334155;
}

@media (min-width: 1600px) {
    .max-w-7xl { max-width: 88rem; }
}

@media (max-width: 1023px) {
    #home { min-height: auto; }
    #home .grid { gap: 3rem; }
    #home .lg\:col-span-5 { margin-inline: auto; width: min(100%, 34rem); }
    #home .lg\:col-span-7 { max-width: 54rem; margin-inline: auto; }
}

@media (max-width: 767px) {
    #navbar > div:first-child { min-height: 4.5rem; }
    #navbar a[href="#home"] .text-xl { font-size: 1.05rem; }
    #navbar a[href="#home"] .text-\[10px\] { font-size: .58rem; }
    #mobile-menu { max-height: calc(100dvh - 4.5rem); overflow-y: auto; padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
    #home { padding-top: 7.5rem; padding-bottom: 4rem; }
    #home .grid { gap: 2.75rem; }
    #home .grid.grid-cols-2 { gap: 1.25rem .75rem; }
    #home .grid.grid-cols-2 h3 { font-size: 1.8rem; }
    #home .glass-card { padding: .6rem; }
    #home .glass-card .relative.h-72 { height: clamp(13rem, 58vw, 19rem); }
    #home .glass-card .absolute.bottom-3 { gap: .5rem; }
    #home .glass-card .absolute.bottom-3 > div:last-child { min-width: 0; }
    #home .glass-card .absolute.bottom-3 .text-xs { font-size: .68rem; }
    #about .grid, #services .grid, #projects .grid { gap: 1.1rem; }
    #about .grid > *, #services .grid > *, #projects .grid > * { min-width: 0; }
    #about .h-48 { height: 11rem; }
    #services .h-36 { height: 10rem; }
    #projects .project-card > div:first-child { height: 12.5rem; }
    #contact .grid { gap: 2.5rem; }
    #contact .glass-card { padding: 1.2rem; }
    footer .grid { gap: 2rem; }
    footer .pt-8 { text-align: center; }
}

@media (max-width: 420px) {
    #home h1 { font-size: clamp(2.25rem, 11vw, 2.8rem); }
    #home .inline-flex { max-width: 100%; flex-wrap: wrap; justify-content: center; font-size: .62rem; }
    #home .grid.grid-cols-2 h3 { font-size: 1.55rem; }
    #home .grid.grid-cols-2 p { font-size: .68rem; }
    #home .glass-card .absolute.bottom-3 { left: .5rem; right: .5rem; bottom: .5rem; padding: .55rem; }
    #home .glass-card .absolute.bottom-3 > span { display: none; }
    #contact .grid.sm\:grid-cols-2 { grid-template-columns: minmax(0,1fr); }
    #projects .project-card .p-6 { padding: 1.1rem; }
    .project-btn { padding: .55rem .85rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
