/* ==========================================
   m2ea Labs - Main Stylesheet
   ========================================== */

/* CSS Variables */
:root {
    --color-bg: #faf9f7;
    --color-text: #1a1a1a;
    --color-text-muted: #6b6b6b;
    --color-accent: #2d2d2d;
    --color-border: #e8e6e3;
    --color-education: #3d5a80;
    --color-health: #457b5d;
    --color-entertainment: #9c6644;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'DM Sans', -apple-system, sans-serif;
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-weight: 300;
    overflow-x: hidden;
    /* Content Protection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Disable image dragging and selection */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Allow pointer events for interactive elements */
a, button, input, textarea, select {
    pointer-events: auto;
}

::selection {
    background: var(--color-text);
    color: var(--color-bg);
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.025;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ==========================================
   Navigation
   ========================================== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(250, 249, 247, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

nav.scrolled {
    border-bottom-color: var(--color-border);
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--color-text);
    text-decoration: none;
}

.logo span {
    font-style: italic;
    opacity: 0.6;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-text);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--color-text);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--color-text);
}

.nav-links a.active::after {
    width: 100%;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    margin: 5px 0;
    transition: var(--transition);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 2rem;
}

.lang-btn {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-decoration: none;
    letter-spacing: 0.05em;
    font-weight: 400;
    transition: color var(--transition);
    padding: 0.25rem 0.5rem;
}

.lang-btn:hover {
    color: var(--color-text);
}

.lang-btn.active {
    color: var(--color-text);
    font-weight: 500;
}

.lang-divider {
    color: var(--color-border);
    font-size: 0.75rem;
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8rem 3rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    max-width: 900px;
}

.hero-tagline {
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.hero h1 em {
    font-style: italic;
    color: var(--color-text-muted);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0.02em;
    padding: 1rem 0;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.8s;
    transition: gap var(--transition);
}

.hero-cta:hover {
    gap: 1.25rem;
}

.hero-cta svg {
    width: 24px;
    height: 24px;
    transition: transform var(--transition);
}

/* ==========================================
   Page Hero (for subpages)
   ========================================== */
.page-hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8rem 3rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-hero-content {
    max-width: 800px;
}

.page-hero .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color var(--transition), gap var(--transition);
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.1s;
}

.page-hero .back-link:hover {
    color: var(--color-text);
    gap: 0.75rem;
}

.page-hero .back-link svg {
    width: 20px;
    height: 20px;
}

.page-hero-tagline {
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.page-hero-tagline.education { color: var(--color-education); }
.page-hero-tagline.health { color: var(--color-health); }
.page-hero-tagline.entertainment { color: var(--color-entertainment); }

.page-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.3s;
}

.page-hero h1 em {
    font-style: italic;
}

.page-hero h1 em.education { color: var(--color-education); }
.page-hero h1 em.health { color: var(--color-health); }
.page-hero h1 em.entertainment { color: var(--color-entertainment); }

.page-hero-description {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 600px;
    line-height: 1.8;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

/* ==========================================
   Section Styles
   ========================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.section-number {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--color-text-muted);
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
}

/* ==========================================
   Domains Section (Homepage)
   ========================================== */
.domains {
    padding: 8rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.domains-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.domain-card {
    position: relative;
    padding: 3rem 2rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    transition: all var(--transition);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}

.domain-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}

.domain-card:hover::before {
    transform: scaleX(1);
}

.domain-card.education::before { background: var(--color-education); }
.domain-card.health::before { background: var(--color-health); }
.domain-card.entertainment::before { background: var(--color-entertainment); }

.domain-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

.domain-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.domain-card.education .domain-icon { color: var(--color-education); }
.domain-card.health .domain-icon { color: var(--color-health); }
.domain-card.entertainment .domain-icon { color: var(--color-entertainment); }

.domain-card h3 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.domain-card > p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.domain-products {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.domain-products span {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.75rem;
}

.domain-products ul {
    list-style: none;
    font-size: 0.875rem;
}

.domain-products li {
    padding: 0.25rem 0;
    color: var(--color-text);
}

.domain-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text);
    transition: gap var(--transition);
}

.domain-card:hover .domain-card-link {
    gap: 0.75rem;
}

.domain-card-link svg {
    width: 16px;
    height: 16px;
}

/* ==========================================
   Products Section (Subpages)
   ========================================== */
.products {
    padding: 4rem 3rem 8rem;
    max-width: 1400px;
    margin: 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.product-card {
    padding: 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    transition: all var(--transition);
}

.product-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.product-card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.product-card p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.product-features {
    list-style: none;
}

.product-features li {
    font-size: 0.875rem;
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--color-text);
}

.product-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.product-card.education .product-features li::before { background: var(--color-education); }
.product-card.health .product-features li::before { background: var(--color-health); }
.product-card.entertainment .product-features li::before { background: var(--color-entertainment); }

/* ==========================================
   Features Section (Subpages)
   ========================================== */
.features {
    padding: 6rem 3rem;
    background: linear-gradient(180deg, var(--color-bg) 0%, #f5f4f2 100%);
}

.features-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 4rem;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    opacity: 0.7;
}

.feature-item.education .feature-icon { color: var(--color-education); }
.feature-item.health .feature-icon { color: var(--color-health); }
.feature-item.entertainment .feature-icon { color: var(--color-entertainment); }

