/* ============================================================
 * TheWriter.id — FTTH Modern Front-Page Design System v1.5.0
 * Award-winning telecom aesthetic: editorial dark + fiber glow
 * Scope: scoped to body.ftth-modern-front to avoid leaking
 *        styles into blog/services/contact templates.
 * ============================================================ */

/* Fonts ----------------------------------------------------- */
body.ftth-modern-front {
    font-family: 'Manrope', 'Inter', sans-serif;
    background: #050714;
    color: #e6e9f5;
    overflow-x: hidden;
}

body.ftth-modern-front .ftth-display {
    font-family: 'Instrument Serif', 'Cormorant Garamond', serif;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 0.95;
}

body.ftth-modern-front .ftth-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: 0.04em;
}

/* Color tokens ---------------------------------------------- */
body.ftth-modern-front {
    --ftth-bg: #050714;
    --ftth-bg-2: #0a0f24;
    --ftth-panel: #0d1330;
    --ftth-line: rgba(120, 144, 220, 0.15);
    --ftth-text: #e6e9f5;
    --ftth-muted: #8b93b8;
    --ftth-cyan: #22d3ee;
    --ftth-cyan-bright: #67e8f9;
    --ftth-amber: #fbbf24;
    --ftth-magenta: #e879f9;
    --ftth-lime: #a3e635;
}

/* Header override on front page — start transparent dark --- */
body.ftth-modern-front #main-header {
    background: transparent !important;
    border-bottom: 1px solid transparent !important;
}
body.ftth-modern-front #main-header.ftth-scrolled {
    background: rgba(5, 7, 20, 0.78) !important;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--ftth-line) !important;
}
body.ftth-modern-front #main-header a span:first-of-type,
body.ftth-modern-front #main-header nav a {
    color: #e6e9f5 !important;
}
body.ftth-modern-front #main-header nav a:hover {
    color: var(--ftth-cyan-bright) !important;
}
body.ftth-modern-front #main-header .text-red-600 { color: #fda4af !important; }
body.ftth-modern-front #main-header [class*="bg-brand-600"]{
    background: linear-gradient(135deg, #22d3ee 0%, #818cf8 100%) !important;
    color: #050714 !important;
    box-shadow: 0 8px 30px rgba(34, 211, 238, 0.35) !important;
}

/* Footer override on front page ----------------------------- */
body.ftth-modern-front footer {
    background: #030510 !important;
    border-top: 1px solid var(--ftth-line);
}

/* Reusable utilities ---------------------------------------- */
body.ftth-modern-front .ftth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--ftth-cyan-bright);
}
body.ftth-modern-front .ftth-eyebrow::before {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--ftth-cyan);
    display: inline-block;
}

body.ftth-modern-front .ftth-glow-cyan {
    text-shadow: 0 0 30px rgba(34, 211, 238, 0.4);
}

body.ftth-modern-front .ftth-gradient-text {
    background: linear-gradient(120deg, #67e8f9 0%, #e879f9 60%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Custom scroll progress bar -------------------------------- */
body.ftth-modern-front .ftth-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, #22d3ee, #e879f9, #fbbf24);
    z-index: 100;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.7);
    transition: width 0.05s linear;
}

/* Hero ------------------------------------------------------ */
body.ftth-modern-front .ftth-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: radial-gradient(ellipse at 70% 40%, #0f1840 0%, #050714 70%);
    overflow: hidden;
}
body.ftth-modern-front .ftth-hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
body.ftth-modern-front .ftth-hero-grain {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        radial-gradient(rgba(34, 211, 238, 0.04) 1px, transparent 1px);
    background-size: 28px 28px, 22px 22px;
    background-position: 0 0, 11px 11px;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2;
    opacity: 0.7;
}
body.ftth-modern-front .ftth-hero-content {
    position: relative;
    z-index: 3;
}

body.ftth-modern-front .ftth-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ftth-lime);
    box-shadow: 0 0 14px var(--ftth-lime);
    animation: ftthPulse 2.2s ease-in-out infinite;
}
@keyframes ftthPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

/* Buttons --------------------------------------------------- */
body.ftth-modern-front .ftth-btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.05rem 1.9rem;
    background: linear-gradient(135deg, #22d3ee 0%, #818cf8 100%);
    color: #050714;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(.3,1.3,.4,1), box-shadow 0.35s ease;
    box-shadow: 0 18px 50px rgba(34, 211, 238, 0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
body.ftth-modern-front .ftth-btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 26px 65px rgba(34, 211, 238, 0.55), inset 0 1px 0 rgba(255,255,255,0.5);
}
body.ftth-modern-front .ftth-btn-primary svg { transition: transform .4s ease; }
body.ftth-modern-front .ftth-btn-primary:hover svg { transform: translateX(5px); }

body.ftth-modern-front .ftth-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.05rem 1.9rem;
    background: rgba(255, 255, 255, 0.04);
    color: #e6e9f5;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    transition: all 0.35s ease;
}
body.ftth-modern-front .ftth-btn-ghost:hover {
    border-color: var(--ftth-cyan);
    color: var(--ftth-cyan-bright);
    background: rgba(34, 211, 238, 0.08);
}

