/* ============================================================
   Yash K Patel Firm - Global Styles (pure CSS, no @apply)
   ============================================================ */

/* ============================================================
   Theme Tokens - change these to re-theme the entire site
   ============================================================ */

/* Gold 
:root {
    --accent-50:  #FFFDF6;
    --accent-100: #FFFBDA;
    --accent-200: #FFEC9E;
    --accent-300: #FFBB70;
    --accent-400: #ED9455;
    --accent-500: #D97A3A;
} */

/* blue
:root {
    --accent-50:  #F0F7FF;
    --accent-100: #E0EFFE;
    --accent-200: #BADEFF;
    --accent-300: #5BA9F8;   
    --accent-400: #2B7CE0;   
    --accent-500: #1A5DB8;
} */

/* Green
:root {
    --accent-50:  #F0FDF7;
    --accent-100: #D7F8E5;
    --accent-200: #9FEEC0;
    --accent-300: #4DD489;
    --accent-400: #1FAB5C;
    --
    
    accent-500: #0F8540;
} */

:root {
    

    --accent-50:  #FFF4EC;
    --accent-100: #FFE4D3;
    --accent-200: #FFC8A3;
    --accent-300: #F5A46D;
    --accent-400: #D97A3A;
    --accent-500: #B85F1F;
}

/* ===== DARK THEME (default) ===== */
:root, .theme-dark {
    --bg-page:       #0A0908;   /* main page background */
    --bg-surface:    #13110F;   /* cards, nav background */
    --bg-elevated:   #1C1A17;   /* code blocks, raised cards */
    --bg-input:      rgba(255, 255, 255, 0.05);

    --text-primary:   #FFFBDA;  /* headlines */
    --text-secondary: #d6d3d1;  /* body */
    --text-muted:     #a8a29e;  /* placeholders, captions */
    --text-on-accent: #0A0908;  /* text on cream buttons */

    --border-soft:    rgba(255, 235, 158, 0.10);
    --border-medium:  rgba(255, 235, 158, 0.20);
    --border-strong:  rgba(255, 187, 112, 0.40);

    --accent-primary:    var(--accent-300);
    --accent-secondary:  var(--accent-400);
    --accent-tint:       rgba(255, 187, 112, 0.10);
    --accent-tint-hover: rgba(255, 187, 112, 0.20);

    --shadow-color: 237, 148, 85;  /* RGB triplet for box-shadows */
}

/* ===== LIGHT THEME ===== */
.theme-light {
    --bg-page:       #FAFAF9;   /* pearl white */
    --bg-surface:    #FFFFFF;
    --bg-elevated:   #F4F4F2;
    --bg-input:      rgba(0, 0, 0, 0.03);

    --text-primary:   #0F0E0D;
    --text-secondary: #44423F;
    --text-muted:     #78756F;
    --text-on-accent: #FFFFFF;

    --border-soft:    rgba(0, 0, 0, 0.06);
    --border-medium:  rgba(0, 0, 0, 0.12);
    --border-strong:  rgba(217, 122, 58, 0.45);

    --accent-primary:    #B85F1F;
    --accent-secondary:  #D97A3A;
    --accent-tint:       rgba(184, 95, 31, 0.08);
    --accent-tint-hover: rgba(184, 95, 31, 0.16);
    --shadow-color:      0, 0, 0;
}
[x-cloak] { display: none !important; }

::selection { background-color: var(--accent-primary); color: var(--text-on-accent); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--accent-secondary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* -------------------- Navigation links -------------------- */
.nav-link {
    position: relative;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--text-secondary);
    transition: color 0.2s;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 2px;
    height: 2px;
    width: 0;
    transform: translateX(-50%);
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
    border-radius: 2px;
}
.nav-link:hover::after, .nav-link.active::after { width: 60%; }

