/* ========================================
   NEURAL.FORM — Sections
   ======================================== */

/* ----------------------------------------
   Section Headers
   ---------------------------------------- */
.section-header {
    font-family: var(--font-display);
    font-size: 3rem;
    margin-bottom: 80px;
    border-bottom: 1px solid var(--grid-line);
    padding-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-header__meta {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 1px;
    color: #888;
}

@media (max-width: 768px) {
    .section-header {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ----------------------------------------
   Methodology Section
   ---------------------------------------- */
.methodology {
    padding: var(--section-padding) var(--container-padding);
    background-color: var(--bg-color);
    border-top: 1px solid var(--grid-line);
    position: relative;
    z-index: 10;
}

.methodology-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    margin-top: 60px;
}

.methodology-text-col {
    display: flex;
    flex-direction: column;
    gap: 40px;
    justify-content: center;
}

.methodology-p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    color: #CCCCCC;
    max-width: 90%;
    letter-spacing: -0.01em;
}

.methodology-highlight {
    color: #FFF;
    font-weight: 600;
}

/* Visual Container & Diagram */
.visual-container {
    border: 1px solid var(--grid-line);
    background: rgba(255, 255, 255, 0.015);
    position: relative;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.diagram-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
}

.diagram-box {
    border: 1px solid var(--grid-line-strong);
    padding: 16px 24px;
    background: #0A0A0A;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
}

.diagram-box:hover {
    border-color: #FFF;
    /* box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);  /* green accent backup */
    box-shadow: 0 0 20px rgba(255,255,255,0.15);
    transform: scale(1.02);
}

.diagram-box.node-box--center {
    border: 1px solid var(--grid-line-strong);
    border-color: rgba(255, 255, 255, 0.4);
    padding: 24px 32px;
    min-width: 240px;
    font-size: 0.85rem;
    background: #0A0A0A;
}

.diagram-box .sub-label {
    display: block;
    font-size: 0.6rem;
    color: #666;
    margin-top: 4px;
}

/* SVG Progress rect - stroke color override */
.node-box .progress-rect {
    /* stroke: #00FF88;  /* green accent backup */
    stroke: #FFFFFF;
}

.diagram-connector {
    height: 40px;
    width: 1px;
    background: var(--grid-line-strong);
    position: relative;
}

/* Static dot removed - only animated pulse remains */

.connector-pulse {
    position: absolute;
    top: 0;
    left: 50%;
    width: 6px;
    height: 6px;
    /* background: #00FF88;  /* green accent backup */
    background: #FFFFFF;
    border-radius: 50%;
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
}

.tech-decor {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--grid-line-strong);
}

.td-tl { top: 10px; left: 10px; }
.td-tr { top: 10px; right: 10px; text-align: right; }
.td-bl { bottom: 10px; left: 10px; }
.td-br { bottom: 10px; right: 10px; text-align: right; }

.metric-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--grid-line);
    border-radius: 4px;
    font-size: 0.6rem;
}

.metric-badge span { color: #888; }
.metric-badge b { color: #FFF; font-weight: 500; }

/* Responsive */
@media (max-width: 1024px) {
    .methodology-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .methodology-p {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .methodology-p {
        font-size: 1rem;
        line-height: 1.7;
    }
    .visual-container {
        min-height: 420px;
        padding: 80px 24px;
    }
    .diagram-box {
        min-width: 160px;
        font-size: 0.65rem;
        padding: 20px 16px;
    }
    
    .diagram-connector {
        height: 40px;
    }
}

/* ----------------------------------------
   Hero Section
   ---------------------------------------- */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}

.hero__canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.5;
}

.hero__content {
    z-index: 10;
    text-align: center;
    pointer-events: none;
    width: 100%;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .hero__content {
        padding: 0 16px;
    }
}

.hero__headline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 20px 0;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 8rem);
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--text-color);
    mix-blend-mode: exclusion;
    letter-spacing: -0.03em;
    transform: scaleY(1.05);
    opacity: 0;
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Tablet */
@media (max-width: 1024px) {
    .hero__title {
        font-size: clamp(1.8rem, 7vw, 4rem);
        line-height: 1;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hero__title {
        font-size: clamp(1.5rem, 9vw, 3rem);
        line-height: 1.1;
        letter-spacing: -0.02em;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .hero__title {
        font-size: clamp(1.3rem, 10vw, 2.5rem);
        line-height: 1.15;
    }
}

/* Tiny screens */
@media (max-width: 360px) {
    .hero__title {
        font-size: clamp(1.1rem, 9vw, 2rem);
    }
}

.hero__title:nth-child(2) {
    animation-delay: 0.2s;
}

.hero__title span {
    display: block;
}

.hero__subtitle {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    max-width: 400px;
    margin: 32px auto 0;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.8s;
    /* Typographic enhancements */
    text-wrap: balance;
    hanging-punctuation: first last;
}

@media (max-width: 768px) {
    .hero__subtitle {
        font-size: 0.75rem;
        max-width: 90%;
        text-align: center;
    }
}

.hero__cta {
    margin-top: 48px;
    pointer-events: auto;
    opacity: 0;
    animation: fadeIn 1s ease forwards 1s;
}

.hero__vertical-text {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 4px;
    color: var(--text-color);
    transform-origin: center right;
    opacity: 0.5;
}

.hero__specs {
    position: absolute;
    bottom: 40px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
    z-index: 5;
}

.spec-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (max-width: 1024px) {
    .hero__vertical-text {
        display: none;
    }
    
    .hero__title {
        font-size: 12vw;
    }
}

@media (max-width: 768px) {
    .hero__specs {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
    }
    
    .spec-block {
        text-align: center !important;
    }
}

/* ----------------------------------------
   Services Section
   ---------------------------------------- */
.services {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: var(--section-padding) var(--container-padding);
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--grid-line);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background-color: var(--grid-line);
    border: 1px solid var(--grid-line);
}

.service-card {
    background-color: var(--bg-color);
    padding: 40px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-base);
    position: relative;
}

