/* ==========================================================
   REXAI — Core Stylesheet
   Design tokens follow the brand color system exactly:
   #001619 (dark) / #50E8F4 (cyan) / #C7F8FE (light cyan)
   #DFF6F0 (soft mint) / #6DD5C4 (mint)
   ========================================================== */

:root {
    --dark: #001619;
    --dark-2: #001b1f;
    --dark-3: #062529;
    --cyan: #50E8F4;
    --cyan-light: #C7F8FE;
    --mint-soft: #DFF6F0;
    --mint: #6DD5C4;

    --text-on-dark: #EAF7F8;
    --text-muted-on-dark: #7FA3A7;
    --text-on-light: #001619;
    --text-muted-on-light: #4A6669;

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --max-width: 1240px;
    --section-pad: 120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--dark);
    color: var(--text-on-dark);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 28px;
}

.section {
    padding: var(--section-pad) 0;
    position: relative;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 18px;
}
.eyebrow::before {
    content: '';
    width: 18px;
    height: 1px;
    background: var(--cyan);
}

/* ----------------------------------------------------------
   Buttons — inspired by the reference CTA (dark pill, colored
   text, hairline underline) but rebuilt in REXAI colors.
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    padding: 14px 26px;
    border-radius: 100px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .25s ease, background .25s ease, border-color .25s ease, color .25s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
    background: var(--cyan);
    color: var(--dark);
}
.btn-primary:hover { background: var(--cyan-light); }

.btn-secondary {
    background: transparent;
    color: var(--cyan-light);
    border-color: rgba(80, 232, 244, 0.35);
}
.btn-secondary:hover { border-color: var(--cyan); background: rgba(80, 232, 244, 0.06); }

.btn svg { width: 14px; height: 14px; transition: transform .25s ease; }
.btn:hover svg { transform: translate(3px, -3px); }

/* ----------------------------------------------------------
   Header
   ---------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 20px 0;
    background: rgba(0, 22, 25, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(80, 232, 244, 0.08);
    transition: background .3s ease, padding .3s ease;
}
.site-header.scrolled { padding: 12px 0; background: rgba(0, 22, 25, 0.92); }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 22px;
    color: var(--text-on-dark);
}
.logo img { height: 34px; width: auto; }
.logo .accent { color: var(--cyan); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 34px;
}
.main-nav a {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-muted-on-dark);
    position: relative;
    padding: 4px 0;
    transition: color .2s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--text-on-dark); }
.main-nav a.active::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 100%; height: 2px;
    background: var(--cyan);
    border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 18px; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    width: 40px; height: 40px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.nav-toggle span {
    width: 22px; height: 2px;
    background: var(--text-on-dark);
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-drawer {
    display: none;
    position: fixed;
    inset: 0;
    top: 72px;
    background: var(--dark);
    z-index: 150; /* must be above .site-header (z-index:100) since it's no longer nested inside it */
    padding: 32px 28px;
    flex-direction: column;
    gap: 6px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
}
.mobile-drawer.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.mobile-drawer a {
    padding: 16px 4px;
    font-size: 18px;
    font-weight: 500;
    border-bottom: 1px solid rgba(80, 232, 244, 0.08);
    color: var(--text-on-dark);
}
.mobile-drawer .btn { margin-top: 20px; align-self: flex-start; }

/* ----------------------------------------------------------
   Hero
   ---------------------------------------------------------- */
