:root {
    --color1: #02408C;
    --color2: #96ADD6;
    --color3: #EC6649;
}

/*** Reset ***/
*{box-sizing: border-box;}
html{ scroll-behavior: smooth; }
body{ margin:0; font-family: "Open Sans", sans-serif; padding-top:76px; }
img{max-width:100%;height:auto;}
a{text-decoration:none;color:inherit;}
h1,h2,h3,h4{ margin:0;}
figure{margin:0;}
input, textarea{font-size:inherit;font-family:inherit;}

/*** Grid ***/
.container{max-width:1125px;margin:0 auto;padding:0 15px; position:relative; z-index:1;}
.row{margin:0 -15px; display:flex; flex-wrap:wrap; align-items:stretch;}
.row:after{content:'.';clear:both;display:block;height:0;visibility:hidden;}
.col{padding:0 15px;min-height:1px;}
.col1{width:8.333%;}
.col2{width:16.666%;}
.col3{width:25%;}
.col4{width:33.333%;}
.col5{width:41.666%;}
.col6{width:50%;}
.col7{width:58.33%;}
.col8{width:66.666%;}
.col9{width:75%;}
.col10{width:83.333%;}
.col11{width:91.666%;}
.col12{width:100%;}


/* Header */
.main-header{ position:fixed; top:0; left:0; width:100%; z-index:99; background:var(--color1); box-shadow: 0 0 10px rgba(0,0,0,0.3);}
.main-header .header-row{ justify-content: space-between; align-items: center; }
.logo-row{display:flex;}
.logo-row img{display:block; height:76px;}
.main-menu{ text-align:right; margin-right:2em;}
.main-menu ul, .main-menu li{ list-style-type: none; padding:0; margin:0; }
.main-menu li{ display:inline-block; margin-left:2em; }
.main-menu li a{ font-size:1.25em; color:var(--color2); transition: 0.2s;}
.main-menu li a:hover{ text-decoration: underline; color:#FFF;}
.main-menu li a.active-menu{ color:#FFF;}

/* HOME */
.home-intro{ position:relative; height:calc(100vh - 76px); background:url('../img/intro_background.png') no-repeat right bottom; background-size:auto 100%;}
.home-intro header{ position:absolute; width:45%; top:50%; left:0; transform: translateY(-50%); margin-left:76px; display:flex; flex-wrap: wrap;}
.home-intro header img{ width:100%; margin-top:1vh; }
.home-intro header .intro-image{ width:40%;}
.home-intro header .intro-text{padding-left:2em;  width:60%; color:var(--color1);}
.home-intro header h2{ font-size:5vh; line-height: 1.2em;}
.home-intro header p{ font-size:1.2em; line-height: 1.5em; margin:1.25em 0;}
.intro-pic{ text-align: right;}

.button1{ background:var(--color1); color:#FFF; display:inline-block; border-radius:1.5em; padding:0.5em 1em; font-size:1.25em; border:1px solid var(--color1); transition:0.2s; }
.button1:hover{ opacity:0.8; }

.about-top{ display:flex; flex-wrap: wrap;}
.about-top-left{ width:20%; }
.about-top-right{ width:80%; }
.about-top-left .about-square{ width:100%;}
.about-square{ position:relative; width:20%; height:20vw; }
.about-square img{ width:100%; display:block; height:100%; object-fit:cover; }
.about-top-right h2{ background:var(--color2); color:var(--color1); padding:1.5em; font-size:2em; text-align:right; }
.about-top-right p{ color:var(--color1); line-height: 1.5em; width:75%; padding:4em 4em 0 4em; font-size: 1.45em; }
.about-bottom{ display: flex; flex-wrap: wrap;}
.about-anchor{ position:absolute; margin-top:-76px;}

.home-gen{ display:flex; flex-wrap: wrap; align-items: stretch; background-color: var(--color2); color:var(--color1); }
.home-gen-left{ width:30%;}
.home-gen img{width: 100%; height:100%; object-fit: cover; }
.home-gen-right{ width:70%; padding:4em;}
.home-gen-header-wrapper{ display:flex; flex-wrap: wrap; justify-content: space-between; align-items: center; width:95%;}
.home-gen-right header{}
.home-gen-right header h2{ font-size:3em; }

.home-gen-points{ display:flex; flex-wrap: wrap; margin-top:4em;} 
.home-gen-point{ width:50%; padding:0 5em 0 0; margin-bottom:4em; }
.home-gen-point h3{ font-size:2em; }
.home-gen-point h3 span{ margin-right:0.5em;}
.home-gen-point p{  }
.home-gen-point a{ text-decoration: underline; font-weight: bold;}

.home-el{ min-height: 100vh; position:relative; }
.home-el-wrap{ position:absolute; top:50%; left:12.5%; width:75%; transform:translateY(-50%); text-align:center;}
.home-el h2{ font-size:2.5em; color:var(--color1); margin-bottom:2em; font-weight: 400;}
.home-el h3{ font-size:2.5em; color:var(--color1); margin-top:2em; font-weight: 400;}
.home-el a{  margin-top:2em; }
.home-el-pics{ display:flex; justify-content: space-between;}
.home-el-pics img{ display:inline-block; width:12%; }

.home-lib{ display:flex; flex-wrap: wrap; border-top:7em solid #EC6649; }
.lib-left{ width:60%; padding:3em 3em 0 3em; }
.lib-left img{ width:100%; height:100%; object-fit: cover; } 
.lib-right{ width:40%; }
.lib-right h2{font-size:2.5em; color:var(--color1); margin:1.25em 0 1em 0; }
.lib-right p{ width:55%; color:var(--color1); font-size:1.15em; line-height: 1.5em; }
.lib-right p span{ display:block; margin:4em 0 1em 0; font-weight: bold;}

.contacts-anchor{ position:absolute; margin-top:-76px; }
.home-contacts{ background-color:var(--color1); color:#fff; padding:6em 12.5%; text-align:center; }
.home-contacts header h2{ font-size:2.5em; margin-bottom:0.6em; font-weight:700; }
.home-contacts header p{ font-size:1.15em; opacity:0.85; margin-bottom:2.5em; line-height:1.6; }
.home-contacts-details{ display:flex; justify-content:center; gap:3em; flex-wrap:wrap; margin-top:1em; }
.home-contacts-item{ display:flex; align-items:center; gap:0.6em; font-size:1.05em; }
.home-contacts-item i{ font-size:1.2em; opacity:0.7; }
.home-contacts-item a{ color:#fff; text-decoration:underline; }

.home-news{ background-color: #F9B8B0; padding:6em 4em; }
.home-news-container{ width:80%; margin:0 auto; }
.home-article{ background:#FFF; }
.home-article header{ padding:1em 2em; color:var(--color1); }
.home-article header h3{ font-size:1.75em; }
.home-article a.button1{ font-size:1em; margin-top:0.5em; }
.home-article figure{ position:relative; padding-top:100%; }
.home-article figure img{ position:absolute; top:0; left:0; width:100%; height:100%; object-fit: cover;}

.main-footer{ background:#FFF; padding:3em 3em; margin-top:3em; }
.footer-container{  width:80%; margin:0 auto; }
.footer-top{ color:var(--color1); margin-bottom:5em; }

.footer-logos{ display:flex; justify-content: space-between; align-items:end }
.footer-logos img{ height:32px; margin:0 1em 0 0;}
.footer-logos h4{ color:var(--color1); font-size:1em; margin-bottom:1em; }

.page-section{ padding:3em 0;}
.page-section > header{ color:var(--color1); text-align: center ; margin-bottom:60px; }
.page-section > header h2{ font-size:2.5em;}
.page-section > header p{ font-size:1.25em; }

.game-item{ color:var(--color1); box-shadow:0 0 5px rgba(0,0,0,0.3); margin-bottom:30px;  }
.game-item figure{ position:relative; padding-top:100%; }
.game-item figure img{ position:absolute; top:0; left:0; width:100%; height:100%; object-fit:cover; }
.game-item header{ padding:1em; }
.game-item header h3{font-size:1.75em; }
.game-item header p{}
.game-item header a.button1{ font-size:1em; background-color: var(--color3); border:none; }
.game-featured-badge{ display:inline-block; background:var(--color3); color:#fff; font-size:0.75em; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; padding:0.25em 0.65em; border-radius:3px; margin-bottom:0.5em; }

.article-section .finish-buttons{ text-align: left; margin:2em 0; }
.article-section .finish-buttons .finish-button{ margin:0 1em 0 0; }

.article-section{ padding:3em 0;}
.article-section > header{ color:var(--color1); margin-bottom:60px; }
.article-section > header h2{ font-size:2.5em;}
.article-section > header h4{ color:var(--color3); font-size:1.5em; }
.article-section > header p{ font-size:1.25em; }


/*** Medium ***/
@media screen and (max-width:768px){

	/*** M Grid ***/
	.m-col1{width:8.333%;}
	.m-col2{width:16.666%;}
	.m-col3{width:25%;}
	.m-col4{width:33.333%;}
	.m-col5{width:41.666%;}
	.m-col6{width:50%;}
	.m-col7{width:58.333%;}
	.m-col8{width:66.666%;}
	.m-col9{width:75%;}
	.m-col10{width:83.333%;}
	.m-col11{width:91.666%;}
	.m-col12{width:100%;}

}

/*** Small ***/
@media screen and (max-width:480px){

	/*** S Grid ***/
	.s-col1{width:8.333%;}
	.s-col2{width:16.666%;}
	.s-col3{width:25%;}
	.s-col4{width:33.333%;}
	.s-col5{width:41.666%;}
	.s-col6{width:50%;}
	.s-col7{width:58.33%;}
	.s-col8{width:66.666%;}
	.s-col9{width:75%;}
	.s-col10{width:83.333%;}
	.s-col11{width:91.666%;}
	.s-col12{width:100%;}

}


/* Generator Styles */
.generator-container {
    margin:0;
    padding:1.5em;
    background-color: #FFF;
}

.steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}

.steps-indicator .step {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background:#CCC;
    border-radius: 5px;
    opacity: 0.7;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.steps-indicator .step.active {
    background: var(--color3);
    color: white;
    opacity: 1;
}

.step-content {
    display: none;
    animation: fadeIn 0.5s ease;
    padding-top:1em;
}

.step-content h2{
    color:var(--color1);
    margin-bottom:1em;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    /*margin-bottom: 1em;*/
}

.form-group label {
    display: block;
    margin-bottom: 0.25em;
    /*font-weight: 700;*/
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding:0.5em 1em;
    border: 2px solid #E4E4E4;
    border-radius: 6px;
    font-size:1em;
    transition: border-color 0.3s ease;
    margin-bottom:1.5em;
    background:#f2f2f2;
}

.form-group select {
    cursor: pointer;
    appearance: auto;
}

/* Two fields side by side on one row */
.form-row {
    display: flex;
    gap: 1.5em;
    align-items: flex-start;
}
.form-row .form-group {
    flex: 1;
}
/* Narrow slot (e.g. language select) */
.form-row .form-group--narrow {
    flex: 0 0 160px;
}
/* Align checkbox row to center vertically */
.form-row--baseline {
    align-items: center;
}
.form-group--checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 1.5em;
}
.form-group--checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
    white-space: nowrap;
}
.form-group--checkbox input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    cursor: pointer;
}

/* Hint text next to label */
.label-hint {
    font-size: 0.8em;
    color: #888;
    margin-left: 0.4em;
    font-weight: normal;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-navigation {
    /*display: flex;
    justify-content: space-between;*/
    margin-top: 0;
    position:relative;
    min-height:2em;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn{
    padding:0.5em 1em; 
    border:none;
    background: var(--color1);
    color:#FFF;
    border-radius:6px;
    cursor: pointer;
    font-size:1.1em;
}

/*.btn-secondary:hover {
    background-color: #5a6268;
}*/

.form-navigation button:nth-child(2), .form-navigation button:nth-child(3){
    position:absolute;
    right:0;
    top:0;
}

.questions-list {
  
}

h2.questions-title{
    background:var(--color3);
    color:#FFF;
    padding:0.5em 0.5em;
    color:#FFF;
}

.questions-list label{
    color:var(--color1);
    margin-bottom:0.5em;
    font-weight: 700;
    font-size:1.2em;
}

.question-item{
    width:100%;
    padding:1em; 
    border:1px solid #CCC;
    margin-bottom:2%;
    background-color: #f2f2f2;
}

.question-item input, .question-item textarea{
    background:#FFF !important;
}

.question-item .form-group input{
    margin-bottom:0;
}

.answer-group input[type="text"]{
    padding:0.25em 0.5em; 
    border-radius:6px;
    margin-bottom:0.5em;
    border:1px solid #CCC;
    width:500px;
}

#generator-finish{
    display:none;
    padding:4em 0 4em 0;
    min-height: 75vh;
}

#generator-finish h2{
    text-align: center;
    color:var(--color1);
    margin-bottom:2em;
    font-size:2.5em;
}

.finish-buttons{
    text-align:center;
}

.finish-buttons h4{
    font-weight: 400;
    font-size:1.25em;
    margin-bottom:1em;
}

.finish-button{
    display:inline-block;
    background-color: var(--color1);
    color:#FFF;
    padding:0.5em 1em;
    cursor: pointer;
    border-radius:6px;
    font-size:1.25em;
    margin:0 1em;
}

.finish-share{
    margin-top:2.5em;
    text-align:left;
}

.finish-share h4{
    font-weight:400;
    font-size:1.25em;
    margin-bottom:0.75em;
}

.finish-share-url{
    display:flex;
    gap:0.5em;
    align-items:center;
    margin-bottom:1.25em;
}

.finish-share-url input[type="text"]{
    flex:1;
    padding:0.45em 0.75em;
    border:1px solid #ccc;
    border-radius:6px;
    font-size:1em;
    background:#f7f7f7;
    color:var(--color1);
}

.finish-share-url button,
.finish-share-email-row button{
    display:inline-flex;
    align-items:center;
    gap:0.4em;
    background-color:var(--color1);
    color:#fff;
    border:none;
    border-radius:6px;
    padding:0.45em 1em;
    font-size:1em;
    cursor:pointer;
    white-space:nowrap;
    transition:background-color 0.2s;
}

.finish-share-url button:hover,
.finish-share-email-row button:hover{
    background-color:var(--color3);
}

.finish-share-url button.copied{
    background-color:#2a9d5c;
}

.finish-share label{
    display:block;
    font-size:0.95em;
    margin-bottom:0.4em;
    color:var(--color1);
}

.finish-share-email-row{
    display:flex;
    gap:0.5em;
    align-items:center;
}

.finish-share-email-row input[type="email"]{
    flex:1;
    padding:0.45em 0.75em;
    border:1px solid #ccc;
    border-radius:6px;
    font-size:1em;
}

.finish-email-msg{
    margin-top:0.5em;
    font-size:0.9em;
}

.finish-email-msg--ok{
    color:#2a9d5c;
}

.finish-email-msg--err{
    color:#c0392b;
}

#content-edit{
    
}

#ai-loader{
    position:absolute;
    width:100%;
    padding:3em;
    z-index:99;
    background:#FFF;
    text-align:center;
    font-size:2em;
    display: none;
}

#ai-loader div:first-child{
    animation:loading_anim 2s infinite;
}

#ai-loader div:last-child{
    font-size:0.6em; 
    color:#666;
}

@keyframes loading_anim {
    0%{opacity:1;}
    50%{opacity:0;}
    100%{opacity:1;}
}

/* --- Step 2: board sections layout --- */
.board-sections-wrapper {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.board-section {
    border: 2px solid #E4E4E4;
    border-radius: 10px;
    padding: 1.5em 1.75em;
    transition: border-color 0.2s;
    flex: 1;
}

.board-section--active {
    border-color: var(--color1);
    background: #f5f8ff;
}

.custom-board-summary {
    margin-top: 1.25em;
    display: flex;
    flex-direction: column;
    gap: 0.35em;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92em;
    padding: 0.2em 0;
    border-bottom: 1px solid #eee;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #555;
}

.summary-value {
    font-weight: 700;
    color: var(--color1);
}

.board-section-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--color1);
    margin-bottom: 1em;
}

.board-section-intro {
    color: #555;
    margin: 0 0 1.25em;
    font-size: 0.95em;
}

.board-sections-divider {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 0 1.25em;
    color: #aaa;
    font-size: 0.85em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
}

.board-sections-divider::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #E4E4E4;
}

.board-sections-divider span {
    position: relative;
    background: #fff;
    padding: 0.5em 0;
}

/* --- Board fullscreen overlay --- */
#board-fullscreen {
    display: none;
    position: fixed;
    top: 76px; /* header height */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: #fff;
    flex-direction: column; /* active when display:flex */
    overflow: hidden;
}

