/* Shared visual language for the sections below Home. */
.tech-section {
    --section-play-state: paused;
    position: relative;
    isolation: isolate;
    scroll-margin-top: 8rem;
    padding-top: 10rem;
}

.section-motion-enabled .tech-section.section-in-view {
    --section-play-state: running;
}

.tech-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgba(0, 209, 255, 0.2) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(135deg, transparent 25%, #000 100%);
    opacity: 0.28;
}

.tech-section::after {
    content: "";
    position: absolute;
    inset: 0 9% auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    pointer-events: none;
}

.tech-section > .section-intro,
.services-container,
.skills-container,
.stack-flow {
    width: min(100%, var(--max-width));
    max-width: var(--max-width);
    margin-inline: auto;
}

.tech-section .section-intro::after {
    content: "";
    display: block;
    width: 8rem;
    height: 2px;
    margin-top: 2.4rem;
    background: linear-gradient(90deg, var(--main-color), transparent);
    transform-origin: left;
    animation: section-trace 5s ease-in-out infinite alternate;
    animation-play-state: var(--section-play-state);
}

.tech-section .section-intro .heading {
    margin-bottom: 1.4rem;
    line-height: 1.15;
}

.tech-section .section-intro > p {
    max-width: 70rem;
    font-size: 1.65rem;
    color: var(--muted-color);
    line-height: 1.8;
}

.section-number {
    margin-right: .8rem;
    color: var(--muted-color);
    font-family: Consolas, 'Courier New', monospace;
    letter-spacing: 0;
}

.about-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: stretch;
}

.about-card {
    transition: border-color .3s ease, box-shadow .3s ease;
}

.about-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.about-card-primary {
    --profile-padding: 3.2rem;
    padding: var(--profile-padding);
    overflow: hidden;
    justify-content: flex-start;
}

.about-card-primary .about-meta-grid {
    margin-top: auto;
    padding-top: 3rem;
}

.profile-toolbar {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin: calc(-1 * var(--profile-padding)) calc(-1 * var(--profile-padding)) 3rem;
    padding: 1.5rem var(--profile-padding);
    border-bottom: 1px solid var(--border-color);
    background: rgba(9, 15, 22, 0.45);
}

.profile-toolbar > span:not(.window-dots) {
    color: var(--muted-color);
    font: 1.2rem Consolas, 'Courier New', monospace;
}

.profile-toolbar > i {
    margin-left: auto;
    color: var(--main-color);
    font-size: 2rem;
}

.window-dots {
    width: 6px;
    height: 6px;
    margin-right: 14px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--main-color);
    box-shadow: 11px 0 rgba(0, 209, 255, 0.45), 22px 0 rgba(0, 209, 255, 0.2);
}

.about-meta-item,
.about-meta-item > div {
    min-width: 0;
}

.about-meta-item strong {
    overflow-wrap: anywhere;
}

.about-card-interests {
    grid-column: auto;
}

.interest-list {
    grid-template-columns: 1fr;
}

.interest-icon {
    flex-shrink: 0;
    transition: transform .3s ease, box-shadow .3s ease;
}

.interest-item > span:last-child {
    color: var(--text-color);
    font-size: 1.4rem;
}

.interest-item:hover .interest-icon {
    transform: rotate(-8deg);
    box-shadow: var(--shadow-glow);
}

.timeline ul {
    margin-left: 1.2rem;
    padding: 0 0 0 2.8rem;
    border-image: linear-gradient(var(--main-color), var(--border-strong), transparent) 1;
}

.timeline ul li {
    margin-bottom: 2.4rem;
    padding: 2.8rem;
    border-color: var(--border-color);
    background: linear-gradient(135deg, rgba(24, 32, 43, 0.8), rgba(13, 20, 28, 0.92));
    cursor: default;
}

.timeline ul li:last-child {
    margin-bottom: 0;
}

.timeline ul li::before {
    left: calc(-2.8rem - 7px);
    top: 3.6rem;
}

