/* ================================================================
   KoznakTech — Premium Design Enhancement Layer
   Applied AFTER app.css to override and extend the base styles
   ================================================================ */

/* === Extended Design Tokens === */
:root {
    --accent-blue: #1E3A5F;
    --accent-teal: #0D9488;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 100px;
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 30px 80px rgba(0, 0, 0, 0.14);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", monospace;
}

/* === Animation Keyframes === */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(44px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(204, 22, 22, 0.25); }
    50%      { box-shadow: 0 0 24px 4px rgba(204, 22, 22, 0.18); }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes counterPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes lineGrow {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}

/* === Scroll Reveal System ===
   IMPORTANT: All reveal hiding is gated behind .reveal-ready on <html>.
   JS adds this class once it's ready to observe. Without JS, content stays visible. */

html.reveal-ready .reveal {
    opacity: 0;
    transform: translateY(44px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

html.reveal-ready .reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

html.reveal-ready .reveal-left {
    opacity: 0;
    transform: translateX(-44px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

html.reveal-ready .reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

html.reveal-ready .reveal-right {
    opacity: 0;
    transform: translateX(44px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

html.reveal-ready .reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

html.reveal-ready .reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

html.reveal-ready .reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered children — also JS-gated */
html.reveal-ready .stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

html.reveal-ready .stagger-children.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
html.reveal-ready .stagger-children.visible > *:nth-child(2) { transition-delay: 0.08s; opacity: 1; transform: translateY(0); }
html.reveal-ready .stagger-children.visible > *:nth-child(3) { transition-delay: 0.16s; opacity: 1; transform: translateY(0); }
html.reveal-ready .stagger-children.visible > *:nth-child(4) { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }
html.reveal-ready .stagger-children.visible > *:nth-child(5) { transition-delay: 0.32s; opacity: 1; transform: translateY(0); }
html.reveal-ready .stagger-children.visible > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }

/* === Enhanced Header === */
.site-header {
    background: rgba(12, 12, 12, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 38px rgba(0, 0, 0, 0.25);
    transition: background 0.3s ease;
}

/* Animated underline instead of solid background fill */
.site-nav a {
    position: relative;
    transition: color 0.3s ease;
}

.site-nav a::after {
    content: "";
    position: absolute;
    bottom: 18px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--brand-red-2);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s var(--ease-out-expo);
}

.site-nav a.active::after,
.site-nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.site-nav a.active,
.site-nav a:hover {
    background: transparent;
    color: #ffffff;
}

/* Enhanced CTA button in nav */
.nav-cta {
    border: 2px solid var(--brand-red);
    border-radius: var(--radius-sm);
    background: var(--brand-red);
    box-shadow: 0 4px 20px rgba(204, 22, 22, 0.35);
    transition: all 0.3s var(--ease-out-expo);
}

.nav-cta:hover {
    background: var(--brand-red-2);
    border-color: var(--brand-red-2);
    box-shadow: 0 6px 28px rgba(204, 22, 22, 0.5);
    transform: translateY(-1px);
}

/* === Enhanced Buttons === */
.primary-action,
.secondary-action {
    border-radius: var(--radius-sm);
    transition: all 0.3s var(--ease-out-expo);
}

.primary-action {
    box-shadow: 0 4px 18px rgba(204, 22, 22, 0.3);
}

.primary-action:hover {
    box-shadow: 0 8px 30px rgba(204, 22, 22, 0.45);
    transform: translateY(-2px);
}

.secondary-action:hover {
    transform: translateY(-2px);
}

/* === Enhanced Hero === */
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 80%, rgba(204, 22, 22, 0.12), transparent),
        radial-gradient(ellipse 500px 300px at 80% 20%, rgba(30, 58, 95, 0.1), transparent);
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    animation: fadeUp 1s var(--ease-out-expo) 0.15s both;
}

.hero-visual,
.modernization-dashboard {
    animation: scaleIn 0.9s var(--ease-out-expo) 0.4s both;
}

.hero-capabilities span {
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.hero-capabilities span:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* === Border Radius — Cards & Panels === */
.hero-visual {
    border-radius: var(--radius-lg);
}

.modernization-dashboard {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.service-panel {
    border-radius: var(--radius-md);
}

.service-panel:hover {
    box-shadow: var(--shadow-hover);
}

.service-panel-head span {
    border-radius: var(--radius-sm);
}

.home-service-card {
    border-radius: var(--radius-md);
}

.home-service-card:hover {
    box-shadow: var(--shadow-hover);
}

.home-service-card > span {
    border-radius: var(--radius-sm);
}

.service-card {
    border-radius: var(--radius-md);
}

.outcome-grid article {
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-expo);
}

.outcome-grid article:hover {
    background: rgba(25, 25, 25, 0.75);
    transform: translateY(-3px);
}

.package-grid article {
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-expo);
}

.package-grid article:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
}

.process-number {
    border-radius: 50%;
}

.process-card {
    border-radius: var(--radius-md);
}

.about-proof article {
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-expo);
}

.about-proof article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.value-grid article {
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-expo);
}

