/* ===================================================
   TUTRA MOCK SITE - Shared Design System
   =================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&display=swap');

/* --- Design Tokens --- */
:root {
    --bg-color: #FAF9F6;
    --bg-color-alt: #F3F1EC;
    --text-color: #333333;
    --text-muted: #666666;
    --text-light: #999999;
    --accent-gold: #C8A96E;
    --accent-gold-hover: #B8964E;
    --miai-blue: #3b82f6;
    --miai-black: #111111;

    /* Soft Elevation */
    --shadow-light: transparent;
    --shadow-dark: rgba(0, 0, 0, 0.04);
    --shadow-dark-strong: rgba(0, 0, 0, 0.08);

    /* Spacing */
    --nav-height: 80px;
    --section-padding: 6rem 2rem;
    --card-radius: 20px;
    --btn-radius: 15px;
    --input-radius: 15px;

    /* Transitions */
    --ease-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    overflow-x: clip;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

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

/* ===================================================
   NAVBAR (Visible by default, animated on home page)
   =================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: rgba(250, 249, 246, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Home page only: starts hidden, slides down on scroll */
body.page-home .navbar {
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.page-home .navbar.scrolled {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.nav-logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-logo img {
    height: 55px;
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-links a {
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-color);
    background-color: var(--bg-color);
    box-shadow: inset 3px 3px 6px var(--shadow-dark),
                inset -3px -3px 6px var(--shadow-light);
}

/* Hamburger (mobile) */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-hamburger:hover {
    box-shadow: inset 2px 2px 4px var(--shadow-dark),
                inset -2px -2px 4px var(--shadow-light);
}

.nav-hamburger span {
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ===================================================
   MAIN CONTENT
   =================================================== */
main {
    flex-grow: 1;
}

/* Add nav offset only to pages without a full hero section */
main > .section:first-child {
    padding-top: calc(var(--nav-height) + 2rem);
}

.section {
    padding: var(--section-padding);
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    display: inline-block;
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.12s ease-out;
}

.pop-on-scroll {
    display: inline-block;
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.12s ease-out;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 550px;
}

.section-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===================================================
   NEUMORPHIC CARDS
   =================================================== */
.neu-card {
    background-color: var(--bg-color);
    border-radius: var(--card-radius);
    padding: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.4s var(--ease-smooth);
}

.neu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.07);
}

.neu-card-flat {
    background-color: var(--bg-color);
    border-radius: var(--card-radius);
    padding: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

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

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
    display: inline-block;
    background-color: var(--bg-color);
    padding: 1rem 2.5rem;
    border-radius: var(--btn-radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    outline: none;
    text-align: center;
}

.btn:hover {
    background-color: #F3F1EC;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.btn-lg {
    padding: 1.2rem 3rem;
    font-size: 1.15rem;
    border-radius: 30px;
}

.btn-gold {
    color: var(--accent-gold);
}

.btn-gold:hover {
    color: var(--accent-gold-hover);
    box-shadow: inset 4px 4px 8px var(--shadow-dark),
                inset -4px -4px 8px var(--shadow-light);
}

/* ===================================================
   FORM ELEMENTS
   =================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 500;
    margin-left: 0.5rem;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: var(--input-radius);
    border: none;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    box-shadow: inset 6px 6px 12px var(--shadow-dark),
                inset -6px -6px 12px var(--shadow-light);
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    box-shadow: inset 8px 8px 16px var(--shadow-dark),
                inset -8px -8px 16px var(--shadow-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-privacy-note {
    color: var(--text-light);
    font-size: 0.78rem;
    line-height: 1.55;
    text-align: center;
    margin: -0.35rem auto 0;
    max-width: 430px;
}

.form-privacy-note a {
    color: var(--accent-gold-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    padding-right: 2.5rem;
}

/* Range Slider */
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-container label {
    font-size: 0.95rem;
    font-weight: 500;
    margin-left: 0.5rem;
    color: var(--text-color);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 0.25rem;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-color);
    box-shadow: inset 3px 3px 6px var(--shadow-dark),
                inset -3px -3px 6px var(--shadow-light);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-color);
    box-shadow: 3px 3px 6px var(--shadow-dark),
                -3px -3px 6px var(--shadow-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 4px 4px 8px var(--shadow-dark),
                -4px -4px 8px var(--shadow-light);
}

/* ===================================================
   CARD ICONS (SVG based)
   =================================================== */
.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background-color: var(--bg-color);
    box-shadow: 4px 4px 8px var(--shadow-dark),
                -4px -4px 8px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent-gold);
}

.card-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.card-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===================================================
   HERO SECTION (Large on load, scales on scroll)
   =================================================== */
.hero {
    position: relative;
    width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-height, 80px) + 1rem) 24px 3rem 24px;
    overflow: clip;
    box-sizing: border-box;
}

.hero-content {
    position: relative;
    width: min(100% - 32px, 1050px);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    transition: transform 0.1s linear, opacity 0.1s linear;
}

/* Brushed Translucent Organic Smudge shape behind large text */
.hero-content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 115%;
    background: radial-gradient(ellipse 65% 55% at 50% 50%, 
        rgba(250, 249, 246, 0.95) 0%, 
        rgba(250, 249, 246, 0.82) 35%, 
        rgba(250, 249, 246, 0.45) 60%, 
        rgba(250, 249, 246, 0.15) 80%, 
        transparent 100%
    );
    z-index: -1;
    pointer-events: none;
}