/* Marquee --------------------------------------------------- */
body.ftth-modern-front .ftth-marquee {
    overflow: hidden;
    border-top: 1px solid var(--ftth-line);
    border-bottom: 1px solid var(--ftth-line);
    background: #07091c;
}
body.ftth-modern-front .ftth-marquee-track {
    display: flex;
    gap: 4rem;
    padding: 1.4rem 0;
    width: max-content;
    animation: ftthMarquee 38s linear infinite;
}
body.ftth-modern-front .ftth-marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Instrument Serif', serif;
    font-size: 2.2rem;
    color: #cbd5ff;
    white-space: nowrap;
}
body.ftth-modern-front .ftth-marquee-item .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ftth-cyan);
    box-shadow: 0 0 12px var(--ftth-cyan);
}
@keyframes ftthMarquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Section base ---------------------------------------------- */
body.ftth-modern-front .ftth-section {
    position: relative;
    padding: 8rem 0;
}
body.ftth-modern-front .ftth-section.bg-light {
    background: #f5f4ef;
    color: #0c0f24;
}
body.ftth-modern-front .ftth-section.bg-dark {
    background: var(--ftth-bg);
}
body.ftth-modern-front .ftth-section.bg-deep {
    background: linear-gradient(180deg, #050714 0%, #0a0f24 50%, #050714 100%);
}

/* Number ticker chip ---------------------------------------- */
body.ftth-modern-front .ftth-stat {
    position: relative;
    padding: 2.5rem 2rem;
    border: 1px solid var(--ftth-line);
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(34, 211, 238, 0.04), transparent);
    overflow: hidden;
}
body.ftth-modern-front .ftth-stat::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.18), transparent 50%);
    opacity: 0;
    transition: opacity 0.5s;
}
body.ftth-modern-front .ftth-stat:hover::before { opacity: 1; }
body.ftth-modern-front .ftth-stat-num {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(4rem, 7vw, 6.5rem);
    line-height: 0.9;
    color: var(--ftth-text);
    letter-spacing: -0.03em;
}

/* Infrastructure capability cards --------------------------- */
body.ftth-modern-front .ftth-capability {
    position: relative;
    padding: 2rem 1.75rem;
    border-radius: 20px;
    background: rgba(13, 19, 48, 0.6);
    border: 1px solid var(--ftth-line);
    transition: all 0.5s cubic-bezier(.2,1,.3,1);
    overflow: hidden;
    isolation: isolate;
}
body.ftth-modern-front .ftth-capability::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 220px at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, 0.22), transparent 65%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
}
body.ftth-modern-front .ftth-capability:hover::after { opacity: 1; }
body.ftth-modern-front .ftth-capability:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.45);
}
body.ftth-modern-front .ftth-capability-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(232, 121, 249, 0.1));
    border: 1px solid rgba(34, 211, 238, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ftth-cyan-bright);
    margin-bottom: 1.4rem;
}
body.ftth-modern-front .ftth-capability h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.65rem;
    line-height: 1.1;
    color: var(--ftth-text);
    margin-bottom: 0.5rem;
}
body.ftth-modern-front .ftth-capability p {
    color: var(--ftth-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}
body.ftth-modern-front .ftth-capability .tag {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--ftth-cyan);
    text-transform: uppercase;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed rgba(34, 211, 238, 0.18);
    width: 100%;
}

/* Portfolio cards (dark-friendly) --------------------------- */
body.ftth-modern-front .ftth-port-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(20, 30, 60, 0.08);
    transition: transform .4s ease, box-shadow .4s ease;
}
body.ftth-modern-front .ftth-port-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.4), 0 0 40px rgba(34,211,238,0.15);
}