.value-grid article:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
}

.intro-panel {
    border-radius: var(--radius-lg);
}

.intro-proof-grid div {
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-expo);
}

.intro-proof-grid div:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.intro-points span {
    border-radius: var(--radius-sm);
}

.intro-panel-foot {
    border-radius: var(--radius-sm);
}

.image-panel {
    border-radius: var(--radius-lg);
}

.about-service-list span {
    border-radius: var(--radius-sm);
    transition: all 0.25s ease;
}

.about-service-list span:hover {
    background: var(--soft-red);
    transform: translateX(4px);
}

/* Dashboard widget polish */
.dashboard-status {
    border-radius: var(--radius-full);
    font-size: 0.72rem;
}

.score-pill {
    border-radius: var(--radius-md);
    animation: pulseGlow 3s ease-in-out infinite;
}

.dashboard-list span {
    border-radius: 50%;
}

/* === CTA Bands === */
.services-cta,
.process-cta,
.about-cta {
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

/* === Form Input Enhancements === */
input, select, textarea {
    border-radius: var(--radius-sm);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(204, 22, 22, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.intake-panel,
.contact-form {
    border-radius: var(--radius-lg);
}

.readiness-meter {
    border-radius: var(--radius-md);
}

.meter-track {
    border-radius: var(--radius-full);
}

.meter-track span {
    border-radius: var(--radius-full);
    transition: width 0.6s var(--ease-out-expo);
}

.signal-grid div {
    border-radius: var(--radius-sm);
}

/* Custom range slider */
.slider-field input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: var(--radius-full);
    background: #e5e5e5;
    border: none;
    outline: none;
}

.slider-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-red);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(204, 22, 22, 0.35);
    transition: transform 0.2s ease;
}

.slider-field input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-field input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: var(--brand-red);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(204, 22, 22, 0.35);
}

/* Newsletter form */
.newsletter-form {
    border-radius: var(--radius-lg);
}

.newsletter-form button {
    border-radius: var(--radius-sm);
    transition: all 0.3s var(--ease-out-expo);
}

.newsletter-form button:hover {
    background: var(--brand-red-2);
    box-shadow: 0 4px 16px rgba(204, 22, 22, 0.35);
    transform: translateY(-1px);
}

/* === Footer Enhancement === */
.footer-cta {
    border-radius: var(--radius-md);
}

.footer-cta .primary-action {
    border-radius: var(--radius-sm);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.social-links a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.social-links a:hover {
    border-color: var(--brand-red);
    background: var(--brand-red);
    color: #ffffff;
    transform: translateY(-2px);
}

.social-links svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* === NEW: Trust Stats Strip === */
.trust-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.trust-stats .stat-item {
    position: relative;
    padding: 32px clamp(20px, 3vw, 40px);
    border-right: 1px solid var(--line);
    text-align: center;
    transition: all 0.3s ease;
}

.trust-stats .stat-item:last-child {
    border-right: 0;
}

.trust-stats .stat-item:hover {
    background: var(--soft);
}

.trust-stats .stat-number {
    display: block;
    color: var(--brand-red);
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 800;
    line-height: 1;
}

.trust-stats .stat-label {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}

.trust-stats .stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--soft-red);
    color: var(--brand-red);
}

.trust-stats .stat-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* === NEW: Technology Stack (Categorized) === */
.tech-stack-section {
    padding: clamp(60px, 8vw, 100px) clamp(20px, 5vw, 82px);
    background: linear-gradient(180deg, var(--soft) 0%, #ffffff 100%);
}

.tech-stack-header {
    max-width: 720px;
    margin-bottom: 48px;
}

.tech-stack-header h2 {
    margin-bottom: 14px;
}

.tech-stack-header > p:not(.eyebrow) {
    color: var(--muted);
    font-size: 1rem;
    max-width: 640px;
}

.tech-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.tech-category {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.3s var(--ease-out-expo);
}

.tech-category:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
}

