/* ═══════════════════════════════════════════════════
   VoskFlow — Literary Journal & Scrapbook Theme
   ═══════════════════════════════════════════════════ */

/* === Theme Variables === */
:root {
    --color-bg: #f5f2eb; /* Warm parchment / journal paper */
    --color-bg-secondary: #eae5d9; /* Slightly darker kraft paper */
    --color-text-primary: #2c2a25; /* Charcoal ink */
    --color-text-secondary: #5c5952; /* Faded ink */
    --color-text-tertiary: #8b877c;
    --color-border: rgba(44, 42, 37, 0.12); /* Subtle pencil line */
    --color-card-bg: #fdfbf7; /* Bright white paper */
    --color-card-border: rgba(44, 42, 37, 0.08);
    --color-accent: #c74a38; /* Terracotta / Editor's red pen */
    --color-accent-hover: #a33b2c;
    --color-accent-text: #fdfbf7;
    --color-surface-elevated: rgba(253, 251, 247, 0.85);
    --color-glow-1: rgba(199, 74, 56, 0.04);
    --color-glow-2: rgba(218, 165, 32, 0.03);
    --color-grid: rgba(44, 42, 37, 0.07); /* Bullet journal dots */
    --color-marquee-bg: #eae5d9;
    --color-code-bg: rgba(44, 42, 37, 0.05);
    --color-code-text: #2c2a25;
    --scrollbar-bg: #f5f2eb;
    --scrollbar-thumb: #d4d0c5;
    --scrollbar-thumb-hover: #b5b1a5;
}

.dark {
    --color-bg: #1c1917; /* Deep Espresso / Midnight Reading */
    --color-bg-secondary: #262220;
    --color-text-primary: #eaddcd; /* Aged paper text */
    --color-text-secondary: #a89f91;
    --color-text-tertiary: #7a7369;
    --color-border: rgba(234, 221, 205, 0.12);
    --color-card-bg: rgba(38, 34, 32, 0.8);
    --color-card-border: rgba(234, 221, 205, 0.08);
    --color-accent: #dca54c; /* Muted Gold/Ochre ink */
    --color-accent-hover: #f0b75e;
    --color-accent-text: #1c1917;
    --color-surface-elevated: rgba(28, 25, 23, 0.85);
    --color-glow-1: rgba(220, 165, 76, 0.04);
    --color-glow-2: rgba(199, 74, 56, 0.03);
    --color-grid: rgba(234, 221, 205, 0.05);
    --color-marquee-bg: #262220;
    --color-code-bg: rgba(234, 221, 205, 0.06);
    --color-code-text: #eaddcd;
    --scrollbar-bg: #1c1917;
    --scrollbar-thumb: #3a3532;
    --scrollbar-thumb-hover: #dca54c;
}

/* === Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E"); /* Subtle paper grain */
}

.dark body {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E"); /* Subtle dark paper grain */
}

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

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* === Dotted Grid Background === */
.bg-grid {
    background-image: radial-gradient(var(--color-grid) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
}

/* === Ambient Glow Orbs === */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.6s ease;
}
.glow-orb-1 {
    width: 600px;
    height: 600px;
    background: var(--color-glow-1);
    top: -100px;
    left: 20%;
}
.glow-orb-2 {
    width: 500px;
    height: 500px;
    background: var(--color-glow-2);
    top: 40%;
    right: 10%;
}
.glow-orb-3 {
    width: 400px;
    height: 400px;
    background: var(--color-glow-1);
    bottom: 20%;
    left: 5%;
}

/* === Navigation === */
.nav-container {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-container.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}
.dark .nav-container.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}
.nav-link {
    position: relative;
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    text-decoration: none;
}
.nav-link:hover {
    color: var(--color-text-primary);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.25s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* === Buttons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: var(--color-accent);
    color: var(--color-accent-text);
    font-weight: 500;
    font-family: 'Figtree', sans-serif;
    font-size: 0.9375rem;
    border-radius: 4px; /* Sharper, paper-like corners */
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.btn-primary:hover {
    background: var(--color-accent-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0) scale(0.98);
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-text-tertiary);
}
.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    background: var(--color-text-primary);
    color: var(--color-bg);
    font-weight: 500;
    font-size: 0.8125rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-nav:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* === Curved Text Path === */