.board-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    justify-content: center;
}

#main-canvas {
    /* Size is driven by the p5.js canvas element created inside */
    flex: 0 0 auto;
    overflow: hidden;
    position: relative;
}

.board-fullscreen-bar {
    position: sticky;
    top: 0;
    z-index: 41;
    background: #fff;
    border-bottom: 1px solid #E4E4E4;
    padding: 0.75em 1.5em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
}

.board-fullscreen-back {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.95em;
    color: var(--color1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.4em 0;
}

.board-fullscreen-back:hover { text-decoration: underline; }

.board-fullscreen-title {
    font-weight: 700;
    color: var(--color1);
    flex: 1;
    text-align: center;
    font-size: 1em;
}

.board-fullscreen-close {
    background: none;
    border: none;
    font-size: 1.3em;
    color: #666;
    cursor: pointer;
    padding: 0.2em 0.4em;
    line-height: 1;
    border-radius: 4px;
}

.board-fullscreen-close:hover { color: var(--color3); }

@media (max-width: 768px) {
    .board-body {
        flex-direction: column;
        overflow-y: auto;
        justify-content: flex-start;
    }
    /* Controls move below the canvas */
    .toggle-container {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid black;
        flex-shrink: 0;
        max-height: 45vh;
        overflow-y: auto;
    }
}

/* Template selection grid --- */
.templates-intro {
    color: #555;
    margin-bottom: 1.5em;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
    margin-bottom: 1.25em;
}

.template-card {
    border: 2px solid #E4E4E4;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.template-card:hover {
    border-color: var(--color2);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.template-card.selected {
    border-color: var(--color1);
    box-shadow: 0 0 0 3px rgba(2, 64, 140, 0.15);
}

.template-thumb {
    aspect-ratio: 4/3;
    background: #f2f2f2;
    overflow: hidden;
    margin: 0;
}

.template-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8edf5, #c8d4e8);
}

.template-info {
    padding: 0.85em 1em;
}

.template-info h3 {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--color1);
    margin-bottom: 0.2em;
}

