
/* ==================================================
   ENDLESSFORGE — ESTILOS GERAIS
================================================== */

:root {
    --brand-color: #ff6600;
    --brand-color-hover: #e65c00;
    --brand-color-light: #fff0e6;

    --text-color: #252525;
    --text-muted: #555;
    --section-background: #f7f5f2;

    --border-color: #e5e5e5;
    --card-radius: 16px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    color: var(--text-color);
}

section {
    scroll-margin-top: 80px;
}

img {
    max-width: 100%;
}

.text-orange {
    color: var(--brand-color);
}

/* ==================================================
   NAVBAR
================================================== */

.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    color: var(--brand-color);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.navbar-logo {
    display: block;
    width: auto;
    height: 30px;
}

.navbar-nav {
    gap: 1rem;
}

.nav-link {
    margin-left: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.nav-link.active {
    color: var(--brand-color) !important;
    font-weight: 600;
}

.btn-orcamento {
    margin-left: 0;
    padding: 8px 18px;
    border: 1px solid var(--brand-color);
    border-radius: 30px;
    background: var(--brand-color);
    color: #fff;
    font-weight: 500;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast);
}

/* ==================================================
   ELEMENTOS COM FUNDO DECORATIVO
================================================== */

.section-with-bg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.logo-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-logo {
    position: absolute;
    display: block;
    pointer-events: none;
}

.section-content {
    position: relative;
    z-index: 1;
}

/* ==================================================
   HERO
================================================== */

.hero {
    display: flex;
    min-height: calc(100vh - 75px);
    align-items: center;
    justify-content: center;
}

.hero-logo {
    width: 60%;
    min-width: 250px;
    max-width: 500px;
    height: auto;
}

.hero h1 {
    margin-bottom: 20px;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 600;
    line-height: 1.2;
}

.hero p {
    max-width: 650px;
    margin-right: auto;
    margin-left: auto;
    color: var(--text-muted);
    line-height: 1.8;
}

/* Botões principais */

.discover-btn,
.contactos-btn {
    margin-top: 20px;
    padding: 12px 40px;
    border: 1px solid var(--brand-color);
    border-radius: 30px;
    background: var(--brand-color);
    color: #fff !important;
    font-weight: 500;
    transition:
        background-color var(--transition-normal),
        border-color var(--transition-normal),
        transform var(--transition-fast);
}

/* ==================================================
   SECÇÕES — ESPAÇAMENTO COMUM
================================================== */

.about-section,
.servicos-section,
.portfolio-section,
.contactos-section {
    padding: 100px 0;
}

.section-label {
    margin-bottom: 0;
    color: var(--brand-color);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.about-intro h2,
.services-intro h2,
.portfolio-intro h2 {
    max-width: 600px;
    margin: 0;
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.about-intro > p,
.services-intro > p,
.portfolio-intro > p {
    margin: 1rem 0 0;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

.services-intro > p,
.portfolio-intro > p {
    max-width: 700px;
}

.services-intro,
.portfolio-intro {
    display: block;
    margin-top: 1.5rem;
    margin-bottom: 0;
}

/* ==================================================
   SOBRE A ENDLESSFORGE
================================================== */

#sobre {
    background: var(--section-background);
}

.about-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 3rem;
    margin-top: 1.5rem;
}

.about-intro > p {
    margin-top: 0;
}

.about-values {
    margin-top: 3.5rem;
}

/* Cartões comuns */

.about-card,
.service-card {
    height: 100%;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background: #fff;
    transition:
        border-color var(--transition-normal),
        box-shadow var(--transition-normal),
        transform var(--transition-normal);
}

.about-icon,
.service-icon {
    color: var(--brand-color);
}

.about-icon {
    font-size: 1.8rem;
}

.about-card h3,
.service-card h3 {
    margin-top: 1.25rem;
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: 650;
    line-height: 1.4;
}

.about-card p,
.service-card p {
    margin-top: 0.75rem;
    margin-bottom: 0;
    color: var(--text-muted);
    line-height: 1.75;
}

/* ==================================================
   SERVIÇOS
================================================== */

.services-grid {
    margin-top: 3.5rem;
}

.service-card {
    text-align: left;
}

.service-icon {
    font-size: 2rem;
    line-height: 1;
}

/* ==================================================
   PORTFÓLIO
================================================== */

#portfolio {
    background: var(--section-background);
}

#portfolio .text-muted {
    color: #6c757d !important;
}

.portfolio-project {
    height: 100%;
    overflow: hidden;
    border: 1px solid #e9e9e9;
    border-radius: 12px;
    background: #fff;
    transition:
        transform var(--transition-normal),
        box-shadow var(--transition-normal);
}

#portfolio .row {
    margin-top: 3.5rem;
}

/* Galeria */

.portfolio-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    isolation: isolate;
    background: #111;
}

.portfolio-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.35s ease-in-out;
    will-change: transform;
}

.portfolio-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.portfolio-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Setas da galeria */

.portfolio-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid var(--brand-color);
    border-radius: 50%;
    background: #fff;
    color: var(--brand-color);
    font-size: 1rem;
    line-height: 1;
    opacity: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        background-color var(--transition-fast),
        color var(--transition-fast);
}

.portfolio-prev {
    left: 10px;
}

.portfolio-next {
    right: 10px;
}

.portfolio-arrow:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 3px;
}

.portfolio-arrow:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Contador de imagens */

