/* ===================================
   RESET & BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #3d4f5c;
    --orange: #E86F3C;
    --off-white: #FAFAFA;
    --light-gray: #F5F5F5;
    --dark-gray: #2A2A2A;
    --border-gray: #E0E0E0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--off-white);
    color: var(--dark-gray);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* Prevent text overflow on mobile */
p, h1, h2, h3, span {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Smooth section transitions */
section {
    transition: background-color 0.6s ease;
}

/* Morphing gradient overlay for premium scroll effect */
.scroll-gradient-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    transition: background 0.3s ease-out;
}

/* Ensure content is above overlay */
header, main, footer {
    position: relative;
    z-index: 1;
}

/* ===================================
   TYPOGRAPHY
   =================================== */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.1;
    color: var(--navy);
}

/* ===================================
   LAYOUT UTILITIES
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
}

/* ===================================
   HEADER
   =================================== */
.header {
    padding: 3rem 0 2rem;
    background-color: var(--off-white);
    cursor: default;
}

.animated-logo {
    max-width: 300px;
    height: auto;
    display: block;
}

/* Individual letter styling and animations */
.letter {
    opacity: 0;
    animation: letterRevealOpacity 0.6s ease-out forwards;
    pointer-events: none; /* Prevents jitter from hover events */
}

.letter text {
    transition: fill 0.3s ease;
}

.logo-subtitle {
    opacity: 0;
    animation: letterRevealOpacity 0.6s ease-out forwards;
}

/* Sophisticated reveal animation - opacity only to avoid transform conflicts */
@keyframes letterRevealOpacity {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

    .animated-logo {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.25rem 0 1rem;
    }

    .animated-logo {
        max-width: 180px;
    }
}

/* ===================================
   HERO SECTION
   =================================== */
.hero {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    background-color: var(--off-white);
    padding: 6rem 0;
}

.hero-title {
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 700;
    max-width: 1100px;
    margin-bottom: 0;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

/* Rhythmic word reveal animation */
.hero-title .word {
    display: inline-block;
    opacity: 0;
    animation: wordReveal 0.6s ease-out forwards;
}

/* Special "i" in "think" */
.i-container {
    position: relative;
    display: inline-block;
}

.i-dot {
    position: absolute;
    top: 0.1em;
    left: 50%;
    transform: translateX(-50%);
    width: 0.22em;
    height: 0.22em;
    background-color: var(--orange);
    border-radius: 50%;
    opacity: 0;
    animation: dotBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    animation-delay: 3.9s; /* 1 second after last word */
}

/* Rhythmic timing for each word */
.word[data-word="1"] { animation-delay: 0s; }      /* Tools */
.word[data-word="2"] { animation-delay: 0.6s; }    /* that (bigger gap after Tools) */
.word[data-word="3"] { animation-delay: 0.9s; }    /* think */
.word[data-word="4"] { animation-delay: 1.2s; }    /* with */
.word[data-word="5"] { animation-delay: 1.5s; }    /* you, */
.word[data-word="6"] { animation-delay: 2.3s; }    /* not (much longer pause) */
.word[data-word="7"] { animation-delay: 2.6s; }    /* for */
.word[data-word="8"] { animation-delay: 2.9s; }    /* you */

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

@keyframes dotBounce {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    max-width: 700px;
    line-height: 1.7;
    color: var(--dark-gray);
    opacity: 0.9;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 2rem 0 4rem;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 3.5rem);
        line-height: 1.15;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1.5rem 0 3rem;
    }

    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
}

/* ===================================
   INTRO SECTION - Scroll Story Experience
   =================================== */
.intro-section {
    padding: 2rem 0;
    background-color: var(--off-white);
    position: relative;
}

.intro-spacer {
    height: 25vh;
}

.intro-spacer-small {
    height: 15vh;
}