/* SEO Vault table ------------------------------------------- */
body.ftth-modern-front .ftth-vault {
    background: linear-gradient(160deg, #07091c 0%, #0d1330 100%);
    border: 1px solid var(--ftth-line);
    border-radius: 28px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
body.ftth-modern-front .ftth-vault::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 60%);
    pointer-events: none;
}
body.ftth-modern-front .ftth-vault table th {
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--ftth-cyan);
    text-transform: uppercase;
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--ftth-line);
}
body.ftth-modern-front .ftth-vault table td {
    padding: 1.1rem 0.75rem;
    border-bottom: 1px dashed rgba(120, 144, 220, 0.1);
    color: var(--ftth-text);
}
body.ftth-modern-front .ftth-vault tbody tr {
    transition: background 0.3s;
}
body.ftth-modern-front .ftth-vault tbody tr:hover {
    background: rgba(34, 211, 238, 0.05);
}
body.ftth-modern-front .ftth-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
}
body.ftth-modern-front .ftth-rank-1 {
    background: rgba(163, 230, 53, 0.15);
    color: var(--ftth-lime);
    box-shadow: inset 0 0 0 1px rgba(163, 230, 53, 0.5), 0 0 14px rgba(163, 230, 53, 0.25);
}
body.ftth-modern-front .ftth-rank-2 {
    background: rgba(251, 191, 36, 0.15);
    color: var(--ftth-amber);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.5);
}
body.ftth-modern-front .ftth-rank-3 {
    background: rgba(232, 121, 249, 0.15);
    color: var(--ftth-magenta);
    box-shadow: inset 0 0 0 1px rgba(232, 121, 249, 0.45);
}

/* Testimonials ---------------------------------------------- */
body.ftth-modern-front .ftth-quote {
    position: relative;
    padding: 3rem;
    border-radius: 24px;
    background: rgba(13, 19, 48, 0.45);
    border: 1px solid var(--ftth-line);
    backdrop-filter: blur(10px);
}
body.ftth-modern-front .ftth-quote .quote-mark {
    font-family: 'Instrument Serif', serif;
    font-size: 5rem;
    line-height: 0.5;
    color: var(--ftth-cyan);
    opacity: 0.6;
    display: block;
    margin-bottom: 1rem;
}
body.ftth-modern-front .ftth-quote p {
    font-family: 'Instrument Serif', serif;
    font-size: 1.7rem;
    line-height: 1.35;
    color: var(--ftth-text);
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

/* Scroll storytelling section: data journey ----------------- */
body.ftth-modern-front .ftth-journey {
    position: relative;
    background: var(--ftth-bg);
}
body.ftth-modern-front .ftth-journey-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    min-height: 90vh;
    padding: 3rem 0;
}
body.ftth-modern-front .ftth-journey-num {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(6rem, 11vw, 11rem);
    color: var(--ftth-cyan);
    line-height: 0.85;
    opacity: 0.85;
    letter-spacing: -0.05em;
}
body.ftth-modern-front .ftth-journey h3 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2.5rem, 4.5vw, 4rem);
    color: var(--ftth-text);
    line-height: 1.02;
    margin: 0.5rem 0 1.5rem;
}
body.ftth-modern-front .ftth-journey p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--ftth-muted);
    max-width: 32rem;
}
body.ftth-modern-front .ftth-journey-visual {
    aspect-ratio: 1 / 1;
    border-radius: 28px;
    background: rgba(13, 19, 48, 0.4);
    border: 1px solid var(--ftth-line);
    position: relative;
    overflow: hidden;
}

/* Final CTA ------------------------------------------------- */
body.ftth-modern-front .ftth-final-cta {
    position: relative;
    padding: 10rem 0;
    background: linear-gradient(180deg, #050714 0%, #0c1638 50%, #050714 100%);
    text-align: center;
    overflow: hidden;
}
body.ftth-modern-front .ftth-final-cta::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.2), transparent 60%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

/* Reveal helpers (driven by GSAP / IntersectionObserver) ---- */
body.ftth-modern-front [data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(.2,.8,.2,1), transform 0.9s cubic-bezier(.2,.8,.2,1);
    will-change: transform, opacity;
}
body.ftth-modern-front [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}
body.ftth-modern-front [data-reveal-char] {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.4em) rotate(2deg);
    transition: opacity 0.7s cubic-bezier(.2,.8,.2,1), transform 0.7s cubic-bezier(.2,.8,.2,1);
    will-change: transform, opacity;
}
body.ftth-modern-front [data-reveal-char].is-visible {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

/* Responsive ------------------------------------------------ */
@media (max-width: 900px) {
    body.ftth-modern-front .ftth-section { padding: 5rem 0; }
    body.ftth-modern-front .ftth-journey-stage { grid-template-columns: 1fr; gap: 2rem; min-height: auto; }
    body.ftth-modern-front .ftth-marquee-item { font-size: 1.4rem; }
    body.ftth-modern-front .ftth-vault { padding: 1.5rem; }
}

/* Respect prefers-reduced-motion ---------------------------- */
@media (prefers-reduced-motion: reduce) {
    body.ftth-modern-front *,
    body.ftth-modern-front *::before,
    body.ftth-modern-front *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    body.ftth-modern-front [data-reveal],
    body.ftth-modern-front [data-reveal-char] {
        opacity: 1 !important;
        transform: none !important;
    }
}
