/* 
 * Ahmad Nikzad Khurasani — Design System
 * Theme: Precision trading / enterprise clarity
 */

:root {
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;

    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --accent-subtle: rgba(29, 78, 216, 0.08);

    --glass-bg: rgba(248, 250, 252, 0.85);
    --glass-blur: blur(14px);
    --glass-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);

    --grid-gap: 24px;
    --container-width: 1200px;
    --section-spacing: 100px;
    --card-padding: 36px;
    --nav-height: 80px;

    --font-main: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --h1-size: clamp(2.5rem, 5vw, 4rem);
    --h2-size: clamp(1.85rem, 3.5vw, 2.75rem);
    --h3-size: 1.25rem;
    --body-size: 1.0625rem;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-reveal: 0.7s;
    --radius: 8px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: var(--body-size);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

body.menu-open {
    overflow: hidden;
}

section {
    background-color: var(--bg-body);
    position: relative;
    z-index: 1;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.25s ease;
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary);
}

h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); margin-bottom: 1rem; }
h3 { font-size: var(--h3-size); font-weight: 600; margin-bottom: 0.75rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

p:last-child {
    margin-bottom: 0;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 32px);
    width: 100%;
}

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    width: 100%;
}

.grid-12 > * {
    min-width: 0;
}

.section-padding {
    padding: var(--section-spacing) 0;
}

.section-heading {
    margin-bottom: clamp(40px, 8vw, 72px);
    max-width: 560px;
}

.section-heading.centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.text-center { text-align: center; }

/* ——— Navigation ——— */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 18px 0;
    transition: padding 0.35s var(--ease-out-expo), box-shadow 0.35s ease, background 0.35s ease;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.navbar.scrolled {
    padding: 12px 0;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.logo {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1002;
    min-width: 0;
    color: var(--text-primary);
}

.logo img {
    height: 36px;
    width: auto;
    flex-shrink: 0;
}

.logo span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links {
    display: flex;
    gap: 36px;
    align-items: center;
}

.nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    padding: 6px 0;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: var(--text-primary);
    transition: width 0.3s var(--ease-out-expo);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    cursor: pointer;
    z-index: 1002;
    border: none;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ——— Hero ——— */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(var(--nav-height) + 40px);
    padding-bottom: 64px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: #0f172a;
}

.hero.hero-page {
    min-height: 48vh;
    min-height: 48dvh;
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 56px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    overflow: hidden;
}

.hero-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("https://images.unsplash.com/photo-1556761175-b413da4baf72?w=1920&h=1080&fit=crop&q=80");
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    animation: kenBurns 28s infinite alternate ease-in-out;
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 41, 59, 0.72) 100%);
}

@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-bg::before {
        animation: none;
    }

    .reveal-on-scroll,
    .js-enabled .reveal-on-scroll:not(.is-visible) {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.hero .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-content {
    max-width: 720px;
    position: relative;
    z-index: 2;
}

.hero-content h1,
.hero-content p,
.hero-content .hero-title,
.hero-content .hero-subtitle {
    color: #fff;
}

.hero-title {
    margin-bottom: 20px;
    color: #fff;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.65;
    max-width: 36rem;
    margin-bottom: 36px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ——— Buttons ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    border: 1px solid transparent;
    min-height: 48px;
    text-align: center;
}

.btn-primary {
    background-color: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--text-primary);
}

.btn-primary.on-dark {
    background-color: #fff;
    color: var(--text-primary);
    border-color: #fff;
}

.btn-primary.on-dark:hover {
    background-color: transparent;
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border-color: rgba(15, 23, 42, 0.15);
}

.btn-outline:hover {
    border-color: var(--text-primary);
}

.btn-outline.on-dark {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.btn-outline.on-dark:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* ——— Services ——— */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--bg-surface);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius);
    padding: var(--card-padding);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s var(--ease-out-expo);
    display: flex;
    flex-direction: column;
    height: 100%;
}

@media (hover: hover) and (pointer: fine) {
    .service-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    }

    .service-card:hover .service-icon img {
        filter: grayscale(0%);
    }

    .service-card:hover .service-link::after {
        transform: translateX(4px);
    }
}

.service-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 24px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 50%;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-body);
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.service-card h3 {
    margin-bottom: 12px;
}

.service-card p {
    flex: 1;
    font-size: 0.98rem;
}

.service-link {
    margin-top: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.service-link::after {
    content: "→";
    transition: transform 0.25s ease;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.values-grid .service-card {
    min-height: auto;
}

/* ——— Stats ——— */
.stats-section {
    background-color: #fff !important;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.stat-item {
    text-align: center;
    padding: 32px 20px;
    border-right: 1px solid rgba(15, 23, 42, 0.06);
}

.stat-item:last-child {
    border-right: none;
}

.stat-number {
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: block;
    letter-spacing: -0.04em;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-weight: 500;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px 28px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--radius);
    background: #fff;
}

.feature-card h3 {
    margin-bottom: 10px;
}

.feature-card p {
    margin: 0;
    font-size: 0.98rem;
}

/* ——— Content blocks ——— */
.content-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(32px, 6vw, 72px);
}

