/* ============================================================
   FAJ Realiza — Página de Materiais dos Empreendimentos
   ------------------------------------------------------------
   Identidade visual baseada na marca FAJ Realiza:
   - Tipografia oficial: Just Sans (local, @font-face)
   - Paleta institucional: navy profundo + lavanda/periwinkle
   ============================================================ */

/* -------- Fonte institucional: Just Sans -------- */
@font-face {
    font-family: 'Just Sans';
    src: url('fonts/JUSTSans-ExLt.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Just Sans';
    src: url('fonts/JUSTSans-Lt.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Just Sans';
    src: url('fonts/JUSTSans-Rg.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Just Sans';
    src: url('fonts/JUSTSans-Md.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Just Sans';
    src: url('fonts/JUSTSans-SmBd.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Just Sans';
    src: url('fonts/JUSTSans-Bd.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Just Sans';
    src: url('fonts/JUSTSans-ExBd.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* -------- Tokens da marca -------- */
:root {
    --color-bg-deep:       #14163a;
    --color-bg-mid:        #1c1f4a;
    --color-bg-soft:       #262a5e;
    --color-lavender:      #9197d1;
    --color-lavender-soft: #b5b9e0;
    --color-lavender-dim:  #6b71b3;
    --color-card:          #ffffff;
    --color-card-border:   rgba(145, 151, 209, 0.18);
    --color-text-light:    #ffffff;
    --color-text-muted:    rgba(255, 255, 255, 0.7);
    --color-text-dim:      rgba(255, 255, 255, 0.55);
    --color-text-dark:     #1c1f4a;
    --color-text-dark-mut: #5a5f8a;

    --radius-card:    18px;
    --radius-button:  16px;
    --shadow-card:    0 10px 30px -12px rgba(8, 10, 35, 0.5),
                      0 4px 10px -4px rgba(8, 10, 35, 0.25);
    --shadow-hover:   0 20px 45px -15px rgba(8, 10, 35, 0.7),
                      0 8px 18px -6px rgba(145, 151, 209, 0.3);

    --ease:           cubic-bezier(0.22, 1, 0.36, 1);
}

/* -------- Reset enxuto -------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Just Sans', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text-light);
    background: var(--color-bg-deep);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%,
            rgba(145, 151, 209, 0.18) 0%,
            transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 100%,
            rgba(145, 151, 209, 0.10) 0%,
            transparent 55%),
        linear-gradient(180deg,
            var(--color-bg-deep) 0%,
            var(--color-bg-mid) 60%,
            var(--color-bg-deep) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    overscroll-behavior-y: none;
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* -------- Sparkles decorativos (marca) -------- */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    display: block;
    width: 14px;
    height: 14px;
    opacity: 0.35;
    background: var(--color-lavender);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 0 L13.6 9.2 L22.4 11 L13.6 12.8 L12 22 L10.4 12.8 L1.6 11 L10.4 9.2 Z'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 0 L13.6 9.2 L22.4 11 L13.6 12.8 L12 22 L10.4 12.8 L1.6 11 L10.4 9.2 Z'/></svg>");
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-size: contain;
            mask-size: contain;
    animation: twinkle 4s ease-in-out infinite;
}

.sparkle--1 { top: 6%;  left: 5%;  width: 10px; height: 10px; animation-delay: 0s;   }
.sparkle--2 { top: 14%; right: 6%; width: 14px; height: 14px; animation-delay: 1.2s; }
.sparkle--3 { bottom: 24%; left: 7%; width: 12px; height: 12px; animation-delay: 2.4s; }
.sparkle--4 { bottom: 14%; right: 8%; width: 9px;  height: 9px;  animation-delay: 3.1s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.18; transform: scale(0.9); }
    50%      { opacity: 0.55; transform: scale(1.1); }
}

/* -------- Layout -------- */
.page {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding:
        calc(32px + env(safe-area-inset-top, 0px))
        clamp(18px, 5.5vw, 24px)
        calc(28px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* -------- Hero -------- */
.hero {
    text-align: center;
    margin-bottom: 32px;
}

.logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.logo {
    width: 100%;
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 6px 20px rgba(145, 151, 209, 0.25));
}

.title {
    font-family: 'Just Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 6.2vw, 2.1rem);
    line-height: 1.18;
    letter-spacing: -0.012em;
    color: var(--color-text-light);
    margin-bottom: 12px;
    text-wrap: balance;
}

.subtitle {
    font-weight: 400;
    font-size: clamp(0.95rem, 3.8vw, 1.05rem);
    line-height: 1.5;
    color: var(--color-text-muted);
    max-width: 440px;
    margin: 0 auto 8px;
    text-wrap: balance;
}

.support-line {
    font-weight: 300;
    font-size: clamp(0.82rem, 3.4vw, 0.9rem);
    line-height: 1.5;
    color: var(--color-text-dim);
    max-width: 420px;
    margin: 0 auto;
    text-wrap: balance;
}

/* -------- Lista de links -------- */
.links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px;
    min-height: 72px;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    color: var(--color-text-dark);
    transition:
        transform 0.35s var(--ease),
        box-shadow 0.35s var(--ease),
        border-color 0.35s var(--ease),
        background 0.35s var(--ease);
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.card__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg,
        rgba(145, 151, 209, 0.18) 0%,
        rgba(145, 151, 209, 0.08) 100%);
    color: var(--color-lavender-dim);
    transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

.card__icon svg {
    width: 22px;
    height: 22px;
}

.card__content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.card__title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.22;
    color: var(--color-text-dark);
    letter-spacing: -0.005em;
    word-break: break-word;
}

.card__action {
    font-weight: 400;
    font-size: 0.82rem;
    line-height: 1.3;
    color: var(--color-text-dark-mut);
    transition: color 0.35s var(--ease);
}

.card__arrow {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-lavender-dim);
    transition: transform 0.35s var(--ease), color 0.35s var(--ease);
}

.card__arrow svg {
    width: 16px;
    height: 16px;
}

/* Hover (desktop) */
@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-hover);
        border-color: rgba(145, 151, 209, 0.4);
    }
    .card:hover .card__icon {
        background: linear-gradient(135deg,
            var(--color-lavender) 0%,
            var(--color-lavender-dim) 100%);
        color: #fff;
    }
    .card:hover .card__action {
        color: var(--color-lavender-dim);
    }
    .card:hover .card__arrow {
        transform: translateX(4px);
        color: var(--color-lavender);
    }
}

/* Focus visível p/ acessibilidade */
.card:focus-visible {
    outline: 2px solid var(--color-lavender-soft);
    outline-offset: 3px;
}

/* Toque (mobile) */
.card:active {
    transform: translateY(-1px) scale(0.995);
}

/* -------- Nota de apoio -------- */
.note {
    margin-bottom: 28px;
}

.note__inner {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 16px;
    border: 1px solid rgba(145, 151, 209, 0.15);
    border-radius: 14px;
    background: rgba(145, 151, 209, 0.05);
}

.note__icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--color-lavender);
    margin-top: 2px;
}