.timeline ul li:first-child {
    border-color: var(--border-strong);
}

.timeline ul li:first-child::after {
    content: "";
    position: absolute;
    left: calc(-2.8rem - 11px);
    top: calc(3.6rem - 4px);
    width: 18px;
    height: 18px;
    border: 1px solid var(--main-color);
    border-radius: 50%;
    animation: timeline-pulse 3.5s ease-out infinite;
    animation-play-state: var(--section-play-state);
    pointer-events: none;
}

.timeline .content {
    padding: 1.4rem 0 0;
}

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

.services-container .services-box {
    position: relative;
    overflow: hidden;
    padding: 3rem;
    text-align: left;
}

.services-box > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 6.4rem;
    height: 6.4rem;
    margin-bottom: 2.2rem;
    border: 1px solid var(--border-strong);
    border-radius: 1.8rem;
    background: var(--main-color-soft);
    font-size: 3.4rem;
    transition: transform .35s ease, box-shadow .35s ease;
}

.services-box:hover > i {
    transform: translateY(-3px) rotate(-4deg);
    box-shadow: var(--shadow-glow);
}

.service-index {
    position: absolute;
    top: 3rem;
    right: 3rem;
    font: 1.4rem Consolas, 'Courier New', monospace;
    color: var(--muted-color);
    opacity: 0.65;
}

.service-stack {
    padding-top: 1.6rem;
    border-top: 1px solid var(--border-strong);
    font: 1.1rem/1.7 Consolas, 'Courier New', monospace;
    letter-spacing: .1rem;
}

.services-box::before,
.portfolio-box picture::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(114, 230, 255, 0.09) 50%, transparent 70%);
    transform: translateX(-120%);
    pointer-events: none;
}

.services-box:hover::before,
.portfolio-box:hover picture::after,
.portfolio-box:focus-within picture::after {
    animation: card-scan 1s ease-out;
    animation-play-state: var(--section-play-state);
}

.stack-flow {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 1.8rem 0;
}

.stack-flow span {
    color: var(--muted-color);
    font: 1.1rem Consolas, 'Courier New', monospace;
    letter-spacing: .15rem;
}

.stack-flow i {
    position: relative;
    flex: 1;
    height: 1px;
    background: var(--border-strong);
}

.stack-flow i::after {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--main-color);
    box-shadow: 0 0 10px var(--main-color);
    animation: stack-packet 4s ease-in-out infinite;
    animation-play-state: var(--section-play-state);
}

.stack-flow i:nth-of-type(2)::after { animation-delay: -2.6s; }
.stack-flow i:nth-of-type(3)::after { animation-delay: -1.3s; }