.content-block.reverse {
    direction: rtl;
}

.content-block.reverse > * {
    direction: ltr;
}

.content-image {
    position: relative;
    min-height: 320px;
    height: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.content-image img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    max-height: 480px;
    object-fit: cover;
}

.content-image.logo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(32px, 6vw, 64px);
    min-height: 280px;
}

.content-image.logo-frame img {
    width: 100%;
    max-width: 320px;
    height: auto;
    min-height: 0;
    max-height: none;
    object-fit: contain;
}

/* ——— Contact ——— */
.contact-panel {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--radius);
    padding: clamp(28px, 5vw, 48px);
    box-shadow: var(--glass-shadow);
}

.contact-block {
    margin-bottom: 36px;
}

.contact-block:last-child {
    margin-bottom: 0;
}

.contact-block h2,
.contact-block h3 {
    margin-bottom: 10px;
}

.contact-block a {
    color: var(--primary);
    font-weight: 500;
}

.contact-block a:hover {
    text-decoration: underline;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-list a,
.contact-list span {
    display: inline-block;
    word-break: break-word;
}

/* ——— Footer ——— */
.footer {
    background-color: #0f172a;
    color: #fff;
    padding: 72px 0 36px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.4fr;
    gap: 40px;
    margin-bottom: 48px;
}

.footer-brand .logo {
    color: #fff;
    margin-bottom: 16px;
}

.footer-brand .logo span {
    color: #fff;
}

.footer-brand .logo img {
    height: 36px;
    opacity: 0.95;
}

.footer h3 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 18px;
    letter-spacing: 0.02em;
}

.footer p,
.footer a,
.footer li {
    color: #94a3b8;
    font-size: 0.95rem;
}

.footer a:hover {
    color: #fff;
}

.footer-links li,
.footer-meta li {
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 28px;
    text-align: center;
    font-size: 0.875rem;
}

.footer-bottom p {
    color: #64748b;
    margin: 0;
}

/* ——— Reveal ——— */
.reveal-on-scroll {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--duration-reveal) var(--ease-out-expo),
                transform var(--duration-reveal) var(--ease-out-expo);
}

.js-enabled .reveal-on-scroll:not(.is-visible) {
    opacity: 0;
    transform: translateY(24px);
}

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

/* ——— Tablet ——— */
@media (max-width: 1024px) {
    :root {
        --section-spacing: 80px;
        --card-padding: 28px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
        background: #fff;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 28px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1001;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-links .nav-link {
        font-size: 1.35rem;
        font-weight: 600;
    }

    .services-grid,
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        border-right: none;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
        padding: 28px 16px;
    }

    .stat-item:nth-child(odd) {
        border-right: 1px solid rgba(15, 23, 42, 0.06);
    }

    .stat-item:nth-last-child(-n + 2) {
        border-bottom: none;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .content-block,
    .content-block.reverse {
        grid-template-columns: 1fr;
        direction: ltr;
        gap: 28px;
    }

    .content-image,
    .content-image img {
        min-height: 240px;
        max-height: 360px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ——— Phone ——— */
@media (max-width: 640px) {
    :root {
        --section-spacing: 64px;
        --card-padding: 24px;
        --h1-size: clamp(2rem, 9vw, 2.75rem);
        --h2-size: clamp(1.5rem, 6vw, 2rem);
        --body-size: 1rem;
    }

    .logo {
        font-size: 0.9rem;
        max-width: calc(100vw - 100px);
    }

    .logo img {
        height: 32px;
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--nav-height) + 28px);
        padding-bottom: 56px;
    }

    .hero.hero-home {
        min-height: 92dvh;
        align-items: flex-end;
        padding-bottom: 72px;
    }

    .hero.hero-page {
        min-height: auto;
        padding-top: calc(var(--nav-height) + 40px);
        padding-bottom: 48px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-subtitle {
        margin-bottom: 28px;
        max-width: none;
    }

    .services-grid,
    .values-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }

    .stat-item {
        padding: 24px 12px;
    }

    .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }

    .section-heading {
        margin-bottom: 36px;
    }

    .section-heading.centered {
        margin-bottom: 40px;
    }

    .content-image.logo-frame {
        min-height: 200px;
        padding: 28px;
    }

    .contact-panel {
        padding: 24px 20px;
        box-shadow: none;
    }

    .footer {
        padding: 56px 0 28px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-bottom: 36px;
    }

    .footer-brand .logo span {
        white-space: normal;
    }
}

/* ——— Very small phones ——— */
@media (max-width: 380px) {
    .logo span {
        font-size: 0.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-item,
    .stat-item:nth-child(odd) {
        border-right: none;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }

    .stat-item:last-child {
        border-bottom: none;
    }
}