.section-title,
.section-subtitle {
    position: relative;
    display: inline-block;
    z-index: 2;
}

.section-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130%;
    height: 130%;
    background: radial-gradient(ellipse 60% 50% at 50% 50%, 
        rgba(250, 249, 246, 0.9) 0%, 
        rgba(250, 249, 246, 0.6) 45%, 
        rgba(250, 249, 246, 0.2) 75%, 
        transparent 100%
    );
    z-index: -1;
    pointer-events: none;
}

.hero-logo {
    height: clamp(140px, 18vh, 230px);
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    margin-bottom: 1.75rem;
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-smooth) 0.1s forwards;
    transform-origin: center center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), margin-bottom 0.6s ease;
}

body.page-home.nav-visible .hero-logo {
    transform: scale(0.92);
}

.hero h1 {
    font-size: clamp(3.6rem, 7vw, 5.8rem);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.04em;
    margin-bottom: 1.75rem;
    color: var(--text-color);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-smooth) 0.25s forwards;
}

.hero h1 .gold {
    color: var(--accent-gold);
}

.hero p {
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    color: var(--text-muted);
    max-width: 740px;
    margin-bottom: 3.5rem;
    line-height: 1.6;
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-smooth) 0.4s forwards;
}

.hero .btn {
    padding: 1.25rem 3.8rem;
    font-size: 1.2rem;
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-smooth) 0.55s forwards;
}

/* ===================================================
   PAGE HERO (Full screen centered opening on load)
   =================================================== */
.page-hero {
    position: relative;
    width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-height, 80px) + 2rem) 24px 3rem 24px;
    box-sizing: border-box;
    overflow: clip;
}

.page-hero-content {
    position: relative;
    width: min(100% - 32px, 850px);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 2;
    transform-origin: center center;
    will-change: transform, opacity;
    transition: transform 0.1s linear, opacity 0.1s linear;
}

.page-hero-title {
    font-size: clamp(3rem, 5.5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    color: var(--text-color);
}

.page-hero-subtitle {
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 auto;
}

/* ===================================================
   JOIN US - PANELS
   =================================================== */
.panel-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.panel-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.panel-header p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.benefits-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.benefits-list li .check-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--bg-color);
    box-shadow: 2px 2px 4px var(--shadow-dark),
                -2px -2px 4px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    color: var(--accent-gold);
}

.benefits-list li .check-icon svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 3;
    fill: none;
}

.benefits-list li .check-icon i {
    font-size: 13px;
    color: var(--accent-gold);
}

.grow-on-scroll {
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.15s ease-out;
}

/* ===================================================
   WORKSHEET PREVIEW
   =================================================== */
.worksheet-preview {
    background-color: var(--bg-color);
    border-radius: var(--card-radius);
    padding: 2.5rem;
    box-shadow: inset 6px 6px 12px var(--shadow-dark),
                inset -6px -6px 12px var(--shadow-light);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

.worksheet-preview .preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.worksheet-preview .preview-placeholder svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-light);
    stroke-width: 1.5;
    fill: none;
}

/* ===================================================
   FOOTER
   =================================================== */
.site-footer {
    padding: 2rem;
    text-align: center;
    width: 100%;
    margin-top: auto;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
    color: var(--accent-gold-hover);
    text-decoration-color: currentColor;
}

.powered-by {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.miai-logo-small {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.08em;
    display: inline-flex;
    align-items: baseline;
    user-select: none;
}

.miai-blue {
    color: var(--miai-blue);
}

.miai-black {
    color: var(--miai-black);
}

/* ===================================================
   BACKGROUND GLYPHS (inspired by Tutra PDF covers)
   =================================================== */
.bg-glyphs,
.glyph-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.glyph {
    position: absolute;
    color: rgba(20, 30, 50, 0.06); /* Solid, pale slate/navy like the worksheet */
    font-weight: 400;
    user-select: none;
    pointer-events: none;
    will-change: transform;
    transition: transform 0.1s linear;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ambient idle floating animation when stationary */
.glyph i {
    display: inline-block;
    will-change: transform;
    animation: ambientFloat 8s ease-in-out infinite alternate;
}

.glyph:nth-child(2n) i { animation-duration: 7s; animation-delay: -2s; }
.glyph:nth-child(3n) i { animation-duration: 10s; animation-delay: -5s; }
.glyph:nth-child(5n) i { animation-duration: 9s; animation-delay: -3.5s; }
.glyph:nth-child(7n) i { animation-duration: 12s; animation-delay: -7s; }

@keyframes ambientFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(8px, -10px) rotate(3deg);
    }
    100% {
        transform: translate(-7px, 8px) rotate(-3deg);
    }
}

/* Fallback for raw SVGs if any */
.glyph svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: rgba(20, 30, 50, 0.06);
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Ensure all real content sits above the glyphs */
.navbar {
    z-index: 1000;
}

main {
    position: relative;
    z-index: 1;
}

.site-footer {
    position: relative;
    z-index: 1;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scroll-triggered animation class */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-smooth),
                transform 0.6s var(--ease-smooth);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for card grids */
.animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 900px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

@media (max-width: 768px) {
    .navbar {
        padding: 0 1.5rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background-color: var(--bg-color);
        flex-direction: column;
        padding: 1rem;
        gap: 0.25rem;
        box-shadow: 0 8px 16px var(--shadow-dark);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
    }

    .nav-hamburger {
        display: flex;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .neu-card {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .navbar {
        padding: 0 1rem;
    }

    .nav-logo img {
        height: 45px;
    }
}
