/* ============================================
   Product Hunt Clone - Premium CSS
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --ph-orange: #C8102E;
    --ph-orange-hover: #A30D24;
    --ph-orange-light: #FFF0F0;
    --bg-primary: #FFFFFF;
    --bg-secondary: #FBF9F8;
    --bg-tertiary: #F5F0ED;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FFFAF9;
    --text-primary: #1A1110;
    --text-secondary: #6B5E5A;
    --text-tertiary: #9C8E89;
    --border-color: #E8DDD8;
    --border-light: #F5F0ED;
    --shadow-sm: 0 1px 2px rgba(60,20,10,0.04);
    --shadow-md: 0 4px 12px rgba(60,20,10,0.06);
    --shadow-lg: 0 12px 40px rgba(60,20,10,0.08);
    --shadow-xl: 0 20px 60px rgba(60,20,10,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 100px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 1200px;
}

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

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

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

/* --- Announcement Bar --- */
.announcement-bar {
    background: linear-gradient(135deg, #C8102E 0%, #D4553A 50%, #C8102E 100%);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    color: white;
    text-align: center;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.announcement-bar i {
    font-size: 16px;
}

.announcement-bar a {
    color: white;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    margin-left: 4px;
}

.announcement-bar a:hover {
    opacity: 0.9;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- Main Header --- */
.main-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: rgba(255,255,255,0.95);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}

.header-brand-group {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    min-width: 0;
}

.header-nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-icon svg {
    display: block;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.nav-link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--ph-orange);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--ph-orange);
    border-radius: 2px;
}

/* --- Search --- */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 300px;
    min-width: 160px;
    transition: max-width 0.25s ease;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all var(--transition);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-input:focus {
    border-color: var(--ph-orange);
    background: white;
    box-shadow: 0 0 0 3px var(--ph-orange-light);
}

/* --- Header Actions --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-mobile-search {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 18px;
    transition: all var(--transition);
}

.btn-mobile-search:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-streak {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: #FFF0F0;
    font-size: 13px;
    font-weight: 600;
    color: #C8102E;
    transition: all var(--transition);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-streak:hover {
    background: #FFE0E0;
    transform: scale(1.05);
}

.streak-fire {
    font-size: 14px;
}

.btn-notification {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-notification:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--ph-orange);
    border-radius: 50%;
    border: 2px solid white;
}

.btn-submit {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ph-orange);
    border: 1px solid var(--ph-orange);
    border-radius: var(--radius-full);
    transition: all var(--transition);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-submit:hover {
    background: var(--ph-orange);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200,16,46,0.3);
}

.btn-signin {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    background: var(--ph-orange);
    border-radius: var(--radius-full);
    transition: all var(--transition);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-signin:hover {
    background: var(--ph-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200,16,46,0.3);
}

/* Mobile toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    flex-shrink: 0;
    position: relative;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--bg-tertiary);
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Hamburger → X animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==============================
   HERO SECTION
   ============================== */
.hero-section {
    background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
    border-bottom: 1px solid var(--border-light);
    padding: 60px 0 48px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(200,16,46,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.04) 0%, transparent 70%);
    pointer-events: none;
}

.hero-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
    box-sizing: border-box;
}

.hero-content {
    max-width: 650px;
    flex: 1.2;
}

@media (max-width: 990px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 36px;
    }
    .hero-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

.hero-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--ph-orange-light);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--ph-orange);
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 16px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 520px;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border-color);
}

/* ==============================
   SECTION SHARED
   ============================== */
.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.section-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ph-orange);
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-filters {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-full);
}

.filter-btn {
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

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

.filter-btn.active {
    background: white;
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ==============================
   FEATURED SECTION
   ============================== */
.featured-section {
    padding: 48px 0 0;
}

.featured-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    animation: fadeInUp 0.6s ease;
}

.featured-card:hover {
    border-color: #D1D5DB;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.featured-card-inner {
    padding: 28px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.featured-left {
    display: flex;
    gap: 20px;
    flex: 1;
}

.featured-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    color: white;
}

.featured-info {
    flex: 1;
}

.featured-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.featured-name-row h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.featured-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ph-orange);
    background: var(--ph-orange-light);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.featured-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.featured-description {
    font-size: 14px;
    color: var(--text-tertiary);
    line-height: 1.6;
    margin-bottom: 14px;
    max-width: 600px;
}

