/* =========================== Modern Java — styles.css A dark/light theme with orange/amber accent =========================== */ /* ---------- Font Faces ---------- */ @font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/inter.woff2) format('woff2'); } @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/jetbrains-mono.woff2) format('woff2'); } /* ---------- Reset ---------- */ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; } body { font-family: 'Inter', system-ui, -apple-system, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } img, svg { display: block; max-width: 100%; } a { color: inherit; text-decoration: none; } button { font: inherit; cursor: pointer; border: none; background: none; } ul, ol { list-style: none; } code, pre { font-family: 'JetBrains Mono', monospace; } /* ---------- Root Variables (Dark) ---------- */ :root { --bg: #0b0b0f; --surface: #14141a; --surface-2: #1a1a22; --border: #25252f; --border-light: #2f2f3a; --text: #e4e4e7; --text-muted: #6b6b76; --accent: #fb923c; --accent-dim: #f97316; --green: #34d399; --blue: #60a5fa; --pink: #f472b6; --orange: #fb923c; --yellow: #fbbf24; --cyan: #22d3ee; --red-muted: #ef4444; --old-bg: #1a1412; --modern-bg: #1a2838; --radius: 16px; --radius-sm: 10px; --nav-bg: rgba(11, 11, 15, .8); color-scheme: dark light; } /* ---------- Light Mode ---------- */ @media (prefers-color-scheme: light) { :root { --bg: #f8f8fa; --surface: #ffffff; --surface-2: #f0f0f4; --border: #d8d8e0; --border-light: #e4e4ea; --text: #1a1a2e; --text-muted: #6b6b80; --accent: #f97316; --accent-dim: #ea580c; --green: #059669; --blue: #2563eb; --pink: #db2777; --orange: #ea580c; --yellow: #ca8a04; --cyan: #0891b2; --red-muted: #dc2626; --old-bg: #fef2f2; --modern-bg: #eff6ff; --nav-bg: rgba(248, 248, 250, .85); } } /* ---------- Manual Theme Override ---------- */ :root[data-theme="light"] { --bg: #f8f8fa; --surface: #ffffff; --surface-2: #f0f0f4; --border: #d8d8e0; --border-light: #e4e4ea; --text: #1a1a2e; --text-muted: #6b6b80; --accent: #f97316; --accent-dim: #ea580c; --green: #059669; --blue: #2563eb; --pink: #db2777; --orange: #ea580c; --yellow: #ca8a04; --cyan: #0891b2; --red-muted: #dc2626; --old-bg: #fef2f2; --modern-bg: #eff6ff; --nav-bg: rgba(248, 248, 250, .85); color-scheme: light; } :root[data-theme="dark"] { --bg: #0b0b0f; --surface: #14141a; --surface-2: #1a1a22; --border: #25252f; --border-light: #2f2f3a; --text: #e4e4e7; --text-muted: #6b6b76; --accent: #fb923c; --accent-dim: #f97316; --green: #34d399; --blue: #60a5fa; --pink: #f472b6; --orange: #fb923c; --yellow: #fbbf24; --cyan: #22d3ee; --red-muted: #ef4444; --old-bg: #1a1412; --modern-bg: #1a2838; --nav-bg: rgba(11, 11, 15, .8); color-scheme: dark; } /* ---------- Base Body ---------- */ body { background: var(--bg); color: var(--text); } /* ---------- Nav ---------- */ nav { position: sticky; top: 0; z-index: 100; background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); } .nav-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 60px; } .logo { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.15rem; color: var(--text); display: inline; } .logo span { color: var(--accent); } .nav-links { display: flex; align-items: center; gap: 24px; } .nav-links a { font-size: 0.9rem; color: var(--text-muted); transition: color 0.2s; } .nav-links a:hover { color: var(--text); } .nav-right { display: flex; align-items: center; gap: 16px; } .cmd-bar { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 0.85rem; cursor: pointer; transition: border-color 0.2s; } .cmd-bar:hover { border-color: var(--border-light); } .cmd-bar kbd { font-family: 'Inter', sans-serif; font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); } .github-link { display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 0.85rem; transition: all 0.2s; text-decoration: none; } .github-link:hover, .theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-2); } .theme-toggle { display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 1rem; line-height: 1; transition: all 0.2s; cursor: pointer; } /* ---------- Hero ---------- */ .hero { text-align: center; padding: 80px 24px 16px; max-width: 800px; margin: 0 auto; } .hero-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 500; color: var(--accent); background: rgba(251, 146, 60, .1); border: 1px solid rgba(251, 146, 60, .2); padding: 5px 14px; border-radius: 999px; margin-bottom: 24px; } .hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; background: linear-gradient(135deg, var(--orange), var(--pink), var(--yellow)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 20px; } .hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 560px; margin: 0 auto; line-height: 1.7; } /* ---------- Hero Compare ---------- */ .hero-compare { display: flex; gap: 2px; max-width: 820px; margin: 48px auto 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); } .hero-compare-side { flex: 1; padding: 28px 24px; font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; line-height: 1.7; position: relative; text-align: left; } .hero-compare-side.old { background: var(--old-bg); } .hero-compare-side.modern { background: var(--modern-bg); } .compare-label { display: inline-flex; align-items: center; gap: 5px; font-family: 'Inter', sans-serif; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 6px; margin-bottom: 16px; } .compare-label.old { color: var(--red-muted); background: rgba(239, 68, 68, .1); } .compare-label.modern { color: var(--green); background: rgba(52, 211, 153, .1); } /* ---------- Code Highlighting ---------- */ .kw { color: var(--pink); } .typ { color: var(--blue); } .str { color: var(--green); } .fn { color: var(--orange); } .cmt { color: var(--text-muted); font-style: italic; } .num { color: var(--yellow); } .ann { color: var(--cyan); } /* ---------- Section ---------- */ .section { max-width: 1100px; margin: 0 auto; padding: 64px 24px; } .section-header { text-align: center; margin-bottom: 48px; } .section-title { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; } .section-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 500; color: var(--accent); background: rgba(251, 146, 60, .08); border: 1px solid rgba(251, 146, 60, .15); padding: 4px 12px; border-radius: 999px; margin-bottom: 16px; } /* ---------- Tips / Card Grid ---------- */ .tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; } .tip-card.filter-hidden { display: none; } .no-results-message { text-align: center; color: var(--text-muted); padding: 3rem 1rem; font-size: 1.1rem; width: 100%; } .tip-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; cursor: pointer; display: flex; flex-direction: column; } .tip-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); border-color: var(--border-light); } .tip-card-body { display: flex; flex-direction: column; padding: 20px 20px 12px; } .tip-card-header { padding: 0 0 8px; } .tip-card-header h3 { font-size: 1rem; font-weight: 600; line-height: 1.4; margin-bottom: 8px; } .tip-card-header p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; } .tip-badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 14px; } /* ---------- Badges ---------- */ .badge { display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 500; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-muted); background: var(--surface-2); } .badge.language { color: var(--blue); background: rgba(96, 165, 250, .1); border-color: rgba(96, 165, 250, .2); } .badge.collections { color: var(--pink); background: rgba(244, 114, 182, .1); border-color: rgba(244, 114, 182, .2); } .badge.strings { color: var(--green); background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .2); } .badge.streams { color: var(--orange); background: rgba(251, 146, 60, .1); border-color: rgba(251, 146, 60, .2); } .badge.concurrency { color: var(--cyan); background: rgba(34, 211, 238, .1); border-color: rgba(34, 211, 238, .2); } .badge.io { color: var(--yellow); background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .2); } .badge.errors { color: var(--red-muted); background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .2); } .badge.datetime { color: var(--accent); background: rgba(251, 146, 60, .1); border-color: rgba(251, 146, 60, .2); } .badge.security { color: var(--pink); background: rgba(244, 114, 182, .1); border-color: rgba(244, 114, 182, .2); } .badge.tooling { color: var(--blue); background: rgba(96, 165, 250, .1); border-color: rgba(96, 165, 250, .2); } .badge.enterprise { color: var(--cyan); background: rgba(34, 211, 238, .1); border-color: rgba(34, 211, 238, .2); } .badge.beginner { color: var(--green); background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .2); } .badge.intermediate { color: var(--yellow); background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .2); } .badge.advanced { color: var(--pink); background: rgba(244, 114, 182, .1); border-color: rgba(244, 114, 182, .2); } /* ---------- Card Code (old → modern hover) ---------- */ .card-code { position: relative; flex: 1; overflow: hidden; border-top: 1px solid var(--border); } .card-code pre { padding: 16px 20px; font-size: 0.78rem; line-height: 1.7; overflow-x: auto; } .old-layer, .modern-layer { transition: opacity 0.35s; padding: 16px 20px; font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; line-height: 1.75; overflow: hidden; } .code-text { white-space: pre; display: block; font-variant-ligatures: none !important; font-feature-settings: "liga" 0, "clig" 0, "calt" 0 !important; } .old-layer { opacity: 1; background: var(--old-bg); min-height: 100%; } .modern-layer { position: absolute; inset: 0; opacity: 0; background: var(--modern-bg); overflow-y: auto; } .tip-card:hover .old-layer, .tip-card.toggled .old-layer { opacity: 0; } .tip-card:hover .modern-layer, .tip-card.toggled .modern-layer { opacity: 1; } .mini-label { display: inline-flex; align-items: center; gap: 4px; font-family: 'Inter', sans-serif; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 4px; position: absolute; top: 10px; right: 12px; z-index: 2; } .mini-label.old { color: var(--red-muted); background: rgba(239, 68, 68, .1); } .mini-label.modern { color: var(--green); background: rgba(52, 211, 153, .1); } .hover-hint { position: absolute; bottom: 10px; right: 12px; font-size: 0.68rem; color: var(--text-muted); opacity: 0.7; transition: opacity 0.3s; } .tip-card:hover .hover-hint, .tip-card.toggled .hover-hint { opacity: 0; } /* ---------- Card Footer ---------- */ .tip-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 0.78rem; } .browser-support { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.75rem; } .arrow-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 500; color: var(--accent); transition: gap 0.2s; } .arrow-link:hover { gap: 8px; } /* ---------- View Toggle Button ---------- */ .view-toggle-wrap { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 16px 0; } /* ---------- JDK Dropdown ---------- */ .jdk-dropdown { position: relative; display: inline-flex; } .jdk-dropdown-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: 0.88rem; font-weight: 500; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.25s; white-space: nowrap; } .jdk-dropdown-toggle:hover { background: var(--surface-2); border-color: var(--border-light); transform: translateY(-2px); } .jdk-dropdown-toggle.has-filter { border-color: var(--accent); color: var(--accent); } .jdk-label { font-weight: 600; } .dropdown-caret { font-size: 0.75rem; opacity: 0.6; } .jdk-dropdown ul { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); margin: 0; padding: 4px 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 16px rgba(0,0,0,0.15); z-index: 100; min-width: 130px; } .jdk-dropdown li { padding: 8px 16px; cursor: pointer; font-size: 0.88rem; color: var(--text); white-space: nowrap; transition: background 0.15s; } .jdk-dropdown li:hover { background: var(--accent); color: #fff; } .jdk-dropdown li.active { font-weight: 600; color: var(--accent); } .jdk-dropdown li.active:hover { color: #fff; } .view-toggle-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; font-size: 0.88rem; font-weight: 500; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.25s; } .view-toggle-btn:hover { background: var(--surface-2); border-color: var(--border-light); transform: translateY(-2px); } .view-toggle-icon { font-size: 1.1rem; line-height: 1; } /* ---------- Expanded Mode ---------- */ .tips-grid.expanded .tip-card { pointer-events: auto; } .tips-grid.expanded .tip-card:hover { transform: none; box-shadow: none; } .tips-grid.expanded .tip-card .card-code { display: flex; flex-direction: column; } .tips-grid.expanded .tip-card .old-layer, .tips-grid.expanded .tip-card .modern-layer { position: static; opacity: 1; min-height: auto; border-top: 1px solid var(--border); } .tips-grid.expanded .tip-card .old-layer { border-top: none; } .tips-grid.expanded .tip-card .mini-label { position: relative; top: 0; right: 0; margin-bottom: 8px; } .tips-grid.expanded .tip-card .hover-hint { display: none; } /* Disable hover effects in expanded mode */ .tips-grid.expanded .tip-card:hover .old-layer, .tips-grid.expanded .tip-card.toggled .old-layer { opacity: 1; } .tips-grid.expanded .tip-card:hover .modern-layer, .tips-grid.expanded .tip-card.toggled .modern-layer { opacity: 1; } /* ---------- Stats Bar ---------- */ .stats-bar { display: flex; justify-content: center; gap: 32px; padding: 40px 24px; flex-wrap: wrap; } .stat-card { text-align: center; } .stat-card .number { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; } .stat-card .number.orange { color: var(--orange); } .stat-card .number.green { color: var(--green); } .stat-card .number.blue { color: var(--blue); } .stat-card .number.pink { color: var(--pink); } .stat-card .label { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; } /* ---------- Newsletter ---------- */ .newsletter-box { max-width: 560px; margin: 0 auto; text-align: center; padding: 48px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); } .newsletter-box h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; } .newsletter-box p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; } .newsletter-form { display: flex; gap: 8px; max-width: 400px; margin: 0 auto; } .newsletter-form input { flex: 1; padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.88rem; outline: none; transition: border-color 0.2s; } .newsletter-form input:focus { border-color: var(--accent); } .newsletter-form button { padding: 10px 20px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-weight: 600; font-size: 0.88rem; transition: background 0.2s; } .newsletter-form button:hover { background: var(--accent-dim); } /* ---------- Article Page ---------- */ .article { max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px; } .breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 32px; } .breadcrumb a { color: var(--text-muted); transition: color 0.2s; } .breadcrumb a:hover { color: var(--text); } .breadcrumb .sep { opacity: 0.4; } .tip-header { margin-bottom: 40px; } .tip-title-row { display: flex; align-items: baseline; gap: 16px; } .tip-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 16px; } .tip-header .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .tip-header code { font-size: 0.85em; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); } /* ---------- Section Labels (Detail Page) ---------- */ .section-label { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); display: inline-block; } /* ---------- Code Comparison (Detail Page) ---------- */ .compare-section { margin: 40px 0; } .compare-container { display: flex; gap: 2px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); } .compare-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; } .compare-panel.old, .compare-panel.old-panel { background: var(--old-bg); border-right: 1px solid var(--border); } .compare-panel.modern, .compare-panel.modern-panel { background: var(--modern-bg); } .compare-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); } .compare-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 10px; border-radius: 6px; } .compare-tag.old { color: var(--red-muted); background: rgba(239, 68, 68, .1); } .compare-tag.modern { color: var(--green); background: rgba(52, 211, 153, .1); } .compare-code { padding: 20px 24px; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; line-height: 1.8; overflow-x: auto; flex: 1; } .compare-code pre { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; white-space: pre; } .compare-code .line { display: flex; padding: 0 16px; } .compare-code .line-number { width: 36px; flex-shrink: 0; color: var(--text-muted); opacity: 0.4; text-align: right; padding-right: 16px; user-select: none; } .compare-code .line-content { flex: 1; white-space: pre; } .hl { background: rgba(251, 146, 60, .06); border-left: 2px solid var(--accent); } .hl-red { background: rgba(239, 68, 68, .06); border-left: 2px solid var(--red-muted); } .copy-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 6px; font-size: 0.72rem; color: var(--text-muted); border: 1px solid var(--border); background: transparent; transition: all 0.2s; } .copy-btn:hover { color: var(--text); border-color: var(--border-light); } /* ---------- Demo Section ---------- */ .demo-section { margin: 48px 0; } .demo-container { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); } .demo-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); } .demo-toolbar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-light); } .demo-toolbar .dot:nth-child(1) { background: var(--red-muted); } .demo-toolbar .dot:nth-child(2) { background: var(--yellow); } .demo-toolbar .dot:nth-child(3) { background: var(--green); } .demo-viewport { padding: 32px 24px; min-height: 200px; } /* ---------- Why Section ---------- */ .why-section { margin: 48px 0; } .why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; } .why-card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color 0.2s; } .why-card:hover { border-color: var(--border-light); } .why-card .why-icon { font-size: 1.5rem; display: inline; margin-right: 8px; vertical-align: middle; } .why-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 8px; display: inline; vertical-align: middle; } .why-card p { font-size: 0.84rem; color: var(--text-muted); line-height: 1.5; } /* ---------- Info Grid ---------- */ .info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 24px 0; } .info-card { padding: 20px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: center; } .info-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; } .info-value { font-size: 1.15rem; font-weight: 700; } .info-value.red { color: #ef4444; } .info-value.green { color: #22c55e; } .info-value.accent { color: var(--accent); } .info-value.blue { color: #3b82f6; } /* ---------- JDK Support Section ---------- */ .bs-section { margin: 48px 0; } .bs-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; } .bs-feature-name { font-size: 0.88rem; font-weight: 500; } .baseline-badge { font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 6px; } .baseline-badge.widely { color: var(--green); background: rgba(52, 211, 153, .1); } .baseline-badge.newly { color: var(--blue); background: rgba(96, 165, 250, .1); } .baseline-badge.limited { color: var(--yellow); background: rgba(251, 191, 36, .1); } .baseline-badge.preview { color: var(--blue); background: rgba(96, 165, 250, .1); } .baseline-badge.experimental { color: var(--yellow); background: rgba(251, 191, 36, .1); } /* ---------- Explanation ---------- */ .explanation { margin: 40px 0; } .explanation p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; } /* ---------- Documentation Links ---------- */ .docs-section { margin: 40px 0; } .docs-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; } .doc-link { display: inline-flex; align-items: center; padding: 8px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--accent); font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: border-color 0.2s, background 0.2s; } .doc-link:hover { border-color: var(--accent); background: var(--bg); } /* ---------- Related ---------- */ .related { margin: 40px 0; } .related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; } .related-card { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; } .related-card:hover { transform: translateY(-2px); border-color: var(--border-light); box-shadow: 0 8px 24px rgba(0, 0, 0, .15); } .related-card h4 { font-size: 0.92rem; font-weight: 600; margin-bottom: 6px; } .related-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; } /* ---------- Search Overlay ---------- */ .search-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding-top: 120px; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; } .search-overlay.active { opacity: 1; visibility: visible; } .search-modal { width: 100%; max-width: 580px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 24px 64px rgba(0, 0, 0, .4); overflow: hidden; } .search-input-wrap { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); } .search-input-wrap svg { flex-shrink: 0; color: var(--text-muted); } .search-input { flex: 1; font-size: 1rem; background: transparent; border: none; color: var(--text); outline: none; } .search-input::placeholder { color: var(--text-muted); } .search-esc { flex-shrink: 0; font-size: 0.7rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; } .search-results { max-height: 400px; overflow-y: auto; padding: 8px; } .search-result { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.15s; } .search-result > div:first-child { flex: 1; min-width: 0; } .search-result > .badge { flex-shrink: 0; } .search-result:hover, .search-result.selected { background: var(--surface-2); } .search-result .title { font-size: 0.88rem; font-weight: 500; } .search-result .desc { font-size: 0.78rem; color: var(--text-muted); } .search-footer { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--text-muted); } .search-footer kbd { font-family: 'Inter', sans-serif; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); } /* ---------- Footer ---------- */ footer { text-align: center; padding: 32px 24px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.82rem; } footer a { color: var(--accent); transition: color 0.2s; } footer a:hover { color: var(--accent-dim); } /* ---------- Responsive: ≤ 700px ---------- */ @media (max-width: 700px) { .nav-links { display: none; } .nav-inner { padding: 0 16px; } .hero { padding: 56px 16px 16px; } .section { padding: 40px 16px; } .tips-grid { grid-template-columns: 1fr; } .stats-bar { gap: 20px; } .filter-pills { gap: 6px; } .newsletter-form { flex-direction: column; } .cmd-bar kbd { display: none; } } /* ---------- Responsive: ≤ 500px ---------- */ @media (max-width: 500px) { .hero-compare { flex-direction: column; } .compare-container { flex-direction: column; } .compare-panel { min-width: unset; } .hero-compare-side { padding: 20px 16px; } } /* Copilot callout banner */ .copilot-callout { max-width: 960px; margin: 0 auto; padding: 0 24px; } .copilot-callout-inner { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 16px 24px; margin-top: 16px; margin-bottom: 8px; } .copilot-icon { font-size: 1.8rem; flex-shrink: 0; } .copilot-callout-text { flex: 1; font-size: 0.95rem; color: var(--text); line-height: 1.5; } .copilot-callout-links { display: flex; gap: 12px; flex-shrink: 0; } .copilot-callout-links a { white-space: nowrap; padding: 8px 16px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: opacity 0.2s; } .copilot-callout-links a:hover { opacity: 0.85; } @media (max-width: 640px) { .copilot-callout-inner { flex-direction: column; text-align: center; } .copilot-callout-links { flex-direction: column; width: 100%; } .copilot-callout-links a { text-align: center; } } /* Social share buttons */ .social-share { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 24px; max-width: 960px; margin: 0 auto; } .share-label { font-size: 0.85rem; color: var(--text-dim); font-weight: 600; margin-right: 4px; } .share-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 0.95rem; font-weight: 700; text-decoration: none; transition: background 0.2s, border-color 0.2s; line-height: 1; } .share-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; } .share-li { font-family: Georgia, serif; font-weight: 800; font-size: 0.85rem; } .share-reddit { font-size: 1.1rem; } /* ============================ Contribute Dropdown ============================ */ .contribute-dropdown { position: relative; display: inline-flex; margin-inline-start: auto; } .contribute-toggle { display: flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: rgba(251, 146, 60, 0.1); color: var(--accent); font-size: 0.82rem; font-weight: 500; line-height: 1; transition: all 0.2s; cursor: pointer; white-space: nowrap; } .contribute-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); } .contribute-inline { text-align: center; padding: 12px 0 0; font-size: 0.85rem; color: var(--text-muted); } .contribute-inline a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; } .contribute-inline a:hover { color: var(--accent-dim); } .contribute-dropdown ul { display: none; position: absolute; top: 100%; right: 0; margin: 4px 0 0; padding: 4px 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 100; min-width: 220px; } [dir="rtl"] .contribute-dropdown ul { right: auto; left: 0; } .contribute-dropdown li a { display: block; padding: 8px 16px; font-size: 0.9rem; color: var(--text); white-space: nowrap; text-decoration: none; transition: background 0.15s; } .contribute-dropdown li a:hover { background: var(--accent); color: #fff; } /* ============================ Locale Picker ============================ */ .locale-picker { position: relative; display: inline-flex; } .locale-toggle { display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 1rem; line-height: 1; transition: all 0.2s; cursor: pointer; } .locale-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); } .locale-picker ul { display: none; position: absolute; top: 100%; right: 0; margin: 4px 0 0; padding: 4px 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 100; min-width: 160px; } .locale-picker li { padding: 8px 16px; cursor: pointer; font-size: 0.9rem; color: var(--text); white-space: nowrap; transition: background 0.15s; } .locale-picker li:hover { background: var(--accent); color: #fff; } .locale-picker li.active { font-weight: 600; color: var(--accent); } .locale-picker li.active:hover { color: #fff; } /* ============================ Untranslated Notice Banner ============================ */ .untranslated-notice { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 12px 16px; margin: 0 auto 24px; max-width: 800px; border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--text-muted); } .untranslated-notice a { color: var(--accent); text-decoration: underline; margin-left: 8px; } /* ============================ RTL overrides — keep code blocks and nav LTR ============================ */ [dir="rtl"] nav, [dir="rtl"] .nav-inner { direction: ltr; } [dir="rtl"] pre, [dir="rtl"] code, [dir="rtl"] .code-text, [dir="rtl"] .card-code, [dir="rtl"] .compare-code { direction: ltr; text-align: left; unicode-bidi: embed; }