.note p {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--color-text-muted);
    font-weight: 400;
}

.note__sub {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--color-text-dim);
    font-weight: 300;
}

/* -------- Rodapé -------- */
.footer {
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid rgba(145, 151, 209, 0.12);
    text-align: center;
}

.footer__brand {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-lavender-soft);
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

.footer__copy {
    font-weight: 300;
    font-size: 0.76rem;
    color: var(--color-text-dim);
    line-height: 1.5;
}

/* -------- Breakpoints -------- */

/* Telas muito pequenas (iPhone SE, etc) */
@media (max-width: 360px) {
    .page {
        padding-left: 16px;
        padding-right: 16px;
    }
    .logo {
        max-width: 190px;
    }
    .card {
        padding: 14px;
        gap: 12px;
    }
    .card__icon {
        width: 40px;
        height: 40px;
    }
    .card__icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Tablet pequeno em diante */
@media (min-width: 640px) {
    .page {
        padding-top: 60px;
        padding-bottom: 36px;
        padding-left: 28px;
        padding-right: 28px;
    }
    .hero {
        margin-bottom: 40px;
    }
    .logo-wrap {
        margin-bottom: 32px;
    }
    .logo {
        max-width: 280px;
    }
    .links {
        gap: 14px;
    }
    .card {
        padding: 20px 22px;
        gap: 18px;
        min-height: 80px;
    }
    .card__icon {
        width: 52px;
        height: 52px;
    }
    .card__icon svg {
        width: 26px;
        height: 26px;
    }
    .card__title {
        font-size: 1.12rem;
    }
    .card__action {
        font-size: 0.88rem;
    }
    .card__arrow {
        width: 28px;
        height: 28px;
    }
    .card__arrow svg {
        width: 18px;
        height: 18px;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .page {
        max-width: 600px;
        padding-top: 80px;
        padding-bottom: 44px;
    }
    .title {
        font-size: 2.25rem;
    }
}

/* Orientação landscape em telefones — encolhe cabeçalho */
@media (max-height: 480px) and (orientation: landscape) {
    .page {
        padding-top: 20px;
    }
    .logo {
        max-width: 160px;
    }
    .logo-wrap {
        margin-bottom: 16px;
    }
    .hero {
        margin-bottom: 20px;
    }
}

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