.tech-category h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
}

.tech-category h3 svg {
    width: 22px;
    height: 22px;
    color: var(--brand-red);
    flex-shrink: 0;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    background: var(--soft);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.tech-badge:hover {
    background: var(--soft-red);
    border-color: rgba(204, 22, 22, 0.2);
    transform: translateY(-2px);
}

.tech-badge svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* === NEW: Testimonials Section === */
.testimonial-section {
    padding: clamp(60px, 8vw, 100px) clamp(20px, 5vw, 82px);
    background: linear-gradient(135deg, #f8f8fa 0%, #f0f0f5 100%);
}

.testimonial-section .section-heading {
    margin-bottom: 48px;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.testimonial-card {
    position: relative;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.3s var(--ease-out-expo);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.testimonial-card::before {
    content: "\201C";
    position: absolute;
    top: 18px;
    right: 24px;
    color: var(--brand-red);
    font-size: 4rem;
    font-family: Georgia, serif;
    line-height: 1;
    opacity: 0.15;
}

.testimonial-card .stars {
    display: flex;
    gap: 3px;
    margin-bottom: 16px;
    color: #f59e0b;
}

.testimonial-card .stars svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.testimonial-quote {
    margin: 0 0 24px;
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.7;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.testimonial-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-red), #8B0000);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.92rem;
    flex-shrink: 0;
}

.testimonial-author strong {
    display: block;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 0.92rem;
}

.testimonial-author span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 2px;
}

/* === NEW: Contact Details Sidebar === */
.contact-details {
    display: grid;
    gap: 20px;
    margin-top: 28px;
}

.contact-detail-item {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    align-items: start;
}

.contact-detail-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--soft-red);
    color: var(--brand-red);
}

.contact-detail-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.contact-detail-item strong {
    display: block;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.contact-detail-item span,
.contact-detail-item a {
    color: var(--text);
    font-size: 0.94rem;
    line-height: 1.5;
}

.contact-detail-item a:hover {
    color: var(--brand-red);
}

/* === NEW: Service Icon Badges (SVG) === */
.service-icon-badge {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-red), #a01010);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(204, 22, 22, 0.25);
}

.service-icon-badge svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-service-card > .service-icon-badge {
    width: 54px;
    height: 54px;
}

/* === Enhanced Hero Parallax Overlay === */
.home-hero {
    overflow: hidden;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 700px 500px at 15% 85%, rgba(204, 22, 22, 0.14), transparent),
        radial-gradient(ellipse 500px 400px at 85% 15%, rgba(30, 58, 95, 0.08), transparent);
    z-index: 0;
    pointer-events: none;
    animation: gradientShift 12s ease infinite;
    background-size: 200% 200%;
}

/* Animated grid overlay on hero */
.hero-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
}

/* === Enhanced Eyebrow === */
.eyebrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.eyebrow::before {
    content: "";
    width: 24px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    flex-shrink: 0;
}

/* === Enhanced Process Timeline === */
.process-timeline::before {
    background: linear-gradient(to bottom, var(--brand-red), var(--line));
    width: 2px;
}

/* Counter Animation Class */
.counter-animate {
    transition: all 0.6s var(--ease-out-expo);
}

/* === Responsive: New Sections === */
@media (max-width: 1040px) {
    .trust-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .testimonial-grid {
        grid-template-columns: 1fr;
    }

    .tech-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .trust-stats {
        grid-template-columns: 1fr;
    }

    .trust-stats .stat-item {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 24px 20px;
    }

    .trust-stats .stat-item:last-child {
        border-bottom: 0;
    }

    .testimonial-card {
        padding: 24px;
    }

    .tech-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .tech-category {
        padding: 20px;
    }

    .contact-details {
        margin-top: 20px;
    }
}

/* === Reduced Motion Preference === */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .stagger-children > * {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-content,
    .hero-visual,
    .modernization-dashboard {
        animation: none;
    }

    .score-pill {
        animation: none;
    }

    .home-hero::before {
        animation: none;
    }
}
