diff --git a/app/src/styles/global.css b/app/src/styles/global.css new file mode 100644 index 0000000..acac431 --- /dev/null +++ b/app/src/styles/global.css @@ -0,0 +1,654 @@ +/* ── Local fonts (no CDN) ─────────────────────────────────────────────────── */ +/* Vazirmatn — body font */ +@font-face { + font-family: 'Vazirmatn'; + src: url('/fonts/Vazirmatn-Regular.ttf') format('truetype'); + font-weight: 400; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: 'Vazirmatn'; + src: url('/fonts/Vazirmatn-Medium.ttf') format('truetype'); + font-weight: 500; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: 'Vazirmatn'; + src: url('/fonts/Vazirmatn-SemiBold.ttf') format('truetype'); + font-weight: 600; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: 'Vazirmatn'; + src: url('/fonts/Vazirmatn-Bold.ttf') format('truetype'); + font-weight: 700; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: 'Vazirmatn'; + src: url('/fonts/Vazirmatn-ExtraBold.ttf') format('truetype'); + font-weight: 800; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: 'Vazirmatn'; + src: url('/fonts/Vazirmatn-Black.ttf') format('truetype'); + font-weight: 900; + font-style: normal; + font-display: swap; +} + +/* PelakFA — display font for headlines */ +@font-face { + font-family: 'PelakFA'; + src: url('/fonts/PelakFA-Bold.woff') format('woff'); + font-weight: 700; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: 'PelakFA'; + src: url('/fonts/PelakFA-ExtraBold.woff') format('woff'); + font-weight: 800; + font-style: normal; + font-display: swap; +} + +/* ── Reset + base ─────────────────────────────────────────────────────────── */ +*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } +html { + scroll-behavior: smooth; + overflow-x: hidden; + max-width: 100vw; +} +body { + font-family: 'Vazirmatn', system-ui, sans-serif; + background: #FAF7F0; + color: #263238; + direction: rtl; + -webkit-font-smoothing: antialiased; + min-height: 100vh; + overflow-x: hidden; + max-width: 100vw; + word-wrap: break-word; + overflow-wrap: break-word; +} +#root { + min-height: 100vh; + overflow-x: hidden; + max-width: 100vw; +} +button, input, select, textarea { font-family: 'Vazirmatn', system-ui, sans-serif; } +a { color: inherit; text-decoration: none; } +img { + max-width: 100%; + height: auto; +} +::-webkit-scrollbar { width: 6px; height: 6px; } +::-webkit-scrollbar-track { background: #FAF7F0; } +::-webkit-scrollbar-thumb { background: #E4DDD2; border-radius: 3px; } +::-webkit-scrollbar-thumb:hover { background: #5F6B6D; } + +/* ── Animation keyframes (shared) ─────────────────────────────────────────── */ +@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } +@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } +@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } } +@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } +@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } } +@keyframes goldShimmer { + 0% { background-position: -200% 0; } + 100% { background-position: 200% 0; } +} +@keyframes pulseRing { + 0% { box-shadow: 0 0 0 0 rgba(15,107,115,0.35); } + 70% { box-shadow: 0 0 0 14px rgba(15,107,115,0); } + 100% { box-shadow: 0 0 0 0 rgba(15,107,115,0); } +} + +/* ── Utility classes ──────────────────────────────────────────────────────── */ +.gold-shimmer { + background: linear-gradient(90deg, #A8761B 0%, #D49A2A 30%, #F4C36A 50%, #D49A2A 70%, #A8761B 100%); + background-size: 200% auto; + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: transparent; + animation: goldShimmer 5s linear infinite; +} +.hero-tilt { transition: transform 0.4s cubic-bezier(.2,.8,.2,1); will-change: transform; } +.lift-on-hover { transition: transform 0.25s ease, box-shadow 0.25s ease; } +.lift-on-hover:hover { transform: translateY(-3px); } + +/* Focus styles for accessibility */ +button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { + outline: 2px solid #0F6B73; + outline-offset: 2px; +} + +/* Mobile nav helper */ +@media (max-width: 768px) { + .desktop-nav { display: none !important; } + .mobile-menu-btn { display: flex !important; } +} + +@media (max-width: 560px) { + body { + text-rendering: optimizeLegibility; + } + + /* Prevent horizontal overflow on all elements */ + * { + max-width: 100vw; + word-wrap: break-word; + overflow-wrap: break-word; + } + + pre, code, table { + max-width: 100%; + overflow-x: auto; + } + + .site-header-inner { + height: 56px !important; + padding-inline: 14px !important; + gap: 12px !important; + } + + .site-header-actions { + gap: 6px !important; + margin-inline-start: auto; + } + + .site-auth-actions { + display: none !important; + } + + .site-search-strip { + padding: 10px 12px !important; + } + + .site-search-form, + .article-search-form { + gap: 8px !important; + } + + .site-search-form button, + .article-search-form button, + .home-hero-actions button, + .article-action-row button, + .article-reaction-row button, + .load-more-wrap button { + min-height: 38px !important; + padding: 8px 14px !important; + border-radius: 9px !important; + font-size: 12px !important; + line-height: 1.5 !important; + } + + .mobile-drawer-panel { + width: min(84vw, 300px) !important; + padding: 18px !important; + } + + .home-hero-inner { + padding: 44px 16px 48px !important; + } + + .home-hero-actions { + gap: 8px !important; + } + + .home-section { + padding-block: 28px !important; + } + + .article-list-page { + padding-top: 64px !important; + } + + .article-list-inner { + padding-inline: 16px !important; + } + + .article-list-head { + padding-top: 22px !important; + } + + .article-list-head h1 { + font-size: 24px !important; + line-height: 1.35 !important; + } + + .filter-bar { + margin-bottom: 16px !important; + gap: 8px !important; + } + + .filter-chip-row { + flex-wrap: nowrap !important; + overflow-x: auto; + padding-bottom: 2px; + scrollbar-width: none; + } + + .filter-chip-row::-webkit-scrollbar { + display: none; + } + + .filter-chip-row button { + padding: 4px 10px !important; + font-size: 11px !important; + } + + .article-row { + grid-template-columns: 1fr !important; + gap: 10px !important; + padding: 20px 0 !important; + } + + .article-row-thumb { + display: none !important; + } + + .article-row h2 { + font-size: 17px !important; + line-height: 1.65 !important; + } + + .article-row p { + font-size: 13px !important; + line-height: 1.8 !important; + margin-bottom: 8px !important; + } + + .article-row-meta, + .article-row-stats { + gap: 8px !important; + font-size: 11px !important; + overflow-x: auto; + flex-wrap: nowrap !important; + scrollbar-width: none; + } + + .article-row-meta::-webkit-scrollbar, + .article-row-stats::-webkit-scrollbar { + display: none; + } + + .article-detail-page { + padding-top: 56px !important; + } + + .article-breadcrumb { + padding: 9px 14px !important; + font-size: 11px !important; + overflow-x: auto; + white-space: nowrap; + scrollbar-width: none; + -ms-overflow-style: none; + } + + .article-breadcrumb::-webkit-scrollbar { + display: none; + } + + .article-layout { + padding: 22px 16px !important; + gap: 20px !important; + grid-template-columns: 1fr !important; + max-width: 100vw; + overflow-x: hidden; + min-width: 0 !important; + } + + .article-main { + max-width: none !important; + width: 100% !important; + min-width: 0 !important; + overflow-x: hidden; + } + + .article-header { + margin-bottom: 22px !important; + padding-bottom: 18px !important; + overflow-x: hidden; + max-width: 100%; + } + + .article-header h1 { + font-size: clamp(20px, 5vw, 23px) !important; + line-height: 1.5 !important; + word-wrap: break-word !important; + overflow-wrap: break-word !important; + hyphens: auto !important; + max-width: 100% !important; + } + + .article-header p { + font-size: 14px !important; + line-height: 1.9 !important; + word-wrap: break-word !important; + overflow-wrap: break-word !important; + } + + .article-byline-row { + align-items: flex-start !important; + gap: 12px !important; + flex-wrap: wrap !important; + max-width: 100%; + min-width: 0 !important; + } + + .article-meta-line { + width: 100% !important; + gap: 8px !important; + overflow-x: auto !important; + flex-wrap: nowrap !important; + white-space: nowrap !important; + padding-bottom: 2px !important; + scrollbar-width: none !important; + -ms-overflow-style: none !important; + } + + .article-meta-line::-webkit-scrollbar { + display: none !important; + } + + .article-action-row, + .article-reaction-row, + .article-social-row { + flex-wrap: wrap !important; + gap: 8px !important; + max-width: 100%; + } + + .article-hero-diagram, + .article-diagram-card { + padding: 14px !important; + margin-bottom: 22px !important; + border-radius: 10px !important; + max-width: 100% !important; + overflow-x: auto !important; + } + + .article-content { + font-size: 15px !important; + line-height: 2.05 !important; + max-width: 100% !important; + overflow-x: hidden !important; + word-wrap: break-word !important; + overflow-wrap: break-word !important; + } + + /* Article content specific mobile fixes */ + .article-content * { + max-width: 100% !important; + } + + .article-content pre { + overflow-x: auto !important; + max-width: calc(100vw - 32px) !important; + margin-inline: 0 !important; + } + + .article-content code:not(pre code) { + word-break: break-all !important; + white-space: pre-wrap !important; + } + + .article-content table { + display: block !important; + overflow-x: auto !important; + max-width: 100% !important; + white-space: nowrap !important; + } + + .article-content img, + .article-content svg, + .article-content video { + max-width: 100% !important; + height: auto !important; + } + + /* CVE summary card mobile */ + .cve-summary-card { + grid-template-columns: 1fr !important; + gap: 12px !important; + padding: 16px !important; + max-width: 100% !important; + } + + .cve-summary-card .cve-item { + border-left: none !important; + border-bottom: 1px solid rgba(15,107,115,0.15) !important; + padding-left: 0 !important; + padding-bottom: 12px !important; + } + + .cve-summary-card .cve-item:last-child { + border-bottom: none !important; + padding-bottom: 0 !important; + } + + /* Comparison tables mobile */ + .comparison-table { + overflow-x: auto !important; + max-width: 100% !important; + display: block !important; + } + + /* Metric grid mobile */ + .metric-grid { + grid-template-columns: 1fr !important; + gap: 10px !important; + max-width: 100% !important; + } + + /* Risk, insight, footnote boxes */ + .risk-box, + .insight-box, + .footnote-box, + .security-alert { + padding: 14px !important; + border-radius: 10px !important; + max-width: 100% !important; + word-wrap: break-word !important; + overflow-wrap: break-word !important; + } + + .article-author-box { + padding: 16px !important; + gap: 12px !important; + max-width: 100% !important; + flex-wrap: wrap !important; + } + + .article-related { + margin-top: 34px !important; + max-width: 100% !important; + } + + article h2 { + font-size: 19px !important; + line-height: 1.65 !important; + margin: 30px 0 12px !important; + word-wrap: break-word !important; + overflow-wrap: break-word !important; + } + + article h3 { + font-size: 16px !important; + line-height: 1.7 !important; + margin: 24px 0 10px !important; + word-wrap: break-word !important; + overflow-wrap: break-word !important; + } + + article p { + margin-bottom: 16px !important; + word-wrap: break-word !important; + overflow-wrap: break-word !important; + } + + article blockquote { + margin: 22px 0 !important; + padding: 12px 14px !important; + font-size: 14px !important; + line-height: 2 !important; + max-width: 100% !important; + word-wrap: break-word !important; + overflow-wrap: break-word !important; + } + + article .metric-grid { + grid-template-columns: 1fr !important; + gap: 10px !important; + } + + article .metric-card, + article .risk-box, + article .insight-box, + article .footnote-box { + padding: 14px !important; + border-radius: 10px !important; + } + + article .agent-step { + padding: 12px 42px 12px 12px !important; + } +} + +/* Loading state */ +html:not(.js) #loading { display: none; } + +#loading { + position: fixed; inset: 0; background: #FAF7F0; + display: flex; align-items: center; justify-content: center; + flex-direction: column; z-index: 9999; font-family: 'Vazirmatn', sans-serif; + transition: opacity 0.4s; +} +#loading.hidden { opacity: 0; pointer-events: none; } + +.js #static-fallback { display: none; } + +.static-fallback { + min-height: 100vh; + background: #FAF7F0; + color: #263238; + direction: rtl; + font-family: 'Vazirmatn', Tahoma, sans-serif; + padding: 72px 20px; +} + +.static-fallback__inner { + max-width: 920px; + margin: 0 auto; +} + +.static-fallback__eyebrow { + margin: 0 0 10px; + color: #C45C3D; + font-size: 13px; + font-weight: 800; +} + +.static-fallback h1 { + margin: 0 0 16px; + color: #0F6B73; + font-size: 36px; + line-height: 1.35; +} + +.static-fallback h2 { + margin: 34px 0 10px; + color: #263238; + font-size: 22px; + line-height: 1.5; +} + +.static-fallback p, +.static-fallback li { + font-size: 16px; + line-height: 2; +} + +.static-fallback__lead { + max-width: 760px; + margin: 0 0 24px; + color: #5F6B6D; +} + +.static-fallback__links, +.static-fallback__facts { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); + gap: 12px; + margin: 24px 0; + padding: 0; + list-style: none; +} + +.static-fallback__links li, +.static-fallback__facts li { + border: 1px solid #E4DDD2; + border-radius: 8px; + background: #fff; + padding: 12px 14px; +} + +.static-fallback__links a, +.static-fallback__facts strong { + display: block; + color: #C45C3D; + font-weight: 800; + text-decoration: none; +} + +.static-fallback__links span, +.static-fallback__facts span { + display: block; + color: #5F6B6D; + font-size: 13px; + line-height: 1.8; +} + +.static-fallback__article { + margin-top: 28px; +} + +.static-fallback__article img, +.static-fallback__article video, +.static-fallback__article iframe { + max-width: 100%; + height: auto; +} + +/* Inline SVG icons (imported .svg rendered via CSS mask) — inherit text color + through currentColor, scale with font-size (1em). RTL-safe: only non-directional + pictographs use this (arrows/chevrons stay as text glyphs). Replaces former emoji. + Usage: */ +.tek-icon { + display: inline-block; + width: 1em; + height: 1em; + background-color: currentColor; + -webkit-mask: var(--i) center / contain no-repeat; + mask: var(--i) center / contain no-repeat; + vertical-align: -0.125em; + flex-shrink: 0; +} + +/* Placeholder shown while the DiagramRenderer lazy chunk loads */ +.tek-diagram-skeleton { + width: 100%; + height: 100%; + min-height: 120px; + border-radius: 8px; + background: linear-gradient(90deg, #ebe3d2 25%, #f4efe6 50%, #ebe3d2 75%); + background-size: 200% 100%; + animation: shimmer 1.4s infinite; +}