.template-subtitle {
    font-size: 0.8em;
    color: #666;
    margin: 0 0 0.6em;
}

.template-counts {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 0.8em;
    font-size: 0.75em;
    color: #444;
}

.template-counts span {
    color: #888;
}

/* Empty state */
.templates-empty {
    padding: 2em;
    text-align: center;
    color: #888;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin-bottom: 1.5em;
}

/* Footer with customize button */
.templates-footer {
    border-top: 1px solid #eee;
    padding-top: 1.25em;
    margin-top: 0.5em;
}

/* Custom board panel header */
.custom-board-header {
    margin-bottom: 1em;
}

.btn-text-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--color1);
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

.btn-text-link:hover {
    color: var(--color3);
}

/* --- Language rules overlay: show only active language --- */
html[lang="en"] #ptRules { display: none; }
html[lang="pt"] #enRules { display: none; }

/* --- Language switcher --- */
.lang-switcher a {
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0.7;
}
.lang-switcher a:hover {
    opacity: 1;
}

/* =====================================================
   HAMBURGER BUTTON
   ===================================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75em 1em;
    margin-left: auto;
    flex-shrink: 0;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color2);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.2s;
}
.menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================================================
   RESPONSIVE — 900 px (tablets)
   ===================================================== */
@media screen and (max-width: 900px) {

    /* Header layout */
    .main-header .col4 { flex: 1; width: auto; }
    .main-header .col8 {
        flex: 0 0 auto;
        width: auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    .menu-toggle { display: flex; }

    /* Mobile nav dropdown */
    .main-menu {
        display: none;
        position: fixed;
        top: 76px;
        left: 0;
        right: 0;
        background: var(--color1);
        margin: 0;
        padding: 0.5em 0 1em;
        box-shadow: 0 4px 16px rgba(0,0,0,0.35);
        z-index: 98;
        text-align: left;
    }
    .main-menu.is-open { display: block; }
    .main-menu ul { display: block; }
    .main-menu li { display: block; margin: 0; }
    .main-menu li a {
        display: block;
        padding: 0.9em 1.5em;
        font-size: 1.05em;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .main-menu li:last-child a { border-bottom: none; }

    /* Hero */
    .home-intro header { width: 72%; margin-left: 4%; }

    /* About — hide side column, full-width text */
    .about-top-left { display: none; }
    .about-top-right { width: 100%; }
    .about-top-right h2 { text-align: left; font-size: 1.6em; }
    .about-top-right p  { width: 90%; padding: 2em 2em 2em 2em; font-size: 1.2em; }
    .about-square { width: 25%; height: 25vw; }

    /* Generator — image on top, content below */
    .home-gen { flex-direction: column; }
    .home-gen-left  { width: 100%; height: 280px; }
    .home-gen-right { width: 100%; padding: 3em 2.5em; }
    .home-gen-right header h2 { font-size: 2.2em; }
    .home-gen-point { padding-right: 2em; }

    /* Elements */
    .home-el-wrap { width: 88%; left: 6%; }
    .home-el h2, .home-el h3 { font-size: 2em; }

    /* Library — stack */
    .home-lib { flex-direction: column; }
    .lib-left  { width: 100%; padding: 0; height: 320px; }
    .lib-right { width: 100%; padding: 3em 2.5em; }
    .lib-right p { width: 100%; }

    /* Footer */
    .footer-container { width: 95%; }
}

/* =====================================================
   RESPONSIVE — 580 px (phones)
   ===================================================== */
@media screen and (max-width: 580px) {

    /* Hero — remove absolute trick, use card overlay */
    .home-intro {
        height: auto;
        min-height: calc(100vh - 76px);
        display: flex;
        align-items: center;
        background-position: right bottom;
        background-size: auto 50%;
    }
    .home-intro header {
        position: static;
        width: 88%;
        margin: 2em auto;
        transform: none;
        left: auto;
        top: auto;
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: rgba(255,255,255,0.92);
        padding: 1.75em 1.5em;
        border-radius: 12px;
    }
    .home-intro header .intro-image { width: 48%; margin: 0 auto 0.5em; }
    .home-intro header .intro-text  { width: 100%; padding: 0; text-align: center; }
    .home-intro header h2 { font-size: 5.5vw; }
    .home-intro header p  { font-size: 0.95em; }

    /* About */
    .about-top-right h2 { font-size: 1.25em; padding: 1em; }
    .about-top-right p  { width: 100%; padding: 1em; font-size: 1em; }
    .about-square { width: 33.33%; height: 33vw; }

    /* Generator */
    .home-gen-left  { height: 200px; }
    .home-gen-right { padding: 2em 1.5em; }
    .home-gen-right header h2 { font-size: 1.65em; }
    .home-gen-header-wrapper { flex-direction: column; align-items: flex-start; gap: 1em; }
    .home-gen-point { width: 100%; padding-right: 0; margin-bottom: 2em; }
    .home-gen-point h3 { font-size: 1.4em; }
    .home-gen-points { margin-top: 1.5em; }

    /* Elements — break out of absolute positioning */
    .home-el { min-height: 0; padding: 5em 0; }
    .home-el-wrap {
        position: static;
        top: auto; left: auto;
        transform: none;
        width: 90%;
        margin: 0 auto;
    }
    .home-el h2, .home-el h3 { font-size: 1.4em; }
    .home-el h2 { margin-bottom: 1.5em; }
    .home-el h3 { margin-top: 1.5em; }
    .home-el-pics { flex-wrap: wrap; justify-content: center; gap: 0.75em; }
    .home-el-pics img { width: 28%; }

    /* Library */
    .home-lib { border-top-width: 4em; }
    .lib-left { height: 220px; }
    .lib-right { padding: 1.75em 1.5em; }
    .lib-right h2 { font-size: 1.75em; margin: 0.75em 0; }
    .lib-right p  { font-size: 1em; }

    /* Contacts */
    .home-contacts { padding: 4em 6%; }
    .home-contacts header h2 { font-size: 1.75em; }
    .home-contacts-details { flex-direction: column; align-items: center; gap: 1.5em; }

    /* Footer */
    .main-footer { padding: 2em 1.5em; }
    .footer-container { width: 100%; }
    .footer-logos { flex-direction: column; gap: 2em; align-items: flex-start; }
    .footer-logos img { height: 26px; }
    .footer-top { margin-bottom: 2.5em; }

    /* Generator — form navigation buttons */
    .form-navigation {
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 2.5em;
    }
    .form-navigation button:nth-child(2),
    .form-navigation button:nth-child(3) {
        position: static;
        margin-left: auto;
    }

    /* Generator — answer inputs (override 500px fixed width) */
    .answer-group input[type="text"] {
        width: 100%;
    }

    /* Generator — generator container padding */
    .generator-container {
        padding: 1em;
    }
}
