/* ============================================
   Right2Think — Styles
   Aesthetic: Editorial minimalism + warm tech
   ============================================ */

/* --- Custom Properties --- */
:root {
    --color-base: #1a1a2e;
    --color-surface: #16213e;
    --color-surface-light: #1e2a4a;
    --color-accent: #e8a838;
    --color-accent-dim: #d4913a;
    --color-text: #f0ece2;
    --color-text-muted: #8a8a9a;
    --color-text-dim: #5a5a6a;
    --color-success: #4ecdc4;
    --color-error: #e85d5d;
    --color-border: rgba(240, 236, 226, 0.08);

    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;

    --container: 1200px;
    --gutter: 1.5rem;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    --nav-height: 72px;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-base);
    overflow-x: hidden;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* --- Reveal Animation --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.5s; }

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.nav--scrolled {
    background-color: rgba(26, 26, 46, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--color-border);
}

.nav__container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--color-text);
    transition: opacity 0.3s ease;
}

.nav__logo:hover {
    opacity: 0.8;
}

.nav__toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    z-index: 101;
}

.nav__toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--color-text);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__toggle.active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav__toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

.nav__links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav__links a {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    transition: color 0.3s ease;
    text-transform: uppercase;
}

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

/* Mobile Nav */
@media (max-width: 767px) {
    .nav__links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: rgba(26, 26, 46, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
    }

    .nav__links.open {
        opacity: 1;
        pointer-events: all;
    }

    .nav__links a {
        font-size: 1.25rem;
    }
}

@media (min-width: 768px) {
    .nav__toggle {
        display: none;
    }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + 2rem) var(--gutter) 2rem;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero__grain {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    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");
    background-repeat: repeat;
    background-size: 256px 256px;
}

.hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.hero__glow--1 {
    width: 600px;
    height: 600px;
    background: var(--color-accent);
    top: -200px;
    right: -100px;
}

.hero__glow--2 {
    width: 400px;
    height: 400px;
    background: var(--color-surface-light);
    bottom: -100px;
    left: -100px;
    opacity: 0.3;
}

.hero__container {
    position: relative;
    z-index: 1;
    max-width: var(--container);
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.hero__tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--color-accent);
    margin-top: 0.75rem;
    line-height: 1.3;
}

.hero__sub {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    color: var(--color-text-muted);
    max-width: 520px;
    margin-top: 1.5rem;
    line-height: 1.7;
}

.hero__cta {
    display: inline-flex;
    align-items: center;
    margin-top: 2.5rem;
    padding: 1rem 2.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--color-base);
    background: var(--color-accent);
    border-radius: 4px;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background-color 0.3s ease;
}

.hero__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(232, 168, 56, 0.25);
    background: #f0b040;
}

.hero__visual {
    display: none;
}

.hero__svg {
    width: 100%;
    max-width: 350px;
    height: auto;
}

/* Node animations */
.node {
    animation: pulse 3s ease-in-out infinite;
}

.node--1 { animation-delay: 0s; }
.node--2 { animation-delay: 0.5s; }
.node--3 { animation-delay: 1s; }
.node--4 { animation-delay: 1.5s; }
.node--5 { animation-delay: 2s; }
.node--center { animation-delay: 0.25s; }

@keyframes pulse {
    0%, 100% { opacity: 0.4; r: 3; }
    50% { opacity: 1; r: 5; }
}

.hero__scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-dim);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.scroll-dot {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { cy: 8; opacity: 1; }
    50% { cy: 16; opacity: 0.3; }
}

@media (min-width: 1024px) {
    .hero__container {
        grid-template-columns: 1fr 1fr;
    }

    .hero__visual {
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* ============================================
   Value Section
   ============================================ */
.value {
    position: relative;
    padding: 8rem var(--gutter);
    background: var(--color-surface);
}

.value::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.value__container {
    max-width: var(--container);
    margin: 0 auto;
}

.value__tagline {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--color-text);
}

/* --- Carousel --- */
.carousel {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.carousel__track {
    position: relative;
    overflow: hidden;
    min-height: 380px;
}

.carousel__slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
    pointer-events: none;
}

.carousel__slide--active {
    position: relative;
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.carousel__slide--exit {
    opacity: 0;
    transform: translateX(-40px);
}

.carousel__slide-inner {
    width: 100%;
    padding: 3rem 2rem;
    background: rgba(240, 236, 226, 0.02);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.carousel__slide-inner:hover {
    border-color: rgba(232, 168, 56, 0.15);
}

.carousel__icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
}

.carousel__icon svg {
    width: 100%;
    height: 100%;
}

.carousel__label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.carousel__heading {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.carousel__body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-text-muted);
}

/* Carousel Controls */
.carousel__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.carousel__arrow {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease-out);
}

.carousel__arrow:hover {
    color: var(--color-text);
    border-color: var(--color-accent-dim);
    transform: scale(1.05);
}

.carousel__dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-dim);
    transition: background-color 0.3s ease, transform 0.3s var(--ease-out);
}

.carousel__dot--active {
    background: var(--color-accent);
    transform: scale(1.25);
}

.carousel__dot:hover {
    background: var(--color-text-muted);
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
    position: relative;
    padding: 8rem var(--gutter);
}

.contact__container {
    max-width: 600px;
    margin: 0 auto;
}

.contact__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.contact__intro {
    font-size: 1.0625rem;
    color: var(--color-text-muted);
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* Form */
.contact__form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--color-text);
    background: rgba(240, 236, 226, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input::placeholder {
    color: var(--color-text-dim);
}

.form-input:focus {
    border-color: var(--color-accent-dim);
    box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.08);
}

.form-input.error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(232, 93, 93, 0.08);
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.375rem;
    min-height: 1.25rem;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--color-error);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.form-counter {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    margin-left: auto;
}

.form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 1rem 2.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--color-base);
    background: var(--color-accent);
    border-radius: 4px;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background-color 0.3s ease, opacity 0.3s ease;
    margin-top: 0.5rem;
    position: relative;
    min-width: 180px;
}

.form-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(232, 168, 56, 0.25);
    background: #f0b040;
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-submit__loading {
    display: none;
}

.form-submit.loading .form-submit__text {
    visibility: hidden;
}

.form-submit.loading .form-submit__loading {
    display: flex;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Message */
.contact__success {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding: 3rem 2rem;
    animation: fadeInUp 0.6s var(--ease-out);
}

.contact__success.visible {
    display: flex;
}

.contact__success p {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    max-width: 400px;
}

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

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: 3rem var(--gutter);
    border-top: 1px solid var(--color-border);
}

.footer__container {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
}

.footer__copyright {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.footer__address {
    font-size: 0.8125rem;
    color: var(--color-text-dim);
    max-width: 500px;
    line-height: 1.5;
}

/* ============================================
   Tablet & Desktop Enhancements
   ============================================ */
@media (min-width: 768px) {
    :root {
        --gutter: 3rem;
    }

    .value {
        padding: 10rem var(--gutter);
    }

    .contact {
        padding: 10rem var(--gutter);
    }

    .carousel__slide-inner {
        padding: 3.5rem 3rem;
    }

    .footer__container {
        flex-direction: row;
        justify-content: space-between;
    }

    .footer__address {
        text-align: right;
    }
}

@media (min-width: 1024px) {
    :root {
        --gutter: 4rem;
    }

    .hero__scroll-hint {
        bottom: 3rem;
    }
}
