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

:root {
    --bg: #0d0c1a;
    --surface: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.08);
    --text: #e8e4f4;
    --muted: rgba(232,228,244,0.42);
    --accent1: #7c3aed;
    --accent2: #9b59e8;
    --accent3: #5b21b6;
    --glow: rgba(124,58,237,0.4);
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── Animated background ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 5%,  rgba(124,58,237,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 85% 85%, rgba(91,33,182,0.16) 0%, transparent 55%),
        radial-gradient(ellipse 45% 40% at 55% 50%, rgba(155,89,232,0.08) 0%, transparent 50%);
    animation: bgPulse 14s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg,  transparent, transparent 59px, rgba(255,255,255,0.018) 60px),
        repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,0.018) 60px);
    pointer-events: none;
    z-index: 0;
}

@keyframes bgPulse {
    0%   { opacity: 0.8; transform: scale(1); }
    50%  { opacity: 1;   transform: scale(1.04); }
    100% { opacity: 0.85; transform: scale(1.01); }
}

/* ── Floating orbs ── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    animation: orbFloat 20s ease-in-out infinite, orbFadeIn 1.5s ease forwards;
}

.orb1 { width: 440px; height: 440px; background: rgba(124,58,237,0.22);  top: -100px; left: -130px; animation-duration: 18s; animation-delay: 0s; }
.orb2 { width: 300px; height: 300px; background: rgba(91,33,182,0.2);    bottom: 8%;  right: -60px; animation-duration: 23s; animation-delay: 2s; }
.orb3 { width: 200px; height: 200px; background: rgba(155,89,232,0.14);  top: 44%;    left: 52%;   animation-duration: 17s; animation-delay: 4s; }

@keyframes orbFadeIn { to { opacity: 1; } }
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0)    scale(1); }
    33%       { transform: translate(30px, -40px) scale(1.06); }
    66%       { transform: translate(-20px, 30px) scale(0.95); }
}

/* ── Layout ── */
.container {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ── Header ── */
header {
    padding: 56px 0 48px;
    opacity: 0;
    transform: translateY(-24px);
    animation: slideDown 0.8s cubic-bezier(0.22,1,0.36,1) 0.2s forwards;
}

@keyframes slideDown {
    to { opacity: 1; transform: translateY(0); }
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
}

/* ── Logo ── */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 16px rgba(124,58,237,0.5);
    transition: box-shadow 0.3s, transform 0.3s;
}

.logo:hover .logo-img {
    box-shadow: 0 0 28px rgba(124,58,237,0.75);
    transform: scale(1.06) rotate(-3deg);
}

/* ── Logo wordmark: "purple" viola, "GPT" bianco — come nel logo ── */
.logo-wordmark {
    font-family: 'Syne', sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;              /* "GPT" bianco */
    position: relative;
}

.logo-wordmark .logo-purple {
    color: var(--accent2);   /* "purple" viola */
}

/* ── Lang selector ── */
.lang-selector select {
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px 8px 12px;
    border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.88rem;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: border-color 0.25s, box-shadow 0.25s;
    outline: none;
}

.lang-selector select:hover,
.lang-selector select:focus {
    border-color: rgba(124,58,237,0.6);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

/* ── Page title ── */
h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    background: linear-gradient(135deg, #fff 30%, var(--accent2) 70%, #b07aff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

#lastUpdate {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 400;
}

/* ── Content sections ── */
#content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px 32px;
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    animation: sectionIn 0.65s cubic-bezier(0.22,1,0.36,1) forwards;
}

@keyframes sectionIn {
    to { opacity: 1; transform: translateY(0); }
}

section::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(124,58,237,0.07) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.35s;
}

section:hover {
    border-color: rgba(124,58,237,0.35);
    box-shadow: 0 0 40px rgba(124,58,237,0.1), 0 8px 32px rgba(0,0,0,0.35);
    transform: translateY(-2px);
}

section:hover::before { opacity: 1; }

section::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent2), var(--accent3));
    opacity: 0;
    transition: opacity 0.35s;
}

section:hover::after { opacity: 1; }

/* ── Section headings ── */
h2 {
    font-family: 'Syne', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--glow);
}

/* ── Body text ── */
section p {
    font-size: 0.97rem;
    font-weight: 400;
    line-height: 1.8;
    color: rgba(232,228,244,0.82);
    letter-spacing: 0.01em;
}

section p strong {
    color: #fff;
    font-weight: 600;
}

section p em {
    color: var(--accent2);
    font-style: normal;
}

/* ── Lists ── */
ul {
    margin-top: 14px;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

li {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: rgba(232,228,244,0.76);
    padding-left: 20px;
    position: relative;
}

li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent2);
    font-size: 1.15rem;
    line-height: 1.7;
}

li strong { color: rgba(232,228,244,0.96); font-weight: 600; }
li em     { color: var(--accent2); font-style: normal; }

/* ── External link ── */
.external-link { margin-top: 18px; }

.external-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 400;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    transition: all 0.28s;
    position: relative;
    overflow: hidden;
}

.external-link a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(91,33,182,0.1));
    opacity: 0;
    transition: opacity 0.28s;
}

.external-link a:hover {
    border-color: rgba(124,58,237,0.5);
    color: #fff;
    box-shadow: 0 0 20px rgba(124,58,237,0.18);
    transform: translateX(4px);
}

.external-link a:hover::before { opacity: 1; }

/* ── Footer ── */
footer {
    margin-top: 60px;
    padding: 28px 0 0;
    border-top: 1px solid var(--border);
    opacity: 0;
    animation: fadeUp 0.7s ease 1.3s forwards;
}

@keyframes fadeUp { to { opacity: 1; } }

footer p {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
    letter-spacing: 0.04em;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.35); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.6); }

/* ── Responsive ── */
@media (max-width: 540px) {
    section { padding: 22px 20px; }
    .header-top { flex-direction: column; align-items: flex-start; gap: 18px; }
}