.portfolio-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 5px 9px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* Informação do projeto */

.portfolio-info {
    padding: 20px;
}

.portfolio-category {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--brand-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.portfolio-info h3 {
    margin: 0 0 10px;
    color: var(--text-color);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
}

.portfolio-info p {
    margin: 0;
    color: #666;
    font-size: 0.92rem;
    line-height: 1.65;
}

/* ==================================================
   CONTACTOS
================================================== */

.contactos-box {
    position: relative;
    overflow: hidden;
    padding: 60px 30px;
    border-radius: 20px;
    background: var(--section-background);
}

.contactos-box h2 {
    margin-bottom: 20px;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 600;
}

.contactos-box p {
    max-width: 700px;
    margin-right: auto;
    margin-left: auto;
    color: var(--text-muted);
    line-height: 1.8;
}

.contactos-form {
    max-width: 900px;
}

.contactos-form .form-control {
    position: relative;
    padding: 0.65rem 0.9rem;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    background: #fff;
}

.contactos-form .form-control:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 102, 0, 0.15);
}

.contactos-form .form-label {
    font-weight: 500;
}

.campo-obrigatorio {
    color: var(--brand-color);
}

.contactos-mensagem-col {
    display: flex;
    flex-direction: column;
}

.contactos-textarea {
    flex: 1 1 auto;
    min-height: 150px;
    resize: none;
}

.contactos-info {
    color: #444;
}

/* ==================================================
   PÁGINA 404
================================================== */

.error-section {
    display: flex;
    min-height: calc(100vh - 75px);
    align-items: center;
    justify-content: center;
}

.error-section h1 {
    margin: 30px 0;
    color: var(--brand-color);
    font-size: clamp(4rem, 10vw, 6rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

.error-section p {
    color: var(--text-muted);
}

/* ==================================================
   FOOTER
================================================== */

.footer {
    padding: 30px 0;
    background: #222;
    color: #aaa;
    font-size: 0.9rem;
}

.footer a {
    color: var(--brand-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
}

.footer-socials a {
    color: var(--text-muted);
    font-size: 1.35rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-socials a:hover {
    color: var(--brand-color);
}

.footer-socials a:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 4px;
    border-radius: 3px;
}

/* ==================================================
   ANIMAÇÕES AO FAZER SCROLL
================================================== */

.js-enabled .reveal {
    opacity: 0;
    transition:
        opacity 0.7s ease,
        transform 0.7s cubic-bezier(0.2, 0.65, 0.3, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.js-enabled .reveal-up {
    transform: translateY(30px);
}

.js-enabled .reveal-left {
    transform: translateX(-30px);
}

.js-enabled .reveal-right {
    transform: translateX(30px);
}

.js-enabled .reveal-scale {
    transform: scale(0.96);
}

.js-enabled .reveal.is-visible {
    opacity: 1;
    transform: none;
    will-change: auto;
}

/* Foco visível para navegação por teclado */

:where(
    a,
    button,
    input,
    textarea,
    select,
    .about-card,
    .service-card
):focus-visible {
    outline: 3px solid var(--brand-color);
    outline-offset: 3px;
}

/* ==================================================
   HOVER — APENAS DISPOSITIVOS COM RATO
================================================== */

@media (hover: hover) and (pointer: fine) {
    .navbar-brand:hover {
        color: var(--brand-color-hover);
    }

    .nav-link:hover {
        color: var(--brand-color);
    }

    .btn-orcamento:hover,
    .discover-btn:hover,
    .contactos-btn:hover {
        border-color: var(--brand-color-hover);
        background: var(--brand-color-hover);
        color: #fff !important;
        transform: translateY(-2px);
    }

    .about-card:hover,
    .service-card:hover {
        transform: translateY(-4px);
        border-color: var(--brand-color);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
    }

    .portfolio-arrow:hover:not(:disabled) {
        background: var(--brand-color);
        color: #fff;
    }

    .footer a:hover {
        color: #ff8533;
    }
}

/* ==================================================
   RESPONSIVIDADE — TABLETS
================================================== */

@media (max-width: 991.98px) {
    .about-section,
    .servicos-section,
    .portfolio-section,
    .contactos-section {
        padding: 75px 0;
    }

    .about-intro {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .about-values,
    .services-grid {
        margin-top: 2.5rem;
    }

    .portfolio-info {
        padding: 16px;
    }
}

/* ==================================================
   RESPONSIVIDADE — TELEMÓVEIS
================================================== */

@media (max-width: 575.98px) {
    .about-section,
    .servicos-section,
    .portfolio-section,
    .contactos-section {
        padding: 60px 0;
    }

    .about-card,
    .service-card {
        padding: 1.5rem;
    }

    .hero-logo {
        width: 75%;
        min-width: 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p,
    .about-intro > p,
    .services-intro > p,
    .portfolio-intro > p {
        font-size: 1rem;
    }

    .portfolio-arrow {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .portfolio-prev {
        left: 8px;
    }

    .portfolio-next {
        right: 8px;
    }

    .portfolio-info h3 {
        font-size: 1.05rem;
    }

    .portfolio-info p {
        font-size: 0.9rem;
    }

    .contactos-box {
        padding: 40px 20px;
    }
}

/* ==================================================
   ACESSIBILIDADE — MOVIMENTO REDUZIDO
================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .js-enabled .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .about-card:hover,
    .service-card:hover,
    .portfolio-project:hover {
        transform: none;
    }
}