.skills-container {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.skills-container .skills-box {
    position: relative;
    min-width: 0;
    cursor: default;
}

.skills-box::after {
    content: "";
    position: absolute;
    top: 2.2rem;
    right: 1.8rem;
    width: 1.6rem;
    height: 2.4rem;
    background: repeating-linear-gradient(0deg, transparent 0 6px, var(--border-strong) 6px 8px);
    transition: opacity .3s ease;
    opacity: 0.6;
}

.skills-box:hover::after { opacity: 1; }

.skills-box .bxl-react::before {
    animation: tech-orbit 24s linear infinite;
    animation-play-state: var(--section-play-state);
}

.portfolio-box {
    transition: border-color .35s ease, box-shadow .35s ease;
}

.portfolio-box:hover,
.portfolio-box:focus-within {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.portfolio-box picture {
    position: relative;
    padding-top: 2.8rem;
    aspect-ratio: auto;
}

.portfolio-box picture::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2.8rem;
    border-bottom: 1px solid var(--border-color);
    background:
        radial-gradient(circle at 1.8rem 50%, var(--main-color) 2px, transparent 3px),
        radial-gradient(circle at 3rem 50%, rgba(0, 209, 255, .45) 2px, transparent 3px),
        radial-gradient(circle at 4.2rem 50%, rgba(0, 209, 255, .2) 2px, transparent 3px),
        var(--second-bg-color);
}

.portfolio-box picture img {
    height: auto;
    aspect-ratio: 1921 / 932;
}

.project-link i {
    transition: transform .25s ease;
}

.project-link:hover i,
.project-link:focus-visible i {
    transform: translateX(4px);
}

.contact-shell {
    width: min(100%, var(--max-width));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 6rem;
    align-items: start;
}

.contact .contact-intro {
    text-align: left;
    margin: 0 0 2.5rem;
}

.contact .contact-heading::after {
    display: none;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
    padding-right: .7rem;
    color: var(--main-color);
    font-size: 1.6rem;
    overflow-wrap: anywhere;
}

.contact-email i:last-child {
    transform: rotate(45deg);
    transition: translate .25s ease;
}

.contact-email:hover i:last-child { translate: 2px -2px; }

.contact-network {
    display: block;
    width: min(100%, 32rem);
    height: auto;
    margin-top: 4rem;
    color: var(--main-color);
}

.contact-network-trace,
.contact-network-ring {
    stroke: currentColor;
    stroke-opacity: .22;
}

.contact-orbit {
    transform-origin: 160px 130px;
    stroke: currentColor;
    animation: tech-orbit 16s linear infinite;
    animation-play-state: var(--section-play-state);
}

.contact-orbit circle {
    fill: #72e6ff;
    stroke: none;
}

.contact-orbit-inner {
    animation-duration: 12s;
    animation-direction: reverse;
}

.contact-network-core {
    fill: var(--surface-color);
    stroke: var(--border-strong);
}

.contact-network-envelope {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.contact form {
    width: 100%;
    min-width: 0;
    margin: 0;
    text-align: left;
    border-top-color: var(--border-strong);
    transition: border-color .3s ease, box-shadow .3s ease;
}

.contact form:focus-within {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.contact form textarea { resize: vertical; }

@keyframes section-trace {
    from { transform: scaleX(.55); opacity: .45; }
    to { transform: scaleX(1); opacity: 1; }
}

@keyframes timeline-pulse {
    0% { transform: scale(.8); opacity: .65; }
    80%, 100% { transform: scale(2); opacity: 0; }
}

@keyframes card-scan {
    to { transform: translateX(120%); }
}

@keyframes stack-packet {
    0% { left: 0; opacity: 0; }
    20%, 80% { opacity: 1; }
    100% { left: calc(100% - 5px); opacity: 0; }
}

@keyframes tech-orbit {
    to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
    .skills-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .contact-shell { gap: 3rem; }
}

@media (max-width: 900px) {
    .tech-section { padding-top: 8rem; }
    .about-grid,
    .contact-shell { grid-template-columns: 1fr; }
    .interest-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contact-heading { position: relative; margin-bottom: 0; padding-right: 22rem; }
    .contact-network { position: absolute; top: 0; right: 0; width: 19rem; margin: 0; }
    .contact form { max-width: none; }
}

@media (max-width: 617px) {
    .services-container { grid-template-columns: 1fr; }
    .skills-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
    .stack-flow { gap: .8rem; }
    .stack-flow span { font-size: .95rem; letter-spacing: 0; }
    .about-card-primary { --profile-padding: 2.4rem; }
    .contact-heading { padding-right: 0; }
    .contact-network { position: static; width: 18rem; margin: 2.4rem auto 0; }
    .contact form { padding: 2.4rem; }
    .timeline ul { padding-left: 2rem; }
    .timeline ul li { padding: 2rem; }
    .timeline ul li::before { left: calc(-2rem - 7px); }
    .timeline ul li:first-child::after { left: calc(-2rem - 11px); }
}

@media (max-width: 450px) {
    .about-meta-grid,
    .interest-list { grid-template-columns: 1fr; }
    .section-kicker { letter-spacing: .16rem; }
    .section-number { margin-right: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
    .tech-section *,
    .tech-section *::before,
    .tech-section *::after {
        animation: none !important;
    }
}
