/* ==========================================================================
   TELLgen responsive website stylesheet
   Drop-in replacement for: assets/css/style.css
   ========================================================================== */

:root {
    --bg: #f5faf4;
    --panel: #ffffff;
    --ink: #162030;
    --muted: #5f6d6a;
    --line: #dbe7d8;
    --brand: #10243d;
    --brand2: #3f6b49;
    --green-soft: #edf6ea;
    --blue-soft: #eef4f1;
    --gold-soft: #f8f2e6;
    --grey-soft: #f3f5f2;
    --radius: 24px;
    --radius-small: 18px;
    --shadow: 0 18px 44px rgba(22, 42, 26, 0.08);
    --shadow-small: 0 10px 28px rgba(22, 42, 26, 0.07);
    --container: 1180px;
}

/* Reset */

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

html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    scroll-padding-top: 92px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: "Archivo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul {
    margin-top: 0;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
    font: inherit;
}

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

.container {
    width: min(var(--container), calc(100% - 48px));
    margin-inline: auto;
}

/* Header and navigation */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(219, 231, 216, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.logo {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.1;
}

.logo > img {
    width: auto;
    height: 48px;
    flex: 0 0 auto;
    object-fit: contain;
}

.logo-text,
.logo:not(:has(.logo-text)) {
    min-width: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo strong {
    display: block;
    color: var(--brand);
    font-size: 25px;
    line-height: 1;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.logo span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.navlinks {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.navlinks > a {
    position: relative;
    padding: 8px 0;
    white-space: nowrap;
}

.navlinks > a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 2px;
    left: 0;
    height: 2px;
    background: var(--brand2);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.navlinks > a:hover {
    color: var(--brand2);
}

.navlinks > a:hover::after {
    transform: scaleX(1);
}

.lang-switch {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.lang-switch button {
    min-width: 38px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--brand);
    font-weight: 700;
    cursor: pointer;
}

.lang-switch button.active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

/* Hero */

.hero {
    position: relative;
    min-height: 720px;
    overflow: hidden;
    display: flex;
    align-items: center;
    background:
        radial-gradient(circle at 86% 18%, rgba(63, 107, 73, 0.10), transparent 32%),
        linear-gradient(180deg, #f7fafc 0%, #eef4f8 100%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    min-height: 720px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
    align-items: center;
    gap: 42px;
    padding-block: 64px;
}

.hero-copy {
    min-width: 0;
    max-width: 720px;
}

.hero-media {
    position: relative;
    inset: auto;
    width: 100%;
    height: 640px;
    max-width: 610px;
    justify-self: end;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

html[lang="it"] .hero-media {
    background-image: url("../img/tellgen-it-hero-it.png");
}

html[lang="en"] .hero-media {
    background-image: url("../img/tellgen-it-hero-en.png");
}

.hero-overlay {
    display: none;
}

.eyebrow {
    margin-bottom: 14px;
    color: var(--brand2);
    font-size: 0.78rem;
    line-height: 1.4;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

h1 {
    max-width: 760px;
    margin-bottom: 22px;
    color: var(--brand);
    font-size: clamp(3rem, 5.2vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    overflow-wrap: anywhere;
}

.hero-text {
    max-width: 690px;
    margin-bottom: 0;
    color: #334155;
    font-size: clamp(1.05rem, 1.6vw, 1.28rem);
    line-height: 1.65;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--brand);
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(16, 36, 61, 0.16);
}

.btn-secondary {
    border-color: var(--line);
    background: #fff;
    color: var(--brand);
}

/* Shared sections */

section {
    padding-block: 78px;
}

.section-head {
    max-width: 920px;
    margin-bottom: 36px;
}

.section-head.narrow {
    max-width: 760px;
}

.section-head.centered {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.section-head.light h2,
.section-head.light p {
    color: #fff;
}

.section-head h2 {
    margin-bottom: 14px;
    color: var(--brand);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.section-head p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

/* Who we are */

.vision-title {
    width: 100%;
    max-width: none;
    margin-bottom: 30px;
}

.vision-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
    align-items: stretch;
    gap: 38px;
}

.vision-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.vision-intro {
    margin-bottom: 26px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}

.factory-box {
    flex: 1;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #fff, #eef4fb);
    box-shadow: var(--shadow);
}

.factory-box h3 {
    margin-bottom: 12px;
    color: var(--brand);
    font-size: 1.4rem;
    line-height: 1.25;
}

.factory-box p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.72;
}

.vision-side {
    min-width: 0;
    display: flex;
}

.vision-side img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

/* Operational areas */

.band {
    background: linear-gradient(135deg, var(--brand), #17344f);
}

.areas-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.area-card {
    min-width: 0;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    backdrop-filter: blur(5px);
}

.area-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    object-fit: contain;
}

.area-card > span {
    display: block;
    margin-bottom: 12px;
    color: #9ec6e2;
    font-size: 13px;
    font-weight: 800;
}

.area-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    line-height: 1.35;
}

.area-card p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.65;
}

/* Method */

.flow-panel {
    display: grid;
    gap: 14px;
}

.flow-item {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: start;
    gap: 14px 22px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #fff, #edf4fb);
    box-shadow: var(--shadow-small);
}

.flow-item > span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #e9f1f8;
    color: var(--brand2);
    font-weight: 900;
}

.flow-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--brand);
    line-height: 1.4;
}

.flow-item p {
    margin-bottom: 0;
    color: var(--muted);
}

.closing-note {
    max-width: 920px;
    margin: 32px auto 0;
    padding: 30px 34px;
    border: 1px solid #cfe0cc;
    border-radius: var(--radius);
    background: var(--green-soft);
    box-shadow: var(--shadow);
    text-align: center;
}

.closing-note p {
    margin-bottom: 0;
    color: #31452f;
    font-size: 1.18rem;
    line-height: 1.7;
    font-weight: 600;
}

/* Services / network */

.network-band {
    background: linear-gradient(180deg, #eff6fb, #f8fbfd);
}

.network-visual {
    margin-bottom: 28px;
}

.network-visual img {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.network-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.network-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow-small);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.network-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.network-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--brand);
    overflow-wrap: anywhere;
}

.network-card span {
    display: block;
    color: var(--muted);
    line-height: 1.5;
}

/* Contact */

.contact {
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--shadow);
}

.contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.contact-copy {
    min-width: 0;
    flex: 1;
}

.contact-action {
    flex: 0 0 auto;
}

.contact h2 {
    margin-bottom: 12px;
    color: var(--brand);
    font-size: clamp(2rem, 4vw, 2.4rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.contact p {
    margin-bottom: 14px;
    color: var(--muted);
}

.contact p:last-child {
    margin-bottom: 0;
}

.contact a:not(.btn) {
    color: var(--brand2);
    font-weight: 800;
    overflow-wrap: anywhere;
}

/* Footer */

.footer {
    margin-top: 40px;
    padding-block: 38px;
    background: var(--brand);
    color: #d7dee9;
    font-size: 14px;
}

.footer-row {
    display: grid;
    grid-template-columns: 0.9fr 1.35fr 0.85fr;
    align-items: start;
    gap: 40px;
}

.footer-col {
    min-width: 0;
}

.footer strong {
    color: #fff;
}

.footer small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.76rem;
    line-height: 1.45;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.footer p {
    margin: 8px 0 0;
    color: #aeb8c8;
    line-height: 1.55;
}

.footer-email,
.footer-network a {
    color: #d7dee9;
}

.footer-email:hover,
.footer-network a:hover {
    color: #fff;
}

.footer-links p {
    margin-bottom: 6px;
}

.footer-network {
    margin: 0;
    padding-left: 18px;
}

.footer-network li {
    margin: 0 0 6px;
    padding: 0;
    line-height: 1.35;
}

.footer-network span {
    opacity: 0.72;
    font-size: 0.9rem;
}

/* Desktop refinement */

@media (max-width: 1180px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr) minmax(350px, 0.85fr);
        gap: 30px;
    }

    .hero-media {
        height: 570px;
    }

    .vision-layout {
        grid-template-columns: minmax(0, 1fr) minmax(350px, 0.86fr);
        gap: 30px;
    }

    .network-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablet: EPAIA-like stacked, clean presentation */

@media (max-width: 900px) {
    html {
        scroll-padding-top: 76px;
    }

    .container {
        width: min(100% - 36px, var(--container));
    }

    .nav {
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-block: 14px;
    }

    .logo {
        align-self: flex-start;
    }

    .navlinks {
        width: 100%;
        justify-content: flex-start;
        gap: 8px 16px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .navlinks::-webkit-scrollbar {
        display: none;
    }

    .navlinks > a {
        flex: 0 0 auto;
    }

    .lang-switch {
        margin-left: auto;
    }

    .hero {
        min-height: auto;
    }

    .hero-inner {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 26px;
        padding-block: 54px 42px;
    }

    .hero-copy {
        max-width: 760px;
    }

    .hero-media {
        width: min(100%, 650px);
        height: 520px;
        justify-self: center;
        order: 2;
    }

    h1 {
        max-width: 760px;
        font-size: clamp(2.7rem, 8vw, 4.6rem);
    }

    section {
        padding-block: 64px;
    }

    .vision-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .vision-side {
        justify-content: center;
    }

    .vision-side img {
        width: min(100%, 680px);
        height: auto;
        max-height: none;
    }

    .network-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px;
    }

    .footer-col:last-child {
        grid-column: 1 / -1;
    }
}

/* Mobile */

@media (max-width: 640px) {
    :root {
        --radius: 20px;
        --radius-small: 16px;
    }

    html {
        scroll-padding-top: 68px;
    }

    .container {
        width: calc(100% - 28px);
    }

    .topbar {
        position: relative;
    }

    .nav {
        padding-block: 12px;
    }

    .logo {
        gap: 9px;
    }

    .logo > img {
        height: 42px;
    }

    .logo strong {
        font-size: 21px;
    }

    .logo span {
        max-width: 250px;
        margin-top: 3px;
        font-size: 9px;
        line-height: 1.35;
        letter-spacing: 0.08em;
    }

    .navlinks {
        display: grid;
        grid-template-columns: repeat(3, auto);
        justify-content: start;
        gap: 4px 14px;
        overflow: visible;
        font-size: 13px;
    }

    .navlinks > a {
        padding: 6px 0;
    }

    .lang-switch {
        grid-column: 1 / -1;
        margin: 4px 0 0;
    }

    .lang-switch button {
        min-width: 40px;
        min-height: 36px;
    }

    .hero {
        background:
            radial-gradient(circle at 82% 10%, rgba(63, 107, 73, 0.10), transparent 34%),
            linear-gradient(180deg, #f7fafc 0%, #eef4f8 100%);
    }

    .hero-inner {
        gap: 20px;
        padding-block: 42px 34px;
    }

    .eyebrow {
        margin-bottom: 11px;
        font-size: 0.7rem;
        line-height: 1.5;
        letter-spacing: 0.1em;
    }

    h1 {
        margin-bottom: 18px;
        font-size: clamp(2.35rem, 12vw, 3.4rem);
        line-height: 1;
        letter-spacing: -0.048em;
    }

    .hero-text {
        font-size: 1rem;
        line-height: 1.65;
    }

    .actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        margin-top: 24px;
    }

    .actions .btn {
        width: auto;
        min-width: 0;
        min-height: 46px;
        padding: 11px 18px;
        font-size: 0.94rem;
        white-space: normal;
    }

    .hero-media {
        width: 100vw;
        max-width: none;
        height: min(118vw, 520px);
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        justify-self: stretch;
        background-size: contain;
        background-position: center top;
    }

    section {
        padding-block: 52px;
    }

    .section-head,
    .vision-title {
        margin-bottom: 26px;
    }

    .section-head h2 {
        margin-bottom: 12px;
        font-size: clamp(1.9rem, 9vw, 2.55rem);
        line-height: 1.08;
    }

    .section-head p,
    .vision-intro {
        font-size: 1rem;
        line-height: 1.7;
    }

    .vision-layout {
        gap: 22px;
    }

    .vision-intro {
        margin-bottom: 20px;
    }

    .factory-box,
    .area-card,
    .flow-item,
    .network-card,
    .contact,
    .closing-note {
        padding: 22px;
    }

    .factory-box h3 {
        font-size: 1.25rem;
    }

    .factory-box p {
        font-size: 1rem;
    }

    .vision-side img,
    .network-visual img {
        border-radius: 18px;
    }

    .areas-grid,
    .network-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .area-card {
        min-height: 0;
    }

    .area-icon {
        width: 46px;
        height: 46px;
    }

    .flow-item {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px 15px;
    }

    .flow-item > span {
        width: 44px;
        height: 44px;
        border-radius: 14px;
        font-size: 0.9rem;
    }

    .flow-item strong {
        line-height: 1.3;
    }

    .closing-note {
        margin-top: 24px;
    }

    .closing-note p {
        font-size: 1.04rem;
        line-height: 1.65;
    }

    .network-visual {
        margin-bottom: 20px;
    }

    .contact-row {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .contact-action {
        width: auto;
        align-self: flex-start;
    }

    .contact-action .btn {
        width: auto;
        min-width: 180px;
        min-height: 46px;
        padding: 11px 20px;
    }

    .contact h2 {
        font-size: 2rem;
    }

    .footer {
        margin-top: 20px;
        padding-block: 32px;
    }

    .footer-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-col:last-child {
        grid-column: auto;
    }
}

/* Very small phones */

@media (max-width: 380px) {
    .container {
        width: calc(100% - 22px);
    }

    .navlinks {
        grid-template-columns: repeat(2, auto);
        gap: 3px 12px;
    }

    .logo span {
        max-width: 210px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .actions .btn,
    .contact-action,
    .contact-action .btn {
        width: 100%;
    }

    .contact-action .btn {
        min-width: 0;
    }

    .hero-media {
        width: 100vw;
        height: min(122vw, 455px);
    }

    .factory-box,
    .area-card,
    .flow-item,
    .network-card,
    .contact,
    .closing-note {
        padding: 19px;
    }

    .flow-item {
        grid-template-columns: 1fr;
    }

    .flow-item > span {
        margin-bottom: 2px;
    }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (max-width: 720px) {
    .hero-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .hero-copy {
        order: 1;
        width: 100%;
    }

    .hero-media {
        order: 2;
        position: relative;
        inset: auto;
        width: 100%;
        max-width: none;
        height: auto;
        aspect-ratio: 1 / 1;
        margin: 24px 0 0;
        justify-self: auto;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
}

@media screen and (max-width: 600px) {

    .hero {
        min-height: auto !important;
        height: auto !important;
        overflow: hidden;
    }

    .hero-inner {
        width: calc(100% - 28px);
        min-height: auto !important;
        height: auto !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;

        grid-template-columns: none !important;
        gap: 24px !important;

        padding-top: 42px;
        padding-bottom: 32px;
    }

    .hero-copy {
        position: relative !important;
        order: 1;

        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    .hero-copy h1,
    .hero-copy p,
    .hero-copy .actions {
        width: 100%;
        max-width: none;
    }

    .hero-media {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        inset: auto !important;

        order: 2;

        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 1 / 1;

        margin: 0 !important;
        padding: 0 !important;

        transform: none !important;

        background-size: contain !important;
        background-position: center top !important;
        background-repeat: no-repeat !important;
    }
}