.featured-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tag {
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.tag:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.featured-maker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.maker-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ph-orange), #D4553A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.maker-info {
    display: flex;
    flex-direction: column;
}

.maker-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.maker-title {
    font-size: 12px;
    color: var(--text-tertiary);
}

.featured-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.featured-comments {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==============================
   UPVOTE BUTTON
   ============================== */
.upvote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all var(--transition);
    min-width: 56px;
    font-weight: 600;
    font-size: 13px;
}

.upvote-btn:hover {
    border-color: var(--ph-orange);
    color: var(--ph-orange);
    background: var(--ph-orange-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200,16,46,0.15);
}

.upvote-btn.upvoted {
    background: var(--ph-orange);
    border-color: var(--ph-orange);
    color: white;
}

.upvote-count {
    font-size: 12px;
    font-weight: 700;
}

/* ==============================
   PRODUCTS LIST
   ============================== */
.products-section {
    padding: 48px 0;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.product-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: var(--bg-card);
    transition: all var(--transition);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    animation: fadeInUp 0.5s ease both;
}

.product-card:last-child {
    border-bottom: none;
}

.product-card:hover {
    background: var(--bg-card-hover);
}

.product-card:hover .product-name {
    color: var(--ph-orange);
}

.product-rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-tertiary);
    min-width: 24px;
    text-align: center;
}

.product-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    color: white;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.product-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    transition: color var(--transition);
    letter-spacing: -0.01em;
}

.product-separator {
    color: var(--text-tertiary);
    font-size: 13px;
}