.dropdown-link {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.dropdown-link:hover {
    background-color: rgba(255, 187, 112, 0.1);
    color: var(--text-primary);
}

.mobile-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}
.mobile-link:hover {
    background-color: rgba(255, 187, 112, 0.1);
    color: var(--text-primary);
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: 1px solid var(--border-medium, rgba(255, 235, 158, 0.20));
    color: var(--text-secondary, #d6d3d1);
    background-color: transparent;
    transition: all 0.3s ease;
    text-decoration: none;
    flex-shrink: 0;
}
.social-icon:hover {
    color: var(--accent-primary, #FFBB70);
    border-color: var(--accent-primary, #FFBB70);
    background-color: var(--accent-tint, rgba(255, 187, 112, 0.10));
    transform: translateY(-2px);
}
.social-icon svg {
    width: 1rem !important;
    height: 1rem !important;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    pointer-events: none;
    display: block;
    flex-shrink: 0;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-link:hover { color: var(--accent-200); }

/* -------------------- Section primitives -------------------- */
.section {
    padding-top: 5rem;
    padding-bottom: 5rem;
    position: relative;
}
@media (min-width: 768px) {
    .section { padding-top: 6rem; padding-bottom: 6rem; }
}
@media (min-width: 1024px) {
    .section { padding-top: 8rem; padding-bottom: 8rem; }
}

.section-tight {
    padding-top: 3rem;
    padding-bottom: 3rem;
    position: relative;
}
@media (min-width: 1024px) {
    .section-tight { padding-top: 5rem; padding-bottom: 5rem; }
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 187, 112, 0.3);
    background-color: rgba(255, 187, 112, 0.06);
    color: var(--accent-primary);
    font-size: 0.7rem;
    line-height: 1;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 2.25rem;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin: 0;
}
@media (min-width: 768px) { .section-title { font-size: 3rem; } }
@media (min-width: 1024px) { .section-title { font-size: 3.75rem; } }
.section-title em {
    font-style: normal;
    font-weight: 600;
    background: linear-gradient(to right, var(--accent-200), var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-top: 1.5rem;
    max-width: 42rem;
}
@media (min-width: 1024px) { .section-subtitle { font-size: 1.2rem; } }

/* -------------------- Buttons -------------------- */
.btn-primary, .btn-outline, .btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}
.btn-primary {
    padding: 0.875rem 1.75rem;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    color: var(--text-on-accent);
    box-shadow: 0 10px 25px -5px rgba(237, 148, 85, 0.2);
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(to right, var(--accent-200), var(--accent-primary));
    box-shadow: 0 15px 35px -5px rgba(237, 148, 85, 0.4);
    transform: translateY(-2px);
}
.btn-outline {
    padding: 0.875rem 1.75rem;
    border: 1px solid rgba(255, 187, 112, 0.4);
    color: var(--text-primary);
    background: transparent;
}
.btn-outline:hover {
    border-color: var(--accent-primary);
    background-color: rgba(255, 187, 112, 0.1);
}
.btn-ghost {
    padding: 0.6rem 1.25rem;
    color: var(--accent-primary);
    font-weight: 500;
    background: transparent;
    border: none;
}
.btn-ghost:hover { color: var(--text-primary); }

/* -------------------- Cards -------------------- */
.card {
    position: relative;
    background-color: rgba(19, 17, 15, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 235, 158, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.5s;
}
.card:hover { border-color: rgba(255, 187, 112, 0.4); }
.card-glow:hover { box-shadow: 0 0 60px -10px rgba(237, 148, 85, 0.25); }

/* -------------------- Stats -------------------- */
.stat-num {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 3rem;
    line-height: 1;
    background: linear-gradient(to bottom right, var(--accent-200), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
@media (min-width: 1024px) { .stat-num { font-size: 3.75rem; } }

/* -------------------- Hologram frame -------------------- */
.hologram-frame { position: relative; isolation: isolate; }
.hologram-frame::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: conic-gradient(from 0deg, transparent, var(--accent-primary), transparent, var(--accent-secondary), transparent);
    border-radius: inherit;
    animation: rotate-glow 6s linear infinite;
    z-index: -1;
    opacity: 0.6;
}
.hologram-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 187, 112, 0.08) 50%, transparent 100%);
    background-size: 100% 200%;
    animation: scan 3s ease-in-out infinite;
    border-radius: inherit;
    pointer-events: none;
    mix-blend-mode: overlay;
}
@keyframes rotate-glow { to { transform: rotate(360deg); } }
@keyframes scan {
    0%, 100% { background-position: 0% 100%; opacity: 0.3; }
    50% { background-position: 0% 0%; opacity: 0.8; }
}

.hero-portrait-emerge {
    animation: emerge 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes emerge {
    0% { opacity: 0; filter: blur(20px) hue-rotate(45deg); transform: translateY(40px) scale(0.92); }
    60% { opacity: 0.8; filter: blur(2px); }
    100% { opacity: 1; filter: blur(0) hue-rotate(0); transform: translateY(0) scale(1); }
}

/* -------------------- Grid mesh -------------------- */
.grid-mesh {
    background-image:
        linear-gradient(rgba(255, 235, 158, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 235, 158, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* -------------------- Pinterest masonry -------------------- */
.masonry { columns: 1; column-gap: 1.25rem; }
@media (min-width: 640px)  { .masonry { columns: 2; } }
@media (min-width: 1024px) { .masonry { columns: 3; } }
@media (min-width: 1280px) { .masonry { columns: 4; } }
.masonry > * { break-inside: avoid; margin-bottom: 1.25rem; display: block; }

/* -------------------- Marquee -------------------- */
.marquee {
    display: flex;
    overflow: hidden;
    user-select: none;
    gap: 3rem;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
    display: flex;
    gap: 3rem;
    animation: marquee 35s linear infinite;
    flex-shrink: 0;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}

/* -------------------- Timeline -------------------- */
.timeline-container { position: relative; }
.timeline-container::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, transparent, var(--accent-primary) 10%, var(--accent-secondary) 90%, transparent);
}
@media (min-width: 768px) {
    .timeline-container::before { left: 50%; transform: translateX(-50%); }
}
.timeline-dot {
    position: absolute;
    left: 1.5rem;
    transform: translateX(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--bg-surface), 0 10px 15px -3px rgba(237, 148, 85, 0.4);
}
@media (min-width: 768px) { .timeline-dot { left: 50%; } }
.timeline-dot::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 9999px;
    background: rgba(255, 187, 112, 0.2);
    animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%     { transform: scale(1.6); opacity: 0; }
}

/* -------------------- Typewriter cursor -------------------- */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent-primary);
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}
@keyframes blink { 50% { opacity: 0; } }

/* -------------------- Prose (CKEditor render) -------------------- */
.prose-light h1, .prose-light h2, .prose-light h3, .prose-light h4 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}
.prose-light h1 { font-size: 1.875rem; }
.prose-light h2 { font-size: 1.5rem; }
.prose-light h3 { font-size: 1.25rem; }
.prose-light p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1rem;
    font-size: 1rem;
}
.prose-light a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.prose-light a:hover { color: var(--accent-200); }
.prose-light ul, .prose-light ol {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.prose-light ul { list-style-type: disc; }
.prose-light ol { list-style-type: decimal; }
.prose-light li { margin-bottom: 0.4rem; line-height: 1.7; }
.prose-light blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
    font-style: italic;
    color: var(--text-secondary);
    margin: 1.25rem 0;
}
.prose-light img { border-radius: 0.75rem; margin: 1.5rem 0; max-width: 100%; height: auto; }
.prose-light code {
    background-color: var(--bg-elevated);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}