.hero {
    position: relative;
    padding: 150px 0 110px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(60% 50% at 78% 8%, rgba(80,232,244,0.16), transparent 60%),
        radial-gradient(45% 40% at 10% 90%, rgba(109,213,196,0.10), transparent 60%),
        var(--dark);
}
.hero-bg::after {
    /* fine grain texture, kept very subtle */
    content: '';
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

.hero-inner { position: relative; z-index: 1; text-align: center; }

.hero-text-mode .hero-heading {
    font-size: clamp(48px, 9vw, 104px);
    font-weight: 700;
    margin: 0 auto 22px;
    max-width: 900px;
}
.hero-text-mode .hero-description {
    max-width: 560px;
    margin: 0 auto 40px;
    color: var(--text-muted-on-dark);
    font-size: 17px;
}
.hero-cta-group { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Ambient particles — text mode only */
.particles { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.particle {
    position: absolute;
    width: 3px; height: 3px;
    background: var(--cyan);
    border-radius: 50%;
    opacity: 0.5;
    animation: float-particle 9s ease-in-out infinite;
}
@keyframes float-particle {
    0%, 100% { transform: translateY(0) translateX(0); opacity: .15; }
    50% { transform: translateY(-40px) translateX(12px); opacity: .6; }
}

/* Hero image mode */
.hero-image-mode { text-align: left; }
.hero-image-mode .hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}
.hero-image-frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(80,232,244,0.15);
    box-shadow: 0 40px 100px -30px rgba(0,0,0,0.7);
}
.hero-image-frame img { width: 100%; height: auto; }

/* ----------------------------------------------------------
   Intro / About preview
   ---------------------------------------------------------- */
.intro-section {
    background: var(--mint-soft);
    color: var(--text-on-light);
    border-radius: var(--radius-lg);
    margin: 0 20px;
    padding: 90px 60px;
}
.intro-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 760px;
}
.intro-section .eyebrow { color: var(--dark); opacity: 0.6; }
.intro-section .eyebrow::before { background: var(--dark); opacity: 0.4; }
.intro-heading { font-size: clamp(30px, 4.5vw, 46px); font-weight: 600; margin-bottom: 18px; }
.intro-paragraph { color: var(--text-muted-on-light); font-size: 17px; max-width: 620px; margin-bottom: 30px; }
.intro-section .btn-primary { background: var(--dark); color: var(--mint-soft); }
.intro-section .btn-primary:hover { background: #002a30; }

/* ----------------------------------------------------------
   Section headers (shared)
   ---------------------------------------------------------- */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 52px;
    flex-wrap: wrap;
}
.section-heading { font-size: clamp(28px, 4vw, 42px); font-weight: 600; max-width: 560px; }
.section-sub { color: var(--text-muted-on-dark); max-width: 420px; font-size: 15.5px; }

/* ----------------------------------------------------------
   Team grid (about.php)
   ---------------------------------------------------------- */
.about-team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.about-team-card {
    background: var(--dark-3);
    border: 1px solid rgba(80,232,244,0.12);
    border-radius: var(--radius-md);
    padding: 30px 26px;
    text-align: center;
    transition: transform .3s ease, border-color .3s ease;
}
.about-team-card:hover { transform: translateY(-4px); border-color: rgba(80,232,244,0.32); }
.about-team-photo {
    width: 84px; height: 84px;
    border-radius: 50%;
    margin: 0 auto 18px;
    background: rgba(80,232,244,0.1);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    font-family: var(--font-heading);
    font-size: 26px; font-weight: 700; color: var(--cyan);
}
.about-team-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-team-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.about-team-card .about-team-role { font-size: 13px; color: var(--mint); font-weight: 600; margin-bottom: 12px; }
.about-team-card p { font-size: 14px; color: var(--text-muted-on-dark); line-height: 1.6; }

