/*
 * ahmadyaseen.com - Design System
 * Clean, intentional, Stripe-inspired
 */

/* ============================================
   CSS RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    /* Colors - softer dark theme */
    --bg-primary: #0f0f0f;
    --bg-secondary: #151515;
    --bg-tertiary: #1a1a1a;
    --bg-elevated: #202020;

    --text-primary: #ebebeb;
    --text-secondary: #9a9a9a;
    --text-muted: #5a5a5a;

    --accent: #f97316;
    --accent-hover: #fb923c;
    --accent-dim: rgba(249, 115, 22, 0.08);
    --accent-border: rgba(249, 115, 22, 0.3);

    --border: #262626;
    --border-light: #303030;

    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-body: 'Work Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Layout */
    --max-width: 1200px;
    --content-width: 800px;
    --nav-height: 72px;
    --sidebar-width: 240px;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}

/* ============================================
   SPLASH SCREEN
   ============================================ */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.splash-greeting {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 4.5rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    position: absolute;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(30px);
    filter: blur(2px);
}

/* Enter from below */
.splash-greeting.entering {
    animation: greetingEnter 0.2s ease-out forwards;
}

/* Visible and holding */
.splash-greeting.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Exit upward while fading */
.splash-greeting.exiting {
    animation: greetingExit 0.25s ease-in forwards;
}

@keyframes greetingEnter {
    from {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes greetingExit {
    from {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }

    to {
        opacity: 0;
        transform: translateY(-30px);
        filter: blur(2px);
    }
}

/* Prevent scroll during splash */
body.splash-active {
    overflow: hidden;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}


/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.95;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

h4 {
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    letter-spacing: -0.01em;
}

/* Utility for emphasized text */
.text-em {
    font-style: italic;
    color: var(--text-primary);
}

/* Headline gradient effect - last words darker */
.headline-fade {
    color: var(--text-secondary);
    opacity: 0.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* ============================================
   BUTTONS - Clean, no scale/position animations
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #000;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
}

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

/* ============================================
   CARDS - Subtle, no transform animations
   ============================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: border-color var(--transition-base);
}

.card:hover {
    border-color: var(--border-light);
}

/* ============================================
   TAGS / PILLS
   ============================================ */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.tag-neutral {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

/* ============================================
   HEADER NAVIGATION
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.header-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
    display: inline-flex;
    gap: 0;
}

.header-logo .logo-word {
    display: inline-flex;
}

.header-logo .logo-letter {
    display: inline-block;
}

.header-logo .logo-rest {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.35s ease-in-out, opacity 0.25s ease-in-out;
}

.header-logo:hover .logo-rest {
    max-width: 100px;
    opacity: 1;
}

.header-logo:hover .logo-word:not(:last-child)::after {
    content: ' ';
    white-space: pre;
}

.header-logo:hover {
    color: var(--accent);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.header-link {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-xs) 0;
    position: relative;
}

/* Flip link animation */
.flip-link {
    position: relative;
    display: inline-flex;
}

.flip-text {
    display: flex;
}

.flip-text span {
    display: inline-block;
    position: relative;
    overflow: hidden;
    line-height: 1.2;
}

.flip-text:first-child span::before,
.flip-text:first-child span::after {
    display: block;
    transition: transform 0.25s ease-in-out;
    transition-delay: calc(var(--i) * 0.025s);
}

.flip-text:first-child span::before {
    content: attr(data-letter);
}

.flip-text:first-child span::after {
    content: attr(data-letter);
    position: absolute;
    top: 0;
    left: 0;
    color: var(--accent);
    transform: translateY(100%);
}

.flip-link:hover .flip-text:first-child span::before {
    transform: translateY(-100%);
}

.flip-link:hover .flip-text:first-child span::after {
    transform: translateY(0);
}

/* Hide the duplicate text row */
.flip-text-bottom {
    display: none;
}

.header-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease-in-out, left 0.3s ease-in-out;
    border-radius: 1px;
}

.header-link:hover,
.header-link.active {
    color: var(--text-primary);
}

.header-link.active::after,
.header-link:hover::after {
    width: 100%;
    left: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-cta {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--accent);
    color: #000;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.header-cta:hover {
    background: var(--accent-hover);
    color: #000;
}

/* Mobile header toggle */
.header-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    gap: 5px;
}

.header-toggle span {
    width: 16px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

.header-toggle.active span:first-child {
    transform: rotate(45deg) translate(2px, 2px);
}

.header-toggle.active span:last-child {
    transform: rotate(-45deg) translate(2px, -2px);
}

/* Main content - no sidebar offset */
main {
    padding-top: var(--nav-height);
}

/* ============================================
   CONTAINER UTILITIES
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-narrow {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ============================================
   SECTION UTILITIES
   ============================================ */
.section {
    padding: var(--space-4xl) 0;
}

.section-header {
    margin-bottom: var(--space-3xl);
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

.section-label::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--accent);
}

.section-title {
    margin-bottom: var(--space-md);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 560px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-fade-up {
    animation: fadeUp 0.6s ease forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* ============================================
   TIMELINE COMPONENT
   ============================================ */
.timeline {
    position: relative;
    padding-left: var(--space-xl);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-2xl);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-xl) + 1px);
    top: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.timeline-subtitle {
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.timeline-subtitle a {
    color: inherit;
}

.timeline-subtitle a:hover {
    text-decoration: underline;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   ICON STYLES (Stripe-like)
   ============================================ */
.icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent);
}

.icon svg {
    width: 24px;
    height: 24px;
}

.icon-lg {
    width: 64px;
    height: 64px;
}

.icon-lg svg {
    width: 32px;
    height: 32px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
}

.footer-name {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.footer-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent);
}

.footer-copyright {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-copyright::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Social icons */
.social-links {
    display: flex;
    gap: var(--space-sm);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.social-link:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {

    .header-nav,
    .header-actions {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: var(--space-lg);
        gap: var(--space-md);
    }

    .header-nav.open,
    .header-actions.open {
        display: flex;
    }

    .header-nav.open+.header-actions {
        display: flex;
        top: auto;
        position: relative;
        border-bottom: none;
        padding-top: 0;
    }

    .header-toggle {
        display: flex;
    }

    .header-cta {
        width: 100%;
        justify-content: center;
    }

    .section {
        padding: var(--space-3xl) 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-accent {
    color: var(--accent);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    body::before {
        display: none;
    }

    .nav,
    .footer {
        display: none;
    }
}