.prose-light pre {
    background-color: var(--bg-elevated);
    padding: 1rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1rem 0;
}

/* -------------------- Project card hover reveal -------------------- */
.project-card { position: relative; overflow: hidden; }
.project-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(10, 9, 8, 0.95));
    opacity: 0.85;
    transition: opacity 0.4s;
}
.project-card:hover .overlay { opacity: 1; }
.project-card .content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    transform: translateY(20%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .content { transform: translateY(0); }

/* -------------------- Floating accent dots -------------------- */
.floating-dot {
    position: absolute;
    width: 6px; height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.4;
    animation: float-up 8s ease-in-out infinite;
}
@keyframes float-up {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50%     { transform: translateY(-30px); opacity: 0.8; }
}

/* -------------------- Forms -------------------- */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 235, 158, 0.2);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, background-color 0.2s;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background-color: rgba(255, 255, 255, 0.07);
}
.form-label {
    display: block;
    font-size: 0.875rem;
    color: var(--accent-200);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* -------------------- Page hero (clears the fixed nav) -------------------- */
/* Nav is h-20 (80px) fixed, so push content well below it.            */
.page-hero {
    position: relative;
    padding-top: 9rem;        /* 144px - clears 80px nav with breathing room */
    padding-bottom: 4rem;
    overflow: hidden;
}
@media (min-width: 768px) {
    .page-hero { padding-top: 10rem; padding-bottom: 5rem; }
}
@media (min-width: 1024px) {
    .page-hero { padding-top: 12rem; padding-bottom: 7rem; }
}
.page-hero-bg { position: absolute; inset: 0; z-index: -10; }
.page-hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 187, 112, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(237, 148, 85, 0.10) 0%, transparent 50%);
}

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