@media (max-width: 720px) {
    .about-team-grid { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
   Ad banner (blog.php, after first 3 posts)
   ---------------------------------------------------------- */
.ad-banner {
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 34px 0;
    border: 1px solid rgba(80,232,244,0.12);
    transition: border-color .2s ease, transform .2s ease;
}
.ad-banner:hover { border-color: rgba(80,232,244,0.4); transform: translateY(-2px); }
.ad-banner img { width: 100%; height: auto; display: block; }

/* ----------------------------------------------------------
   Category filter pills (tools.php)
   ---------------------------------------------------------- */
.category-filters {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-bottom: 40px;
}
.filter-pill {
    background: var(--dark-3);
    border: 1px solid rgba(80,232,244,0.14);
    color: var(--text-muted-on-dark);
    padding: 9px 18px;
    border-radius: 100px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}
.filter-pill:hover { border-color: rgba(80,232,244,0.4); color: var(--text-on-dark); }
.filter-pill.active { background: var(--cyan); color: var(--dark); border-color: var(--cyan); }

/* ----------------------------------------------------------
   Tools grid
   ---------------------------------------------------------- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.tool-card {
    background: var(--dark-3);
    border: 1px solid rgba(80,232,244,0.10);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    transition: transform .3s ease, border-color .3s ease, background .3s ease;
}
.tool-card:hover {
    transform: translateY(-6px);
    border-color: rgba(80,232,244,0.35);
    background: #0a2f34;
}
.tool-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: rgba(80,232,244,0.10);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 22px;
}
.tool-icon img { width: 24px; height: 24px; object-fit: contain; }
.tool-card h3 { font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.tool-card p { color: var(--text-muted-on-dark); font-size: 14.5px; margin-bottom: 22px; min-height: 44px; }
.tool-card .tool-cta {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600; color: var(--cyan);
}
.tool-card .tool-cta svg { width: 13px; height: 13px; transition: transform .25s ease; }
.tool-card:hover .tool-cta svg { transform: translate(3px,-3px); }

/* Coming Soon tool card */
.tool-card { position: relative; }
.tool-card-disabled { cursor: default; opacity: 0.72; }
.tool-card-disabled:hover { transform: none; border-color: rgba(80,232,244,0.10); background: var(--dark-3); }
.coming-soon-badge {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(80,232,244,0.14);
    color: var(--cyan);
    border: 1px solid rgba(80,232,244,0.35);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 4px 10px;
    border-radius: 100px;
}
.tool-cta-disabled { color: var(--text-muted-on-dark) !important; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted-on-dark);
    border: 1px dashed rgba(80,232,244,0.2);
    border-radius: var(--radius-md);
}

/* ----------------------------------------------------------
   Blog cards
   ---------------------------------------------------------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}
.blog-card { display: flex; flex-direction: column; }
.blog-thumb {
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/3;
    margin-bottom: 18px;
    background: var(--dark-3);
}
.blog-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.blog-card:hover .blog-thumb img { transform: scale(1.05); }
.blog-category {
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--mint);
    margin-bottom: 10px;
}
.blog-card h3 { font-size: 19px; font-weight: 600; margin-bottom: 10px; line-height: 1.3; }
.blog-meta { font-size: 13px; color: var(--text-muted-on-dark); margin-bottom: 14px; }
.blog-excerpt { color: var(--text-muted-on-dark); font-size: 14.5px; margin-bottom: 18px; flex-grow: 1; }
.blog-readmore { font-size: 14px; font-weight: 600; color: var(--cyan); display: inline-flex; align-items: center; gap: 6px; }

/* ----------------------------------------------------------
   FAQ accordion
   ---------------------------------------------------------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
    border-bottom: 1px solid rgba(80,232,244,0.12);
}
.faq-question {
    width: 100%;
    background: none; border: none;
    display: flex; align-items: center; justify-content: space-between;
    padding: 26px 4px;
    text-align: left;
    font-family: var(--font-heading);
    font-size: 18px; font-weight: 500;
    color: var(--text-on-dark);
    cursor: pointer;
}
.faq-icon {
    width: 22px; height: 22px; flex-shrink: 0;
    position: relative;
    margin-left: 20px;
}
.faq-icon::before, .faq-icon::after {
    content: '';
    position: absolute; background: var(--cyan);
    transition: transform .3s ease;
}
.faq-icon::before { width: 100%; height: 2px; top: 50%; left: 0; transform: translateY(-50%); }
.faq-icon::after { width: 2px; height: 100%; left: 50%; top: 0; transform: translateX(-50%); }
.faq-item.open .faq-icon::after { transform: translateX(-50%) rotate(90deg); opacity: 0; }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}
.faq-answer-inner { padding: 0 4px 26px; color: var(--text-muted-on-dark); font-size: 15px; max-width: 680px; }

/* ----------------------------------------------------------
   Contact / send message
   ---------------------------------------------------------- */
.contact-wrap {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 60px;
    align-items: center;
}
.contact-form {
    background: var(--dark-3);
    border: 1px solid rgba(80,232,244,0.12);
    border-radius: var(--radius-lg);
    padding: 40px;
}
.form-row { margin-bottom: 18px; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row label {
    display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px;
    color: var(--text-muted-on-dark); text-transform: uppercase; letter-spacing: 0.06em;
}
.form-row input, .form-row textarea {
    width: 100%;
    background: var(--dark);
    border: 1px solid rgba(80,232,244,0.16);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    color: var(--text-on-dark);
    font-family: var(--font-body);
    font-size: 14.5px;
    transition: border-color .2s ease;
}
.form-row input:focus, .form-row textarea:focus {
    outline: none;
    border-color: var(--cyan);
}
.form-row textarea { resize: vertical; min-height: 130px; }
.form-submit { width: 100%; justify-content: center; margin-top: 6px; border: none; }
.form-msg { margin-top: 16px; font-size: 14px; padding: 12px 14px; border-radius: 8px; display: none; }
.form-msg.success { background: rgba(109,213,196,0.15); color: var(--mint); display: block; }
.form-msg.error { background: rgba(255,99,99,0.12); color: #ff8888; display: block; }

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */
.site-footer {
    border-top: 1px solid rgba(80,232,244,0.1);
    padding: 70px 0 30px;
    margin-top: 40px;
}
.footer-top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
    gap: 40px;
    padding-bottom: 60px;
}
.footer-brand p { color: var(--text-muted-on-dark); font-size: 14.5px; margin-top: 16px; max-width: 280px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted-on-dark); margin-bottom: 18px; font-family: var(--font-body); font-weight: 600;}
.footer-col a { display: block; font-size: 14.5px; color: var(--text-on-dark); opacity: 0.85; margin-bottom: 12px; transition: opacity .2s ease, color .2s ease; }
.footer-col a:hover { opacity: 1; color: var(--cyan); }
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.footer-social a {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(80,232,244,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: border-color .2s ease, color .2s ease;
}
.footer-social a:hover { border-color: var(--cyan); color: var(--cyan); }

.footer-wordmark {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(52px, 12vw, 130px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(80,232,244,0.25);
    text-align: center;
    padding: 20px 0 10px;
    letter-spacing: -0.03em;
}

.footer-bottom {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 24px; border-top: 1px solid rgba(80,232,244,0.08);
    font-size: 13px; color: var(--text-muted-on-dark); flex-wrap: wrap; gap: 12px;
}
.footer-bottom a { color: var(--text-muted-on-dark); }
.footer-bottom a:hover { color: var(--cyan); }
.footer-legal { display: flex; gap: 20px; }

/* ----------------------------------------------------------
   Scroll reveal
   ---------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 980px) {
    .tools-grid, .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: 1fr 1fr; }
    .contact-wrap { grid-template-columns: 1fr; gap: 40px; }
    :root { --section-pad: 90px; }
}

@media (max-width: 720px) {
    .main-nav { display: none; }
    .nav-toggle { display: flex; }
    .header-actions .btn-primary.desktop-only { display: none; }

    .tools-grid, .blog-grid { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr; gap: 34px; padding-bottom: 40px; }
    .intro-section { margin: 0 12px; padding: 56px 26px; border-radius: var(--radius-md); }
    .form-row.two-col { grid-template-columns: 1fr; }
    :root { --section-pad: 64px; }
    .hero { padding: 120px 0 70px; }
    .container { padding: 0 20px; }
    .section-head { flex-direction: column; align-items: flex-start; }
}