@keyframes rotate-text {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.rotating-text {
    animation: rotate-text 30s linear infinite;
}

/* === Marquee === */
@keyframes marquee {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}
.animate-marquee {
    animation: marquee 40s linear infinite;
    will-change: transform;
}
.animate-marquee:hover {
    animation-play-state: paused;
}

/* === Bubble Peek Animation === */
@keyframes bubble-peek {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.05) translateY(-2px); }
}
.animate-bubble {
    animation: bubble-peek 3s ease-in-out infinite;
    will-change: transform;
}

/* === Waveform Bars === */
@keyframes wave {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}
.wave-bar {
    width: 3px;
    height: 24px;
    border-radius: 1.5px;
    background: var(--color-accent);
    transform-origin: center;
    animation: wave 1s ease-in-out infinite;
}
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.5s; }
.wave-bar:nth-child(7) { animation-delay: 0.6s; }
.wave-bar:nth-child(8) { animation-delay: 0.7s; }

/* === Sticker / Washi Tape Header === */
.sticker {
    position: relative;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}
.sticker::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    width: 40px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.dark .sticker::before {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

/* === Bento Grid Cards (Scrapbook/Note style) === */
.bento-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: 4px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.03);
}
.bento-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(225deg, transparent 50%, var(--color-bg) 50%);
    border-bottom-left-radius: 4px;
    box-shadow: -2px 2px 4px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    opacity: 0.5;
}
.dark .bento-card::after {
    box-shadow: -2px 2px 4px rgba(0,0,0,0.2);
}
.bento-card:hover {
    border-color: var(--color-accent);
    box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.06);
    z-index: 10;
}
.dark .bento-card {
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.15);
}
.dark .bento-card:hover {
    box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.3);
}
.bento-card:hover::after {
    width: 24px;
    height: 24px;
    opacity: 1;
}

/* === Code Editor Mock === */
.editor-window {
    background: #11100e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}
.editor-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.editor-dots {
    display: flex;
    gap: 6px;
}
.editor-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.editor-dot-red { background: #ff5f57; }
.editor-dot-yellow { background: #febc2e; }
.editor-dot-green { background: #28c840; }

/* === Fade-In on Scroll (Removed for Instant Loading) === */
.fade-in-up {
    /* Kept class to avoid HTML edits, but disabled the delay */
    opacity: 1;
    transform: translateY(0);
}

/* === Social Proof Logo Bar === */
.logo-bar svg {
    height: 28px;
    opacity: 0.3;
    filter: sepia(1) hue-rotate(-50deg) saturate(0.5);
    transition: all 0.3s ease;
}
.logo-bar svg:hover {
    opacity: 0.9;
    filter: none;
}
.dark .logo-bar svg {
    filter: grayscale(1);
    opacity: 0.4;
}
.dark .logo-bar svg:hover {
    filter: none;
    opacity: 1;
}

/* === Mobile Menu === */
.mobile-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 1rem;
    right: 1rem;
    background: var(--color-surface-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    transform-origin: top;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .mobile-menu {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.mobile-menu.hidden {
    opacity: 0;
    transform: scaleY(0.95);
    pointer-events: none;
}
.mobile-menu.open {
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
}
.mobile-menu a {
    display: block;
    padding: 0.75rem 0;
    color: var(--color-text-primary);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: color 0.2s ease;
}
.mobile-menu a:last-child {
    border-bottom: none;
}
.mobile-menu a:hover {
    color: var(--color-accent);
}

/* === Hero Circular Text === */
.hero-circle-text {
    position: absolute;
    width: 260px;
    height: 260px;
}
@media (max-width: 1024px) {
    .hero-circle-text { display: none; }
}

/* === Responsive Helpers === */
@media (max-width: 768px) {
    .bento-card { padding: 1.5rem; }
}