.service-card__num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border: 1px solid var(--text-color);
    width: fit-content;
    padding: 4px 8px;
    border-radius: 50%;
    margin-bottom: 80px;
}

.service-card__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 16px;
    line-height: 1.1;
    min-height: 4.4em;
}

.service-card__desc {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    flex-grow: 1;
    padding-bottom: 60px;
}

.service-card__icon {
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 40px;
    height: 40px;
    background: var(--text-color);
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 17L17 7M17 7H7M17 7V17' stroke='black' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 17L17 7M17 7H7M17 7V17' stroke='black' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
}

.service-card:hover {
    background-color: #0F0F0F;
}



@media (max-width: 1200px) {
    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services__grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        min-height: 320px;
        padding: 32px;
    }
    
    .service-card__num {
        margin-bottom: 24px;
    }
    
    .service-card__title {
        font-size: 1.3rem;
        margin-bottom: 12px;
        min-height: auto;
    }
    
    .service-card__desc {
        padding-bottom: 50px;
    }
    
    .service-card__icon {
        bottom: 32px;
        right: 32px;
    }
}

/* ----------------------------------------
   Portfolio Section
   ---------------------------------------- */
.portfolio {
    padding: var(--section-padding) var(--container-padding);
    border-top: 1px solid var(--grid-line);
    position: relative;
    z-index: 10;
    background-color: var(--bg-color);
}

.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 60px;
}

.portfolio-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-decoration: none;
    color: inherit;
}

.portfolio-item__image {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #1a1a1a;
    position: relative;
    border: 1px solid var(--grid-line);
    overflow: hidden;
}

.portfolio-item__image img,
.portfolio-item__image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity var(--transition-slow), filter var(--transition-slow);
    filter: grayscale(100%);
}

.portfolio-item__image img.align-top,
.portfolio-item__image video.align-top {
    object-position: top center;
}

.portfolio-item:hover .portfolio-item__image img,
.portfolio-item:hover .portfolio-item__image video {
    opacity: 1;
    filter: grayscale(0%);
}

/* Отключаем grayscale на мобильных — изображения всегда цветные */
@media (hover: none) and (pointer: coarse) {
    .portfolio-item__image img,
    .portfolio-item__image video {
        opacity: 1;
        filter: grayscale(0%);
    }
}

.portfolio-item__overlay {
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    transition: border-color var(--transition-base);
    z-index: 2;
}

.portfolio-item:hover .portfolio-item__overlay {
    border-color: rgba(255, 255, 255, 0.3);
}

.portfolio-item__meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-top: 1px solid var(--grid-line);
    padding-top: 16px;
}

.portfolio-item__title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-transform: uppercase;
}

.portfolio-item__tags {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #888;
    text-align: right;
}

@media (max-width: 1024px) {
    .portfolio__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .portfolio-item__meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .portfolio-item__title {
        font-size: 1rem;
    }
    
    .portfolio-item__tags {
        text-align: left;
    }
}

/* ----------------------------------------
   CTA Section
   ---------------------------------------- */
.cta {
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 120px var(--container-padding);
    position: relative;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cta__decor {
    font-family: var(--font-mono);
    margin-bottom: 24px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.cta__title {
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 0.9;
    text-transform: uppercase;
    margin-bottom: 48px;
    max-width: 900px;
}

@media (max-width: 1024px) {
    .cta__title {
        font-size: 2.5rem;
    }
}

/* ----------------------------------------
   Contact / Footer Section
   ---------------------------------------- */
.contact {
    padding: 80px var(--container-padding);
    background-color: var(--bg-color);
    border-top: 1px solid var(--grid-line);
    position: relative;
    z-index: 10;
}

.contact__grid {
    display: grid;
    grid-template-columns: 2fr auto auto;
    gap: 80px;
    justify-content: end;
}

.contact__brand {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.contact__tagline {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #888;
    max-width: 300px;
    line-height: 1.6;
}

.contact-group__title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-group__link {
    display: block;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.9rem;
    margin-bottom: 12px;
    transition: color var(--transition-base);
}

.contact-group__link:hover {
    color: #888;
}

.contact__copyright {
    margin-top: 80px;
    padding-top: 20px;
    border-top: 1px solid var(--grid-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.contact__copyright-left {
    flex-shrink: 0;
}

.contact__copyright-right {
    flex-shrink: 0;
}

.contact__legal {
    display: flex;
    gap: 24px;
    font-family: var(--font-mono);
}

.contact__legal-link {
    color: var(--text-dim);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    transition: color var(--transition-base);
}

.contact__legal-link:hover {
    color: var(--text-color);
}

@media (max-width: 1024px) {
    .contact__grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px 20px;
    }
}

@media (max-width: 1024px) {
    .contact__grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px 20px;
        justify-content: initial;
    }
}

@media (max-width: 600px) {
    .contact__grid {
        grid-template-columns: 1fr;
    }
    
    .contact__copyright {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .contact__legal {
        flex-direction: column;
        gap: 8px;
    }
}
