/* =========================================================
   ShamsiCal — Celestial Timekeeper
   Premium landing page for iOS, macOS & visionOS
   ========================================================= */

/* --- Tokens ------------------------------------------------ */
:root {
    --bg:           #08070E;
    --bg-warm:      #0C0B14;
    --gold:         #C9A84C;
    --gold-light:   #E2C773;
    --gold-dim:     rgba(201, 168, 76, 0.12);
    --text:         #EDE8DF;
    --text-dim:     #7A7584;
    --surface:      rgba(255, 255, 255, 0.04);
    --border:       rgba(255, 255, 255, 0.07);
    --red:          #FF3B30;
    --serif:        'Instrument Serif', 'Georgia', serif;
    --sans:         'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --farsi:        'Vazirmatn', 'Tahoma', sans-serif;
    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset ------------------------------------------------- */
*, *::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(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

/* --- Grain overlay ----------------------------------------- */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
    mix-blend-mode: overlay;
}

/* --- Container --------------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 48px);
}

/* --- Header ------------------------------------------------ */
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 28px 0;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--serif);
    font-size: 22px;
    letter-spacing: 0.02em;
    color: var(--text);
}

.nav-platforms {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0.6;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 120px 0 80px;
}

/* Warm ambient glow */
.hero-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 80%;
    height: 120%;
    background:
        radial-gradient(ellipse 60% 50% at 65% 40%,
            rgba(201, 168, 76, 0.08) 0%,
            transparent 70%),
        radial-gradient(ellipse 40% 60% at 55% 55%,
            rgba(180, 100, 30, 0.05) 0%,
            transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 0.85fr;
    gap: clamp(32px, 6vw, 80px);
    align-items: center;
    width: 100%;
}

/* Hero text */
.hero-text {
    padding: clamp(0px, 2vw, 24px) 0;
}

.hero-text h1 {
    font-family: var(--serif);
    font-size: clamp(44px, 6.5vw, 80px);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.35s forwards;
}

.hero-text h1 em {
    font-style: italic;
    color: var(--gold-light);
}

.hero-sub {
    font-size: clamp(16px, 1.6vw, 19px);
    font-weight: 300;
    color: var(--text-dim);
    max-width: 440px;
    line-height: 1.7;
    margin-bottom: 44px;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.55s forwards;
}

.cta {
    display: inline-block;
    transition: transform 0.3s var(--ease-smooth), opacity 0.3s;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.7s forwards;
}

.cta:hover {
    transform: scale(1.05);
}

.cta:active {
    transform: scale(0.98);
}

.cta img {
    height: 52px;
    width: auto;
}

/* Hero device */
.hero-device {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeUp 1.1s var(--ease-out) 0.5s forwards;
}

.device-glow {
    position: absolute;
    width: 130%;
    height: 130%;
    border-radius: 50%;
    background:
        radial-gradient(circle,
            rgba(201, 168, 76, 0.12) 0%,
            rgba(201, 168, 76, 0.04) 40%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.mockup {
    position: relative;
    z-index: 1;
    max-height: 75vh;
    width: auto;
    filter: drop-shadow(0 32px 64px rgba(0, 0, 0, 0.5))
            drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
    animation: float 6s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    opacity: 0;
    animation: fadeIn 1s var(--ease-out) 1.4s forwards;
}

.scroll-hint span {
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--gold), transparent);
    opacity: 0.4;
    animation: scrollPulse 2s ease-in-out infinite;
}

/* =========================================================
   FEATURES
   ========================================================= */