.product-tagline {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.product-topics {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.topic-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-comments-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Show More */
.show-more-wrapper {
    text-align: center;
    padding: 24px 0 0;
}

.btn-show-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: white;
    transition: all var(--transition);
}

.btn-show-more:hover {
    border-color: var(--ph-orange);
    color: var(--ph-orange);
    background: var(--ph-orange-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ==============================
   TWO COLUMN SECTION
   ============================== */
.two-col-section {
    padding: 0 0 48px;
}

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.upcoming-card,
.topics-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition);
}

.upcoming-card:hover,
.topics-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 6px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Upcoming items */
.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.upcoming-item:hover {
    border-color: var(--border-color);
    background: var(--bg-card-hover);
}

.upcoming-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.upcoming-info {
    flex: 1;
    min-width: 0;
}

.upcoming-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.upcoming-info p {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upcoming-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.subscribers-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.launch-countdown {
    font-size: 11px;
    font-weight: 600;
    color: var(--ph-orange);
    background: var(--ph-orange-light);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.btn-notify {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: white;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-notify:hover {
    border-color: var(--ph-orange);
    color: var(--ph-orange);
    background: var(--ph-orange-light);
}

/* Topics */
.topics-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.topic-item:hover {
    background: var(--bg-tertiary);
}

.topic-item:hover .topic-arrow {
    transform: translateX(4px);
    color: var(--ph-orange);
}

.topic-emoji {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.topic-info {
    flex: 1;
}

.topic-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.topic-count {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 1px;
}

.topic-arrow {
    color: var(--text-tertiary);
    transition: all var(--transition);
    flex-shrink: 0;
}

/* ==============================
   NEWSLETTER SECTION
   ============================== */
.newsletter-section {
    padding: 0 0 64px;
}

.newsletter-card {
    background: linear-gradient(135deg, #1F2937 0%, #111827 50%, #0F172A 100%);
    border-radius: var(--radius-xl);
    padding: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    position: relative;
    overflow: hidden;
}

.newsletter-card::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(200,16,46,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.newsletter-card::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 30%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.newsletter-content {
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 520px;
}

.newsletter-emoji {
    font-size: 40px;
    display: inline-block;
    margin-bottom: 16px;
    color: var(--ph-orange);
}

.newsletter-content h2 {
    font-size: 28px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.newsletter-content p {
    font-size: 15px;
    color: #9CA3AF;
    line-height: 1.6;
    margin-bottom: 28px;
}

.newsletter-form {
    position: relative;
}

.input-group {
    display: flex;
    gap: 8px;
}

.newsletter-input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-family: var(--font-family);
    color: white;
    background: rgba(255,255,255,0.06);
    outline: none;
    transition: all var(--transition);
}

.newsletter-input::placeholder {
    color: #6B7280;
}

.newsletter-input:focus {
    border-color: var(--ph-orange);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(200,16,46,0.15);
}

.btn-subscribe {
    padding: 14px 28px;
    background: var(--ph-orange);
    color: white;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-full);
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-subscribe:hover {
    background: var(--ph-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(200,16,46,0.4);
}

.newsletter-note {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: #6B7280;
}

/* Newsletter floating cards */
.newsletter-visual {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.floating-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.float-card {
    position: absolute;
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(255,255,255,0.4);
    backdrop-filter: blur(10px);
    animation: floatCards 6s ease-in-out infinite;
    transition: color var(--transition);
}

.fc1 { top: 10%; left: 10%; animation-delay: 0s; }
.fc2 { top: 5%; right: 15%; animation-delay: 1s; }
.fc3 { top: 45%; left: 35%; animation-delay: 2s; }
.fc4 { bottom: 15%; left: 5%; animation-delay: 3s; }
.fc5 { bottom: 10%; right: 10%; animation-delay: 4s; }

@keyframes floatCards {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-12px) rotate(2deg); }
    66% { transform: translateY(8px) rotate(-1deg); }
}

/* ==============================
   FOOTER
   ============================== */
.main-footer {
    background: #111827;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 64px 0 0;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.footer-brand {
    max-width: 280px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.footer-logo span {
    font-size: 17px;
    font-weight: 700;
    color: white;
}

.footer-tagline {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    transition: all var(--transition);
}

.social-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateY(-2px);
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 14px;
    color: #9CA3AF;
    padding: 5px 0;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
}

.footer-bottom-left p {
    font-size: 13px;
    color: #6B7280;
}

.footer-bottom-right {
    display: flex;
    gap: 20px;
}

.footer-bottom-right a {
    font-size: 13px;
    color: #6B7280;
    transition: color var(--transition);
}

.footer-bottom-right a:hover {
    color: #9CA3AF;
}

/* ==============================
   ANIMATIONS
   ============================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================
   DRAWER & SEARCH OVERLAY
   ============================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-primary);
    z-index: 2000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-drawer.active {
    right: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 16px;
}

.drawer-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--ph-orange);
    letter-spacing: -0.02em;
}

.drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    transition: all var(--transition);
}

.drawer-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.drawer-link:hover, .drawer-link.active {
    color: var(--ph-orange);
    background: var(--ph-orange-light);
}

.drawer-link i {
    font-size: 18px;
}

.drawer-divider {
    height: 1px;
    background: var(--border-light);
}

.drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-streak {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #FFF7ED;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: #EA580C;
    font-weight: 500;
}

.drawer-streak i {
    font-size: 18px;
}

.drawer-btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: white;
    border: 1px solid var(--ph-orange);
    border-radius: var(--radius-full);
    color: var(--ph-orange);
    font-weight: 700;
    font-size: 14px;
    transition: all var(--transition);
}

.drawer-btn-submit:hover {
    background: var(--ph-orange);
    color: white;
}

.drawer-btn-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: var(--ph-orange);
    border-radius: var(--radius-full);
    color: white;
    font-weight: 700;
    font-size: 14px;
    transition: all var(--transition);
}

.drawer-btn-signin:hover {
    background: var(--ph-orange-hover);
}

/* --- Mobile Search Overlay --- */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 2100;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-search-overlay.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.search-overlay-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-overlay-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-overlay-icon {
    position: absolute;
    left: 14px;
    font-size: 18px;
    color: var(--text-tertiary);
}

.search-overlay-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font-size: 15px;
    font-family: var(--font-family);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    outline: none;
    background: var(--bg-secondary);
}

.search-overlay-input:focus {
    border-color: var(--ph-orange);
    background: white;
    box-shadow: 0 0 0 3px var(--ph-orange-light);
}

.search-overlay-close {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px;
}

.search-overlay-close:hover {
    color: var(--text-primary);
}

.search-overlay-results {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-tip {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
    margin-top: 40px;
}


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

/* --- Tablet Landscape --- */
@media (max-width: 1100px) {
    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }
    .header-brand-group {
        gap: 16px;
    }
    .header-nav-actions {
        gap: 16px;
    }
}

/* --- Tablet / Nav Collapse --- */
@media (max-width: 990px) {
    .main-nav {
        display: none;
    }
    .search-wrapper {
        display: none;
    }
    .btn-mobile-search {
        display: flex;
    }
    .mobile-menu-toggle {
        display: flex;
    }
    .header-container {
        height: 58px;
        padding: 0 16px;
    }
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 36px;
    }
    .hero-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .hero-right-visual {
        margin-top: 20px;
        height: 340px;
    }
}

/* --- Tablet Portrait / Mobile Large --- */
@media (max-width: 768px) {
    /* Header actions */
    .header-actions .btn-streak,
    .header-actions .btn-notification,
    .header-actions .btn-submit {
        display: none;
    }

    /* Announcement bar */
    .announcement-bar {
        font-size: 11px;
        padding: 8px 16px;
        line-height: 1.4;
    }
    .announcement-bar i {
        font-size: 13px;
    }

    /* Hero */
    .hero-section {
        padding: 40px 0 36px;
    }
    .hero-content h1 {
        font-size: 32px;
    }
    .hero-subtitle {
        font-size: 15px;
    }
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    .stat-divider {
        display: none;
    }
    .stat-item {
        align-items: center;
    }

    /* Sections */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .section-filters {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    .section-filters::-webkit-scrollbar {
        display: none;
    }
    .filter-btn {
        flex-shrink: 0;
    }

    /* Featured card */
    .featured-card-inner {
        flex-direction: column;
        padding: 20px;
    }
    .featured-left {
        flex-direction: column;
    }
    .featured-right {
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
    }
    .featured-icon {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }
    .featured-name-row h3 {
        font-size: 17px;
    }
    .featured-description {
        font-size: 13px;
    }

    /* Product cards */
    .product-card {
        padding: 14px 16px;
        gap: 12px;
    }
    .product-tagline {
        display: none;
    }
    .product-separator {
        display: none;
    }
    .product-name {
        font-size: 14px;
    }
    .upvote-btn {
        padding: 10px 12px;
        min-width: 50px;
    }
    .upvote-count {
        font-size: 11px;
    }

    /* Two column grid */
    .two-col-grid {
        grid-template-columns: 1fr;
    }
    .upcoming-card,
    .topics-card {
        padding: 20px;
    }

    /* Newsletter */
    .newsletter-card {
        padding: 28px;
        flex-direction: column;
    }
    .newsletter-visual {
        display: none;
    }
    .newsletter-content {
        max-width: 100%;
    }
    .newsletter-content h2 {
        font-size: 22px;
    }
    .input-group {
        flex-direction: column;
    }
    .btn-subscribe {
        width: 100%;
        text-align: center;
    }

    /* Footer */
    .main-footer {
        padding: 40px 0 0;
    }
    .footer-top {
        flex-direction: column;
        gap: 32px;
    }
    .footer-brand {
        max-width: 100%;
        text-align: center;
    }
    .footer-social {
        justify-content: center;
    }
    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    /* === SECONDARY PAGES (inline-styled pages) === */
    .page-section {
        padding: 40px 16px !important;
        min-height: auto !important;
    }
    .page-section > .section-container {
        padding: 28px 20px !important;
        border-radius: 12px !important;
    }
    /* Override inline section-container widths on secondary pages */
    .page-section > div[style*="max-width"] {
        max-width: 100% !important;
        padding: 28px 20px !important;
    }
    /* Blog post articles */
    .blog-body {
        font-size: 15px !important;
        line-height: 1.75 !important;
    }
    .blog-body pre {
        font-size: 12px !important;
        padding: 14px !important;
        margin-left: -4px !important;
        margin-right: -4px !important;
    }
    .blog-body blockquote {
        font-size: 15px !important;
        padding-left: 16px !important;
    }
    .blog-body h3 {
        font-size: 19px !important;
    }
    .blog-body h4 {
        font-size: 16px !important;
    }

    /* Inline grid layouts on secondary pages */
    div[style*="grid-template-columns: repeat(auto-fill"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
    }
}

/* --- Mobile Standard --- */
@media (max-width: 480px) {
    /* Hero */
    .hero-section {
        padding: 28px 0 24px;
    }
    .hero-container {
        padding: 0 16px;
    }
    .hero-content h1 {
        font-size: 26px;
        letter-spacing: -0.02em;
    }
    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    .hero-date-badge {
        font-size: 11px;
        padding: 5px 12px;
    }
    .stat-number {
        font-size: 20px;
    }
    .stat-label {
        font-size: 11px;
    }

    /* Product icons shrink */
    .product-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
        border-radius: 6px;
    }
    .product-rank {
        font-size: 12px;
        min-width: 18px;
    }
    .product-name-row {
        gap: 6px;
        margin-bottom: 4px;
    }
    .product-topics {
        gap: 4px;
    }
    .topic-tag {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Upcoming items stack */
    .upcoming-item {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
    }
    .btn-notify {
        width: 100%;
        justify-content: center;
    }
    .upcoming-info p {
        white-space: normal;
    }

    /* Section spacing */
    .section-container {
        padding: 0 16px;
    }
    .products-section {
        padding: 32px 0;
    }
    .featured-section {
        padding: 32px 0 0;
    }
    .two-col-section {
        padding: 0 0 32px;
    }
    .newsletter-section {
        padding: 0 0 40px;
    }

    /* Footer */
    .footer-links-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .footer-col h4 {
        font-size: 12px;
        margin-bottom: 12px;
    }
    .footer-col a {
        font-size: 13px;
    }

    /* Secondary pages */
    .page-section {
        padding: 24px 12px !important;
    }
    .page-section > div[style*="max-width"] {
        padding: 20px 16px !important;
    }
    .page-section h1 {
        font-size: 24px !important;
        line-height: 1.25 !important;
    }
    .page-section h3 {
        font-size: 16px !important;
    }

    /* Blog article on mobile */
    .blog-body {
        font-size: 14.5px !important;
    }
    .blog-body pre {
        font-size: 11.5px !important;
        padding: 12px !important;
        border-radius: 8px !important;
    }

    /* Inline flex layouts on secondary pages - stack */
    div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-wrap: wrap !important;
    }

    /* Newsletter form on newsletter page */
    .newsletter-form[style*="display: flex"] {
        flex-direction: column !important;
        border-radius: 12px !important;
        padding: 12px !important;
    }
    .newsletter-form[style*="display: flex"] input[type="email"] {
        width: 100% !important;
        padding: 14px 16px !important;
    }
    .newsletter-form[style*="display: flex"] button[type="submit"] {
        width: 100% !important;
        border-radius: 8px !important;
    }

    /* Trusted users row */
    .trusted-avatar {
        width: 30px;
        height: 30px;
        margin-left: -6px;
    }
    .trusted-avatar:nth-child(n+11) {
        display: none;
    }
    .trusted-text {
        font-size: 13px;
    }
}

/* --- Mobile Small (SE, compact) --- */
@media (max-width: 360px) {
    .header-container {
        padding: 0 12px;
        height: 52px;
    }
    .logo-text {
        font-size: 16px;
    }
    .hero-content h1 {
        font-size: 23px;
    }
    .hero-subtitle {
        font-size: 13px;
    }
    .product-card {
        padding: 12px;
        gap: 10px;
    }
    .product-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .product-name {
        font-size: 13px;
    }
    .upvote-btn {
        padding: 8px 10px;
        min-width: 44px;
    }
    .featured-card-inner {
        padding: 16px;
    }
    .featured-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    .newsletter-card {
        padding: 20px;
    }
    .newsletter-content h2 {
        font-size: 19px;
    }
    .newsletter-input {
        padding: 12px 14px;
        font-size: 13px;
    }
    .btn-subscribe {
        padding: 12px 20px;
        font-size: 13px;
    }

    .page-section h1 {
        font-size: 21px !important;
    }
    .page-section > div[style*="max-width"] {
        padding: 16px 12px !important;
    }
    .footer-links-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ==============================
   HERO RIGHT VISUAL
   ============================== */
.hero-right-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 480px;
    height: 380px;
    position: relative;
    animation: fadeInUp 0.8s ease 0.2s both;
}
.faces-collage-container {
    position: relative;
    width: 320px;
    height: 320px;
}
.face-card {
    position: absolute;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0.2s, box-shadow 0.3s;
    cursor: pointer;
    background: #fff;
}
.face-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.face-card:hover {
    transform: scale(1.18) translateY(-6px);
    z-index: 10;
    box-shadow: 0 10px 28px rgba(200, 16, 46, 0.2);
}

/* Individual Face Positions */
.face-card.c1 { width: 75px; height: 75px; left: 10px; top: 10px; animation: float1 6s ease-in-out infinite; }
.face-card.c2 { width: 60px; height: 60px; left: 130px; top: 0px; animation: float2 5s ease-in-out infinite; }
.face-card.c3 { width: 80px; height: 80px; left: 230px; top: 20px; animation: float3 7s ease-in-out infinite; }
.face-card.c4 { width: 65px; height: 65px; left: 0px; top: 120px; animation: float2 6s ease-in-out infinite; }
.face-card.c5 { width: 70px; height: 70px; left: 250px; top: 130px; animation: float1 5s ease-in-out infinite; }
.face-card.c6 { width: 75px; height: 75px; left: 15px; top: 220px; animation: float3 6s ease-in-out infinite; }
.face-card.c7 { width: 60px; height: 60px; left: 125px; top: 260px; animation: float1 7s ease-in-out infinite; }
.face-card.c8 { width: 85px; height: 85px; left: 215px; top: 220px; animation: float2 6s ease-in-out infinite; }
.face-card.c9 { width: 50px; height: 50px; left: 135px; top: 100px; animation: float3 5s ease-in-out infinite; }

/* Center Badge */
.collage-center-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 105px;
    height: 105px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C8102E, #A30D24);
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px rgba(200, 16, 46, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-align: center;
    z-index: 5;
    animation: pulseBadge 3s ease-in-out infinite;
}
.collage-center-badge i {
    font-size: 22px;
    margin-bottom: 2px;
    color: #FFFC00;
}
.collage-center-badge .badge-num {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.collage-center-badge .badge-lbl {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

/* Floating Animations */
@keyframes float1 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}
@keyframes float2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(6px) rotate(-2deg); }
}
@keyframes float3 {
    0%, 100% { transform: translateX(0px) translateY(0px); }
    50% { transform: translateX(4px) translateY(-6px); }
}
@keyframes pulseBadge {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.04); }
}

@media (max-width: 540px) {
    .hero-right-visual {
        display: none;
    }
}

/* ==============================
   TOUCH & ACCESSIBILITY POLISH
   ============================== */

/* Minimum 44px touch targets */
@media (pointer: coarse) {
    .nav-link,
    .filter-btn,
    .btn-notify,
    .topic-item,
    .drawer-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .upvote-btn {
        min-width: 52px;
        min-height: 52px;
    }
    .social-link {
        width: 44px;
        height: 44px;
    }
}

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

/* Safe area for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .main-footer .footer-bottom {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
    .mobile-drawer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* ==============================
   FINAL POLISH & ENHANCEMENTS
   ============================== */

/* Smoother focus rings */
*:focus-visible {
    outline: 2px solid var(--ph-orange);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Active press states for mobile */
@media (hover: none) {
    .product-card:active {
        background: var(--bg-tertiary);
        transform: scale(0.995);
    }
    .upvote-btn:active {
        transform: scale(0.92);
    }
    .btn-signin:active,
    .btn-submit:active {
        transform: scale(0.96);
    }
    .drawer-link:active {
        transform: scale(0.98);
    }
}

/* Prevent text size adjust on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Hide scrollbars on filter rows */
.section-filters {
    -ms-overflow-style: none;
}

/* Better image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
}

/* Selection color */
::selection {
    background: var(--ph-orange-light);
    color: var(--ph-orange);
}

/* ==============================
   SECONDARY PAGE MOBILE FIXES
   ============================== */

/* Fix grid columns with minmax(340px,...) overflowing on small screens */
@media (max-width: 600px) {
    div[style*="minmax(340px"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="minmax(300px"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="minmax(280px"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="minmax(260px"] {
        grid-template-columns: 1fr !important;
    }
}

/* Horizontal scroll for table-like layouts on mobile */
@media (max-width: 600px) {
    /* Leaderboard / streaks table rows */
    .page-section div[style*="padding: 18px 24px"],
    .page-section div[style*="padding: 20px 24px"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Blog post header stacking */
    .page-section header[style*="margin-bottom"] {
        padding-bottom: 16px !important;
    }
    .page-section header h1 {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }

    /* Blog author row - stack on mobile */
    .page-section header div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    /* Blog post article footer - social share */
    .page-section > div > div[style*="border-top: 1px solid"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    /* Code blocks overflow */
    pre {
        max-width: 100% !important;
        overflow-x: auto !important;
        word-break: break-all !important;
    }

    /* Forms inside page-section */
    .page-section input[type="text"],
    .page-section input[type="email"],
    .page-section input[type="password"],
    .page-section input[type="url"],
    .page-section textarea,
    .page-section select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }

    /* Ship page pricing cards */
    .page-section div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Gift card quiz - full width buttons */
    .page-section button[style*="padding: 14px"] {
        width: 100% !important;
        text-align: center !important;
    }

    /* Verify page - input and button stacking */
    .page-section div[style*="display: flex"][style*="gap: 12px"] {
        flex-direction: column !important;
    }

    /* Section padding adjustments for inner containers */
    .page-section div[style*="padding: 48px"] {
        padding: 24px 16px !important;
    }
    .page-section div[style*="padding: 40px"] {
        padding: 24px 16px !important;
    }
    .page-section div[style*="padding: 56px"] {
        padding: 24px 16px !important;
    }

    /* Fixed width elements that overflow */
    .page-section div[style*="width: 72px"] {
        width: 56px !important;
        height: 56px !important;
    }

    /* Maker avatars in stories/hall-of-fame */
    .page-section div[style*="width: 64px"][style*="border-radius: 50%"],
    .page-section div[style*="width: 56px"][style*="border-radius: 50%"] {
        width: 44px !important;
        height: 44px !important;
    }
}

/* Extra small screen overrides */
@media (max-width: 380px) {
    /* All inline paddings get reduced */
    .page-section div[style*="padding: 28px"] {
        padding: 16px !important;
    }
    .page-section div[style*="padding: 24px"] {
        padding: 14px !important;
    }
    /* Reduce font sizes for very long headings */
    .page-section h1 {
        font-size: 20px !important;
        word-break: break-word !important;
    }
    .page-section h3 {
        font-size: 15px !important;
    }
    /* Blog body tighter */
    .blog-body {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }
}

/* Smooth scrolling momentum for all scrollable containers */
.page-section {
    -webkit-overflow-scrolling: touch;
}

/* Print styles - clean output */
@media print {
    .announcement-bar,
    .main-header,
    .mobile-drawer,
    .drawer-overlay,
    .mobile-search-overlay,
    .main-footer {
        display: none !important;
    }
    .page-section {
        padding: 0 !important;
        min-height: auto !important;
    }
    body {
        background: white;
    }
}