.feature-item h4 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.feature-item p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ==========================================
   About Section
   ========================================== */
.about {
    padding: 8rem 3rem;
    background: linear-gradient(180deg, var(--color-bg) 0%, #f5f4f2 100%);
}

.about-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 6rem;
    align-items: start;
}

.about-left h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.about-left p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.about-right {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--color-text);
}

.about-right p {
    margin-bottom: 1.5rem;
}

.about-right em {
    font-family: var(--font-serif);
    font-style: italic;
}

/* ==========================================
   Philosophy Section
   ========================================== */
.philosophy {
    padding: 8rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    margin-top: 4rem;
}

.philosophy-item {
    position: relative;
}

.philosophy-number {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-style: italic;
    color: var(--color-border);
    margin-bottom: 1rem;
}

.philosophy-item h4 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.philosophy-item p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ==========================================
   CTA Section (Subpages)
   ========================================== */
.cta-section {
    padding: 6rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.cta-section h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--color-text);
    color: var(--color-bg);
    text-decoration: none;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    border-radius: 2px;
    transition: all var(--transition);
}

.cta-button:hover {
    background: var(--color-text-muted);
    gap: 1rem;
}

.cta-button svg {
    width: 18px;
    height: 18px;
}

/* ==========================================
   Contact Section
   ========================================== */
.contact {
    padding: 8rem 3rem;
    background: var(--color-text);
    color: var(--color-bg);
}

.contact-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact h2 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.contact h2 em {
    font-style: italic;
    opacity: 0.6;
}

.contact-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.contact-item {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(250, 249, 247, 0.15);
}

.contact-item:last-child {
    border-bottom: 1px solid rgba(250, 249, 247, 0.15);
}

.contact-label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.contact-value {
    font-size: 1.125rem;
}

.contact-value a {
    color: var(--color-bg);
    text-decoration: none;
    transition: opacity var(--transition);
}

.contact-value a:hover {
    opacity: 0.7;
}

/* ==========================================
   Footer
   ========================================== */
footer {
    padding: 2rem 3rem;
    background: var(--color-text);
    color: var(--color-bg);
    border-top: 1px solid rgba(250, 249, 247, 0.1);
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 0.8125rem;
    opacity: 0.5;
}

.footer-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.footer-links a {
    font-size: 0.8125rem;
    color: var(--color-bg);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.footer-links a:hover {
    opacity: 1;
}

/* ==========================================
   Products Grid (for m2eacircle)
   ========================================== */
.products-section {
    padding: 4rem 3rem 8rem;
    max-width: 1400px;
    margin: 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    position: relative;
    padding: 2.5rem 2rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.product-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 0 0 12px 12px;
    transform: scaleX(0);
    transition: transform var(--transition);
}

.product-card:hover::after {
    transform: scaleX(1);
}

.product-card.education::after { background: var(--color-education); }
.product-card.health::after { background: var(--color-health); }
.product-card.entertainment::after { background: var(--color-entertainment); }

.product-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    transition: transform var(--transition);
}

.product-card:hover .product-icon {
    transform: scale(1.05);
}

.product-card.education .product-icon { 
    background: linear-gradient(135deg, #3d5a80 0%, #5a7ca8 100%);
    color: white;
}

.product-card.health .product-icon { 
    background: linear-gradient(135deg, #457b5d 0%, #5a9a78 100%);
    color: white;
}

.product-card.entertainment .product-icon { 
    background: linear-gradient(135deg, #9c6644 0%, #b8845f 100%);
    color: white;
}

.product-icon svg {
    width: 50px;
    height: 50px;
}

.product-card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.product-card p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.product-type {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-top: auto;
}

.product-card.education .product-type {
    background: rgba(61, 90, 128, 0.1);
    color: var(--color-education);
}

.product-card.health .product-type {
    background: rgba(69, 123, 93, 0.1);
    color: var(--color-health);
}

.product-card.entertainment .product-type {
    background: rgba(156, 102, 68, 0.1);
    color: var(--color-entertainment);
}

/* Coming Soon Card */
.product-card.coming-soon {
    opacity: 0.5;
    cursor: default;
}

.product-card.coming-soon:hover {
    transform: none;
    box-shadow: none;
}

.product-card.coming-soon::after {
    display: none;
}

.product-card.coming-soon .product-icon {
    background: var(--color-border);
    color: var(--color-text-muted);
}

.product-card.coming-soon:hover .product-icon {
    transform: none;
}

.product-card.coming-soon .product-type {
    background: var(--color-border);
    color: var(--color-text-muted);
}

/* ==========================================
   Animations
   ========================================== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   Responsive Styles
   ========================================== */
@media (max-width: 1024px) {
    .domains-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .philosophy-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .contact-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .lang-switcher {
        margin-left: auto;
        margin-right: 1rem;
    }

    .hero,
    .page-hero {
        padding: 6rem 1.5rem 3rem;
    }

    .domains,
    .philosophy,
    .products,
    .cta-section {
        padding: 4rem 1.5rem;
    }

    .about,
    .features {
        padding: 4rem 1.5rem;
    }

    .contact {
        padding: 4rem 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .philosophy-grid {
        grid-template-columns: 1fr;
    }

    footer {
        padding: 1.5rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
