@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500&display=swap');

:root {
    --bg:       #080e18;
    --surface:  #0d1625;
    --card:     #111d2e;
    --border:   rgba(100, 160, 200, 0.12);
    --ocean:    #5ab3d8;
    --melt:     #7ecfed;
    --arctic:   #b0d8ea;
    --accent:   #4aadcf;
    --text:     #cde0ea;
    --muted:    #5e7f95;
    --white:    #ffffff;
    --deep:     #e8f4fa;
    --glow:     rgba(74, 173, 207, 0.15);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    transition: .2s;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

/* ── NAV ── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 64px;
    background: rgba(8, 14, 24, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--melt);
    text-decoration: none;
}

.nav-cta {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    padding: 8px 20px;
    border: 1px solid rgba(74, 173, 207, 0.4);
    border-radius: 50px;
    transition: all 0.25s ease;
    background: rgba(74, 173, 207, 0.06);
}

.nav-cta:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--glow);
}

/* ── HERO ── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    padding: 0 64px 90px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(170deg, #020609 0%, #07131f 35%, #0b2035 65%, #0e2d45 100%);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: url('https://www.aguasdoalgarve.pt/sites/aguasdoalgarve.pt/files/paginas_base/ed_ambiental/polar-bear2.jpg') center/cover no-repeat;
    opacity: 0.12;
    mix-blend-mode: screen;
}

/* Aurora shimmer */
.hero-aurora {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 30%, rgba(30,100,150,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(10,60,100,0.12) 0%, transparent 60%);
    pointer-events: none;
    animation: aurora 8s ease-in-out infinite alternate;
}

@keyframes aurora {
    from { opacity: 0.6; transform: translateX(-10px); }
    to   { opacity: 1;   transform: translateX(10px); }
}

.hero-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 780px;
    animation: fadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-eyebrow {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ocean);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-eyebrow::before {
    content: '';
    display: block;
    width: 36px;
    height: 1px;
    background: var(--ocean);
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(44px, 6.5vw, 82px);
    font-weight: 700;
    line-height: 1.06;
    color: var(--white);
    margin-bottom: 28px;
}

.hero-title em {
    font-style: italic;
    color: var(--melt);
    text-shadow: 0 0 60px rgba(126, 207, 237, 0.25);
}

.hero-lead {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.8;
    color: rgba(176, 216, 234, 0.7);
    max-width: 500px;
    margin-bottom: 44px;
}

.hero-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(126, 207, 237, 0.15);
    border-radius: 10px;
    padding: 16px 24px;
    backdrop-filter: blur(8px);
    transition: border-color 0.3s, background 0.3s;
}

.hero-stat:hover {
    border-color: rgba(126, 207, 237, 0.3);
    background: rgba(255,255,255,0.07);
}

.hero-stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--melt);
}

.hero-stat-label {
    font-size: 11px;
    font-weight: 400;
    color: rgba(176, 216, 234, 0.6);
    max-width: 120px;
    line-height: 1.45;
}

/* ── ARTICLE ── */
.article-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 100px 64px;
}

/* ── EXCERPT CARD ── */
.excerpt-card {
    display: grid;
    grid-template-columns: 3px 1fr;
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    padding: 36px 36px 36px 0;
    margin-bottom: 80px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 40px rgba(0,0,0,0.3);
}

.excerpt-bar {
    background: linear-gradient(180deg, var(--melt), var(--accent));
}

.excerpt-body {
    padding-left: 28px;
}

.excerpt-body strong {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--deep);
    margin-bottom: 14px;
    line-height: 1.45;
}

.excerpt-body p {
    font-size: 15px;
    line-height: 1.85;
    color: var(--muted);
}

/* ── STATS ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 0 0 80px;
    transition: .25s;
}

.stat-card {
    background: var(--card);
    border-radius: 14px;
    padding: 28px 24px;
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
    transition: .5s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0);
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(74,173,207,0.07) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    border-top-color: var(--melt);
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 40px;
    font-weight: 700;
    color: var(--melt);
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(126,207,237,0.2);
}

.stat-desc {
    font-size: 13px;
    font-weight: 300;
    color: var(--muted);
    line-height: 1.55;
}

/* ── DIVIDER ── */
.divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100,160,200,0.2), transparent);
    margin: 64px 0;
}

/* ── SECTION LABEL ── */
.section-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-label::after {
    content: '';
    flex: 1;
    max-width: 36px;
    height: 1px;
    background: var(--accent);
}

/* ── PROSE ── */
.prose-section {
    margin-bottom: 64px;
}

.prose-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--deep);
    margin-bottom: 18px;
    line-height: 1.3;
}

.prose-section p {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.95;
    color: var(--text);
    margin-bottom: 14px;
}

/* ── FIGURES ── */
.figure-block {
    margin: 44px 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    box-shadow: 0 12px 60px rgba(0,0,0,0.5);
}

.figure-block img {
    width: 100%;
    display: block;
    max-height: 480px;
    object-fit: cover;
    filter: brightness(0.88) saturate(0.9);
    transition: filter 0.4s ease;
}

.figure-block:hover img {
    filter: brightness(0.95) saturate(1.05);
}

.figure-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 16px 24px;
    background: linear-gradient(0deg, rgba(2,6,9,0.85), transparent);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: rgba(176, 216, 234, 0.6);
    text-align: right;
}

/* ── CONTENT SPLIT ── */
.content-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
    margin-bottom: 64px;
}

.content-split.reverse { direction: rtl; }
.content-split.reverse > * { direction: ltr; }

.content-split .figure-block { margin: 0; }

/* ── REFERENCES ── */
.references {
    background: var(--card);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid var(--border);
}

.references h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: var(--deep);
    margin-bottom: 24px;
}

.references ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.references li a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 300;
    color: var(--accent);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.references li a::before {
    content: '→';
    font-size: 11px;
    opacity: 0.5;
}

.references li a:hover {
    background: rgba(74,173,207,0.07);
    border-color: var(--border);
    color: var(--melt);
}

/* ── MODAL ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 12, 0.82);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-box {
    background: var(--card);
    border: 1px solid rgba(126,207,237,0.15);
    border-radius: 20px;
    overflow: hidden;
    max-width: 520px;
    width: 90%;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
}

.modal-head {
    background: linear-gradient(135deg, #0b1e33, #153d58);
    border-bottom: 1px solid var(--border);
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-head h5 {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    color: var(--deep);
}

.modal-close {
    background: rgba(126,207,237,0.1);
    border: 1px solid rgba(126,207,237,0.2);
    color: var(--melt);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(126,207,237,0.2);
    color: var(--white);
}

.modal-body {
    padding: 28px;
}

.modal-body img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
}

.modal-body p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.65;
}

/* ── FOOTER ── */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 28px 64px;
    font-size: 12px;
    letter-spacing: 0.05em;
    color: var(--muted);
}

footer strong { color: var(--ocean); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    nav { padding: 16px 24px; }
    .hero { padding: 0 24px 64px; }
    .article-wrap { padding: 64px 24px; }
    .stats-row { grid-template-columns: 1fr; }
    .content-split { grid-template-columns: 1fr; }
    .content-split.reverse { direction: ltr; }
}