/* -------------------- Mobile fine-tuning -------------------- */
@media (max-width: 640px) {
    .section-title { font-size: 2rem; }
    .btn-primary, .btn-outline { padding: 0.75rem 1.4rem; font-size: 0.9rem; }
    .card { padding: 1.25rem; border-radius: 0.875rem; }
}


/* ============================================================
   Internal-page spacing fixes - append after existing rules
   ============================================================ */

/* Tighter section spacing for internal pages */
.section { padding-top: 4rem; padding-bottom: 4rem; }
@media (min-width: 768px)  { .section { padding-top: 5rem;  padding-bottom: 5rem;  } }
@media (min-width: 1024px) { .section { padding-top: 6rem;  padding-bottom: 6rem;  } }

.section-tight { padding-top: 2.5rem; padding-bottom: 2.5rem; }
@media (min-width: 1024px) { .section-tight { padding-top: 3.5rem; padding-bottom: 3.5rem; } }

/* The legacy .page-hero class - kept compact */
.page-hero {
    position: relative;
    padding-top: 7rem;
    padding-bottom: 3rem;
    overflow: hidden;
}
@media (min-width: 768px)  { .page-hero { padding-top: 8rem;  padding-bottom: 4rem; } }
@media (min-width: 1024px) { .page-hero { padding-top: 9rem;  padding-bottom: 5rem; } }

/* Fix: when section directly follows page-hero, remove top padding */
.page-hero + .section,
section.page-hero + section.section,
section[class*="page-hero"] + section.section { padding-top: 1rem; }

/* Tighter card padding on small screens */
.card { padding: 1.5rem; }
@media (min-width: 768px) { .card { padding: 1.75rem; } }

/* Better breathing room on text content blocks */
.prose-light > *:first-child { margin-top: 0; }
.prose-light > *:last-child  { margin-bottom: 0; }

/* Container helper - consistent left/right gutters site-wide */
.container-page {
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
@media (min-width: 1024px) { .container-page { padding-left: 2.5rem; padding-right: 2.5rem; } }

/* Eyebrow icon spacing inside section-eyebrow */
.section-eyebrow svg, .section-eyebrow i { width: 0.85rem; height: 0.85rem; }

/* Smooth border on auth/utility pages */
.auth-card {
    background-color: rgba(19, 17, 15, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 235, 158, 0.12);
    border-radius: 1.25rem;
    padding: 2.5rem;
}

/* Make sure overlapping elements (next sections) get proper spacing */
main > section:first-child:not(.page-hero):not([class*="hero"]) { padding-top: 7rem; }
@media (min-width: 1024px) { main > section:first-child:not(.page-hero):not([class*="hero"]) { padding-top: 9rem; } }

/* Fix: project detail negative margin when there's no cover image */
.project-cover-spacer { height: 2rem; }

/* Better mobile typography */
@media (max-width: 640px) {
    .section-eyebrow { font-size: 0.65rem; padding: 0.35rem 0.85rem; }
    .section-title   { font-size: 1.875rem; }
}

/* Improve detail page hero (used by services/projects/blog/research detail) */
.page-hero h1 { word-break: break-word; }

/* Footer top spacing */
footer { margin-top: 6rem; }
@media (min-width: 1024px) { footer { margin-top: 8rem; } }


/* ============================================================
   Mega-menu items
   ============================================================ */
.mega-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.625rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.mega-item:hover { background-color: rgba(255, 187, 112, 0.08); }

.mega-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(255, 187, 112, 0.1);
    color: #FFBB70;
}

.mega-title {
    font-family: 'Fraunces', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #FFFBDA);
    line-height: 1.2;
    margin-bottom: 0.2rem;
}
.mega-item:hover .mega-title { color: #FFEC9E; }

.mega-desc {
    font-size: 0.78rem;
    color: var(--text-muted, #a8a29e);
    line-height: 1.4;
}

/* On smaller desktops (lg but not xl), hide the Explore mega-menu trigger
   since secondary links are accessible via the burger menu's Explore section */
@media (max-width: 1279px) {
    .nav-link.xl-only { display: none; }
}