/* ==================== VARIABLES & RESET ==================== */
:root {
    --bg-color: #f8fafc; --text-dark: #1e293b; --text-main: #334155;
    --text-muted: #64748b; --maroon: #5E001F; --rose-start: #ff0844;
    --rose-end: #ffb199; --border-color: rgba(226, 232, 240, 0.8);
}

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

body {
    margin: 0; background: var(--bg-color); color: var(--text-main);
    font-family: system-ui, -apple-system, sans-serif; line-height: 1.6;
    display: flex; flex-direction: column; align-items: center;
    min-height: 100vh; scroll-behavior: smooth;
}

/* ==================== TYPOGRAPHY ==================== */
h1 {
    font-size: clamp(2.5rem, 5vw, 3.8rem); font-weight: 800; margin: 0 0 20px;
    letter-spacing: -1px; line-height: 1.1; text-align: center;
    background: linear-gradient(135deg, var(--text-dark) 30%, var(--maroon) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-muted);
    margin: 0 auto 52px; font-weight: 500; text-align: center; max-width: 620px;
}

.text-link { color: var(--rose-start); text-decoration: none; font-weight: 600; position: relative; }
.text-link::after { content: ''; position: absolute; width: 100%; height: 2px; bottom: -2px; left: 0; background: var(--rose-start); transform: scaleX(0); transform-origin: right; transition: transform 0.3s ease; }
.text-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ==================== NAVIGATION ==================== */
matek-menu {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(248,250,252,.97);
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
    padding: 14px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    /* NEW: Reserves space before JS loads the menu */
    min-height: 74px;
}
.nav-menu { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.nav-menu ul { list-style: none; padding: 6px 12px; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; background: #fff; border-radius: 99px; box-shadow: 0 4px 16px -6px rgba(0,0,0,.1); }
.nav-menu a { text-decoration: none; color: var(--text-muted); font-weight: 600; padding: 11px 26px; border-radius: 99px; transition: 0.25s ease; display: block; }
.nav-menu a:hover { color: #fff; background: linear-gradient(135deg, var(--rose-start), var(--rose-end)); box-shadow: 0 6px 16px rgba(255,8,68,.22); transform: translateY(-1px); }

/* ==================== HERO & SCENE ==================== */
.ambient-glow { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100vw; max-width: 1200px; height: 600px; background: radial-gradient(ellipse at top, rgba(255,8,68,.07) 0%, transparent 70%); z-index: -1; pointer-events: none; }
.sunrise-scene { width: 100%; max-width: 1200px; margin: clamp(40px, 8vw, 60px) auto 0; padding: 0 24px; text-align: center; animation: fadeInDown 0.8s ease-out; }
.hero-section { padding: 20px 24px 60px; max-width: 800px; text-align: center; animation: fadeInDown 0.6s ease-out; }

.sun-area { position: relative; z-index: 2; margin-bottom: clamp(-32px, -5vw, -48px); display: inline-block; }
.sun-area::before {
    content: ''; position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%);
    width: clamp(300px, 40vw, 480px); height: clamp(150px, 20vw, 240px);
    background: radial-gradient(ellipse at center bottom, rgba(255,177,153,.4) 0%, rgba(255,8,68,.1) 45%, transparent 75%); z-index: -1;
}
.sun-logo, .logo {
    width: clamp(120px, 15vw, 180px);
    display: block;
    margin: 0 auto;
    transition: transform 0.6s ease;
    filter: drop-shadow(0 4px 24px rgba(255,8,68,.18));
    /* NEW: Tells the browser the height scales 1:1 with the clamped width */
    aspect-ratio: 1 / 1;
    height: auto;
}
.logo { margin: 72px auto 24px; width: 138px; filter: none; }
.sun-logo:hover, .logo:hover { transform: scale(1.05) rotate(6deg); }

.water-container { position: relative; z-index: 1; -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 92%); mask-image: linear-gradient(to bottom, #000 30%, transparent 92%); }
.water-svg { display: block; width: 100%; height: auto; }

/* ==================== UNIFIED CONTAINERS & CARDS ==================== */
.mosaic-grid, .problem-list, .content-container { width: 100%; margin: 0 auto; padding: 0 24px 80px; animation: fadeInUp 0.6s ease-out forwards; opacity: 0; display: flex; flex-direction: column; gap: 32px; }
.mosaic-grid { max-width: 1200px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.problem-list { max-width: 860px; }
.content-container { max-width: 850px; }

/* Glassmorphism Card Style Base */
.mosaic-item, .problem-card, .content-block {
    background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(12px); border: 1px solid var(--border-color);
    border-radius: 24px; box-shadow: 0 4px 20px rgba(0,0,0,.03); position: relative; overflow: hidden; transition: all 0.4s ease; text-decoration: none; text-align: left;
}

/* Specific Premium Layout for Mosaic Items */
.mosaic-item {
    padding: 48px 32px; /* Bigger padding for breathing room */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center horizontally */
    justify-content: center;
    text-align: center; /* Center text */
    gap: 24px; /* Perfect spacing between icon and text */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Slight bounce on hover */
}
.problem-card, .content-block { padding: 32px; }

.mosaic-item::before, .problem-card::before, .content-block::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(135deg, var(--rose-start), var(--rose-end)); opacity: 0; transition: opacity 0.4s ease;
}
.mosaic-item:hover, .problem-card:hover, .content-block:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(255,8,68,.08); background: #fff; }
.mosaic-item:hover::before, .problem-card:hover::before, .content-block:hover::before { opacity: 1; }

.problem-card::before { opacity: 0.8; }

/* Unified Card Icons */
.card-icon {
    width: 88px; /* Considerably larger */
    height: 88px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,8,68,.05), rgba(255,177,153,.15));
    color: var(--rose-start); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.4s ease;
    box-shadow: inset 0 0 0 1px rgba(255,8,68,0.08); /* Premium inner border detail */
}
.problem-card .card-icon, .content-block .card-icon { margin-bottom: 24px; width: 60px; height: 60px; border-radius: 16px; }

.card-icon svg {
    width: 44px; /* Larger SVG */
    height: 44px;
    transition: all 0.4s ease;
    stroke-width: 1.5px; /* Thinner stroke looks more elegant */
}
.problem-card .card-icon svg, .content-block .card-icon svg { width: 30px; height: 30px; }

.mosaic-item:hover .card-icon, .content-block:hover .card-icon {
    background: linear-gradient(135deg, var(--rose-start), var(--rose-end));
    color: white;
    border-radius: 28px;
    box-shadow: 0 12px 24px rgba(255,8,68,0.25); /* Glow effect on icon */
}
.mosaic-item:hover .card-icon svg, .content-block:hover .card-icon svg {
    transform: scale(1.15) translateY(-2px);
    stroke-width: 2px; /* Gets slightly bolder on hover */
}

/* Unified Block Text */
.block-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.block-header h2 { font-size: clamp(1.4rem, 2vw, 1.8rem); color: var(--text-dark); margin: 0; font-weight: 800; }

.mosaic-item h2 {
    font-size: clamp(1.25rem, 1.8vw, 1.5rem); /* Optimal size calculation */
    color: var(--text-dark);
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.5px;
    width: 100%;
    /* Guarantee that Valószínűségszámítás fits the box perfectly */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.mosaic-item p, .block-content p, .problem-text { color: var(--text-muted); font-size: 1.1rem; line-height: 1.6; margin: 0 0 16px; }
.mosaic-item p { flex-grow: 1; margin: 0; }
.block-content p:last-child { margin: 0; }
.block-content strong { color: var(--text-dark); font-weight: 600; }

/* ==================== PROBLEM SOLUTIONS ==================== */
.problem-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid rgba(226,232,240,.6); }
.problem-date { font-weight: 700; font-size: 1.1rem; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.problem-date svg { color: var(--rose-start); }
.problem-points { background: linear-gradient(135deg, rgba(255,8,68,.08), rgba(255,177,153,.2)); color: var(--rose-start); padding: 6px 14px; border-radius: 20px; font-weight: 700; font-size: 0.9rem; }
.points-inline { color: var(--text-muted); font-style: italic; font-size: 0.95rem; margin-left: 6px; }

.btn-solution { background: transparent; border: 2px solid var(--rose-end); color: var(--rose-start); padding: 10px 20px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: 0.3s ease; }
.btn-solution:hover { background: linear-gradient(135deg, var(--rose-start), var(--rose-end)); border-color: transparent; color: white; box-shadow: 0 4px 15px rgba(255,8,68,.2); }
.btn-solution svg { transition: transform 0.3s ease; }
.btn-solution.active svg { transform: rotate(180deg); }

.solution-wrapper { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s ease; margin-top: 16px; }
.solution-wrapper.open { grid-template-rows: 1fr; }
.solution-inner { overflow: hidden; }
.solution-content { background: #f8fafc; border-left: 4px solid var(--rose-end); padding: 20px; border-radius: 0 12px 12px 0; margin-top: 8px; font-size: 1.05rem; line-height: 1.6; }

/* ==================== ANIMATIONS & MOBILE ==================== */
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.content-block:nth-child(1){animation-delay:.1s} .content-block:nth-child(2){animation-delay:.2s} .content-block:nth-child(3){animation-delay:.3s}

@media (max-width: 600px) {
    .block-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .mosaic-item, .problem-card, .content-block { padding: 24px; }
    .mosaic-item { padding: 36px 24px; }
}