.features {
    padding: clamp(80px, 12vw, 160px) 0;
    background: var(--bg);
    position: relative;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: clamp(48px, 6vw, 80px);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.feature {
    display: grid;
    grid-template-columns: clamp(60px, 10vw, 120px) 1fr;
    gap: clamp(16px, 3vw, 40px);
    align-items: start;
    padding: clamp(28px, 4vw, 48px) 0;
    border-top: 1px solid var(--border);
}

.feature:last-child {
    border-bottom: 1px solid var(--border);
}

.feature-num {
    font-family: var(--serif);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 400;
    line-height: 1;
    color: var(--gold);
    opacity: 0.25;
    padding-top: 4px;
}

.feature-body h2 {
    font-family: var(--serif);
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.feature-body p {
    font-size: clamp(15px, 1.4vw, 17px);
    font-weight: 300;
    color: var(--text-dim);
    max-width: 520px;
    line-height: 1.75;
}

/* =========================================================
   PLATFORMS
   ========================================================= */
.platforms {
    padding: clamp(80px, 12vw, 160px) 0;
    background: var(--bg-warm);
    position: relative;
}

/* subtle top edge glow */
.platforms::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold-dim),
        rgba(201, 168, 76, 0.2),
        var(--gold-dim),
        transparent
    );
}

.platforms-heading {
    font-family: var(--serif);
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: clamp(56px, 8vw, 96px);
}

.platforms-heading em {
    font-style: italic;
    color: var(--gold-light);
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 3vw, 40px);
}

.platform-card {
    padding: clamp(28px, 3vw, 44px);
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: transform 0.5s var(--ease-out),
                border-color 0.4s,
                background 0.4s;
}

.platform-card:hover {
    transform: translateY(-6px);
    border-color: rgba(201, 168, 76, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.platform-icon {
    width: clamp(36px, 4vw, 48px);
    height: auto;
    color: var(--gold);
    margin-bottom: 24px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.platform-card:hover .platform-icon {
    opacity: 1;
}

.platform-card h3 {
    font-family: var(--serif);
    font-size: clamp(22px, 2.5vw, 28px);
    font-weight: 400;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.platform-card p {
    font-size: clamp(14px, 1.3vw, 16px);
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.7;
}

/* =========================================================
   DOWNLOAD CTA
   ========================================================= */
.download {
    padding: clamp(100px, 14vw, 180px) 0;
    text-align: center;
    position: relative;
}

.download::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 60%;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(201, 168, 76, 0.06) 0%,
        transparent 70%);
    pointer-events: none;
}

.download-heading {
    font-family: var(--serif);
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: clamp(36px, 5vw, 56px);
}

.download-heading em {
    font-style: italic;
    color: var(--gold-light);
}

.cta-lg {
    animation: none;
    opacity: 1;
}

.cta-lg img {
    height: 64px;
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
    padding: 48px 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 400;
    border-top: 1px solid var(--border);
}

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s var(--ease-out),
                transform 0.8s var(--ease-out);
}

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

/* Stagger siblings */
.feature.reveal:nth-child(2) { transition-delay: 0.08s; }
.feature.reveal:nth-child(3) { transition-delay: 0.16s; }
.feature.reveal:nth-child(4) { transition-delay: 0.24s; }

.platform-card.reveal:nth-child(1) { transition-delay: 0.06s; }
.platform-card.reveal:nth-child(2) { transition-delay: 0.14s; }
.platform-card.reveal:nth-child(3) { transition-delay: 0.22s; }

/* =========================================================
   KEYFRAMES
   ========================================================= */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.15; transform: scaleY(1); }
    50%      { opacity: 0.5;  transform: scaleY(1.2); }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablet */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr 0.75fr;
    }

    .platform-grid {
        gap: 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    header { padding: 20px 0; }

    .nav-platforms { display: none; }

    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-sub {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-text .cta {
        display: inline-block;
    }

    .hero-device {
        margin-top: 48px;
        order: -1;
    }

    .mockup {
        max-height: 55vh;
    }

    .device-glow {
        width: 160%;
        height: 160%;
    }

    .scroll-hint { display: none; }

    /* Features */
    .feature {
        grid-template-columns: 48px 1fr;
        gap: 16px;
    }

    .feature-num {
        font-size: 28px;
    }

    /* Platforms */
    .platform-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .platform-card {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 20px;
        align-items: start;
    }

    .platform-icon {
        grid-row: 1 / 3;
        width: 36px;
        margin-bottom: 0;
        align-self: center;
    }

    .platform-card h3 { margin-bottom: 4px; }
}

/* Small phones */
@media (max-width: 400px) {
    .hero-text h1 { font-size: 38px; }
    .platforms-heading { font-size: 34px; }
    .download-heading { font-size: 34px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .mockup { animation: none; }
}