.scroll-story {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-block {
    opacity: 0;
    transform: translateX(-100px) scale(0.9);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity;
}

.story-block.active {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.story-text {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 500;
    line-height: 1.3;
    color: var(--navy);
    letter-spacing: -0.02em;
    max-width: 900px;
}

/* Progressive word highlighting */
.story-text .highlight {
    color: var(--navy) !important;
    transition: color 1.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: inline-block;
    will-change: transform;
}

.story-text .highlight.lit {
    color: var(--orange) !important;
    cursor: default;
}

/* Period bounce effect */
.period-bounce {
    display: inline-block;
    transition: color 1.2s ease, transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.period-bounce.lit {
    animation: periodBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes periodBounce {
    0% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-8px) scale(1.3);
    }
    70% {
        transform: translateY(0) scale(0.9);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Different entrance animations for each block */
.story-block[data-block="1"] {
    transform: translateX(-120px) scale(0.85);
}

.story-block[data-block="2"] {
    transform: translateY(60px) scale(0.9);
}

.story-block[data-block="3"] {
    transform: translateX(100px) scale(0.85);
}

@media (max-width: 768px) {
    .intro-section {
        padding: 1rem 0;
    }

    .intro-spacer {
        height: 15vh;
    }

    .intro-spacer-small {
        height: 10vh;
    }

    .scroll-story {
        min-height: 35vh;
    }

    .story-text {
        font-size: clamp(1.4rem, 5vw, 2rem);
        line-height: 1.5;
    }

    .story-block[data-block="1"],
    .story-block[data-block="2"],
    .story-block[data-block="3"] {
        transform: translateY(40px) scale(0.95);
    }
}

@media (max-width: 480px) {
    .intro-spacer {
        height: 10vh;
    }

    .intro-spacer-small {
        height: 8vh;
    }

    .scroll-story {
        min-height: 30vh;
    }

    .story-text {
        font-size: 1.25rem;
        line-height: 1.5;
    }
}

/* ===================================
   PRODUCTS SHOWCASE SECTION
   =================================== */
.products-showcase {
    padding: 8rem 0 0;
    background-color: var(--off-white);
}

.section-header {
    text-align: center;
    margin-bottom: 6rem;
}

.section-accent-line {
    width: 60px;
    height: 2px;
    background: var(--orange);
    margin: 0 auto 2rem;
    opacity: 0;
    animation: lineReveal 0.8s ease-out 0.3s forwards;
}

@keyframes lineReveal {
    from {
        opacity: 0;
        width: 0;
    }
    to {
        opacity: 1;
        width: 60px;
    }
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    color: var(--navy);
    letter-spacing: -0.01em;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

/* Showcase Items */
.showcase-item {
    padding: 6rem 0;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.showcase-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.showcase-item:nth-child(odd) {
    background-color: var(--off-white);
}

.showcase-item:nth-child(even) {
    background-color: white;
}

.showcase-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 6rem;
    align-items: center;
}

.showcase-reverse .showcase-content {
    grid-template-columns: 1.4fr 1fr;
}

.showcase-reverse .showcase-text {
    order: 2;
}

.showcase-reverse .showcase-media {
    order: 1;
}

/* Showcase Text */
.showcase-text {
    position: relative;
}

.showcase-number {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--orange);
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.showcase-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.showcase-name {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.02em;
    line-height: 1;
}

.showcase-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.status-live {
    background-color: var(--orange);
    color: white;
}

.status-coming-soon {
    background-color: var(--navy);
    color: white;
    opacity: 0.5;
}

.status-available {
    background-color: var(--navy);
    color: white;
}

.showcase-description {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--dark-gray);
    margin-bottom: 2rem;
    max-width: 480px;
}

.showcase-detail {
    font-size: 0.95rem;
    color: var(--navy);
    font-weight: 500;
    opacity: 0.7;
    margin-bottom: 2rem;
}

.showcase-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--navy);
    text-decoration: none;
    padding: 1rem 0;
    position: relative;
    transition: color 0.3s ease, gap 0.3s ease;
}

.showcase-link::after {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--orange);
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.showcase-link:hover::after {
    width: calc(100% - 2rem);
}

.showcase-link .link-arrow {
    color: var(--orange);
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.showcase-link:hover {
    color: var(--orange);
    gap: 1rem;
}

.showcase-link:hover .link-arrow {
    transform: translateX(6px);
}

/* Showcase Media */
.showcase-media {
    position: relative;
}

.media-wrapper {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(61, 79, 92, 0.15),
                0 10px 30px rgba(61, 79, 92, 0.1);
    transform: perspective(1000px) rotateY(0deg);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.6s ease;
}

.showcase-item:not(.showcase-reverse) .media-wrapper {
    transform-origin: left center;
}

.showcase-reverse .media-wrapper {
    transform-origin: right center;
}

.showcase-item:hover .media-wrapper {
    box-shadow: 0 35px 100px rgba(61, 79, 92, 0.2),
                0 15px 40px rgba(61, 79, 92, 0.12);
}

.showcase-video,
.showcase-image {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.showcase-video {
    background-color: var(--navy);
}

.showcase-media {
    max-width: 100%;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 1024px) {
    .showcase-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 0 2rem;
    }

    .showcase-reverse .showcase-content {
        grid-template-columns: 1fr;
    }

    .showcase-reverse .showcase-text,
    .showcase-reverse .showcase-media {
        order: unset;
    }

    .showcase-item {
        padding: 4rem 0;
    }
}

@media (max-width: 768px) {
    .products-showcase {
        padding: 4rem 0 0;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    .showcase-item {
        padding: 3rem 0;
    }

    .showcase-content {
        padding: 0 1.25rem;
        gap: 2rem;
    }

    .showcase-number {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    .showcase-header {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .showcase-name {
        font-size: 2rem;
    }

    .showcase-status {
        font-size: 0.6rem;
        padding: 0.4rem 0.8rem;
    }

    .showcase-description {
        font-size: 1rem;
        line-height: 1.7;
        max-width: 100%;
    }

    .showcase-detail {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .showcase-link {
        font-size: 1rem;
    }

    .media-wrapper {
        box-shadow: 0 15px 50px rgba(61, 79, 92, 0.12),
                    0 5px 20px rgba(61, 79, 92, 0.08);
    }
}

@media (max-width: 480px) {
    .products-showcase {
        padding: 3rem 0 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

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

    .showcase-item {
        padding: 2.5rem 0;
    }

    .showcase-content {
        padding: 0 1rem;
        gap: 1.5rem;
    }

    .showcase-name {
        font-size: 1.75rem;
    }

    .showcase-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .showcase-detail {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }
}


/* ===================================
   CONTACT SECTION
   =================================== */
.contact {
    padding: 10rem 0 8rem;
    background-color: var(--navy);
}

.contact-content {
    max-width: 600px;
}

.contact-intro {
    margin-bottom: 4rem;
}

.contact-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    margin-bottom: 1.5rem;
    color: white;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.contact-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    line-height: 1.6;
}

.contact-form {
    margin-bottom: 4rem;
}

.form-row {
    margin-bottom: 1.5rem;
}

.form-input {
    width: 100%;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    padding: 1.25rem 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background-color: transparent;
    color: white;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
    border-bottom-color: var(--orange);
}

.form-textarea {
    resize: none;
    min-height: 120px;
    line-height: 1.6;
}

.submit-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1.25rem 2.5rem;
    background-color: var(--orange);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-top: 1rem;
}

.submit-button .button-arrow {
    transition: transform 0.3s ease;
}

.submit-button:hover {
    background-color: #d4612f;
    transform: translateY(-2px);
    gap: 1rem;
}

.submit-button:hover .button-arrow {
    transform: translateX(4px);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.submit-button.success {
    background-color: #2a9d5c;
}

.submit-button.error {
    background-color: #c0392b;
}

.form-success-message {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.form-success-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.contact-alt {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-alt-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.contact-email {
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-email:hover {
    color: var(--orange);
}

@media (max-width: 768px) {
    .contact {
        padding: 5rem 0 4rem;
    }

    .contact-intro {
        margin-bottom: 2.5rem;
    }

    .contact-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .contact-subtitle {
        font-size: 1rem;
    }

    .contact-form {
        margin-bottom: 3rem;
    }

    .form-input {
        font-size: 1rem;
        padding: 1rem 0;
    }

    .form-textarea {
        min-height: 100px;
    }

    .submit-button {
        width: 100%;
        justify-content: center;
        padding: 1.1rem 2rem;
        font-size: 1rem;
    }

    .contact-alt {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding-top: 2rem;
    }

    .contact-alt-text {
        font-size: 0.8rem;
    }

    .contact-email {
        font-size: 1rem;
    }

    .form-success-message {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .contact {
        padding: 4rem 0 3rem;
    }

    .contact-title {
        font-size: 2.2rem;
    }

    .contact-subtitle {
        font-size: 0.95rem;
    }
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    padding: 2rem 0;
    background-color: var(--navy);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===================================
   SUBTLE ANIMATIONS
   =================================== */
@media (prefers-reduced-motion: no-preference) {
    .hero-title,
    .hero-subtitle,
    .product-card,
    .services-title,
    .services-description {
        animation: fadeInUp 0.6s ease-out backwards;
    }

    .hero-subtitle {
        animation-delay: 0.1s;
    }

    .product-card:nth-child(2) {
        animation-delay: 0.1s;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
