/* ============================================================
   EtherHelm — Shared site styles
   Organized into sections:
     1. Base / typography
     2. Layout helpers
     3. Navigation + language dropdown
     4. Hero
     5. Section headings (h2)
     6. Cards (advantage / tech / solution)
     7. Download card
     8. Contact
     9. Footer
    10. Back link
    11. Responsive
   ============================================================ */

/* ---------- 1. Base / typography ---------- */
body {
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
        "Segoe UI Emoji", "Segoe UI Symbol";
    font-weight: 400;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin-top: 0;
}

h1 { font-size: 2.25rem; }
h3 { font-size: 1.1rem; }

/* ---------- 2. Layout helpers ---------- */
.container-main {
    max-width: 1100px;
    margin: 0 auto;
}

.section {
    padding: 4rem 2rem;
}

.section:nth-child(even) {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.section:nth-child(odd) {
    background: #ffffff;
}

/* ---------- 3. Navigation + language dropdown ---------- */
.container-fluid {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    box-shadow: 0px 2px 6px #ddd;
    margin: 0;
    z-index: 10000;
}

.container-fluid a { color: #0d6fb8; }
.container-fluid a.active { background-color: #e1f2f7; }

.brand {
    justify-content: center;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-size: 24px;
}

.brand strong {
    color: rgb(23 81 125);
    font-weight: normal;
}

.logo {
    width: 40px;
    height: 40px;
    background: url('../assets/etherhelm.png') no-repeat center center;
    background-size: contain;
    display: inline-block;
    vertical-align: middle;
    margin: 0 10px;
}

li a {
    --pico-text-decoration: none;
    font-size: 0.8em;
}

.lang-dropdown { position: relative; }

.lang-dropdown-trigger {
    cursor: pointer;
    font-size: 0.8em !important;
    padding: 0 0.5rem;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.lang-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 0.3rem 0;
    min-width: 110px;
    z-index: 20000;
    list-style: none;
    margin: 0;
}

.lang-dropdown-menu.open { display: block; }
.lang-dropdown-menu li { list-style: none; margin: 0; }

.lang-dropdown-menu a {
    display: block !important;
    padding: 0.45rem 1rem !important;
    color: #0d6fb8 !important;
    text-decoration: none !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
}

.lang-dropdown-menu a:hover { background: #e1f2f7; }
.lang-dropdown-menu a.active-lang { font-weight: 600; background: #f0f7fc; }

/* ---------- 4. Hero ---------- */
.hero {
    text-align: center;
    padding: 4rem 2rem 3rem;
    background: linear-gradient(135deg, #f4f7fb 0%, #e6eef6 50%, #d6e6f4 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    padding-top: 4rem;
    position: relative;
    z-index: 1;
}

/* Metallic gradient hero heading (h1 or h2 used as hero title) */
.hero h1,
.hero h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 2.8rem;
    position: relative;
    padding-bottom: 0.5rem;
    color: #5a6a73;
    background: linear-gradient(180deg,
        #ffffff 0%, #57ade6 25%, #b1daf4 50%, #f4f6f7 75%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85),
        0 2px 4px rgba(0, 0, 0, 0.36),
        0 6px 12px rgba(13, 111, 184, 0.24);
    letter-spacing: 0.02em;
    font-weight: 700;
    line-height: 1.02;
}

/* Hero title underline is disabled inside hero */
.hero h1::after,
.hero h2::after { display: none; }

.hero-logo {
    width: 18vw;
    height: 18vw;
    background: url('../assets/etherhelm.png') no-repeat center center;
    background-size: contain;
    margin: 0 auto 2rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.36));
}

.hero-subtitle,
.hero-name,
.hero-tagline {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 300;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: #aaa;
}

.hero-tagline {
    font-style: normal;
    color: #4a6a7f;
    font-weight: 400;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

.hero-acronym {
    font-size: 1.1rem;
    color: #8a9bab;
    font-weight: 400;
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
}

/* ---------- 5. Section headings (h2) ---------- */
h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
    position: relative;
    padding-bottom: 2rem;
    color: #2e3b42;
    background-image: linear-gradient(180deg, #c8daf5 0%, #1a2329 30%, #192c35 65%, #7cacca 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6),
        0 3px 4px rgba(196, 196, 196, 0.533),
        0 8px 16px rgba(58, 152, 206, 0.08);
    letter-spacing: 0.02em;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #ababab, transparent);
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: #6c757d;
    font-size: 1.0rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* ---------- 6. Cards ---------- */
/* Advantage cards (helm / gplm) */
.advantage-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 0;
}

/* GPLM uses a 3-column advantage grid */
.advantage-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.advantage-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.advantage-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(13, 111, 184, 0.1);
}

.advantage-icon {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.advantage-card h3 {
    color: #0d6fb8;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.advantage-card p {
    color: #495057;
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0;
}

.advantage-card .hl,
.how-text .hl,
.tech-card .hl {
    color: #0d6fb8;
    font-weight: 600;
}

/* Tech cards (helm) */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.tech-card {
    background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
    border: 1px solid #e6eef6;
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 4px 12px rgba(13, 111, 184, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tech-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(13, 111, 184, 0.1);
}

.tech-label {
    display: inline-block;
    background: #e1f2f7;
    color: #0d6fb8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    margin-bottom: 0.6rem;
    letter-spacing: 0.03em;
}

.tech-card h3 {
    color: #123e5a;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.tech-card p {
    color: #495057;
    font-size: 0.84rem;
    line-height: 1.65;
    margin: 0;
}

.future-tag {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.12rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.25rem;
    vertical-align: middle;
}

/* Solution cards (index) */
.solutions {
    padding: 5rem 2rem;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.solutions-intro {
    text-align: center;
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.solution-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.solution-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(13, 111, 184, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
}

.solution-video {
    width: 100%;
    aspect-ratio: 4 / 2;
    height: auto;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.1rem;
    border-bottom: 3px solid #0d6fb8;
    position: relative;
    overflow: hidden;
}

.solution-video video,
.solution-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: transparent;
    object-position: center;
}

.solution-content {
    padding: 2rem;
}

.solution-card h3 {
    color: #0d6fb8;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.solution-card p {
    color: #495057;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
}

.solution-card li {
    color: #495057;
    line-height: 1.8;
    font-size: 0.8rem;
}

.solution-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    background: #0d6fb8;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.18s ease;
    font-weight: 500;
    font-size: 0.8rem;
    box-shadow: 0 1px 2px rgba(13, 111, 184, 0.12);
    align-self: flex-start;
    width: auto;
    max-width: max-content;
}

.solution-link::after {
    content: '→';
    transition: transform 0.18s ease;
    margin-left: 0.2rem;
}

.solution-link:hover {
    background: #0a5a94;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(13, 111, 184, 0.18);
}

.solution-link:hover::after { transform: translateX(2px); }

/* How-it-works layout (gplm) */
.how-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.how-diagram {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    aspect-ratio: 2 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(13, 111, 184, 0.05);
    overflow: hidden;
    position: relative;
}

.how-diagram img,
.how-diagram video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.how-text h3 {
    color: #123e5a;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.how-text p {
    color: #495057;
    font-size: 0.88rem;
    line-height: 1.7;
    margin: 0 0 1rem 0;
}

.how-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
}

.how-steps li {
    counter-increment: step;
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    font-size: 0.86rem;
    color: #495057;
    line-height: 1.6;
}

.how-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.05rem;
    width: 1.4rem;
    height: 1.4rem;
    background: #e1f2f7;
    color: #0d6fb8;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Compatibility / scope tags */
.compat-section {
    text-align: center;
    margin-top: 2rem;
}

.compat-section p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.scope-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 2rem;
}

.scope-tag {
    background: #e1f2f7;
    color: #0a5a94;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    border: 1px solid #cde6f4;
}

/* Gallery (helm / gplm) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(13, 111, 184, 0.12);
}

.gallery-item video,
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    color: white;
    font-size: 0.78rem;
    padding: 1.5rem 0.75rem 0.6rem;
    text-align: center;
    font-weight: 500;
}

/* ---------- 7. Download card ---------- */
.download-section {
    padding: 6rem 2rem 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.download-desc {
    text-align: center;
    color: #6c757d;
    font-size: 1.05rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.download-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid #e6eef6;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 6px 18px rgba(13, 111, 184, 0.06);
    max-width: 900px;
    margin: 0.5rem auto 2rem;
}

.download-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: #123e5a;
    font-weight: 600;
}

.download-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.download-item {
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-bottom: 1px dashed rgba(18, 62, 90, 0.04);
}

.download-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.download-item strong {
    color: #0f3f5f;
    font-weight: 600;
    font-size: 0.98rem;
}

.download-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.download-link:hover { text-decoration: underline; }

.download-note {
    color: #64748b;
    font-size: 0.95rem;
}

/* ---------- 7b. About page ---------- */
.about-section {
    padding: 3rem 2rem 4rem;
    max-width: 860px;
    margin: 0 auto;
}

.about-section h3 {
    color: #0d6fb8;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.about-section p {
    color: #495057;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.about-section li {
    color: #495057;
    line-height: 1.8;
    font-size: 0.85rem;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #d0dce8, transparent);
    margin: 2rem 0;
}

.pub-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pub-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f4f8;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #495057;
}

.pub-list li:last-child { border-bottom: none; }

.pub-list .pub-links {
    display: inline-flex;
    gap: 0.4rem;
    margin-left: 0.3rem;
}

.pub-list .pub-links a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
}

.pub-list .pub-links a:hover { text-decoration: underline; }

.contact-info {
    text-align: center;
    padding: 1rem 0;
}

/* ---------- 8. Contact ---------- */
.contact {
    padding: 4rem 2rem;
    text-align: center;
    background: white;
    border-top: 1px solid #e9ecef;
}

.contact p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.contact-email {
    font-size: 1.25rem;
    color: #0d6fb8;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
}

.contact-email:hover {
    background: #e1f2f7;
    transform: scale(1.05);
}

/* ---------- 9. Footer ---------- */
footer {
    text-align: center;
    padding: 2rem;
    background: #2d3748;
    color: white;
    font-size: 0.9rem;
}

footer a { color: white; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- 10. Back link ---------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #0d6fb8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.back-link:hover { text-decoration: underline; }
.back-link::before { content: '←'; }

/* ---------- 11. Responsive ---------- */
@media screen and (max-width: 1024px) {
    .hero h1, .hero h2 { font-size: 2rem; }
    .hero-subtitle, .hero-tagline { font-size: 1.1rem; }
    .hero-logo { width: 18vw; height: 18vw; }
    h2 { font-size: 1.75rem; }

    .advantage-grid { grid-template-columns: repeat(2, 1fr); }
    .advantage-grid--3 { grid-template-columns: repeat(3, 1fr); }
    .tech-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .how-layout { grid-template-columns: 1fr; }

    /* Solution cards: stacked on tablet/mobile */
    .solution-card {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-left: 8vw;
        margin-right: 8vw;
    }

    .solution-video {
        width: 100%;
        min-height: 200px;
        border-right: none;
        border-bottom: 3px solid #0d6fb8;
        margin-bottom: 0;
    }

    .solution-content {
        width: 100%;
        padding: 0.75rem;
    }
}

@media screen and (max-width: 480px) {
    .hero { padding: 3rem 1rem 2rem; }
    .hero h1, .hero h2 { font-size: 1.6rem; }
    .hero-subtitle, .hero-tagline { font-size: 1rem; }
    .hero-logo { width: 100px; height: 100px; }
    h2 { font-size: 1.75rem; }
    .brand { width: 75px; font-size: 12px; }

    .advantage-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }
    .section { padding: 2.5rem 1rem; }
    .solutions, .contact { padding: 2rem 1rem; }
    .solution-video { min-height: 140px; }
    .solution-content { padding: 1.5rem; }

    .download-card {
        padding: 1rem;
        margin-left: 1rem;
        margin-right: 1rem;
    }
    .download-section { padding: 5rem 1rem 2rem; }
}

/* Desktop: solution card = video left, content right */
@media screen and (min-width: 1025px) {
    .solution-card {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 1.5rem;
    }

    .solution-video {
        width: 32%;
        aspect-ratio: 4 / 2;
        min-height: 220px;
        border-bottom: none;
        border-right: 3px solid #0d6fb8;
        padding: 0;
        margin-bottom: 0;
    }

    .solution-content {
        width: 68%;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}
